diff options
author | Chris Craik <ccraik@google.com> | 2014-05-19 21:54:03 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-19 21:54:03 +0000 |
commit | f2985ba3f41c4619f7b64797d07e3a008e17b20a (patch) | |
tree | 7d1a8a9fd61a77fbc7ef31d62c1026d915c71baa /libs | |
parent | a4fcdad1b8b436136599bba48df82aa6480054fe (diff) | |
parent | 924197513aa2df4c1fb2977c1727f5d2c21f2689 (diff) | |
download | frameworks_base-f2985ba3f41c4619f7b64797d07e3a008e17b20a.zip frameworks_base-f2985ba3f41c4619f7b64797d07e3a008e17b20a.tar.gz frameworks_base-f2985ba3f41c4619f7b64797d07e3a008e17b20a.tar.bz2 |
Merge "Correct viewport initialization, bounds comparison"
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 4 | ||||
-rw-r--r-- | libs/hwui/Snapshot.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 7993c0f..826d988 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -662,7 +662,9 @@ void OpenGLRenderer::calculateLayerBoundsAndClip(Rect& bounds, Rect& clip, bool // When the layer is not an FBO, we may use glCopyTexImage so we // need to make sure the layer does not extend outside the bounds // of the framebuffer - if (!bounds.intersect(Rect(0, 0, getViewportWidth(), getViewportHeight()))) { + const Snapshot& previous = *(currentSnapshot()->previous); + Rect previousViewport(0, 0, previous.getViewportWidth(), previous.getViewportHeight()); + if (!bounds.intersect(previousViewport)) { bounds.setEmpty(); } else if (fboLayer) { clip.set(bounds); diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h index 485dbf6..5426e89 100644 --- a/libs/hwui/Snapshot.h +++ b/libs/hwui/Snapshot.h @@ -271,7 +271,7 @@ public: private: struct ViewportData { - ViewportData() : mWidth(0), mHeight() {} + ViewportData() : mWidth(0), mHeight(0) {} void initialize(int width, int height) { mWidth = width; mHeight = height; |