36 const std::vector<Expectation>& expectations) {
40 std::unique_ptr<Recorder> surfaceRecorder = context->
makeRecorder();
46 std::unique_ptr<skgpu::graphite::Recording> surfaceRecording = surfaceRecorder->snap();
51 std::unique_ptr<Recorder> recorder = context->
makeRecorder();
52 SkCanvas* canvas = recorder->makeDeferredCanvas(recordingImageInfo, textureInfo);
57 recorder->makeDeferredCanvas(recordingImageInfo, textureInfo) ==
nullptr);
58 std::unique_ptr<Recording> recording = recorder->snap();
62 {recording.get(),
surface.get(), {replayOffset.fWidth, replayOffset.fHeight}});
67 bitmap.allocPixels(surfaceImageInfo);
69 if (!
surface->readPixels(pixmap, 0, 0)) {
76 for (
const Expectation&
e : expectations) {
80 SkDebugf(
"Wrong color\n\texpected: %f %f %f %f\n\tactual: %f %f %f %f",
114 bitmap.allocN32Pixels(4, 4,
true);
136 bitmap.allocN32Pixels(4, 4,
true);
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
#define REPORTER_ASSERT(r, cond,...)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void drawIRect(const SkIRect &rect, const SkPaint &paint)
SkColor4f getColor4f(int x, int y) const
std::unique_ptr< Recorder > makeRecorder(const RecorderOptions &={})
bool insertRecording(const InsertRecordingInfo &)
TextureProxy * backingTextureProxy() const
const TextureInfo & textureInfo() const
Dart_NativeFunction function
constexpr SkColor4f kGreen
constexpr SkColor4f kTransparent
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)
std::function< void(SkCanvas *)> DrawCallback
void run_test(skiatest::Reporter *reporter, Context *context, SkISize surfaceSize, SkISize recordingSize, SkISize replayOffset, DrawCallback draw, const std::vector< Expectation > &expectations)
DEF_GRAPHITE_TEST_FOR_ALL_CONTEXTS(DeviceTestVertexTransparency, reporter, context, CtsEnforcement::kNextRelease)
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
static constexpr SkISize Make(int32_t w, int32_t h)
SkImageInfo makeDimensions(SkISize newSize) const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)