39#if defined(SK_GRAPHITE)
50static const int kSize = 8;
55 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType,
false);
68#if defined(SK_GRAPHITE)
97 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType,
true);
133 bool contextIsProtected,
134 bool beTexIsProtected) {
148 skgpu::Mipmapped::kNo,
166 for (
bool contextIsProtected : {
true,
false }) {
167 for (
bool beTexIsProtected : {
true,
false }) {
168 create_backend_texture_ganesh(
reporter, contextIsProtected, beTexIsProtected);
173#if defined(SK_GRAPHITE)
178 bool contextIsProtected,
179 bool beTexIsProtected) {
206 helper->recorder()->deleteBackendTexture(backendTex);
214 for (
bool contextIsProtected : {
true,
false }) {
215 for (
bool beTexIsProtected : {
true,
false }) {
216 create_backend_texture_graphite(
reporter, contextIsProtected, beTexIsProtected);
245 bool fCalled =
false;
246 std::unique_ptr<const SkSurface::AsyncReadResult> fResult;
250 auto context =
static_cast<AsyncContext*
>(c);
251 context->fResult = std::move(
result);
252 context->fCalled =
true;
257 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType,
true);
268 AsyncContext cbContext;
273 SkSurface::RescaleGamma::kSrc,
274 SkSurface::RescaleMode::kNearest,
277 helper->submitAndWaitForCompletion(&cbContext.fCalled);
299 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType,
true);
335 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType,
true);
350 paint.setAntiAlias(
true);
372 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType,
true);
409 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType,
true);
447 constexpr bool kIsProtected =
true;
449 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType, kIsProtected);
465 paint.setAntiAlias(
true);
466 paint.setStrokeWidth(.4f);
488 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType,
true);
527 constexpr bool kIsProtected =
true;
529 std::unique_ptr<VkTestHelper> helper = VkTestHelper::Make(testType, kIsProtected);
550 SkCanvas* canvas = surface2->getCanvas();
558DEF_GANESH_TEST(VkProtectedContext_DrawProtectedImageOnProtectedSurface,
565DEF_GRAPHITE_TEST(VkProtectedContext_DrawProtectedImageOnProtectedSurface_Graphite,
skgpu::Protected GrProtected
static void async_callback(void *c, std::unique_ptr< const SkImage::AsyncReadResult > result)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kColorDodge
brighten destination to reflect source
@ kOuter_SkBlurStyle
nothing inside, fuzzy outside
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorBLACK
@ kIdentity_SkYUVColorSpace
maps Y->R, U->G, V->B
#define DEF_GANESH_TEST(name, reporter, options, ctsEnforcement)
#define DEF_GRAPHITE_TEST(name, reporter, ctsEnforcement)
#define REPORTER_ASSERT(r, cond,...)
void deleteBackendTexture(const GrBackendTexture &)
GrBackendTexture createBackendTexture(int width, int height, const GrBackendFormat &, skgpu::Mipmapped, GrRenderable, GrProtected=GrProtected::kNo, std::string_view label={})
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawPath(const SkPath &path, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
const TextureInfo & info() const
Protected isProtected() const
static constexpr int kSize
SkISize dimensions() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeWH(float w, float h)
VkImageCreateFlags fFlags
VkImageUsageFlags fImageUsageFlags
@ VK_IMAGE_CREATE_PROTECTED_BIT
@ VK_IMAGE_USAGE_TRANSFER_DST_BIT
@ VK_IMAGE_USAGE_SAMPLED_BIT
@ VK_IMAGE_USAGE_TRANSFER_SRC_BIT
@ VK_FORMAT_R8G8B8A8_UNORM