40 for (
int x = 0;
x < bmp.
width(); ++
x) {
56#if defined(SK_GRAPHITE)
70 auto rContext = canvas->recordingContext();
72#if defined(SK_GRAPHITE)
73 recorder = canvas->recorder();
75 if (!rContext && !recorder) {
90 if (
auto origSurface = canvas->getSurface()) {
93 auto ct = canvas->imageInfo().colorType();
97 auto info = canvas->imageInfo().makeColorType(ct);
103 canvas->drawImage(
surface->makeImageSnapshot(), 0, 0);
111 auto rContext = canvas->recordingContext();
113#if defined(SK_GRAPHITE)
114 recorder = canvas->recorder();
116 if (!rContext && !recorder) {
133 auto [planes, yuvaInfo] = sk_gpu_test::MakeYUVAPlanesAsA8(
image.
get(),
138 for (
int i = 0; i < yuvaInfo.numPlanes(); ++i) {
139 planes[i]->peekPixels(&pixmaps[i]);
144#if defined(SK_GRAPHITE)
153 *errMsg =
"Could not make YUVA image";
166 canvas->rotate(30.f);
167 canvas->scale(0.4f, 0.4f);
170 canvas->translate(-240000.f, -240000.f);
175 paint.setShader(std::move(shader));
176 canvas->drawPaint(
paint);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kUnknown_SkColorType
uninitialized
void allocPixels(const SkImageInfo &info, size_t rowBytes)
void notifyPixelsChanged() const
const SkPixmap & pixmap() const
uint32_t * getAddr32(int x, int y) const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
SkColorType colorType() const
virtual sk_sp< SkImage > makeSubset(GrDirectContext *direct, const SkIRect &subset) const =0
@ k420
1 set of UV values for each 2x2 block of Y values.
static SkYUVAPixmaps FromExternalPixmaps(const SkYUVAInfo &, const SkPixmap[kMaxPlanes])
static std::unique_ptr< LazyYUVImage > Make(sk_sp< SkData > data, skgpu::Mipmapped=skgpu::Mipmapped::kNo, sk_sp< SkColorSpace >=nullptr)
#define DEF_SIMPLE_GM_CAN_FAIL(NAME, CANVAS, ERR_MSG, W, H)
static sk_sp< SkImage > make_image()
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
constexpr int32_t width() const
constexpr int32_t height() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkISize kImageDim
static constexpr int kScale