summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Sears <bsears@google.com>2011-11-18 13:35:14 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-11-18 13:35:14 -0800
commitcb513ba7f14fdf08b5729edef5baf22e302e3e08 (patch)
treedc203c43a605196d0bbc23dd50cf816fe0a52324
parent322f884dfda201f7bcb5b8cbff80d0ae5122ced3 (diff)
parente6a96560ed96e5121db2e22168698f14338c8f1d (diff)
downloadframeworks_base-cb513ba7f14fdf08b5729edef5baf22e302e3e08.zip
frameworks_base-cb513ba7f14fdf08b5729edef5baf22e302e3e08.tar.gz
frameworks_base-cb513ba7f14fdf08b5729edef5baf22e302e3e08.tar.bz2
am e6a96560: Merge "Content and viewport rects set in one step." into ics-mr1
* commit 'e6a96560ed96e5121db2e22168698f14338c8f1d': Content and viewport rects set in one step.
-rw-r--r--core/java/android/webkit/WebView.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 35fd945..04f095f 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -366,6 +366,7 @@ public class WebView extends AbsoluteLayout
private final Rect mGLRectViewport = new Rect();
private final Rect mViewRectViewport = new Rect();
+ private final RectF mVisibleContentRect = new RectF();
private boolean mGLViewportEmpty = false;
/**
@@ -4607,11 +4608,14 @@ public class WebView extends AbsoluteLayout
+ " extras=" + extras);
}
+ calcOurContentVisibleRectF(mVisibleContentRect);
if (canvas.isHardwareAccelerated()) {
- int functor = nativeGetDrawGLFunction(mNativeClass,
- mGLViewportEmpty ? null : mGLRectViewport, mGLViewportEmpty ? null : mViewRectViewport, getScale(), extras);
- ((HardwareCanvas) canvas).callDrawGLFunction(functor);
+ Rect glRectViewport = mGLViewportEmpty ? null : mGLRectViewport;
+ Rect viewRectViewport = mGLViewportEmpty ? null : mViewRectViewport;
+ int functor = nativeGetDrawGLFunction(mNativeClass, glRectViewport,
+ viewRectViewport, mVisibleContentRect, getScale(), extras);
+ ((HardwareCanvas) canvas).callDrawGLFunction(functor);
if (mHardwareAccelSkia != getSettings().getHardwareAccelSkiaEnabled()) {
mHardwareAccelSkia = getSettings().getHardwareAccelSkiaEnabled();
nativeUseHardwareAccelSkia(mHardwareAccelSkia);
@@ -4627,7 +4631,8 @@ public class WebView extends AbsoluteLayout
canvas.setDrawFilter(df);
// XXX: Revisit splitting content. Right now it causes a
// synchronization problem with layers.
- int content = nativeDraw(canvas, color, extras, false);
+ int content = nativeDraw(canvas, mVisibleContentRect, color,
+ extras, false);
canvas.setDrawFilter(null);
if (!mBlockWebkitViewMessages && content != 0) {
mWebViewCore.sendMessage(EventHub.SPLIT_PICTURE_SET, content, 0);
@@ -5797,8 +5802,9 @@ public class WebView extends AbsoluteLayout
} else {
mGLViewportEmpty = true;
}
+ calcOurContentVisibleRectF(mVisibleContentRect);
nativeUpdateDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport,
- mGLViewportEmpty ? null : mViewRectViewport);
+ mGLViewportEmpty ? null : mViewRectViewport, mVisibleContentRect);
}
/**
@@ -8795,7 +8801,6 @@ public class WebView extends AbsoluteLayout
mSendScrollEvent = false;
recordNewContentSize(draw.mContentSize.x,
draw.mContentSize.y, updateLayout);
-
if (isPictureAfterFirstLayout) {
// Reset the last sent data here since dealing with new page.
mLastWidthSent = 0;
@@ -9366,7 +9371,8 @@ public class WebView extends AbsoluteLayout
* @hide only needs to be accessible to Browser and testing
*/
public void drawPage(Canvas canvas) {
- nativeDraw(canvas, 0, 0, false);
+ calcOurContentVisibleRectF(mVisibleContentRect);
+ nativeDraw(canvas, mVisibleContentRect, 0, 0, false);
}
/**
@@ -9497,13 +9503,14 @@ public class WebView extends AbsoluteLayout
* MUST be passed to WebViewCore with SPLIT_PICTURE_SET message so that the
* native allocation can be freed.
*/
- private native int nativeDraw(Canvas canvas, int color, int extra,
- boolean splitIfNeeded);
+ private native int nativeDraw(Canvas canvas, RectF visibleRect,
+ int color, int extra, boolean splitIfNeeded);
private native void nativeDumpDisplayTree(String urlOrNull);
private native boolean nativeEvaluateLayersAnimations(int nativeInstance);
private native int nativeGetDrawGLFunction(int nativeInstance, Rect rect,
- Rect viewRect, float scale, int extras);
- private native void nativeUpdateDrawGLFunction(Rect rect, Rect viewRect);
+ Rect viewRect, RectF visibleRect, float scale, int extras);
+ private native void nativeUpdateDrawGLFunction(Rect rect, Rect viewRect,
+ RectF visibleRect);
private native void nativeExtendSelection(int x, int y);
private native int nativeFindAll(String findLower, String findUpper,
boolean sameAsLastSearch);