summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-03-16 17:31:30 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-03-16 17:31:30 -0700
commita30f43624f76a7d49fcb48944c310cb4dbfc6522 (patch)
tree33802c8360cead9e9dd88ecfe8e8d8e167dc5b3d /libs/hwui
parentd50349de17784f924f8cca6ef2fb2708b9fd2ecd (diff)
parent72064c66e20b9cc86900a9d833c228c345a2b2a4 (diff)
downloadframeworks_base-a30f43624f76a7d49fcb48944c310cb4dbfc6522.zip
frameworks_base-a30f43624f76a7d49fcb48944c310cb4dbfc6522.tar.gz
frameworks_base-a30f43624f76a7d49fcb48944c310cb4dbfc6522.tar.bz2
am 72064c66: am b0204d0a: am c2b91a61: Merge "Modify the GL renderer\'s functor to pass the clip to WebView" into honeycomb-mr1
* commit '72064c66e20b9cc86900a9d833c228c345a2b2a4': Modify the GL renderer's functor to pass the clip to WebView
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index e01e072..d265804 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -216,21 +216,41 @@ bool OpenGLRenderer::callDrawGLFunction(Functor *functor, Rect& dirty) {
setScissorFromClip();
}
+ Rect clip(*mSnapshot->clipRect);
+ clip.snapToPixelBoundaries();
+
#if RENDER_LAYERS_AS_REGIONS
// Since we don't know what the functor will draw, let's dirty
// tne entire clip region
if (hasLayer()) {
- Rect clip(*mSnapshot->clipRect);
- clip.snapToPixelBoundaries();
dirtyLayerUnchecked(clip, getRegion());
}
#endif
- float bounds[4];
- status_t result = (*functor)(&bounds[0], 4);
+ struct {
+ // Input: current clip rect
+ int clipLeft;
+ int clipTop;
+ int clipRight;
+ int clipBottom;
+
+ // Output: dirty region to redraw
+ float dirtyLeft;
+ float dirtyTop;
+ float dirtyRight;
+ float dirtyBottom;
+ } constraints;
+
+ constraints.clipLeft = clip.left;
+ constraints.clipTop = clip.top;
+ constraints.clipRight = clip.right;
+ constraints.clipBottom = clip.bottom;
+
+ status_t result = (*functor)(0, &constraints);
if (result != 0) {
- Rect localDirty(bounds[0], bounds[1], bounds[2], bounds[3]);
+ Rect localDirty(constraints.dirtyLeft, constraints.dirtyTop,
+ constraints.dirtyRight, constraints.dirtyBottom);
dirty.unionWith(localDirty);
}