diff options
author | Jason Sams <jsams@google.com> | 2012-07-25 19:33:43 -0700 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2012-07-27 14:32:42 -0700 |
commit | 61a4bb734b91ced09fbfee4214c6f253cb66e5f0 (patch) | |
tree | a6964822e47fd121fc35d673cb2153ce515e614c /rsScriptC_LibGL.cpp | |
parent | 3779f42ee8c45b8d9ca244086be41c5e2b4fd08f (diff) | |
download | rs-61a4bb734b91ced09fbfee4214c6f253cb66e5f0.tar.gz |
Cleanup pointer access in adapter and font.
Change-Id: Ie500574adebb9bdb38c138f78582af2cd7610f76
Diffstat (limited to 'rsScriptC_LibGL.cpp')
-rw-r--r-- | rsScriptC_LibGL.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rsScriptC_LibGL.cpp b/rsScriptC_LibGL.cpp index 995cef2d..6a897a37 100644 --- a/rsScriptC_LibGL.cpp +++ b/rsScriptC_LibGL.cpp @@ -285,9 +285,10 @@ uint32_t rsrGetHeight(Context *rsc, Script *sc) { } void rsrDrawTextAlloc(Context *rsc, Script *sc, Allocation *a, int x, int y) { - const char *text = (const char *)a->getPtr(); + const char *text = (const char *)rsc->mHal.funcs.allocation.lock1D(rsc, a); size_t allocSize = a->getType()->getSizeBytes(); rsc->mStateFont.renderText(text, allocSize, x, y); + rsc->mHal.funcs.allocation.unlock1D(rsc, a); } void rsrDrawText(Context *rsc, Script *sc, const char *text, int x, int y) { @@ -314,11 +315,12 @@ static void SetMetrics(Font::Rect *metrics, void rsrMeasureTextAlloc(Context *rsc, Script *sc, Allocation *a, int32_t *left, int32_t *right, int32_t *top, int32_t *bottom) { CHECK_OBJ(a); - const char *text = (const char *)a->getPtr(); + const char *text = (const char *)rsc->mHal.funcs.allocation.lock1D(rsc, a); size_t textLen = a->getType()->getSizeBytes(); Font::Rect metrics; rsc->mStateFont.measureText(text, textLen, &metrics); SetMetrics(&metrics, left, right, top, bottom); + rsc->mHal.funcs.allocation.unlock1D(rsc, a); } void rsrMeasureText(Context *rsc, Script *sc, const char *text, |