Loading core/java/android/webkit/WebView.java +11 −4 Original line number Diff line number Diff line Loading @@ -4538,7 +4538,7 @@ public class WebView extends AbsoluteLayout boolean isPictureAfterFirstLayout, boolean registerPageSwapCallback) { if (mNativeClass == 0) return; nativeSetBaseLayer(layer, invalRegion, showVisualIndicator, nativeSetBaseLayer(mNativeClass, layer, invalRegion, showVisualIndicator, isPictureAfterFirstLayout, registerPageSwapCallback); if (mHTML5VideoViewProxy != null) { mHTML5VideoViewProxy.setBaseLayer(layer); Loading Loading @@ -9493,7 +9493,12 @@ public class WebView extends AbsoluteLayout /** @hide call pageSwapCallback upon next page swap */ protected void registerPageSwapCallback() { nativeRegisterPageSwapCallback(); nativeRegisterPageSwapCallback(mNativeClass); } /** @hide discard all textures from tiles */ protected void discardAllTextures() { nativeDiscardAllTextures(); } /** Loading Loading @@ -9643,7 +9648,8 @@ public class WebView extends AbsoluteLayout private native void nativeSetFindIsEmpty(); private native void nativeSetFindIsUp(boolean isUp); private native void nativeSetHeightCanMeasure(boolean measure); private native void nativeSetBaseLayer(int layer, Region invalRegion, private native void nativeSetBaseLayer(int nativeInstance, int layer, Region invalRegion, boolean showVisualIndicator, boolean isPictureAfterFirstLayout, boolean registerPageSwapCallback); private native int nativeGetBaseLayer(); Loading @@ -9657,7 +9663,8 @@ public class WebView extends AbsoluteLayout private native void nativeStopGL(); private native Rect nativeSubtractLayers(Rect content); private native int nativeTextGeneration(); private native void nativeRegisterPageSwapCallback(); private native void nativeRegisterPageSwapCallback(int nativeInstance); private native void nativeDiscardAllTextures(); private native void nativeTileProfilingStart(); private native float nativeTileProfilingStop(); private native void nativeTileProfilingClear(); Loading tests/TileBenchmark/res/layout/main.xml +43 −37 Original line number Diff line number Diff line Loading @@ -18,6 +18,11 @@ android:layout_width="match_parent" android:layout_height="match_parent" > <HorizontalScrollView android:id="@+id/horizontalScrollView" android:layout_width="wrap_content" android:layout_height="wrap_content" > <LinearLayout android:id="@+id/top" android:layout_width="match_parent" Loading Loading @@ -45,10 +50,10 @@ /> <EditText android:id="@+id/url" android:layout_width="0dip" android:layout_width="400dp" android:layout_height="wrap_content" android:inputType="textUri" android:imeOptions="actionGo" android:imeOptions="actionGo|flagNoExtractUi" android:layout_weight="1" /> <Button Loading @@ -58,6 +63,7 @@ android:text="@string/inspect_log" /> </LinearLayout> </HorizontalScrollView> <com.test.tilebenchmark.ProfiledWebView android:id="@+id/web" android:layout_width="match_parent" Loading tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java +1 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,7 @@ public class ProfileActivity extends Activity { settings.setEnableSmoothTransition(true); settings.setBuiltInZoomControls(true); settings.setLoadWithOverviewMode(true); settings.setProperty("use_minimal_memory", "false"); // prefetch tiles, as browser does mWeb.setWebViewClient(new LoggingWebViewClient()); // URL text entry Loading tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java +7 −16 Original line number Diff line number Diff line Loading @@ -33,8 +33,7 @@ public class ProfiledWebView extends WebView { private ProfileCallback mCallback; private long mContentInvalMillis; private boolean mHadToBeForced = false; private int mTestCount = 0; private static final int LOAD_STALL_MILLIS = 5000; // nr of millis after load, private static final int LOAD_STALL_MILLIS = 2000; // nr of millis after load, // before test is forced public ProfiledWebView(Context context) { Loading Loading @@ -76,13 +75,6 @@ public class ProfiledWebView extends WebView { mIsScrolling = autoScrolling; mCallback = callback; mIsTesting = false; mContentInvalMillis = System.currentTimeMillis(); registerPageSwapCallback(); contentInvalidateAll(); invalidate(); mTestCount++; final int testCount = mTestCount; if (autoScrolling) { // after a while, force it to start even if the pages haven't swapped Loading @@ -93,13 +85,12 @@ public class ProfiledWebView extends WebView { @Override public void onFinish() { if (testCount == mTestCount && !mIsTesting) { mHadToBeForced = true; Log.d("ProfiledWebView", "num " + testCount + " forcing a page swap with a scroll..."); scrollBy(0, 1); invalidate(); // ensure a redraw so that auto-scrolling can occur } // invalidate all content, and kick off redraw registerPageSwapCallback(); discardAllTextures(); invalidate(); mContentInvalMillis = System.currentTimeMillis(); } }.start(); } Loading Loading
core/java/android/webkit/WebView.java +11 −4 Original line number Diff line number Diff line Loading @@ -4538,7 +4538,7 @@ public class WebView extends AbsoluteLayout boolean isPictureAfterFirstLayout, boolean registerPageSwapCallback) { if (mNativeClass == 0) return; nativeSetBaseLayer(layer, invalRegion, showVisualIndicator, nativeSetBaseLayer(mNativeClass, layer, invalRegion, showVisualIndicator, isPictureAfterFirstLayout, registerPageSwapCallback); if (mHTML5VideoViewProxy != null) { mHTML5VideoViewProxy.setBaseLayer(layer); Loading Loading @@ -9493,7 +9493,12 @@ public class WebView extends AbsoluteLayout /** @hide call pageSwapCallback upon next page swap */ protected void registerPageSwapCallback() { nativeRegisterPageSwapCallback(); nativeRegisterPageSwapCallback(mNativeClass); } /** @hide discard all textures from tiles */ protected void discardAllTextures() { nativeDiscardAllTextures(); } /** Loading Loading @@ -9643,7 +9648,8 @@ public class WebView extends AbsoluteLayout private native void nativeSetFindIsEmpty(); private native void nativeSetFindIsUp(boolean isUp); private native void nativeSetHeightCanMeasure(boolean measure); private native void nativeSetBaseLayer(int layer, Region invalRegion, private native void nativeSetBaseLayer(int nativeInstance, int layer, Region invalRegion, boolean showVisualIndicator, boolean isPictureAfterFirstLayout, boolean registerPageSwapCallback); private native int nativeGetBaseLayer(); Loading @@ -9657,7 +9663,8 @@ public class WebView extends AbsoluteLayout private native void nativeStopGL(); private native Rect nativeSubtractLayers(Rect content); private native int nativeTextGeneration(); private native void nativeRegisterPageSwapCallback(); private native void nativeRegisterPageSwapCallback(int nativeInstance); private native void nativeDiscardAllTextures(); private native void nativeTileProfilingStart(); private native float nativeTileProfilingStop(); private native void nativeTileProfilingClear(); Loading
tests/TileBenchmark/res/layout/main.xml +43 −37 Original line number Diff line number Diff line Loading @@ -18,6 +18,11 @@ android:layout_width="match_parent" android:layout_height="match_parent" > <HorizontalScrollView android:id="@+id/horizontalScrollView" android:layout_width="wrap_content" android:layout_height="wrap_content" > <LinearLayout android:id="@+id/top" android:layout_width="match_parent" Loading Loading @@ -45,10 +50,10 @@ /> <EditText android:id="@+id/url" android:layout_width="0dip" android:layout_width="400dp" android:layout_height="wrap_content" android:inputType="textUri" android:imeOptions="actionGo" android:imeOptions="actionGo|flagNoExtractUi" android:layout_weight="1" /> <Button Loading @@ -58,6 +63,7 @@ android:text="@string/inspect_log" /> </LinearLayout> </HorizontalScrollView> <com.test.tilebenchmark.ProfiledWebView android:id="@+id/web" android:layout_width="match_parent" Loading
tests/TileBenchmark/src/com/test/tilebenchmark/ProfileActivity.java +1 −0 Original line number Diff line number Diff line Loading @@ -276,6 +276,7 @@ public class ProfileActivity extends Activity { settings.setEnableSmoothTransition(true); settings.setBuiltInZoomControls(true); settings.setLoadWithOverviewMode(true); settings.setProperty("use_minimal_memory", "false"); // prefetch tiles, as browser does mWeb.setWebViewClient(new LoggingWebViewClient()); // URL text entry Loading
tests/TileBenchmark/src/com/test/tilebenchmark/ProfiledWebView.java +7 −16 Original line number Diff line number Diff line Loading @@ -33,8 +33,7 @@ public class ProfiledWebView extends WebView { private ProfileCallback mCallback; private long mContentInvalMillis; private boolean mHadToBeForced = false; private int mTestCount = 0; private static final int LOAD_STALL_MILLIS = 5000; // nr of millis after load, private static final int LOAD_STALL_MILLIS = 2000; // nr of millis after load, // before test is forced public ProfiledWebView(Context context) { Loading Loading @@ -76,13 +75,6 @@ public class ProfiledWebView extends WebView { mIsScrolling = autoScrolling; mCallback = callback; mIsTesting = false; mContentInvalMillis = System.currentTimeMillis(); registerPageSwapCallback(); contentInvalidateAll(); invalidate(); mTestCount++; final int testCount = mTestCount; if (autoScrolling) { // after a while, force it to start even if the pages haven't swapped Loading @@ -93,13 +85,12 @@ public class ProfiledWebView extends WebView { @Override public void onFinish() { if (testCount == mTestCount && !mIsTesting) { mHadToBeForced = true; Log.d("ProfiledWebView", "num " + testCount + " forcing a page swap with a scroll..."); scrollBy(0, 1); invalidate(); // ensure a redraw so that auto-scrolling can occur } // invalidate all content, and kick off redraw registerPageSwapCallback(); discardAllTextures(); invalidate(); mContentInvalMillis = System.currentTimeMillis(); } }.start(); } Loading