56 using namespace skgpu;
62 auto makeDirectBackendSurface = [&]() {
103 surf = makeDirectBackendSurface();
110 surf = makeDirectBackendSurface();
136 dstSC->asFillContext()->clear(
SkPMColor4f{1, 0, 0, 1});
143 srcSC->asFillContext()->clear(
SkPMColor4f{0, 0, 1, 1});
148 srcSC->asSurfaceProxyRef(),
162 dstSC->readPixels(dContext, pixels, {0, 0});
164 std::function<ComparePixmapsErrorReporter> errorReporter(
165 [&](
int x,
int y,
const float diffs[4]) {
167 diffs[0], diffs[1], diffs[2], diffs[3]);
172#if defined(SK_GANESH)
197 dst->readPixels(dContext, pixels, {0, 0});
199 std::function<ComparePixmapsErrorReporter> errorReporter(
200 [&](
int x,
int y,
const float diffs[4]) {
202 diffs[0], diffs[1], diffs[2], diffs[3]);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
@ kBottomLeft_GrSurfaceOrigin
@ kTopLeft_GrSurfaceOrigin
skgpu::Protected Protected
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
std::unique_ptr< skgpu::ganesh::SurfaceContext > CreateSurfaceContext(GrRecordingContext *rContext, const GrImageInfo &info, SkBackingFit fit, GrSurfaceOrigin origin, GrRenderable renderable, int sampleCount, skgpu::Mipmapped mipmapped, GrProtected isProtected, skgpu::Budgeted budgeted)
bool CheckSolidPixels(const SkColor4f &col, const SkPixmap &pixmap, const float tolRGBA[4], std::function< ComparePixmapsErrorReporter > &error)
#define REPORTER_ASSERT(r, cond,...)
DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS(SkipCopyTaskTest, reporter, ctxInfo, CtsEnforcement::kNever)
DEF_GANESH_TEST_FOR_ALL_CONTEXTS(WrappedSurfaceCopyOnWrite, reporter, ctxInfo, CtsEnforcement::kApiLevel_T)
const GrCaps * caps() const
bool supportsProtectedContent() const
GrSemaphoresSubmitted flush(const GrFlushInfo &info)
GrDirectContextPriv priv()
sk_sp< GrRenderTask > newCopyRenderTask(sk_sp< GrSurfaceProxy > dst, SkIRect dstRect, const sk_sp< GrSurfaceProxy > &src, SkIRect srcRect, GrSamplerState::Filter filter, GrSurfaceOrigin)
GrDrawingManager * drawingManager()
std::unique_ptr< skgpu::ganesh::SurfaceFillContext > makeSFC(GrImageInfo, std::string_view label, SkBackingFit=SkBackingFit::kExact, int sampleCount=1, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Protected=skgpu::Protected::kNo, GrSurfaceOrigin=kTopLeft_GrSurfaceOrigin, skgpu::Budgeted=skgpu::Budgeted::kYes)
UniqueID uniqueID() const
void alloc(const SkImageInfo &)
void clear(SkColor color)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
bool characterize(GrSurfaceCharacterization *characterization) const
sk_sp< SkImage > makeImageSnapshot()
void reset(T *ptr=nullptr)
GrTextureProxy * GetTextureImageProxy(SkImage *image, GrRecordingContext *rContext)
sk_sp< SkSurface > MakeBackendTextureSurface(GrDirectContext *dContext, const SkImageInfo &ii, GrSurfaceOrigin origin, int sampleCnt, skgpu::Mipmapped mipmapped, GrProtected isProtected, const SkSurfaceProps *props)
GrRenderTargetProxy * TopDeviceTargetProxy(const SkCanvas *canvas)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)