You are looking at the software implementation. The hardware implementation is in frameworks/base/libs/hwui
and frameworks/base/core/java/android/view/
(see HardwareRenderer.java
, HardwareCanvas.java
, GLES20Canvas.java
, etc.)
Android Canvas hardware acceleration
Question
Upon the link
I found that Canvas now supports hardware acceleration(mostly).
I downloaded the 4.2.2 AOSP(API Level 17) source and checked the code in external/skia/src/core/sKCanvas.cpp
I reached sKCanvas.cpp because this will finally get called via jni from Android Canvas class.
However, say drawPosText(), this function should be using hardware acceleration (open gl)
in the code. But when I checked this function in sKCanvas.cpp, I dont see any code related to open gl.
Did I misunderstand anything? This does confuse me.
Thanks.
void SkCanvas::drawPosText(const void* text, size_t byteLength,
const SkPoint pos[], const SkPaint& paint) {
LOOPER_BEGIN(paint, SkDrawFilter::kText_Type)
while (iter.next()) {
SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint());
iter.fDevice->drawPosText(iter, text, byteLength, &pos->fX, 0, 2,
dfp.paint());
}
LOOPER_END
}
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow