summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-05-15 13:21:28 -0700
committerChris Craik <ccraik@google.com>2014-05-15 13:21:28 -0700
commit924197513aa2df4c1fb2977c1727f5d2c21f2689 (patch)
tree402ec417e1b44e3f2b2c0ce6ef1efcd6d5a0f576 /libs
parentfe4c1e225d147fe9cb5d7c121b7d6d11a312844e (diff)
downloadframeworks_base-924197513aa2df4c1fb2977c1727f5d2c21f2689.zip
frameworks_base-924197513aa2df4c1fb2977c1727f5d2c21f2689.tar.gz
frameworks_base-924197513aa2df4c1fb2977c1727f5d2c21f2689.tar.bz2
Correct viewport initialization, bounds comparison
Change-Id: Ibd751856e3712991e149800ed179464397dad7c3
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp4
-rw-r--r--libs/hwui/Snapshot.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 4df97e6..921c77b 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 e9ab1ff..1a517fc 100644
--- a/libs/hwui/Snapshot.h
+++ b/libs/hwui/Snapshot.h
@@ -229,7 +229,7 @@ public:
private:
struct ViewportData {
- ViewportData() : mWidth(0), mHeight() {}
+ ViewportData() : mWidth(0), mHeight(0) {}
void initialize(int width, int height) {
mWidth = width;
mHeight = height;