Cleanup type offsets which cannot be calculated for flexible YUV.
Support flexible YUV
bug 10567550
Change-Id: I4f6e5a8d86eeee635605460f1751208f3320969b
(cherry picked from commit a75372759e288be3fb8835735a830b1f7d1a4c42)
diff --git a/rsScriptC_LibGL.cpp b/rsScriptC_LibGL.cpp
index 279ddb2..dbf2336 100644
--- a/rsScriptC_LibGL.cpp
+++ b/rsScriptC_LibGL.cpp
@@ -220,7 +220,7 @@
void rsrDrawTextAlloc(Context *rsc, Allocation *a, int x, int y) {
const char *text = (const char *)rsc->mHal.funcs.allocation.lock1D(rsc, a);
- size_t allocSize = a->getType()->getSizeBytes();
+ size_t allocSize = a->getType()->getPackedSizeBytes();
rsc->mStateFont.renderText(text, allocSize, x, y);
rsc->mHal.funcs.allocation.unlock1D(rsc, a);
}
@@ -250,7 +250,7 @@
int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) {
CHECK_OBJ(a);
const char *text = (const char *)rsc->mHal.funcs.allocation.lock1D(rsc, a);
- size_t textLen = a->getType()->getSizeBytes();
+ size_t textLen = a->getType()->getPackedSizeBytes();
Font::Rect metrics;
rsc->mStateFont.measureText(text, textLen, &metrics);
SetMetrics(&metrics, left, right, top, bottom);