am e6a96560: Merge "Content and viewport rects set in one step." into ics-mr1
* commit 'e6a96560ed96e5121db2e22168698f14338c8f1d': Content and viewport rects set in one step.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user