21static const int kSize = 8;
24 auto dContext = ctxInfo.directContext();
26 if (!dContext->supportsProtectedContent()) {
31 for (
bool textureable : {
true,
false }) {
32 for (
bool isProtected : {
true,
false }) {
48 isProtected ?
"protected" :
"unprotected");
59 for (
bool isProtected : {
true,
false }) {
78 for (
bool renderable : {
true,
false }) {
79 for (
bool isProtected : {
true,
false }) {
104 dContext->deleteBackendTexture(beTex);
113 auto dContext = ctxInfo.directContext();
115 if (!dContext->supportsProtectedContent()) {
136 bool fCalled =
false;
137 std::unique_ptr<const SkSurface::AsyncReadResult>
fResult;
141 auto context =
static_cast<AsyncContext*
>(c);
142 context->fResult = std::move(
result);
143 context->fCalled =
true;
151 auto dContext = ctxInfo.directContext();
153 if (!dContext->supportsProtectedContent()) {
166 AsyncContext cbContext;
174 while (!cbContext.fCalled) {
175 dContext->checkAsyncWorkCompletion();
static void readback(const SkBitmap &src, int *result, int resultCount)
skgpu::Protected GrProtected
skgpu::Renderable GrRenderable
@ kTopLeft_GrSurfaceOrigin
static void async_callback(void *c, std::unique_ptr< const SkImage::AsyncReadResult > result)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
LoopControlFlowInfo fResult
#define REPORTER_ASSERT(r, cond,...)
#define DEF_GANESH_TEST_FOR_ALL_CONTEXTS(name, reporter, context_info, ctsEnforcement)
sk_sp< SkSurface > CreateProtectedSkSurface(GrDirectContext *dContext, SkISize size, bool textureable, bool isProtected, const SkSurfaceProps *surfaceProps)
sk_sp< SkImage > CreateProtectedSkImage(GrDirectContext *dContext, SkISize size, SkColor4f color, bool isProtected)
void CheckImageBEProtection(SkImage *image, bool expectingProtected)
constexpr SkColor4f kTransparent
constexpr SkColor4f kBlue
SK_API sk_sp< SkImage > BorrowTextureFrom(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, SkColorType colorType, SkAlphaType alphaType, sk_sp< SkColorSpace > colorSpace, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
sk_sp< const SkImage > image
static constexpr SkIRect MakeWH(int32_t w, int32_t h)