Merge "Rewrite PictureSet" into jb-dev

This commit is contained in:
John Reck
2012-05-02 16:11:17 -07:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 60 deletions

View File

@@ -984,7 +984,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
static final int REQUEST_KEYBOARD = 118;
static final int SHOW_FULLSCREEN = 120;
static final int HIDE_FULLSCREEN = 121;
static final int REPLACE_BASE_CONTENT = 123;
static final int UPDATE_MATCH_COUNT = 126;
static final int CENTER_FIT_RECT = 127;
static final int SET_SCROLLBAR_MODES = 129;
@@ -4232,14 +4231,8 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
df = mScrollFilter;
}
canvas.setDrawFilter(df);
// XXX: Revisit splitting content. Right now it causes a
// synchronization problem with layers.
int content = nativeDraw(canvas, mVisibleContentRect, mBackgroundColor,
extras, false);
nativeDraw(canvas, mVisibleContentRect, mBackgroundColor, extras);
canvas.setDrawFilter(null);
if (!mBlockWebkitViewMessages && content != 0) {
mWebViewCore.sendMessage(EventHub.SPLIT_PICTURE_SET, content, 0);
}
}
canvas.restoreToCount(saveCount);
@@ -7256,10 +7249,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
mZoomManager.updateDefaultZoomDensity(density);
break;
}
case REPLACE_BASE_CONTENT: {
nativeReplaceBaseContent(msg.arg1);
break;
}
case NEW_PICTURE_MSG_ID: {
// called for new content
final WebViewCore.DrawData draw = (WebViewCore.DrawData) msg.obj;
@@ -8433,18 +8422,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
public void debugDump() {
}
/**
* Draw the HTML page into the specified canvas. This call ignores any
* view-specific zoom, scroll offset, or other changes. It does not draw
* any view-specific chrome, such as progress or URL bars.
*
* only needs to be accessible to Browser and testing
*/
public void drawPage(Canvas canvas) {
calcOurContentVisibleRectF(mVisibleContentRect);
nativeDraw(canvas, mVisibleContentRect, 0, 0, false);
}
/**
* Enable the communication b/t the webView and VideoViewProxy
*
@@ -8578,14 +8555,8 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
private native void nativeDebugDump();
private native void nativeDestroy();
/**
* Draw the picture set with a background color and extra. If
* "splitIfNeeded" is true and the return value is not 0, the return value
* MUST be passed to WebViewCore with SPLIT_PICTURE_SET message so that the
* native allocation can be freed.
*/
private native int nativeDraw(Canvas canvas, RectF visibleRect,
int color, int extra, boolean splitIfNeeded);
private native void nativeDraw(Canvas canvas, RectF visibleRect,
int color, int extra);
private native void nativeDumpDisplayTree(String urlOrNull);
private native boolean nativeEvaluateLayersAnimations(int nativeInstance);
private native int nativeCreateDrawGLFunction(int nativeInstance, Rect rect,
@@ -8599,7 +8570,6 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
private native boolean nativeSetBaseLayer(int nativeInstance,
int layer, boolean showVisualIndicator, boolean isPictureAfterFirstLayout);
private native int nativeGetBaseLayer();
private native void nativeReplaceBaseContent(int content);
private native void nativeCopyBaseContentToPicture(Picture pict);
private native boolean nativeHasContent();
private native void nativeStopGL();

View File

@@ -610,12 +610,6 @@ public final class WebViewCore {
private native boolean nativeFocusBoundsChanged(int nativeClass);
/**
* Splits slow parts of the picture set. Called from the webkit thread after
* WebView.nativeDraw() returns content to be split.
*/
private native void nativeSplitContent(int nativeClass, int content);
private native boolean nativeKey(int nativeClass, int keyCode,
int unichar, int repeatCount, boolean isShift, boolean isAlt,
boolean isSym, boolean isDown);
@@ -1018,7 +1012,7 @@ public final class WebViewCore {
"WEBKIT_DRAW", // = 130;
"131", // = 131;
"POST_URL", // = 132;
"SPLIT_PICTURE_SET", // = 133;
"", // = 133;
"CLEAR_CONTENT", // = 134;
"", // = 135;
"", // = 136;
@@ -1094,7 +1088,6 @@ public final class WebViewCore {
static final int WEBKIT_DRAW = 130;
static final int POST_URL = 132;
static final int SPLIT_PICTURE_SET = 133;
static final int CLEAR_CONTENT = 134;
// UI nav messages
@@ -1611,13 +1604,6 @@ public final class WebViewCore {
data.mOrigin, data.mAllow, data.mRemember);
break;
case SPLIT_PICTURE_SET:
nativeSplitContent(mNativeClass, msg.arg1);
mWebViewClassic.mPrivateHandler.obtainMessage(
WebViewClassic.REPLACE_BASE_CONTENT, msg.arg1, 0);
mSplitPictureIsScheduled = false;
break;
case CLEAR_CONTENT:
// Clear the view so that onDraw() will draw nothing
// but white background
@@ -1879,7 +1865,6 @@ public final class WebViewCore {
private synchronized void removeMessages() {
// reset mDrawIsScheduled flag as WEBKIT_DRAW may be removed
mDrawIsScheduled = false;
mSplitPictureIsScheduled = false;
if (mMessages != null) {
mMessages.clear();
} else {
@@ -2141,20 +2126,9 @@ public final class WebViewCore {
return usedQuota;
}
// called from UI thread
void splitContent(int content) {
if (!mSplitPictureIsScheduled) {
mSplitPictureIsScheduled = true;
sendMessage(EventHub.SPLIT_PICTURE_SET, content, 0);
}
}
// Used to avoid posting more than one draw message.
private boolean mDrawIsScheduled;
// Used to avoid posting more than one split picture message.
private boolean mSplitPictureIsScheduled;
// Used to suspend drawing.
private boolean mDrawIsPaused;