| 1 |
From e30d3d14a4c33a4d594fa1a71ab3d4f74b7aeebe Mon Sep 17 00:00:00 2001 |
| 2 |
From: Robert Phillips <[email protected]> |
| 3 |
Date: Tue, 30 Jun 2026 17:35:01 +0000 |
| 4 |
Subject: [PATCH] Propagate protectedness to SkPictureShader draws |
| 5 |
|
| 6 |
This change seems harmless and is more correct. Basically, the protected-ness of the backing surface is propagated to the internal image created for a PictureShader. This is relevant if the SkPicture contains protected content. |
| 7 |
|
| 8 |
Bug: https://issues.chromium.org/issues/513969378 |
| 9 |
Change-Id: I9314aca6481850d098bab0515601cca51fb7a00a |
| 10 |
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1281217 |
| 11 |
Reviewed-by: Michael Ludwig <[email protected]> |
| 12 |
Commit-Queue: Robert Phillips <[email protected]> |
| 13 |
--- |
| 14 |
src/gpu/ganesh/GrFragmentProcessors.cpp | 6 ++- |
| 15 |
tests/ProtectedTest.cpp | 58 +++++++++++++++++++++++++ |
| 16 |
2 files changed, 62 insertions(+), 2 deletions(-) |
| 17 |
|
| 18 |
diff --git a/src/gpu/ganesh/GrFragmentProcessors.cpp b/src/gpu/ganesh/GrFragmentProcessors.cpp |
| 19 |
index 5de0327b90..bfb26ea6cd 100644 |
| 20 |
--- a/src/gpu/ganesh/GrFragmentProcessors.cpp |
| 21 |
+++ b/src/gpu/ganesh/GrFragmentProcessors.cpp |
| 22 |
@@ -755,7 +755,9 @@ static std::unique_ptr<GrFragmentProcessor> make_shader_fp(const SkPictureShader |
| 23 |
} else { |
| 24 |
const int msaaSampleCount = 0; |
| 25 |
const bool createWithMips = false; |
| 26 |
- const bool kUnprotected = false; |
| 27 |
+ const bool isProtected = |
| 28 |
+ args.fSurfaceDrawContext->asSurfaceProxy()->isProtected() == |
| 29 |
+ GrProtected::kYes; |
| 30 |
auto image = info.makeImage(SkSurfaces::RenderTarget(ctx, |
| 31 |
skgpu::Budgeted::kYes, |
| 32 |
info.imageInfo, |
| 33 |
@@ -763,7 +765,7 @@ static std::unique_ptr<GrFragmentProcessor> make_shader_fp(const SkPictureShader |
| 34 |
kTopLeft_GrSurfaceOrigin, |
| 35 |
&info.props, |
| 36 |
createWithMips, |
| 37 |
- kUnprotected), |
| 38 |
+ isProtected), |
| 39 |
shader->picture().get()); |
| 40 |
if (!image) { |
| 41 |
return nullptr; |
| 42 |
-- |
| 43 |
2.43.0 |
| 44 |
|