30 std::unique_ptr<Recorder> surfaceRecorder = context->makeRecorder();
36 std::unique_ptr<Recording> surfaceRecording = surfaceRecorder->snap();
38 context->insertRecording({surfaceRecording.get()});
42 paint.setStrokeWidth(3);
47 constexpr int kPathPoints[][2] = {
54 for (
size_t i = 0; i < std::size(kPathPoints); ++i) {
55 path.lineTo(kPathPoints[i][0], kPathPoints[i][1]);
60 std::unique_ptr<Recording> surfaceRecording2 = surfaceRecorder->snap();
62 context->insertRecording({surfaceRecording2.get()});
66 bitmap.allocPixels(surfaceImageInfo);
79 for (
size_t i = 0; i < std::size(kPathPoints) - 1; ++i) {
@ 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 DEF_GRAPHITE_TEST_FOR_ALL_CONTEXTS(name, reporter, graphite_ctx, ctsEnforcement)
#define REPORTER_ASSERT(r, cond,...)
void clear(SkColor color)
void drawPath(const SkPath &path, const SkPaint &paint)
@ kStroke_Style
set to stroke geometry
constexpr SkColor4f kBlue
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)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)