Loading libs/hwui/Properties.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ bool Properties::showDirtyRegions = false; bool Properties::skipEmptyFrames = true; bool Properties::useBufferAge = true; bool Properties::enablePartialUpdates = true; bool Properties::enableRenderEffectCache = false; DebugLevel Properties::debugLevel = kDebugDisabled; OverdrawColorSet Properties::overdrawColorSet = OverdrawColorSet::Default; Loading libs/hwui/Properties.h +1 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,7 @@ public: static bool skipEmptyFrames; static bool useBufferAge; static bool enablePartialUpdates; static bool enableRenderEffectCache; // TODO: Move somewhere else? static constexpr float textGamma = 1.45f; Loading libs/hwui/pipeline/skia/RenderNodeDrawable.cpp +27 −8 Original line number Diff line number Diff line Loading @@ -231,14 +231,33 @@ void RenderNodeDrawable::drawContent(SkCanvas* canvas) const { SkASSERT(properties.effectiveLayerType() == LayerType::RenderLayer); SkPaint paint; layerNeedsPaint(layerProperties, alphaMultiplier, &paint); sk_sp<SkImage> snapshotImage; auto* imageFilter = layerProperties.getImageFilter(); auto recordingContext = canvas->recordingContext(); // On some GL vendor implementations, caching the result of // getLayerSurface->makeImageSnapshot() causes a call to // Fence::waitForever without a corresponding signal. This would // lead to ANRs throughout the system. // Instead only cache the SkImage created with the SkImageFilter // for supported devices. Otherwise just create a new SkImage with // the corresponding SkImageFilter each time. // See b/193145089 and b/197263715 if (!Properties::enableRenderEffectCache) { snapshotImage = renderNode->getLayerSurface()->makeImageSnapshot(); if (imageFilter) { auto subset = SkIRect::MakeWH(srcBounds.width(), srcBounds.height()); snapshotImage = snapshotImage->makeWithFilter(recordingContext, imageFilter, subset, clipBounds.roundOut(), &srcBounds, &offset); } } else { const auto snapshotResult = renderNode->updateSnapshotIfRequired( canvas->recordingContext(), layerProperties.getImageFilter(), clipBounds.roundOut() ); sk_sp<SkImage> snapshotImage = snapshotResult->snapshot; recordingContext, layerProperties.getImageFilter(), clipBounds.roundOut()); snapshotImage = snapshotResult->snapshot; srcBounds = snapshotResult->outSubset; offset = snapshotResult->outOffset; } const auto dstBounds = SkIRect::MakeXYWH(offset.x(), offset.y(), srcBounds.width(), Loading libs/hwui/renderthread/EglManager.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,9 @@ void EglManager::initialize() { LOG_ALWAYS_FATAL("Unsupported wide color space."); } mHasWideColorGamutSupport = EglExtensions.glColorSpace && hasWideColorSpaceExtension; auto* vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR)); Properties::enableRenderEffectCache = (strcmp(vendor, "Qualcomm") != 0); } EGLConfig EglManager::load8BitsConfig(EGLDisplay display, EglManager::SwapBehavior swapBehavior) { Loading Loading
libs/hwui/Properties.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ bool Properties::showDirtyRegions = false; bool Properties::skipEmptyFrames = true; bool Properties::useBufferAge = true; bool Properties::enablePartialUpdates = true; bool Properties::enableRenderEffectCache = false; DebugLevel Properties::debugLevel = kDebugDisabled; OverdrawColorSet Properties::overdrawColorSet = OverdrawColorSet::Default; Loading
libs/hwui/Properties.h +1 −0 Original line number Diff line number Diff line Loading @@ -224,6 +224,7 @@ public: static bool skipEmptyFrames; static bool useBufferAge; static bool enablePartialUpdates; static bool enableRenderEffectCache; // TODO: Move somewhere else? static constexpr float textGamma = 1.45f; Loading
libs/hwui/pipeline/skia/RenderNodeDrawable.cpp +27 −8 Original line number Diff line number Diff line Loading @@ -231,14 +231,33 @@ void RenderNodeDrawable::drawContent(SkCanvas* canvas) const { SkASSERT(properties.effectiveLayerType() == LayerType::RenderLayer); SkPaint paint; layerNeedsPaint(layerProperties, alphaMultiplier, &paint); sk_sp<SkImage> snapshotImage; auto* imageFilter = layerProperties.getImageFilter(); auto recordingContext = canvas->recordingContext(); // On some GL vendor implementations, caching the result of // getLayerSurface->makeImageSnapshot() causes a call to // Fence::waitForever without a corresponding signal. This would // lead to ANRs throughout the system. // Instead only cache the SkImage created with the SkImageFilter // for supported devices. Otherwise just create a new SkImage with // the corresponding SkImageFilter each time. // See b/193145089 and b/197263715 if (!Properties::enableRenderEffectCache) { snapshotImage = renderNode->getLayerSurface()->makeImageSnapshot(); if (imageFilter) { auto subset = SkIRect::MakeWH(srcBounds.width(), srcBounds.height()); snapshotImage = snapshotImage->makeWithFilter(recordingContext, imageFilter, subset, clipBounds.roundOut(), &srcBounds, &offset); } } else { const auto snapshotResult = renderNode->updateSnapshotIfRequired( canvas->recordingContext(), layerProperties.getImageFilter(), clipBounds.roundOut() ); sk_sp<SkImage> snapshotImage = snapshotResult->snapshot; recordingContext, layerProperties.getImageFilter(), clipBounds.roundOut()); snapshotImage = snapshotResult->snapshot; srcBounds = snapshotResult->outSubset; offset = snapshotResult->outOffset; } const auto dstBounds = SkIRect::MakeXYWH(offset.x(), offset.y(), srcBounds.width(), Loading
libs/hwui/renderthread/EglManager.cpp +3 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,9 @@ void EglManager::initialize() { LOG_ALWAYS_FATAL("Unsupported wide color space."); } mHasWideColorGamutSupport = EglExtensions.glColorSpace && hasWideColorSpaceExtension; auto* vendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR)); Properties::enableRenderEffectCache = (strcmp(vendor, "Qualcomm") != 0); } EGLConfig EglManager::load8BitsConfig(EGLDisplay display, EglManager::SwapBehavior swapBehavior) { Loading