Skip to content

Commit 33b019b

Browse files
committed
Rewrite PictureSet
Removes no longer supported splitPicture Removes unnused code Bulk of the change is in webkit CL: https://android-git.corp.google.com/g/#/c/185850/ Change-Id: I4eca363ba3cb4a6d6fccc82bf5ea8588df780a4b
1 parent 6dbac37 commit 33b019b

File tree

2 files changed

+4
-60
lines changed

2 files changed

+4
-60
lines changed

core/java/android/webkit/WebViewClassic.java

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,6 @@ public void onTrimMemory(int level) {
984984
static final int REQUEST_KEYBOARD = 118;
985985
static final int SHOW_FULLSCREEN = 120;
986986
static final int HIDE_FULLSCREEN = 121;
987-
static final int REPLACE_BASE_CONTENT = 123;
988987
static final int UPDATE_MATCH_COUNT = 126;
989988
static final int CENTER_FIT_RECT = 127;
990989
static final int SET_SCROLLBAR_MODES = 129;
@@ -4232,14 +4231,8 @@ && nativeEvaluateLayersAnimations(mNativeClass)) {
42324231
df = mScrollFilter;
42334232
}
42344233
canvas.setDrawFilter(df);
4235-
// XXX: Revisit splitting content. Right now it causes a
4236-
// synchronization problem with layers.
4237-
int content = nativeDraw(canvas, mVisibleContentRect, mBackgroundColor,
4238-
extras, false);
4234+
nativeDraw(canvas, mVisibleContentRect, mBackgroundColor, extras);
42394235
canvas.setDrawFilter(null);
4240-
if (!mBlockWebkitViewMessages && content != 0) {
4241-
mWebViewCore.sendMessage(EventHub.SPLIT_PICTURE_SET, content, 0);
4242-
}
42434236
}
42444237

42454238
canvas.restoreToCount(saveCount);
@@ -7245,10 +7238,6 @@ public void handleMessage(Message msg) {
72457238
mZoomManager.updateDefaultZoomDensity(density);
72467239
break;
72477240
}
7248-
case REPLACE_BASE_CONTENT: {
7249-
nativeReplaceBaseContent(msg.arg1);
7250-
break;
7251-
}
72527241
case NEW_PICTURE_MSG_ID: {
72537242
// called for new content
72547243
final WebViewCore.DrawData draw = (WebViewCore.DrawData) msg.obj;
@@ -8422,18 +8411,6 @@ public void setBackgroundColor(int color) {
84228411
public void debugDump() {
84238412
}
84248413

8425-
/**
8426-
* Draw the HTML page into the specified canvas. This call ignores any
8427-
* view-specific zoom, scroll offset, or other changes. It does not draw
8428-
* any view-specific chrome, such as progress or URL bars.
8429-
*
8430-
* only needs to be accessible to Browser and testing
8431-
*/
8432-
public void drawPage(Canvas canvas) {
8433-
calcOurContentVisibleRectF(mVisibleContentRect);
8434-
nativeDraw(canvas, mVisibleContentRect, 0, 0, false);
8435-
}
8436-
84378414
/**
84388415
* Enable the communication b/t the webView and VideoViewProxy
84398416
*
@@ -8567,14 +8544,8 @@ private void postInvalidate() {
85678544
private native void nativeDebugDump();
85688545
private native void nativeDestroy();
85698546

8570-
/**
8571-
* Draw the picture set with a background color and extra. If
8572-
* "splitIfNeeded" is true and the return value is not 0, the return value
8573-
* MUST be passed to WebViewCore with SPLIT_PICTURE_SET message so that the
8574-
* native allocation can be freed.
8575-
*/
8576-
private native int nativeDraw(Canvas canvas, RectF visibleRect,
8577-
int color, int extra, boolean splitIfNeeded);
8547+
private native void nativeDraw(Canvas canvas, RectF visibleRect,
8548+
int color, int extra);
85788549
private native void nativeDumpDisplayTree(String urlOrNull);
85798550
private native boolean nativeEvaluateLayersAnimations(int nativeInstance);
85808551
private native int nativeCreateDrawGLFunction(int nativeInstance, Rect rect,
@@ -8588,7 +8559,6 @@ private native void nativeUpdateDrawGLFunction(int nativeInstance, Rect rect
85888559
private native boolean nativeSetBaseLayer(int nativeInstance,
85898560
int layer, boolean showVisualIndicator, boolean isPictureAfterFirstLayout);
85908561
private native int nativeGetBaseLayer();
8591-
private native void nativeReplaceBaseContent(int content);
85928562
private native void nativeCopyBaseContentToPicture(Picture pict);
85938563
private native boolean nativeHasContent();
85948564
private native void nativeStopGL();

core/java/android/webkit/WebViewCore.java

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -610,12 +610,6 @@ protected void exitFullscreenVideo() {
610610

611611
private native boolean nativeFocusBoundsChanged(int nativeClass);
612612

613-
/**
614-
* Splits slow parts of the picture set. Called from the webkit thread after
615-
* WebView.nativeDraw() returns content to be split.
616-
*/
617-
private native void nativeSplitContent(int nativeClass, int content);
618-
619613
private native boolean nativeKey(int nativeClass, int keyCode,
620614
int unichar, int repeatCount, boolean isShift, boolean isAlt,
621615
boolean isSym, boolean isDown);
@@ -1018,7 +1012,7 @@ static class GeolocationPermissionsData {
10181012
"WEBKIT_DRAW", // = 130;
10191013
"131", // = 131;
10201014
"POST_URL", // = 132;
1021-
"SPLIT_PICTURE_SET", // = 133;
1015+
"", // = 133;
10221016
"CLEAR_CONTENT", // = 134;
10231017
"", // = 135;
10241018
"", // = 136;
@@ -1094,7 +1088,6 @@ public class EventHub implements WebViewInputDispatcher.WebKitCallbacks {
10941088

10951089
static final int WEBKIT_DRAW = 130;
10961090
static final int POST_URL = 132;
1097-
static final int SPLIT_PICTURE_SET = 133;
10981091
static final int CLEAR_CONTENT = 134;
10991092

11001093
// UI nav messages
@@ -1611,13 +1604,6 @@ public void handleMessage(Message msg) {
16111604
data.mOrigin, data.mAllow, data.mRemember);
16121605
break;
16131606

1614-
case SPLIT_PICTURE_SET:
1615-
nativeSplitContent(mNativeClass, msg.arg1);
1616-
mWebViewClassic.mPrivateHandler.obtainMessage(
1617-
WebViewClassic.REPLACE_BASE_CONTENT, msg.arg1, 0);
1618-
mSplitPictureIsScheduled = false;
1619-
break;
1620-
16211607
case CLEAR_CONTENT:
16221608
// Clear the view so that onDraw() will draw nothing
16231609
// but white background
@@ -1879,7 +1865,6 @@ private synchronized void sendMessageAtFrontOfQueue(Message msg) {
18791865
private synchronized void removeMessages() {
18801866
// reset mDrawIsScheduled flag as WEBKIT_DRAW may be removed
18811867
mDrawIsScheduled = false;
1882-
mSplitPictureIsScheduled = false;
18831868
if (mMessages != null) {
18841869
mMessages.clear();
18851870
} else {
@@ -2141,20 +2126,9 @@ private long getUsedQuota() {
21412126
return usedQuota;
21422127
}
21432128

2144-
// called from UI thread
2145-
void splitContent(int content) {
2146-
if (!mSplitPictureIsScheduled) {
2147-
mSplitPictureIsScheduled = true;
2148-
sendMessage(EventHub.SPLIT_PICTURE_SET, content, 0);
2149-
}
2150-
}
2151-
21522129
// Used to avoid posting more than one draw message.
21532130
private boolean mDrawIsScheduled;
21542131

2155-
// Used to avoid posting more than one split picture message.
2156-
private boolean mSplitPictureIsScheduled;
2157-
21582132
// Used to suspend drawing.
21592133
private boolean mDrawIsPaused;
21602134

0 commit comments

Comments
 (0)