Move read/write-Pixels up to GrSurfaceContext
This still needs to be propagated out in several ways:
replace more instances of GrSurface::read/write-Pixels
add colorSpace to more instances of the TextureContext
but it establishes a beach-head and is exciting enough as is.
Change-Id: If86035aa0245e70b54541e83722b3c75bc5ade13
Reviewed-on: https://skia-review.googlesource.com/7172
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/include/gpu/GrTextureContext.h b/include/gpu/GrTextureContext.h
index ef9613f..b49b272 100644
--- a/include/gpu/GrTextureContext.h
+++ b/include/gpu/GrTextureContext.h
@@ -32,8 +32,8 @@
GrRenderTargetProxy* asDeferredRenderTarget() override;
protected:
- GrTextureContext(GrContext*, GrDrawingManager*, sk_sp<GrTextureProxy>, GrAuditTrail*,
- GrSingleOwner*);
+ GrTextureContext(GrContext*, GrDrawingManager*, sk_sp<GrTextureProxy>,
+ sk_sp<SkColorSpace>, GrAuditTrail*, GrSingleOwner*);
GrDrawingManager* drawingManager() { return fDrawingManager; }
@@ -43,6 +43,10 @@
friend class GrDrawingManager; // for ctor
bool onCopy(GrSurfaceProxy* src, const SkIRect& srcRect, const SkIPoint& dstPoint) override;
+ bool onReadPixels(const SkImageInfo& dstInfo, void* dstBuffer,
+ size_t dstRowBytes, int x, int y) override;
+ bool onWritePixels(const SkImageInfo& srcInfo, const void* srcBuffer,
+ size_t srcRowBytes, int x, int y) override;
GrTextureOpList* getOpList();