diff options
author | Romain Guy <romainguy@google.com> | 2010-07-14 16:34:53 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-07-14 16:35:43 -0700 |
commit | 3d58c03de0d8877b36cdb78b0ca8b5cac7f600e2 (patch) | |
tree | 81d20a1aac231574266c696b82c36a67ff6772be /libs/hwui/OpenGLRenderer.cpp | |
parent | 756088482fb102f0c728151553210dca254b575f (diff) | |
download | frameworks_base-3d58c03de0d8877b36cdb78b0ca8b5cac7f600e2.zip frameworks_base-3d58c03de0d8877b36cdb78b0ca8b5cac7f600e2.tar.gz frameworks_base-3d58c03de0d8877b36cdb78b0ca8b5cac7f600e2.tar.bz2 |
Do not apply transforms when using drawColor().
This fixes an issue in the way the clip transformations were applied.
Change-Id: I91e7b5d15baf244d1280e48938282bb33609081d
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 9739b9b..12b0dea 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -406,7 +406,7 @@ bool OpenGLRenderer::quickReject(float left, float top, float right, float botto } bool OpenGLRenderer::clipRect(float left, float top, float right, float bottom) { - bool clipped = mSnapshot->clipRect.intersect(left, top, right, bottom); + bool clipped = mSnapshot->clip(left, top, right, bottom); if (clipped) { mSnapshot->flags |= Snapshot::kFlagClipSet; setScissorFromClip(); @@ -492,8 +492,8 @@ void OpenGLRenderer::drawPatch(SkBitmap* bitmap, Res_png_9patch* patch, } void OpenGLRenderer::drawColor(int color, SkXfermode::Mode mode) { - const Rect& clip = mSnapshot->clipRect; - drawColorRect(clip.left, clip.top, clip.right, clip.bottom, color, mode); + const Rect& clip = mSnapshot->getMappedClip(); + drawColorRect(clip.left, clip.top, clip.right, clip.bottom, color, mode, true); } void OpenGLRenderer::drawRect(float left, float top, float right, float bottom, const SkPaint* p) { @@ -524,7 +524,7 @@ void OpenGLRenderer::drawRect(float left, float top, float right, float bottom, /////////////////////////////////////////////////////////////////////////////// void OpenGLRenderer::drawColorRect(float left, float top, float right, float bottom, - int color, SkXfermode::Mode mode) { + int color, SkXfermode::Mode mode, bool ignoreTransform) { const int alpha = (color >> 24) & 0xFF; const GLfloat a = alpha / 255.0f; const GLfloat r = ((color >> 16) & 0xFF) / 255.0f; @@ -538,7 +538,12 @@ void OpenGLRenderer::drawColorRect(float left, float top, float right, float bot mModelView.scale(right - left, bottom - top, 1.0f); const bool inUse = useShader(mDrawColorShader); - mDrawColorShader->set(mOrthoMatrix, mModelView, mSnapshot->transform); + if (!ignoreTransform) { + mDrawColorShader->set(mOrthoMatrix, mModelView, mSnapshot->transform); + } else { + mat4 identity; + mDrawColorShader->set(mOrthoMatrix, mModelView, identity); + } if (!inUse) { const GLvoid* p = &gDrawColorVertices[0].position[0]; |