summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-03-16 17:24:35 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-16 17:24:35 -0700
commit6e9c5336ef1a230b1cabc7c55ef19aeee6c00f55 (patch)
tree610f2a35266e81b5b57f3b5f565c209802df1338 /WebKit
parentd6f0aa4a5a76d43d382dad30b31541fc7372206b (diff)
parent79d8e0434bfe00a793e8041f96dc02ec1d98e694 (diff)
downloadexternal_webkit-6e9c5336ef1a230b1cabc7c55ef19aeee6c00f55.zip
external_webkit-6e9c5336ef1a230b1cabc7c55ef19aeee6c00f55.tar.gz
external_webkit-6e9c5336ef1a230b1cabc7c55ef19aeee6c00f55.tar.bz2
Merge "Pass the clip rect to WebView to optimize rendering" into honeycomb-mr1
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/nav/WebView.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index 0762fb9..8cc5810 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -1481,17 +1481,33 @@ class GLDrawFunctor : Functor {
scale = _scale;
extras = _extras;
};
- status_t operator()(float* dirty, uint32_t len) {
- if (viewRect.isEmpty() || len != 4) {
+ status_t operator()(int messageId, void* data) {
+ if (viewRect.isEmpty()) {
// NOOP operation if viewport is empty
return 0;
}
+
+ struct DrawConstraints {
+ // Input: clip rect as set on the Canvas, in screen coordinates
+ int clipLeft;
+ int clipTop;
+ int clipRight;
+ int clipBottom;
+
+ // Output: dirty region that must be redrawn
+ float dirtyLeft;
+ float dirtyTop;
+ float dirtyRight;
+ float dirtyBottom;
+ };
+
bool retVal = (*wvInstance.*funcPtr)(viewRect, scale, extras);
if (retVal) {
- dirty[0] = webViewRect.x();
- dirty[1] = webViewRect.y();
- dirty[2] = webViewRect.right();
- dirty[3] = webViewRect.bottom();
+ DrawConstraints* constraints = reinterpret_cast<DrawConstraints*>(data);
+ constraints->dirtyLeft = webViewRect.x();
+ constraints->dirtyTop = webViewRect.y();
+ constraints->dirtyRight = webViewRect.right();
+ constraints->dirtyBottom = webViewRect.bottom();
}
// return 1 if invalidation needed, 0 otherwise
return retVal ? 1 : 0;