summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2011-03-15 18:20:42 -0700
committerNicolas Roard <nicolasroard@google.com>2011-03-16 23:43:46 -0700
commit9f5143f9ae49a8e5fdb7ea626c4efad66096b020 (patch)
treeb1d3eb92be0b354b8f662f50653da96c4d3cbdc8 /WebKit/android
parent8e1d10880da3108f7eb53ae81682a7c4192a2e3f (diff)
downloadexternal_webkit-9f5143f9ae49a8e5fdb7ea626c4efad66096b020.zip
external_webkit-9f5143f9ae49a8e5fdb7ea626c4efad66096b020.tar.gz
external_webkit-9f5143f9ae49a8e5fdb7ea626c4efad66096b020.tar.bz2
Implement partial screen invalidations
bug:3461349 Change-Id: Id654d176c58027c67be7cb604b87c0ec68984525
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/nav/WebView.cpp36
1 files changed, 25 insertions, 11 deletions
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index 8cc5810..6e85873 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -428,7 +428,7 @@ void drawCursorPostamble()
}
}
-bool drawGL(WebCore::IntRect& viewRect, float scale, int extras)
+bool drawGL(WebCore::IntRect& viewRect, WebCore::IntRect* invalRect, float scale, int extras)
{
#if USE(ACCELERATED_COMPOSITING)
if (!m_baseLayer || inFullScreenMode())
@@ -499,7 +499,7 @@ bool drawGL(WebCore::IntRect& viewRect, float scale, int extras)
SkRect visibleRect;
calcOurContentVisibleRect(&visibleRect);
- bool ret = m_glWebViewState->drawGL(viewRect, visibleRect, scale);
+ bool ret = m_glWebViewState->drawGL(viewRect, visibleRect, invalRect, scale);
if (ret || m_glWebViewState->currentPictureCounter() != pic)
return true;
#endif
@@ -1473,7 +1473,7 @@ private: // local state for WebView
class GLDrawFunctor : Functor {
public:
GLDrawFunctor(WebView* _wvInstance,
- bool(WebView::*_funcPtr)(WebCore::IntRect&, jfloat, jint),
+ bool(WebView::*_funcPtr)(WebCore::IntRect&, WebCore::IntRect*, jfloat, jint),
WebCore::IntRect _viewRect, float _scale, int _extras) {
wvInstance = _wvInstance;
funcPtr = _funcPtr;
@@ -1501,13 +1501,26 @@ class GLDrawFunctor : Functor {
float dirtyBottom;
};
- bool retVal = (*wvInstance.*funcPtr)(viewRect, scale, extras);
+ WebCore::IntRect inval;
+ int titlebarHeight = webViewRect.height() - viewRect.height();
+ bool retVal = (*wvInstance.*funcPtr)(viewRect, &inval, scale, extras);
if (retVal) {
DrawConstraints* constraints = reinterpret_cast<DrawConstraints*>(data);
- constraints->dirtyLeft = webViewRect.x();
- constraints->dirtyTop = webViewRect.y();
- constraints->dirtyRight = webViewRect.right();
- constraints->dirtyBottom = webViewRect.bottom();
+ IntRect finalInval;
+ if (inval.isEmpty()) {
+ finalInval = webViewRect;
+ retVal = false;
+ } else {
+ finalInval.setX(webViewRect.x() + inval.x());
+ finalInval.setY(webViewRect.y() + inval.y() + titlebarHeight);
+ finalInval.setWidth(inval.width());
+ finalInval.setHeight(inval.height());
+ finalInval.intersect(webViewRect);
+ }
+ constraints->dirtyLeft = finalInval.x();
+ constraints->dirtyTop = finalInval.y();
+ constraints->dirtyRight = finalInval.right();
+ constraints->dirtyBottom = finalInval.bottom();
}
// return 1 if invalidation needed, 0 otherwise
return retVal ? 1 : 0;
@@ -1520,7 +1533,7 @@ class GLDrawFunctor : Functor {
}
private:
WebView* wvInstance;
- bool (WebView::*funcPtr)(WebCore::IntRect&, float, int);
+ bool (WebView::*funcPtr)(WebCore::IntRect&, WebCore::IntRect*, float, int);
WebCore::IntRect viewRect;
WebCore::IntRect webViewRect;
jfloat scale;
@@ -1805,13 +1818,14 @@ static bool nativeDrawGL(JNIEnv *env, jobject obj, jobject jrect,
jfloat scale, jint extras)
{
WebCore::IntRect viewRect = jrect_to_webrect(env, jrect);
- return GET_NATIVE_VIEW(env, obj)->drawGL(viewRect, scale, extras);
+ WebCore::IntRect invalRect;
+ return GET_NATIVE_VIEW(env, obj)->drawGL(viewRect, &invalRect, scale, extras);
}
static bool nativeEvaluateLayersAnimations(JNIEnv *env, jobject obj)
{
#if USE(ACCELERATED_COMPOSITING)
- const LayerAndroid* root = GET_NATIVE_VIEW(env, obj)->compositeRoot();
+ LayerAndroid* root = GET_NATIVE_VIEW(env, obj)->compositeRoot();
if (root)
return root->evaluateAnimations();
#endif