Merge "Update tilebenchmark to work with current drawing infrastructure"
This commit is contained in:
@@ -4538,7 +4538,7 @@ public class WebView extends AbsoluteLayout
|
|||||||
boolean isPictureAfterFirstLayout, boolean registerPageSwapCallback) {
|
boolean isPictureAfterFirstLayout, boolean registerPageSwapCallback) {
|
||||||
if (mNativeClass == 0)
|
if (mNativeClass == 0)
|
||||||
return;
|
return;
|
||||||
nativeSetBaseLayer(layer, invalRegion, showVisualIndicator,
|
nativeSetBaseLayer(mNativeClass, layer, invalRegion, showVisualIndicator,
|
||||||
isPictureAfterFirstLayout, registerPageSwapCallback);
|
isPictureAfterFirstLayout, registerPageSwapCallback);
|
||||||
if (mHTML5VideoViewProxy != null) {
|
if (mHTML5VideoViewProxy != null) {
|
||||||
mHTML5VideoViewProxy.setBaseLayer(layer);
|
mHTML5VideoViewProxy.setBaseLayer(layer);
|
||||||
@@ -9493,7 +9493,12 @@ public class WebView extends AbsoluteLayout
|
|||||||
|
|
||||||
/** @hide call pageSwapCallback upon next page swap */
|
/** @hide call pageSwapCallback upon next page swap */
|
||||||
protected void registerPageSwapCallback() {
|
protected void registerPageSwapCallback() {
|
||||||
nativeRegisterPageSwapCallback();
|
nativeRegisterPageSwapCallback(mNativeClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @hide discard all textures from tiles */
|
||||||
|
protected void discardAllTextures() {
|
||||||
|
nativeDiscardAllTextures();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -9643,7 +9648,8 @@ public class WebView extends AbsoluteLayout
|
|||||||
private native void nativeSetFindIsEmpty();
|
private native void nativeSetFindIsEmpty();
|
||||||
private native void nativeSetFindIsUp(boolean isUp);
|
private native void nativeSetFindIsUp(boolean isUp);
|
||||||
private native void nativeSetHeightCanMeasure(boolean measure);
|
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 showVisualIndicator, boolean isPictureAfterFirstLayout,
|
||||||
boolean registerPageSwapCallback);
|
boolean registerPageSwapCallback);
|
||||||
private native int nativeGetBaseLayer();
|
private native int nativeGetBaseLayer();
|
||||||
@@ -9657,7 +9663,8 @@ public class WebView extends AbsoluteLayout
|
|||||||
private native void nativeStopGL();
|
private native void nativeStopGL();
|
||||||
private native Rect nativeSubtractLayers(Rect content);
|
private native Rect nativeSubtractLayers(Rect content);
|
||||||
private native int nativeTextGeneration();
|
private native int nativeTextGeneration();
|
||||||
private native void nativeRegisterPageSwapCallback();
|
private native void nativeRegisterPageSwapCallback(int nativeInstance);
|
||||||
|
private native void nativeDiscardAllTextures();
|
||||||
private native void nativeTileProfilingStart();
|
private native void nativeTileProfilingStart();
|
||||||
private native float nativeTileProfilingStop();
|
private native float nativeTileProfilingStop();
|
||||||
private native void nativeTileProfilingClear();
|
private native void nativeTileProfilingClear();
|
||||||
|
|||||||
@@ -18,46 +18,52 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
>
|
>
|
||||||
<LinearLayout
|
<HorizontalScrollView
|
||||||
android:id="@+id/top"
|
android:id="@+id/horizontalScrollView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
>
|
>
|
||||||
<Spinner
|
<LinearLayout
|
||||||
android:id="@+id/movement"
|
android:id="@+id/top"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:prompt="@string/movement_method"
|
>
|
||||||
/>
|
<Spinner
|
||||||
<Spinner
|
android:id="@+id/movement"
|
||||||
android:id="@+id/velocity"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:prompt="@string/movement_method"
|
||||||
android:gravity="center_horizontal"
|
/>
|
||||||
android:prompt="@string/desired_scroll_velocity"
|
<Spinner
|
||||||
/>
|
android:id="@+id/velocity"
|
||||||
<ToggleButton
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/capture"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:gravity="center_horizontal"
|
||||||
android:layout_height="wrap_content"
|
android:prompt="@string/desired_scroll_velocity"
|
||||||
android:textOn="@string/capture_stop"
|
/>
|
||||||
android:textOff="@string/capture_start"
|
<ToggleButton
|
||||||
/>
|
android:id="@+id/capture"
|
||||||
<EditText
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/url"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="0dip"
|
android:textOn="@string/capture_stop"
|
||||||
android:layout_height="wrap_content"
|
android:textOff="@string/capture_start"
|
||||||
android:inputType="textUri"
|
/>
|
||||||
android:imeOptions="actionGo"
|
<EditText
|
||||||
android:layout_weight="1"
|
android:id="@+id/url"
|
||||||
/>
|
android:layout_width="400dp"
|
||||||
<Button
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/inspect"
|
android:inputType="textUri"
|
||||||
android:layout_width="wrap_content"
|
android:imeOptions="actionGo|flagNoExtractUi"
|
||||||
android:layout_height="wrap_content"
|
android:layout_weight="1"
|
||||||
android:text="@string/inspect_log"
|
/>
|
||||||
/>
|
<Button
|
||||||
</LinearLayout>
|
android:id="@+id/inspect"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/inspect_log"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</HorizontalScrollView>
|
||||||
<com.test.tilebenchmark.ProfiledWebView
|
<com.test.tilebenchmark.ProfiledWebView
|
||||||
android:id="@+id/web"
|
android:id="@+id/web"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ public class ProfileActivity extends Activity {
|
|||||||
settings.setEnableSmoothTransition(true);
|
settings.setEnableSmoothTransition(true);
|
||||||
settings.setBuiltInZoomControls(true);
|
settings.setBuiltInZoomControls(true);
|
||||||
settings.setLoadWithOverviewMode(true);
|
settings.setLoadWithOverviewMode(true);
|
||||||
|
settings.setProperty("use_minimal_memory", "false"); // prefetch tiles, as browser does
|
||||||
mWeb.setWebViewClient(new LoggingWebViewClient());
|
mWeb.setWebViewClient(new LoggingWebViewClient());
|
||||||
|
|
||||||
// URL text entry
|
// URL text entry
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ public class ProfiledWebView extends WebView {
|
|||||||
private ProfileCallback mCallback;
|
private ProfileCallback mCallback;
|
||||||
private long mContentInvalMillis;
|
private long mContentInvalMillis;
|
||||||
private boolean mHadToBeForced = false;
|
private boolean mHadToBeForced = false;
|
||||||
private int mTestCount = 0;
|
private static final int LOAD_STALL_MILLIS = 2000; // nr of millis after load,
|
||||||
private static final int LOAD_STALL_MILLIS = 5000; // nr of millis after load,
|
|
||||||
// before test is forced
|
// before test is forced
|
||||||
|
|
||||||
public ProfiledWebView(Context context) {
|
public ProfiledWebView(Context context) {
|
||||||
@@ -76,13 +75,6 @@ public class ProfiledWebView extends WebView {
|
|||||||
mIsScrolling = autoScrolling;
|
mIsScrolling = autoScrolling;
|
||||||
mCallback = callback;
|
mCallback = callback;
|
||||||
mIsTesting = false;
|
mIsTesting = false;
|
||||||
mContentInvalMillis = System.currentTimeMillis();
|
|
||||||
registerPageSwapCallback();
|
|
||||||
contentInvalidateAll();
|
|
||||||
invalidate();
|
|
||||||
|
|
||||||
mTestCount++;
|
|
||||||
final int testCount = mTestCount;
|
|
||||||
|
|
||||||
if (autoScrolling) {
|
if (autoScrolling) {
|
||||||
// after a while, force it to start even if the pages haven't swapped
|
// after a while, force it to start even if the pages haven't swapped
|
||||||
@@ -93,13 +85,12 @@ public class ProfiledWebView extends WebView {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onFinish() {
|
||||||
if (testCount == mTestCount && !mIsTesting) {
|
// invalidate all content, and kick off redraw
|
||||||
mHadToBeForced = true;
|
registerPageSwapCallback();
|
||||||
Log.d("ProfiledWebView", "num " + testCount
|
discardAllTextures();
|
||||||
+ " forcing a page swap with a scroll...");
|
invalidate();
|
||||||
scrollBy(0, 1);
|
|
||||||
invalidate(); // ensure a redraw so that auto-scrolling can occur
|
mContentInvalMillis = System.currentTimeMillis();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user