diff options
author | Romain Guy <romainguy@google.com> | 2011-03-16 17:31:32 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-16 17:31:32 -0700 |
commit | df18bcda73437f0690129e4915d0c55b62dc9458 (patch) | |
tree | ef507122f7f8616ec87db420bf878ebea846ef3b /WebKit/android | |
parent | 2bc5e543e4c9db061e9d02e9bf5387023b23d5b8 (diff) | |
parent | 114ea00b345ca2696f097bc1ee69a196be11e4a1 (diff) | |
download | external_webkit-df18bcda73437f0690129e4915d0c55b62dc9458.zip external_webkit-df18bcda73437f0690129e4915d0c55b62dc9458.tar.gz external_webkit-df18bcda73437f0690129e4915d0c55b62dc9458.tar.bz2 |
am 114ea00b: am 6e9c5336: Merge "Pass the clip rect to WebView to optimize rendering" into honeycomb-mr1
* commit '114ea00b345ca2696f097bc1ee69a196be11e4a1':
Pass the clip rect to WebView to optimize rendering
Diffstat (limited to 'WebKit/android')
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index baf59b9..fd00693 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -1489,17 +1489,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; |