From b1ee70b1499a1b5a8cd07f5041ed8122ead6601b Mon Sep 17 00:00:00 2001 From: Hui Shu Date: Tue, 3 Mar 2015 11:38:41 -0800 Subject: Add API for WebView OffscreenPreRaster setting. BUG: 19592029 Change-Id: Ic903b823e5f7830e2cf2d4f3dd9a5458334648a3 --- core/java/android/webkit/WebSettings.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'core/java/android/webkit') diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index 1d2c311..c06175e 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -1330,4 +1330,25 @@ public abstract class WebSettings { */ @SystemApi public abstract boolean getVideoOverlayForEmbeddedEncryptedVideoEnabled(); + + /** + * Sets whether this WebView should raster tiles when it is + * offscreen but attached to a window. Turning this on can avoid + * rendering artifacts when animating an offscreen WebView on-screen. + * Offscreen WebViews in this mode use more memory. The default value is + * false. + * Please follow these guidelines to limit memory usage: + * - WebView size should be not be larger than the device screen size. + * - Limit use of this mode to a small number of WebViews. Use it for + * visible WebViews and WebViews about to be animated to visible. + */ + public abstract void setOffscreenPreRaster(boolean enabled); + + /** + * Gets whether this WebView should raster tiles when it is + * offscreen but attached to a window. + * @return true if this WebView will raster tiles when it is + * offscreen but attached to a window. + */ + public abstract boolean getOffscreenPreRaster(); } -- cgit v1.1