37#define ASSERT_SINGLE_OWNER SKGPU_ASSERT_SINGLE_OWNER(this->singleOwner())
38#define RETURN_FALSE_IF_ABANDONED if (this->fContext->abandoned()) { return false; }
39#define RETURN_NULLPTR_IF_ABANDONED if (this->fContext->abandoned()) { return nullptr; }
83 if (dst.rowBytes() % dst.info().bpp()) {
88 if (!dst.hasPixels()) {
99 if (srcProxy->framebufferOnly()) {
108 GrSurface* srcSurface = srcProxy->peekSurface();
112 bool unpremul =
flags.unpremul,
113 needColorConversion =
flags.linearize ||
flags.gamut_transform ||
flags.encode,
126 bool canvas2DFastPath = unpremul && !needColorConversion &&
129 SkToBool(srcProxy->asTextureProxy()) &&
146 std::unique_ptr<SurfaceContext> tempCtx;
151 SkAlphaType alphaType = canvas2DFastPath ? dst.alphaType()
163 std::unique_ptr<GrFragmentProcessor> fp;
164 if (canvas2DFastPath) {
183 tempCtx = std::move(sfc);
190 static constexpr auto kMipMapped = skgpu::Mipmapped::kNo;
191 if (restrictions.fMustCopyWholeSrc) {
198 "SurfaceContext_ReadPixelsWithCopyWholeSrc");
208 "SurfaceContext_ReadPixels",
209 restrictions.fRectsMustMatch);
219 return tempCtx->readPixels(dContext, dst, pt);
230 bool convert = unpremul ||
premul || needColorConversion || flip || makeTight ||
231 (dst.colorType() != supportedRead.fColorType);
233 std::unique_ptr<char[]> tmpPixels;
235 void* readDst = dst.addr();
236 size_t readRB = dst.rowBytes();
239 this->colorInfo().alphaType(),
240 this->colorInfo().refColorSpace(),
243 size_t size = tmpRB * tmpInfo.
height();
245 tmpPixels = std::make_unique<char[]>(size);
246 tmp = {tmpInfo, tmpPixels.get(), tmpRB};
248 readDst = tmpPixels.get();
250 pt.
fY = flip ? srcSurface->
height() - pt.
fY - dst.height() : pt.
fY;
257 this->colorInfo().colorType(),
258 supportedRead.fColorType,
277 src = src.clip(this->dimensions(), &dstPt);
278 if (!src.hasPixels()) {
281 if (!src.info().bpp() || src.rowBytes() % src.info().bpp()) {
284 return this->internalWritePixels(dContext, &src, 1, dstPt);
298 if (numLevels == 1) {
299 if (src->dimensions() != this->dimensions()) {
302 return this->
writePixels(dContext, src[0], {0, 0});
305 this->
asTextureProxy()->proxyMipmapped() == skgpu::Mipmapped::kNo) {
313 for (
int i = 0; i < numLevels; ++i) {
320 if (!src[i].
info().bpp() || src[i].rowBytes() % src[i].
info().bpp()) {
323 dims = {std::max(1, dims.
width()/2), std::max(1, dims.
height()/2)};
325 return this->internalWritePixels(dContext, src, numLevels, {0, 0});
375 bool unpremul =
flags.unpremul,
376 needColorConversion =
flags.linearize ||
flags.gamut_transform ||
flags.encode,
393 rgbaDefaultFormat.isValid() &&
407 if (canvas2DFastPath) {
411 format = rgbaDefaultFormat;
433 skgpu::Mipmapped::kNo,
437 "SurfaceContext_InternalWritePixels");
450 if (canvas2DFastPath) {
455 if (!tempCtx.writePixels(dContext, srcBase, {0, 0})) {
460 std::unique_ptr<GrFragmentProcessor>
fp;
461 if (canvas2DFastPath) {
481 if (!this->
copy(std::move(tempProxy), srcRect, dstPoint)) {
489 auto [allowedColorType,
_] =
495 bool convertAll =
premul ||
497 needColorConversion ||
499 (srcColorType != allowedColorType);
502 if (mustBeTight || convertAll) {
503 for (
int i = 0; i < numLevels; ++i) {
504 if (convertAll || (mustBeTight && src[i].rowBytes() != src[i].
info().minRowBytes())) {
505 tmpSize +=
src[i].info().makeColorType(allowedColorType).minRowBytes()*
512 void* tmp = tmpSize ? tmpData->writable_data() :
nullptr;
514 bool ownAllStorage =
true;
515 for (
int i = 0; i < numLevels; ++i) {
516 if (convertAll || (mustBeTight && src[i].rowBytes() != src[i].
info().minRowBytes())) {
521 auto tmpRB = tmpInfo.minRowBytes();
522 GrPixmap tmpPM(tmpInfo, tmp, tmpRB);
524 srcLevels[i] = {tmpPM.addr(), tmpPM.rowBytes(), tmpData};
525 tmp = SkTAddOffset<void>(tmp, tmpRB*tmpPM.height());
527 srcLevels[i] = {
src[i].addr(),
src[i].rowBytes(),
src[i].pixelStorage()};
528 ownAllStorage &=
src[i].ownsPixels();
545 if (!ownAllStorage) {
565 if (rt && rt->wrapsVkSecondaryCB()) {
569 if (rt && rt->framebufferOnly()) {
578 bool needsRescale = srcRect.
size() !=
info.dimensions() ||
584 surfaceBackendFormat,
596 if ((~legalReadChannels & dstChannels) & srcChannels) {
601 std::unique_ptr<SurfaceFillContext> tempFC;
603 int y = srcRect.
fTop;
607 rescaleGamma, rescaleMode);
616 auto srcCtx = tempFC ? tempFC.get() :
this;
617 return srcCtx->asyncReadPixels(dContext,
632 SkASSERT(rect.fLeft >= 0 && rect.fRight <= this->width());
633 SkASSERT(rect.fTop >= 0 && rect.fBottom <= this->height());
635 if (!dContext || this->
asSurfaceProxy()->isProtected() == GrProtected::kYes) {
644 if (!transferResult.fTransferBuffer) {
646 this->colorInfo().refColorSpace());
661 struct FinishContext {
671 auto* finishContext =
new FinishContext{
callback,
675 std::move(transferResult)};
677 const auto* context =
reinterpret_cast<const FinishContext*
>(c);
678 auto manager = context->fMappedBufferManager;
679 auto result = std::make_unique<AsyncReadResult>(manager->ownerID());
680 if (!
result->addTransferResult(context->fTransferResult,
682 context->fTransferResult.fRowBytes,
686 (*context->fClientCallback)(context->fClientContext, std::move(
result));
720 if (rt && rt->wrapsVkSecondaryCB()) {
724 if (rt && rt->framebufferOnly()) {
733 int y = srcRect.
fTop;
734 bool needsRescale = srcRect.
size() != dstSize ||
755 srcView = tempFC->readSurfaceView();
760 skgpu::Mipmapped::kNo,
764 "SurfaceContext_AsyncRescaleAndReadPixelsYUV420");
777 skgpu::Mipmapped::kNo, skgpu::Protected::kNo);
778 std::unique_ptr<SurfaceFillContext> aFC;
782 skgpu::Mipmapped::kNo, skgpu::Protected::kNo);
785 auto uvInfo = yaInfo.makeWH(yaInfo.width()/2, yaInfo.height()/2);
788 skgpu::Mipmapped::kNo, skgpu::Protected::kNo);
791 skgpu::Mipmapped::kNo, skgpu::Protected::kNo);
793 if (!yFC || !uFC || !vFC || (readAlpha && !aFC)) {
805 auto [readCT, offsetAlignment] =
807 yFC->asSurfaceProxy()->backendFormat(),
819 std::fill_n(yM, 15, 0.f);
820 std::copy_n(baseM + 0, 5, yM + 15);
828 yFC->fillWithFP(std::move(yFP));
829 if (!doSynchronousRead) {
845 aFC->fillWithFP(std::move(aFP));
846 if (!doSynchronousRead) {
856 texMatrix.preScale(2.f, 2.f);
859 std::fill_n(uM, 15, 0.f);
860 std::copy_n(baseM + 5, 5, uM + 15);
865 GrSamplerState::Filter::kLinear);
871 uFC->fillWithFP(std::move(uFP));
872 if (!doSynchronousRead) {
883 std::fill_n(vM, 15, 0.f);
884 std::copy_n(baseM + 10, 5, vM + 15);
888 GrSamplerState::Filter::kLinear);
894 vFC->fillWithFP(std::move(vFP));
896 if (!doSynchronousRead) {
905 if (doSynchronousRead) {
913 if (!yFC->readPixels(dContext, yPmp, {0, 0}) ||
914 !uFC->readPixels(dContext, uPmp, {0, 0}) ||
915 !vFC->readPixels(dContext, vPmp, {0, 0}) ||
916 (readAlpha && !aFC->readPixels(dContext, aPmp, {0, 0}))) {
931 struct FinishContext {
944 auto* finishContext =
new FinishContext{
callback,
948 std::move(yTransfer),
949 std::move(uTransfer),
950 std::move(vTransfer),
951 std::move(aTransfer)};
953 const auto* context =
reinterpret_cast<const FinishContext*
>(c);
954 auto manager = context->fMappedBufferManager;
955 auto result = std::make_unique<AsyncReadResult>(manager->ownerID());
956 if (!
result->addTransferResult(context->fYTransfer,
958 context->fYTransfer.fRowBytes,
960 (*context->fClientCallback)(context->fClientContext,
nullptr);
964 SkISize uvSize = {context->fSize.
width() / 2, context->fSize.height() / 2};
965 if (!
result->addTransferResult(context->fUTransfer,
967 context->fUTransfer.fRowBytes,
969 (*context->fClientCallback)(context->fClientContext,
nullptr);
973 if (!
result->addTransferResult(context->fVTransfer,
975 context->fVTransfer.fRowBytes,
977 (*context->fClientCallback)(context->fClientContext,
nullptr);
981 if (context->fATransfer.fTransferBuffer &&
982 !
result->addTransferResult(context->fATransfer,
984 context->fATransfer.fRowBytes,
986 (*context->fClientCallback)(context->fClientContext,
nullptr);
990 (*context->fClientCallback)(context->fClientContext, std::move(
result));
1004 src->dimensions(), &srcRect)) {
1009 return this->copyScaled(src, srcRect, dstRect, GrSamplerState::Filter::kNearest);
1032 if (filter == GrSamplerState::Filter::kLinear && !
src->isFunctionallyExact()) {
1042#if defined(SK_USE_SAFE_INSET_FOR_TEXTURE_SAMPLING)
1043 const bool upscalingXAtApproxEdge =
1046 srcRect.
fRight <
src->backingStoreDimensions().width();
1047 const bool upscalingYAtApproxEdge =
1050 srcRect.
fBottom <
src->backingStoreDimensions().height();
1054 const bool upscalingXAtApproxEdge =
1057 srcRect.
fRight <
src->backingStoreDimensions().width();
1058 const bool upscalingYAtApproxEdge =
1061 srcRect.
fBottom <
src->backingStoreDimensions().height();
1063 if (upscalingXAtApproxEdge || upscalingYAtApproxEdge) {
1072 SkASSERT(
src->backendFormat() == this->asSurfaceProxy()->backendFormat());
1089 skgpu::Mipmapped::kNo,
1113 if (rtProxy && rtProxy->wrapsVkSecondaryCB()) {
1130 skgpu::Mipmapped::kNo,
1134 "SurfaceContext_RescaleInto");
1140 return std::make_pair(std::move(texView), srcRect);
1144 if (finalSize == srcRect.
size()) {
1145 rescaleGamma = RescaleGamma::kSrc;
1146 rescaleMode = RescaleMode::kNearest;
1151 std::unique_ptr<SurfaceFillContext> tempA;
1152 std::unique_ptr<SurfaceFillContext> tempB;
1156 if (rescaleGamma == RescaleGamma::kLinear && this->
colorInfo().colorSpace() &&
1157 !this->
colorInfo().colorSpace()->gammaIsLinear()) {
1159 std::tie(texView, srcRect) = ensureTexturable(texView, srcRect);
1166 dst->colorInfo().alphaType(),
1172 skgpu::Mipmapped::kNo,
1181 GrSamplerState::Filter::kNearest,
1182 GrSamplerState::MipmapMode::kNone);
1185 linearRTC->colorInfo());
1186 linearRTC->fillWithFP(std::move(fp));
1187 texView = linearRTC->readSurfaceView();
1189 tempA = std::move(linearRTC);
1195 if (rescaleMode != RescaleMode::kNearest && rescaleMode != RescaleMode::kLinear) {
1198 }
else if (srcRect.
width() < finalSize.
width()) {
1207 auto input = tempA ? tempA.get() :
this;
1211 if (nextDims == finalSize) {
1213 stepDstRect = dstRect;
1216 GrImageInfo nextInfo(input->colorInfo(), nextDims);
1220 skgpu::Mipmapped::kNo,
1225 stepDst = tempB.get();
1228 std::unique_ptr<GrFragmentProcessor> fp;
1229 if (rescaleMode == RescaleMode::kRepeatedCubic) {
1231 std::tie(texView, srcRect) = ensureTexturable(texView, srcRect);
1244 input->colorInfo().alphaType(),
1253 auto filter = rescaleMode == RescaleMode::kNearest ? GrSamplerState::Filter::kNearest
1254 : GrSamplerState::Filter::kLinear;
1257 !stepDst->copyScaled(texView.
refProxy(), srcRect, stepDstRect, filter)) {
1260 std::tie(texView, srcRect) = ensureTexturable(texView, srcRect);
1268 {filter, GrSamplerState::MipmapMode::kNone},
1284 tempA = std::move(tempB);
1286 }
while (srcRect.
size() != finalSize);
1292 SkASSERT(rect.fLeft >= 0 && rect.fRight <= this->width());
1293 SkASSERT(rect.fTop >= 0 && rect.fBottom <= this->height());
1299 if (rtProxy && rtProxy->wrapsVkSecondaryCB()) {
1305 proxy->backendFormat(), dstCT);
1311 if ((~legalReadChannels & dstChannels) & srcChannels) {
1315 if (!this->
caps()->transferFromSurfaceToBufferSupport() ||
1316 !supportedRead.fOffsetAlignmentForTransferBuffer) {
1321 rowBytes =
SkAlignTo(rowBytes, this->
caps()->transferBufferRowBytesAlignment());
1322 size_t size = rowBytes * rect.height();
1326 auto buffer = direct->priv().resourceProvider()->createBuffer(
1334 auto srcRect = rect;
1337 srcRect =
SkIRect::MakeLTRB(rect.fLeft, this->height() - rect.fBottom, rect.fRight,
1338 this->height() - rect.fTop);
1342 supportedRead.fColorType,
buffer, 0);
1346 if (supportedRead.fColorType != dstCT || flip) {
1347 int w = rect.width(),
h = rect.height();
1348 GrImageInfo srcInfo(supportedRead.fColorType, at,
nullptr,
w,
h);
1351 result.fPixelConverter = [dstInfo, srcInfo, rowBytes](
1352 void* dst,
const void* src) {
1357 result.fRowBytes = rowBytes;
1363void SurfaceContext::validate()
const {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
bool GrConvertPixels(const GrPixmap &dst, const GrCPixmap &src, bool flipY)
static bool GrClipSrcRectAndDstPoint(const SkISize &dstSize, SkIPoint *dstPoint, const SkISize &srcSize, SkIRect *srcRect)
#define GR_CREATE_TRACE_MARKER_CONTEXT(classname, op, context)
static constexpr uint32_t GrColorTypeChannelFlags(GrColorType ct)
static constexpr size_t GrColorTypeBytesPerPixel(GrColorType ct)
@ kStream_GrAccessPattern
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
@ kBottomLeft_GrSurfaceOrigin
@ kTopLeft_GrSurfaceOrigin
void * GrGpuFinishedContext
static constexpr size_t SkAlignTo(size_t x, size_t alignment)
@ kUnknown_SkAlphaType
uninitialized
#define SkAssertResult(cond)
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static bool contains(const SkRect &r, SkPoint p)
sk_sp< T > sk_ref_sp(T *obj)
static constexpr bool SkToBool(const T &x)
void SkColorMatrix_RGB2YUV(SkYUVColorSpace cs, float m[20])
#define RETURN_FALSE_IF_ABANDONED
#define RETURN_NULLPTR_IF_ABANDONED
static uint32_t premul(uint32_t color)
bool matches(GrContext_Base *candidate) const
const GrCaps * caps() const
static constexpr SkCubicResampler gCatmullRom
static std::unique_ptr< GrFragmentProcessor > MakeSubset(GrSurfaceProxyView view, SkAlphaType, const SkMatrix &, const GrSamplerState::WrapMode wrapX, const GrSamplerState::WrapMode wrapY, const SkRect &subset, SkCubicResampler, Direction, const GrCaps &)
bool avoidWritePixelsFastPath() const
virtual SupportedWrite supportedWritePixelsColorType(GrColorType surfaceColorType, const GrBackendFormat &surfaceFormat, GrColorType srcColorType) const =0
bool surfaceSupportsWritePixels(const GrSurface *) const
virtual SurfaceReadPixelsSupport surfaceSupportsReadPixels(const GrSurface *) const =0
virtual DstCopyRestrictions getDstCopyRestrictions(const GrRenderTargetProxy *src, GrColorType ct) const
bool areColorTypeAndFormatCompatible(GrColorType grCT, const GrBackendFormat &format) const
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
bool isFormatCompressed(const GrBackendFormat &format) const
SupportedRead supportedReadPixelsColorType(GrColorType srcColorType, const GrBackendFormat &srcFormat, GrColorType dstColorType) const
bool canCopySurface(const GrSurfaceProxy *dst, const SkIRect &dstRect, const GrSurfaceProxy *src, const SkIRect &srcRect) const
bool readPixelsRowBytesSupport() const
bool writePixelsRowBytesSupport() const
bool transferFromSurfaceToBufferSupport() const
sk_sp< SkColorSpace > refColorSpace() const
SkColorSpace * colorSpace() const
GrColorType colorType() const
SkAlphaType alphaType() const
virtual GrDirectContext * asDirectContext()
GrSemaphoresSubmitted flushSurface(GrSurfaceProxy *proxy, SkSurfaces::BackendSurfaceAccess access=SkSurfaces::BackendSurfaceAccess::kNoAccess, const GrFlushInfo &info={}, const skgpu::MutableTextureState *newState=nullptr)
GrResourceProvider * resourceProvider()
std::unique_ptr< GrFragmentProcessor > createPMToUPMEffect(std::unique_ptr< GrFragmentProcessor >)
std::unique_ptr< GrFragmentProcessor > createUPMToPMEffect(std::unique_ptr< GrFragmentProcessor >)
GrClientMappedBufferManager * clientMappedBufferManager()
bool validPMUPMConversionExists()
bool submit(GrSyncCpu sync=GrSyncCpu::kNo)
DirectContextID directContextID() const
GrDirectContextPriv priv()
void newTransferFromRenderTask(const sk_sp< GrSurfaceProxy > &srcProxy, const SkIRect &srcRect, GrColorType surfaceColorType, GrColorType dstColorType, sk_sp< GrGpuBuffer > dstBuffer, size_t dstOffset)
sk_sp< GrRenderTask > newCopyRenderTask(sk_sp< GrSurfaceProxy > dst, SkIRect dstRect, const sk_sp< GrSurfaceProxy > &src, SkIRect srcRect, GrSamplerState::Filter filter, GrSurfaceOrigin)
bool newWritePixelsTask(sk_sp< GrSurfaceProxy > dst, SkIRect rect, GrColorType srcColorType, GrColorType dstColorType, const GrMipLevel[], int levelCount)
static std::unique_ptr< GrFragmentProcessor > SwizzleOutput(std::unique_ptr< GrFragmentProcessor >, const skgpu::Swizzle &)
static std::unique_ptr< GrFragmentProcessor > ColorMatrix(std::unique_ptr< GrFragmentProcessor > child, const float matrix[20], bool unpremulInput, bool clampRGBOutput, bool premulOutput)
bool readPixels(GrSurface *surface, SkIRect rect, GrColorType surfaceColorType, GrColorType dstColorType, void *buffer, size_t rowBytes)
GrImageInfo makeColorType(GrColorType ct) const
size_t minRowBytes() const
sk_sp< SkData > pixelStorage() const
const GrImageInfo & info() const
SkISize dimensions() const
GrColorType colorType() const
static GrPixmap Allocate(const GrImageInfo &info)
sk_sp< GrTextureProxy > createProxy(const GrBackendFormat &, SkISize dimensions, GrRenderable, int renderTargetSampleCnt, skgpu::Mipmapped, SkBackingFit, skgpu::Budgeted, GrProtected, std::string_view label, GrInternalSurfaceFlags=GrInternalSurfaceFlags::kNone, UseAllocator useAllocator=UseAllocator::kYes)
GrDrawingManager * drawingManager()
GrProxyProvider * proxyProvider()
std::unique_ptr< skgpu::ganesh::SurfaceFillContext > makeSFCWithFallback(GrImageInfo, SkBackingFit, int sampleCount, skgpu::Mipmapped, skgpu::Protected, GrSurfaceOrigin=kTopLeft_GrSurfaceOrigin, skgpu::Budgeted=skgpu::Budgeted::kYes)
std::unique_ptr< skgpu::ganesh::SurfaceContext > makeSC(GrSurfaceProxyView readView, const GrColorInfo &)
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)
GrRecordingContextPriv priv()
bool abandoned() override
GrTextureProxy * asTextureProxy() const
GrSurfaceOrigin origin() const
GrSurfaceProxy * proxy() const
sk_sp< GrSurfaceProxy > refProxy() const
static GrSurfaceProxyView Copy(GrRecordingContext *context, GrSurfaceProxyView src, skgpu::Mipmapped mipmapped, SkIRect srcRect, SkBackingFit fit, skgpu::Budgeted budgeted, std::string_view label)
GrProtected isProtected() const
const GrBackendFormat & backendFormat() const
virtual bool instantiate(GrResourceProvider *)=0
bool framebufferOnly() const
static sk_sp< GrSurfaceProxy > Copy(GrRecordingContext *, sk_sp< GrSurfaceProxy > src, GrSurfaceOrigin, skgpu::Mipmapped, SkIRect srcRect, SkBackingFit, skgpu::Budgeted, std::string_view label, RectsMustMatch=RectsMustMatch::kNo, sk_sp< GrRenderTask > *outTask=nullptr)
virtual GrTextureProxy * asTextureProxy()
GrSurface * peekSurface() const
virtual GrBackendFormat backendFormat() const =0
static std::unique_ptr< GrFragmentProcessor > MakeSubset(GrSurfaceProxyView, SkAlphaType, const SkMatrix &, GrSamplerState, const SkRect &subset, const GrCaps &caps, const float border[4]=kDefaultBorder, bool alwaysUseShaderTileMode=false)
static std::unique_ptr< GrFragmentProcessor > Make(GrSurfaceProxyView, SkAlphaType, const SkMatrix &=SkMatrix::I(), GrSamplerState::Filter=GrSamplerState::Filter::kNearest, GrSamplerState::MipmapMode mipmapMode=GrSamplerState::MipmapMode::kNone)
static bool Equals(const SkColorSpace *, const SkColorSpace *)
sk_sp< SkColorSpace > makeLinearGamma() const
static sk_sp< SkData > MakeUninitialized(size_t length)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
static const SkMatrix & I()
static int ComputeLevelCount(int baseWidth, int baseHeight)
static constexpr Swizzle BGRA()
PixelTransferResult transferPixels(GrColorType colorType, const SkIRect &rect)
GrSurfaceProxy * asSurfaceProxy()
GrDrawingManager * drawingManager()
bool readPixels(GrDirectContext *dContext, GrPixmap dst, SkIPoint srcPt)
SkDEBUGCODE(void validate() const ;) SkDEBUGCODE(skgpu GrRecordingContext * fContext
SkISize dimensions() const
bool writePixels(GrDirectContext *dContext, GrCPixmap src, SkIPoint dstPt)
GrRenderTargetProxy * asRenderTargetProxy()
bool rescaleInto(SurfaceFillContext *dst, SkIRect dstRect, SkIRect srcRect, SkImage::RescaleGamma, SkImage::RescaleMode)
const GrCaps * caps() const
SkImage::ReadPixelsCallback ReadPixelsCallback
const GrColorInfo & colorInfo() const
GrSurfaceProxyView fReadView
GrTextureProxy * asTextureProxy()
void asyncRescaleAndReadPixels(GrDirectContext *, const SkImageInfo &info, const SkIRect &srcRect, RescaleGamma rescaleGamma, RescaleMode, ReadPixelsCallback callback, ReadPixelsContext callbackContext)
skgpu::Mipmapped mipmapped() const
GrSurfaceProxyView readSurfaceView()
SurfaceContext(GrRecordingContext *, GrSurfaceProxyView readView, const GrColorInfo &)
void asyncRescaleAndReadPixelsYUV420(GrDirectContext *, SkYUVColorSpace yuvColorSpace, bool readAlpha, sk_sp< SkColorSpace > dstColorSpace, const SkIRect &srcRect, SkISize dstSize, RescaleGamma rescaleGamma, RescaleMode, ReadPixelsCallback callback, ReadPixelsContext context)
void asyncReadPixels(GrDirectContext *, const SkIRect &srcRect, SkColorType, ReadPixelsCallback, ReadPixelsContext)
skgpu::Swizzle readSwizzle() const
SkImage::ReadPixelsContext ReadPixelsContext
std::unique_ptr< SurfaceFillContext > rescale(const GrImageInfo &info, GrSurfaceOrigin, SkIRect srcRect, SkImage::RescaleGamma, SkImage::RescaleMode)
virtual SurfaceFillContext * asFillContext()
sk_sp< GrSurfaceProxy > asSurfaceProxyRef()
GrSurfaceOrigin origin() const
void fillRectToRectWithFP(const SkRect &srcRect, const SkIRect &dstRect, std::unique_ptr< GrFragmentProcessor > fp)
static Editor::Movement convert(skui::Key key)
FlutterSemanticsFlag flags
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
static const uint8_t buffer[]
uint32_t uint32_t * format
#define ASSERT_SINGLE_OWNER
@ kNoAccess
back-end surface will not be used by client
static bool alpha_types_compatible(SkAlphaType srcAlphaType, SkAlphaType dstAlphaType)
GrGpuFinishedContext fFinishedContext
GrGpuFinishedProc fFinishedProc
static constexpr SkIPoint Make(int32_t x, int32_t y)
int32_t fBottom
larger y-axis bounds
static constexpr SkIRect MakeLTRB(int32_t l, int32_t t, int32_t r, int32_t b)
constexpr SkISize size() const
constexpr int32_t height() const
int32_t fTop
smaller y-axis bounds
static constexpr SkIRect MakeSize(const SkISize &size)
constexpr int32_t width() const
constexpr SkIPoint topLeft() const
int32_t fLeft
smaller x-axis bounds
static constexpr SkIRect MakePtSize(SkIPoint pt, SkISize size)
bool contains(int32_t x, int32_t y) const
int32_t fRight
larger x-axis bounds
constexpr int32_t width() const
constexpr int32_t height() const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
SkAlphaType alphaType() const
static SkImageInfo MakeA8(int width, int height)
static SkRect Make(const SkISize &size)
sk_sp< GrGpuBuffer > fTransferBuffer