31 auto recorder = context->makeRecorder();
43 topPM.alloc(
info.makeDimensions({1, 1}));
47 auto mbet = sk_gpu_test::ManagedGraphiteTexture::MakeMipmappedFromPixmaps(recorder.get(),
57 std::unique_ptr<Recording> recording = recorder->snap();
60 std::unique_ptr<Recording>(
static_cast<Recording*
>(context));
67 if (!context->insertRecording(recordingInfo)) {
72 static constexpr struct TestCase {
78 for (
const auto& testCase : kTestCases) {
79 recorder = context->makeRecorder();
92 sk_gpu_test::ManagedGraphiteTexture::ImageReleaseProc,
93 mbet->releaseContext());
112 surface->getCanvas()->scale(0.05f, 0.05f);
114 paint.setShader(std::move(shader));
117 recording = recorder->snap();
120 if (!context->insertRecording(recordingInfo)) {
127 bool success =
false;
131 std::unique_ptr<const SkImage::AsyncReadResult>
result) {
132 auto& readContext = *
static_cast<ReadContext*
>(context);
133 readContext.called =
true;
135 readContext.success =
true;
136 readContext.color = *
static_cast<const uint32_t*
>(
result->data(0));
139 ReadContext readContext;
140 context->asyncRescaleAndReadPixels(
surface.get(),
148 while (!readContext.called) {
150 context->checkAsyncWorkCompletion();
153 if (!readContext.success) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
DEF_CONDITIONAL_GRAPHITE_TEST_FOR_ALL_CONTEXTS(ImageWrapTextureMipmapsTest, reporter, context, testContext, true, CtsEnforcement::kNextRelease)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorGREEN
#define REPORTER_ASSERT(r, cond,...)
void alloc(const SkImageInfo &)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
SK_API sk_sp< SkImage > WrapTexture(skgpu::graphite::Recorder *, const skgpu::graphite::BackendTexture &, SkColorType colorType, SkAlphaType alphaType, sk_sp< SkColorSpace > colorSpace, skgpu::Origin origin, GenerateMipmapsFromBase generateMipmapsFromBase, TextureReleaseProc=nullptr, ReleaseContext=nullptr, std::string_view label={})
sk_sp< const SkImage > image
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkIRect MakeSize(const SkISize &size)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
GpuFinishedContext fFinishedContext
GpuFinishedProc fFinishedProc