Loading libs/hwui/RenderNode.cpp +20 −11 Original line number Diff line number Diff line Loading @@ -28,16 +28,20 @@ #include "DamageAccumulator.h" #include "pipeline/skia/SkiaDisplayList.h" #endif #include <SkPathOps.h> #include <gui/TraceUtils.h> #include "utils/MathUtils.h" #include "utils/StringUtils.h" #include <ui/FatVector.h> #include <SkPathOps.h> #include <algorithm> #include <atomic> #include <sstream> #include <string> #include <ui/FatVector.h> #ifdef __ANDROID__ #include "include/gpu/ganesh/SkImageGanesh.h" #endif #include "utils/MathUtils.h" #include "utils/StringUtils.h" namespace android { namespace uirenderer { Loading Loading @@ -370,13 +374,18 @@ std::optional<RenderNode::SnapshotResult> RenderNode::updateSnapshotIfRequired( mImageFilterClipBounds != clipBounds || mTargetImageFilterLayerSurfaceGenerationId != layerSurfaceGenerationId) { // Otherwise create a new snapshot with the given filter and snapshot mSnapshotResult.snapshot = snapshot->makeWithFilter(context, imageFilter, subset, clipBounds, &mSnapshotResult.outSubset, #ifdef __ANDROID__ if (context) { mSnapshotResult.snapshot = SkImages::MakeWithFilter( context, snapshot, imageFilter, subset, clipBounds, &mSnapshotResult.outSubset, &mSnapshotResult.outOffset); } else #endif { mSnapshotResult.snapshot = SkImages::MakeWithFilter( snapshot, imageFilter, subset, clipBounds, &mSnapshotResult.outSubset, &mSnapshotResult.outOffset); } mTargetImageFilter = sk_ref_sp(imageFilter); mImageFilterClipBounds = clipBounds; mTargetImageFilterLayerSurfaceGenerationId = layerSurfaceGenerationId; Loading libs/hwui/pipeline/skia/BackdropFilterDrawable.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ #include "RenderNode.h" #include "RenderNodeDrawable.h" #ifdef __ANDROID__ #include "include/gpu/ganesh/SkImageGanesh.h" #endif namespace android { namespace uirenderer { Loading Loading @@ -72,9 +75,17 @@ void BackdropFilterDrawable::onDraw(SkCanvas* canvas) { } auto imageSubset = mImageSubset.roundOut(); #ifdef __ANDROID__ if (canvas->recordingContext()) { backdropImage = backdropImage->makeWithFilter(canvas->recordingContext(), backdropFilter, imageSubset, SkImages::MakeWithFilter(canvas->recordingContext(), backdropImage, backdropFilter, imageSubset, imageSubset, &mOutSubset, &mOutOffset); } else #endif { backdropImage = SkImages::MakeWithFilter(backdropImage, backdropFilter, imageSubset, imageSubset, &mOutSubset, &mOutOffset); } canvas->drawImageRect(backdropImage, SkRect::Make(mOutSubset), mDstBounds, SkSamplingOptions(SkFilterMode::kLinear), &mPaint, SkCanvas::kStrict_SrcRectConstraint); Loading libs/hwui/pipeline/skia/RenderNodeDrawable.cpp +21 −7 Original line number Diff line number Diff line Loading @@ -15,21 +15,25 @@ */ #include "RenderNodeDrawable.h" #include <SkPaint.h> #include <SkPaintFilterCanvas.h> #include <SkPoint.h> #include <SkRRect.h> #include <SkRect.h> #include <gui/TraceUtils.h> #include <include/effects/SkImageFilters.h> #ifdef __ANDROID__ #include <include/gpu/ganesh/SkImageGanesh.h> #endif #include <optional> #include "RenderNode.h" #include "SkiaDisplayList.h" #include "StretchMask.h" #include "TransformCanvas.h" #include <include/effects/SkImageFilters.h> #include <optional> namespace android { namespace uirenderer { namespace skiapipeline { Loading Loading @@ -255,9 +259,19 @@ void RenderNodeDrawable::drawContent(SkCanvas* canvas) const { snapshotImage = renderNode->getLayerSurface()->makeImageSnapshot(); if (imageFilter) { auto subset = SkIRect::MakeWH(srcBounds.width(), srcBounds.height()); snapshotImage = snapshotImage->makeWithFilter(recordingContext, imageFilter, subset, clipBounds.roundOut(), &srcBounds, &offset); #ifdef __ANDROID__ if (recordingContext) { snapshotImage = SkImages::MakeWithFilter( recordingContext, snapshotImage, imageFilter, subset, clipBounds.roundOut(), &srcBounds, &offset); } else #endif { snapshotImage = SkImages::MakeWithFilter(snapshotImage, imageFilter, subset, clipBounds.roundOut(), &srcBounds, &offset); } } } else { const auto snapshotResult = renderNode->updateSnapshotIfRequired( Loading Loading
libs/hwui/RenderNode.cpp +20 −11 Original line number Diff line number Diff line Loading @@ -28,16 +28,20 @@ #include "DamageAccumulator.h" #include "pipeline/skia/SkiaDisplayList.h" #endif #include <SkPathOps.h> #include <gui/TraceUtils.h> #include "utils/MathUtils.h" #include "utils/StringUtils.h" #include <ui/FatVector.h> #include <SkPathOps.h> #include <algorithm> #include <atomic> #include <sstream> #include <string> #include <ui/FatVector.h> #ifdef __ANDROID__ #include "include/gpu/ganesh/SkImageGanesh.h" #endif #include "utils/MathUtils.h" #include "utils/StringUtils.h" namespace android { namespace uirenderer { Loading Loading @@ -370,13 +374,18 @@ std::optional<RenderNode::SnapshotResult> RenderNode::updateSnapshotIfRequired( mImageFilterClipBounds != clipBounds || mTargetImageFilterLayerSurfaceGenerationId != layerSurfaceGenerationId) { // Otherwise create a new snapshot with the given filter and snapshot mSnapshotResult.snapshot = snapshot->makeWithFilter(context, imageFilter, subset, clipBounds, &mSnapshotResult.outSubset, #ifdef __ANDROID__ if (context) { mSnapshotResult.snapshot = SkImages::MakeWithFilter( context, snapshot, imageFilter, subset, clipBounds, &mSnapshotResult.outSubset, &mSnapshotResult.outOffset); } else #endif { mSnapshotResult.snapshot = SkImages::MakeWithFilter( snapshot, imageFilter, subset, clipBounds, &mSnapshotResult.outSubset, &mSnapshotResult.outOffset); } mTargetImageFilter = sk_ref_sp(imageFilter); mImageFilterClipBounds = clipBounds; mTargetImageFilterLayerSurfaceGenerationId = layerSurfaceGenerationId; Loading
libs/hwui/pipeline/skia/BackdropFilterDrawable.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -21,6 +21,9 @@ #include "RenderNode.h" #include "RenderNodeDrawable.h" #ifdef __ANDROID__ #include "include/gpu/ganesh/SkImageGanesh.h" #endif namespace android { namespace uirenderer { Loading Loading @@ -72,9 +75,17 @@ void BackdropFilterDrawable::onDraw(SkCanvas* canvas) { } auto imageSubset = mImageSubset.roundOut(); #ifdef __ANDROID__ if (canvas->recordingContext()) { backdropImage = backdropImage->makeWithFilter(canvas->recordingContext(), backdropFilter, imageSubset, SkImages::MakeWithFilter(canvas->recordingContext(), backdropImage, backdropFilter, imageSubset, imageSubset, &mOutSubset, &mOutOffset); } else #endif { backdropImage = SkImages::MakeWithFilter(backdropImage, backdropFilter, imageSubset, imageSubset, &mOutSubset, &mOutOffset); } canvas->drawImageRect(backdropImage, SkRect::Make(mOutSubset), mDstBounds, SkSamplingOptions(SkFilterMode::kLinear), &mPaint, SkCanvas::kStrict_SrcRectConstraint); Loading
libs/hwui/pipeline/skia/RenderNodeDrawable.cpp +21 −7 Original line number Diff line number Diff line Loading @@ -15,21 +15,25 @@ */ #include "RenderNodeDrawable.h" #include <SkPaint.h> #include <SkPaintFilterCanvas.h> #include <SkPoint.h> #include <SkRRect.h> #include <SkRect.h> #include <gui/TraceUtils.h> #include <include/effects/SkImageFilters.h> #ifdef __ANDROID__ #include <include/gpu/ganesh/SkImageGanesh.h> #endif #include <optional> #include "RenderNode.h" #include "SkiaDisplayList.h" #include "StretchMask.h" #include "TransformCanvas.h" #include <include/effects/SkImageFilters.h> #include <optional> namespace android { namespace uirenderer { namespace skiapipeline { Loading Loading @@ -255,9 +259,19 @@ void RenderNodeDrawable::drawContent(SkCanvas* canvas) const { snapshotImage = renderNode->getLayerSurface()->makeImageSnapshot(); if (imageFilter) { auto subset = SkIRect::MakeWH(srcBounds.width(), srcBounds.height()); snapshotImage = snapshotImage->makeWithFilter(recordingContext, imageFilter, subset, clipBounds.roundOut(), &srcBounds, &offset); #ifdef __ANDROID__ if (recordingContext) { snapshotImage = SkImages::MakeWithFilter( recordingContext, snapshotImage, imageFilter, subset, clipBounds.roundOut(), &srcBounds, &offset); } else #endif { snapshotImage = SkImages::MakeWithFilter(snapshotImage, imageFilter, subset, clipBounds.roundOut(), &srcBounds, &offset); } } } else { const auto snapshotResult = renderNode->updateSnapshotIfRequired( Loading