Expose writing to mip levels via GrSurfaceContext::writePixels
Bug: skia:11786
Change-Id: Id17952db0aede56fa39845d9d371cf0a141f9dd7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/391836
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrSurfaceContext.h b/src/gpu/GrSurfaceContext.h
index 664e89d..beff3c7 100644
--- a/src/gpu/GrSurfaceContext.h
+++ b/src/gpu/GrSurfaceContext.h
@@ -128,14 +128,22 @@
ReadPixelsContext context);
/**
- * Writes a rectangle of pixels [srcInfo, srcBuffer, srcRowbytes] into the
- * surfaceDrawContext at the specified position.
- * @param dContext The direct context to use
- * @param src source for the write
- * @param dstPt offset w/in the surface context at which to write
+ * Writes a rectangle of pixels from src into the surfaceDrawContext at the specified position.
+ * @param dContext The direct context to use
+ * @param src source for the write
+ * @param dstPt offset w/in the surface context at which to write
*/
bool writePixels(GrDirectContext* dContext, GrCPixmap src, SkIPoint dstPt);
+ /**
+ * Fully populates either the base level or all MIP levels of the GrSurface with pixel data.
+ * @param dContext The direct context to use
+ * @param src Array of pixmaps
+ * @param numLevels Number of pixmaps in src. To succeed this must be 1 or the total
+ * number of MIP levels.
+ */
+ bool writePixels(GrDirectContext* dContext, const GrCPixmap src[], int numLevels);
+
GrSurfaceProxy* asSurfaceProxy() { return fReadView.proxy(); }
const GrSurfaceProxy* asSurfaceProxy() const { return fReadView.proxy(); }
sk_sp<GrSurfaceProxy> asSurfaceProxyRef() { return fReadView.refProxy(); }
@@ -246,6 +254,11 @@
*/
sk_sp<GrRenderTask> copy(sk_sp<GrSurfaceProxy> src, SkIRect srcRect, SkIPoint dstPoint);
+ bool internalWritePixels(GrDirectContext* dContext,
+ const GrCPixmap src[],
+ int numLevels,
+ SkIPoint);
+
class AsyncReadResult;
GrColorInfo fColorInfo;