58 paint.setStrokeWidth(20);
59 paint.setColor(0xFF800000);
61 paint.setColor(0xFF008000);
63 paint.setColor(0xFF000080);
88 primaries.
fRX = 0.7347f;
89 primaries.
fRY = 0.2653f;
90 primaries.
fGX = 0.1596f;
91 primaries.
fGY = 0.8404f;
92 primaries.
fBX = 0.0366f;
93 primaries.
fBY = 0.0001f;
94 primaries.
fWX = 0.34567f;
95 primaries.
fWY = 0.35850f;
101 primaries.
fRX = 0.50f;
102 primaries.
fRY = 0.33f;
103 primaries.
fGX = 0.30f;
104 primaries.
fGY = 0.50f;
105 primaries.
fBX = 0.25f;
106 primaries.
fBY = 0.16f;
107 primaries.
fWX = 0.3127f;
108 primaries.
fWY = 0.3290f;
118 dstAlphaType, dstColorSpace);
193 return SkISize::Make(3 * (kEncodedWidth + 1), 12 * (kEncodedHeight + 1));
198 *errorMsg =
"This gm is only interesting in color correct modes.";
199 return DrawResult::kSkip;
228 dstColorSpace, hint);
229 canvas->
translate(0.0f, (
float) kEncodedHeight + 1);
234 canvas->
translate((
float) kEncodedWidth + 1, 0.0f);
236 return DrawResult::kOk;
240 static const int kEncodedWidth = 8;
241 static const int kEncodedHeight = 8;
258 *errorMsg =
"This gm is only interesting in color correct modes.";
259 return DrawResult::kSkip;
291 dstColorSpace, hint);
300 return DrawResult::kOk;
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
std::unique_ptr< SkStreamAsset > GetResourceAsStream(const char *resource, bool useFileStream)
sk_sp< SkData > GetResourceAsData(const char *resource)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
SK_API int SkColorTypeBytesPerPixel(SkColorType ct)
#define INHERITED(method,...)
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
SkString getName() const override
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
SkISize getISize() override
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
SkISize getISize() override
SkString getName() const override
void translate(SkScalar dx, SkScalar dy)
virtual GrRecordingContext * recordingContext() const
SkImageInfo imageInfo() const
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static std::unique_ptr< SkCodec > MakeFromStream(std::unique_ptr< SkStream >, SkSpan< const SkCodecs::Decoder > decoders, Result *=nullptr, SkPngChunkReader *=nullptr, SelectionPolicy selectionPolicy=SelectionPolicy::kPreferStillImage)
static sk_sp< SkColorSpace > MakeSRGB()
static sk_sp< SkColorSpace > MakeRGB(const skcms_TransferFunction &transferFn, const skcms_Matrix3x3 &toXYZ)
static sk_sp< SkData > MakeUninitialized(size_t length)
bool readPixels(GrDirectContext *context, const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY, CachingHint cachingHint=kAllow_CachingHint) const
@ kDisallow_CachingHint
disallows internally caching decoded and copied pixels
@ kAllow_CachingHint
allows internally caching decoded and copied pixels
@ kStroke_Style
set to stroke geometry
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
std::array< MockImage, 3 > images
SK_API sk_sp< SkImage > DeferredFromPicture(sk_sp< SkPicture > picture, const SkISize &dimensions, const SkMatrix *matrix, const SkPaint *paint, BitDepth bitDepth, sk_sp< SkColorSpace > colorSpace, SkSurfaceProps props)
SK_API sk_sp< SkImage > RasterFromData(const SkImageInfo &info, sk_sp< SkData > pixels, size_t rowBytes)
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
SK_API sk_sp< SkImage > TextureFromImage(GrDirectContext *, const SkImage *, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Budgeted=skgpu::Budgeted::kYes)
@ kU8
uses 8-bit unsigned int per color component
sk_sp< const SkImage > image
const myers::Point & get< 0 >(const myers::Segment &s)
static void draw_image(GrDirectContext *dContext, SkCanvas *canvas, SkImage *image, SkColorType dstColorType, SkAlphaType dstAlphaType, sk_sp< SkColorSpace > dstColorSpace, SkImage::CachingHint hint)
static sk_sp< SkColorSpace > make_wide_gamut()
static sk_sp< SkImage > make_picture_image()
static sk_sp< SkImage > make_raster_image(SkColorType colorType)
static sk_sp< SkColorSpace > make_parametric_transfer_fn(const SkColorSpacePrimaries &primaries)
static sk_sp< SkImage > make_codec_image()
static sk_sp< SkColorSpace > make_small_gamut()
static void draw_contents(SkCanvas *canvas)
bool toXYZD50(skcms_Matrix3x3 *toXYZD50) const
static constexpr SkISize Make(int32_t w, int32_t h)
SkColorSpace * colorSpace() const
SkImageInfo makeColorSpace(sk_sp< SkColorSpace > cs) const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static SkRect MakeIWH(int w, int h)
std::shared_ptr< const fml::Mapping > data