diff options
| author | Romain Guy <romainguy@google.com> | 2012-09-28 13:55:44 -0700 |
|---|---|---|
| committer | Romain Guy <romainguy@google.com> | 2012-09-28 13:55:44 -0700 |
| commit | a3dc55f83ab583e0a66b893c71b849afa046770a (patch) | |
| tree | bce89bc2bccaa9e4e9eb334b5c3185e360c02dc0 /libs/hwui/OpenGLRenderer.cpp | |
| parent | 3cd961292e877cc5fac146290421e9e67aa553a2 (diff) | |
| download | frameworks_base-a3dc55f83ab583e0a66b893c71b849afa046770a.zip frameworks_base-a3dc55f83ab583e0a66b893c71b849afa046770a.tar.gz frameworks_base-a3dc55f83ab583e0a66b893c71b849afa046770a.tar.bz2 | |
Fix a couple of rendering issues
Bug #7253839
1. Make sure we don't make GL calls while recording display lists
2. Disable an early and trivial clip optimization in font renderer
when a perspective transformation is used on the Canvas
Change-Id: I3f1052164239329346854f72d0a0d401fbfecf06
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
| -rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 684d5e1..c015077 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -2647,20 +2647,21 @@ status_t OpenGLRenderer::drawText(const char* text, int bytesCount, int count, setupDrawShaderUniforms(pureTranslate); setupDrawTextGammaUniforms(); - const Rect* clip = pureTranslate ? mSnapshot->clipRect : &mSnapshot->getLocalClip(); + const Rect* clip = pureTranslate ? mSnapshot->clipRect : + (mSnapshot->hasPerspectiveTransform() ? NULL : &mSnapshot->getLocalClip()); Rect bounds(FLT_MAX / 2.0f, FLT_MAX / 2.0f, FLT_MIN / 2.0f, FLT_MIN / 2.0f); const bool hasActiveLayer = hasLayer(); bool status; - if (paint->getTextAlign() != SkPaint::kLeft_Align) { + if (CC_UNLIKELY(paint->getTextAlign() != SkPaint::kLeft_Align)) { SkPaint paintCopy(*paint); paintCopy.setTextAlign(SkPaint::kLeft_Align); status = fontRenderer.renderPosText(&paintCopy, clip, text, 0, bytesCount, count, x, y, - positions, hasActiveLayer ? &bounds : NULL); + positions, hasActiveLayer ? &bounds : NULL); } else { status = fontRenderer.renderPosText(paint, clip, text, 0, bytesCount, count, x, y, - positions, hasActiveLayer ? &bounds : NULL); + positions, hasActiveLayer ? &bounds : NULL); } if (status && hasActiveLayer) { |
