summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-07-30 11:36:12 -0700
committerRomain Guy <romainguy@google.com>2010-07-30 11:40:21 -0700
commitb82da65cb1601be504241f36778395cd6cb9f87b (patch)
tree19fc51fb41e806817a4895212b8111fa9131af04 /libs/hwui
parentb422107d1d599e5d43cc47cd7e1342976b6b5b1a (diff)
downloadframeworks_base-b82da65cb1601be504241f36778395cd6cb9f87b.zip
frameworks_base-b82da65cb1601be504241f36778395cd6cb9f87b.tar.gz
frameworks_base-b82da65cb1601be504241f36778395cd6cb9f87b.tar.bz2
Fix improper clipping after a save()
Change-Id: I13426a67f20d77e2710bd500d82884098f4be97c
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp5
-rw-r--r--libs/hwui/Snapshot.h9
2 files changed, 10 insertions, 4 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 3c36f95..cc8e6bc 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -177,7 +177,7 @@ void OpenGLRenderer::setViewport(int width, int height) {
}
void OpenGLRenderer::prepare() {
- mSnapshot = mFirstSnapshot;
+ mSnapshot = new Snapshot(mFirstSnapshot);
mSaveCount = 0;
glDisable(GL_SCISSOR_TEST);
@@ -188,7 +188,7 @@ void OpenGLRenderer::prepare() {
glEnable(GL_SCISSOR_TEST);
glScissor(0, 0, mWidth, mHeight);
- mSnapshot->clipRect.set(0.0f, 0.0f, mWidth, mHeight);
+ mSnapshot->setClip(0.0f, 0.0f, mWidth, mHeight);
}
///////////////////////////////////////////////////////////////////////////////
@@ -569,6 +569,7 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
chooseBlending(true, mode);
bindTexture(mFontRenderer.getTexture(), GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE, 0);
+ glUniform1i(mCurrentProgram->getUniform("sampler"), 0);
int texCoordsSlot = mCurrentProgram->getAttrib("texCoords");
glEnableVertexAttribArray(texCoordsSlot);
diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h
index 020bdb0..399ae68 100644
--- a/libs/hwui/Snapshot.h
+++ b/libs/hwui/Snapshot.h
@@ -57,8 +57,13 @@ public:
flags(0),
previous(s),
layer(NULL),
- fbo(s->fbo),
- localClip(s->localClip) {
+ fbo(s->fbo) {
+ if ((s->flags & Snapshot::kFlagClipSet) &&
+ !(s->flags & Snapshot::kFlagDirtyLocalClip)) {
+ localClip.set(s->localClip);
+ } else {
+ flags |= Snapshot::kFlagDirtyLocalClip;
+ }
}
/**