18#if defined(SK_GRAPHITE)
35#include <initializer_list>
42 for (
auto mm : { skgpu::Mipmapped::kYes, skgpu::Mipmapped::kNo }) {
43 if (!testMipmaps && mm == skgpu::Mipmapped::kYes) {
60 size_t expectedSize = bytesPerPixel * gpu->width() * gpu->height();
61 if (mm == skgpu::Mipmapped::kYes) {
62 expectedSize += expectedSize/3;
65 size_t actualSize = gpu->textureSize();
68 "Expected: %zu Actual: %zu", expectedSize, actualSize);
81 auto dContext = ctxInfo.directContext();
83 bool testMipmaps = dContext->priv().caps()->mipmapSupport();
93#if defined(SK_GRAPHITE)
99 std::unique_ptr<Recorder> recorder = context->makeRecorder();
104 { mipmapped == skgpu::Mipmapped::kYes });
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorWHITE
SK_API int SkColorTypeBytesPerPixel(SkColorType ct)
#define DEF_GRAPHITE_TEST_FOR_ALL_CONTEXTS(name, reporter, graphite_ctx, ctsEnforcement)
#define REPORTER_ASSERT(r, cond,...)
#define DEF_GANESH_TEST_FOR_ALL_CONTEXTS(name, reporter, context_info, ctsEnforcement)
SK_API sk_sp< SkImage > TextureFromImage(GrDirectContext *, const SkImage *, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Budgeted=skgpu::Budgeted::kYes)
void run_test(skiatest::Reporter *reporter, Context *context, SkISize surfaceSize, SkISize recordingSize, SkISize replayOffset, DrawCallback draw, const std::vector< Expectation > &expectations)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)