Loading core/java/android/view/ViewRootImpl.java +8 −4 Original line number Diff line number Diff line Loading @@ -1442,8 +1442,10 @@ public final class ViewRootImpl implements ViewParent, if (mHardwareRendererObserver != null) { mAttachInfo.mThreadedRenderer.addObserver(mHardwareRendererObserver); } if (HardwareRenderer.isWebViewOverlaysEnabled()) { addPrepareSurfaceControlForWebviewCallback(); addASurfaceTransactionCallback(); } mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl); } } Loading Loading @@ -7777,8 +7779,10 @@ public final class ViewRootImpl implements ViewParent, } } if (mAttachInfo.mThreadedRenderer != null) { if (HardwareRenderer.isWebViewOverlaysEnabled()) { addPrepareSurfaceControlForWebviewCallback(); addASurfaceTransactionCallback(); } mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl); } } else { Loading graphics/java/android/graphics/HardwareRenderer.java +5 −0 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,11 @@ public class HardwareRenderer { */ public static native void preload(); /** * @hide */ public static native boolean isWebViewOverlaysEnabled(); /** @hide */ protected static native void setupShadersDiskCache(String cacheFile, String skiaCacheFile); Loading libs/hwui/Properties.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ float Properties::defaultSdrWhitePoint = 200.f; bool Properties::useHintManager = true; int Properties::targetCpuTimePercentage = 70; bool Properties::enableWebViewOverlays = false; StretchEffectBehavior Properties::stretchEffectBehavior = StretchEffectBehavior::ShaderHWUI; bool Properties::load() { Loading Loading @@ -137,6 +139,8 @@ bool Properties::load() { targetCpuTimePercentage = base::GetIntProperty(PROPERTY_TARGET_CPU_TIME_PERCENTAGE, 70); if (targetCpuTimePercentage <= 0 || targetCpuTimePercentage > 100) targetCpuTimePercentage = 70; enableWebViewOverlays = base::GetBoolProperty(PROPERTY_WEBVIEW_OVERLAYS_ENABLED, false); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } Loading libs/hwui/Properties.h +7 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,11 @@ enum DebugLevel { */ #define PROPERTY_REDUCE_OPS_TASK_SPLITTING "renderthread.skia.reduceopstasksplitting" /** * Enable WebView Overlays feature. */ #define PROPERTY_WEBVIEW_OVERLAYS_ENABLED "debug.hwui.webview_overlays_enabled" /////////////////////////////////////////////////////////////////////////////// // Misc /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -276,6 +281,8 @@ public: static bool useHintManager; static int targetCpuTimePercentage; static bool enableWebViewOverlays; static StretchEffectBehavior getStretchEffectBehavior() { return stretchEffectBehavior; } Loading libs/hwui/WebViewFunctorManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ void WebViewFunctor::drawGl(const DrawGlInfo& drawInfo) { .mergeTransaction = currentFunctor.mergeTransaction, }; if (!drawInfo.isLayer) { if (Properties::enableWebViewOverlays && !drawInfo.isLayer) { renderthread::CanvasContext* activeContext = renderthread::CanvasContext::getActiveContext(); if (activeContext != nullptr) { Loading Loading
core/java/android/view/ViewRootImpl.java +8 −4 Original line number Diff line number Diff line Loading @@ -1442,8 +1442,10 @@ public final class ViewRootImpl implements ViewParent, if (mHardwareRendererObserver != null) { mAttachInfo.mThreadedRenderer.addObserver(mHardwareRendererObserver); } if (HardwareRenderer.isWebViewOverlaysEnabled()) { addPrepareSurfaceControlForWebviewCallback(); addASurfaceTransactionCallback(); } mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl); } } Loading Loading @@ -7777,8 +7779,10 @@ public final class ViewRootImpl implements ViewParent, } } if (mAttachInfo.mThreadedRenderer != null) { if (HardwareRenderer.isWebViewOverlaysEnabled()) { addPrepareSurfaceControlForWebviewCallback(); addASurfaceTransactionCallback(); } mAttachInfo.mThreadedRenderer.setSurfaceControl(mSurfaceControl); } } else { Loading
graphics/java/android/graphics/HardwareRenderer.java +5 −0 Original line number Diff line number Diff line Loading @@ -1304,6 +1304,11 @@ public class HardwareRenderer { */ public static native void preload(); /** * @hide */ public static native boolean isWebViewOverlaysEnabled(); /** @hide */ protected static native void setupShadersDiskCache(String cacheFile, String skiaCacheFile); Loading
libs/hwui/Properties.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,8 @@ float Properties::defaultSdrWhitePoint = 200.f; bool Properties::useHintManager = true; int Properties::targetCpuTimePercentage = 70; bool Properties::enableWebViewOverlays = false; StretchEffectBehavior Properties::stretchEffectBehavior = StretchEffectBehavior::ShaderHWUI; bool Properties::load() { Loading Loading @@ -137,6 +139,8 @@ bool Properties::load() { targetCpuTimePercentage = base::GetIntProperty(PROPERTY_TARGET_CPU_TIME_PERCENTAGE, 70); if (targetCpuTimePercentage <= 0 || targetCpuTimePercentage > 100) targetCpuTimePercentage = 70; enableWebViewOverlays = base::GetBoolProperty(PROPERTY_WEBVIEW_OVERLAYS_ENABLED, false); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } Loading
libs/hwui/Properties.h +7 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,11 @@ enum DebugLevel { */ #define PROPERTY_REDUCE_OPS_TASK_SPLITTING "renderthread.skia.reduceopstasksplitting" /** * Enable WebView Overlays feature. */ #define PROPERTY_WEBVIEW_OVERLAYS_ENABLED "debug.hwui.webview_overlays_enabled" /////////////////////////////////////////////////////////////////////////////// // Misc /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -276,6 +281,8 @@ public: static bool useHintManager; static int targetCpuTimePercentage; static bool enableWebViewOverlays; static StretchEffectBehavior getStretchEffectBehavior() { return stretchEffectBehavior; } Loading
libs/hwui/WebViewFunctorManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -121,7 +121,7 @@ void WebViewFunctor::drawGl(const DrawGlInfo& drawInfo) { .mergeTransaction = currentFunctor.mergeTransaction, }; if (!drawInfo.isLayer) { if (Properties::enableWebViewOverlays && !drawInfo.isLayer) { renderthread::CanvasContext* activeContext = renderthread::CanvasContext::getActiveContext(); if (activeContext != nullptr) { Loading