61 unsigned char innerY[16] = {149, 160, 130, 105,
65 unsigned char innerU[4] = {43, 75, 145, 200};
66 unsigned char innerV[4] = {88, 180, 200, 43};
67 int outerYUV[] = {128, 128, 128};
69 for (
int i = 0; i < 3; ++i) {
84#if defined(SK_GRAPHITE)
87 if (!context && !recorder) {
96#if defined(SK_GRAPHITE)
114#if defined(SK_GRAPHITE)
117 if (!context && !recorder) {
123 *errorMsg =
"No valid YUV image generated -- skipping";
133 rect = rect.makeOutset(fYUVImage->
width()/2.f, fYUVImage->
height()/2.f);
137 for (uint32_t i = 0; i < std::size(kFilters); ++i) {
144 const SkIRect* subset = j > 0 ? &kColorRect :
nullptr;
161#if defined(SK_GRAPHITE)
163 subsetImg = fYUVImage->
makeSubset(recorder, *subset, {
false});
167 subsetImg = fYUVImage->
makeSubset(context, *subset);
170 paint.setShader(subsetImg->makeShader(tm, tm,
178 x += rect.width() + kTestPad;
181 y += rect.height() + kTestPad;
191 inline static constexpr SkScalar kTestPad = 10.f;
193 using INHERITED =
GM;
196DEF_GM(
return new YUVtoRGBSubsetEffect;)
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorBLACK
@ kJPEG_Full_SkYUVColorSpace
describes full range
static constexpr int kSkTileModeCount
bool installPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, void(*releaseProc)(void *addr, void *context), void *context)
bool writePixels(const SkPixmap &src, int dstX, int dstY)
void eraseColor(SkColor4f) const
void drawRect(const SkRect &rect, const SkPaint &paint)
virtual GrRecordingContext * recordingContext() const
virtual skgpu::graphite::Recorder * recorder() const
void concat(const SkMatrix &matrix)
SkISize dimensions() const
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
virtual sk_sp< SkImage > makeSubset(GrDirectContext *direct, const SkIRect &subset) const =0
SkMatrix & postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
static const SkMatrix & I()
@ kY_U_V
Plane 0: Y, Plane 1: U, Plane 2: V.
@ k420
1 set of UV values for each 2x2 block of Y values.
const SkPixmap & plane(int i) const
static SkYUVAPixmaps Allocate(const SkYUVAPixmapInfo &yuvaPixmapInfo)
static std::unique_ptr< LazyYUVImage > Make(sk_sp< SkData > data, skgpu::Mipmapped=skgpu::Mipmapped::kNo, sk_sp< SkColorSpace >=nullptr)
void reset(T *ptr=nullptr)
static constexpr char kErrorMsg_DrawSkippedGpuOnly[]
void onGpuTeardown() override
SkISize getISize() override
DrawResult onGpuSetup(SkCanvas *canvas, SkString *errorMsg, GraphiteTestContext *) override
SkString getName() const override
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
static constexpr SkIRect MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
static SkImageInfo MakeA8(int width, int height)
static SkRect Make(const SkISize &size)