39 std::vector<Expectation> expectations) {
40 std::unique_ptr<Recorder> recorder = context->makeRecorder();
49 bitmap.eraseColor(kRectColor);
56 std::move(
image), srcRect, tileMode, tileMode, samplingOptions, &srcToDst));
63 bool peekPixelsSuccess =
result.peekPixels(&pm);
66 bool readPixelsSuccess =
surface->readPixels(pm, 0, 0);
69 for (
const Expectation&
e : expectations) {
74 "At position {%.1f, %.1f}, "
75 "expected {%.1f, %.1f, %.1f, %.1f}, "
76 "found {%.1f, %.1f, %.1f, %.1f}",
78 a.fR,
a.fG,
a.fB,
a.fA,
79 b.fR,
b.fG,
b.fB,
b.fA);
100 {{{0, 40}, kRectColor},
103 {{75, 40}, kBgColor}});
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
#define REPORTER_ASSERT(r, cond,...)
void drawRect(const SkRect &rect, const SkPaint &paint)
static sk_sp< SkShader > MakeSubset(sk_sp< SkImage >, const SkRect &subset, SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix, bool clampAsIfUnpremul=false)
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
SkColor4f getColor4f(int x, int y) const
constexpr SkColor4f kTransparent
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)
DEF_GRAPHITE_TEST_FOR_RENDERING_CONTEXTS(BufferManagerGpuOnlyBufferTest, reporter, context, CtsEnforcement::kNextRelease)
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
static void test_draw(SkCanvas *canvas, const char label[])