Index: include/gpu/GrSurface.h |
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h |
index b87b2dbaf04f7c8e94c323cc0c1272c24c47f516..e6c991d341ee6e5d1bfd2bdb4cd5dada1f1c725a 100644 |
--- a/include/gpu/GrSurface.h |
+++ b/include/gpu/GrSurface.h |
@@ -17,6 +17,7 @@ |
class GrRenderTarget; |
class GrSurfacePriv; |
class GrTexture; |
+class SkColorSpace; |
class SK_API GrSurface : public GrGpuResource { |
public: |
@@ -100,7 +101,7 @@ public: |
* packed. |
* @param pixelOpsFlags See the GrContext::PixelOpsFlags enum. |
* |
- * @return true if the read succeeded, false if not. The read can fail because of an |
+ * @return true if the write succeeded, false if not. The write can fail because of an |
* unsupported pixel config. |
*/ |
bool writePixels(int left, int top, int width, int height, |
@@ -110,6 +111,32 @@ public: |
uint32_t pixelOpsFlags = 0); |
/** |
+ * Copy the src pixels [buffer, rowbytes, pixelconfig] into the surface at the specified |
+ * rectangle, performing color space conversion. No other conversions are allowed. |
+ * @param left left edge of the rectangle to write (inclusive) |
+ * @param top top edge of the rectangle to write (inclusive) |
+ * @param width width of rectangle to write in pixels. |
+ * @param height height of rectangle to write in pixels. |
+ * @param config the pixel config of the source buffer |
+ * @param srcColorSpace color space of the source buffer |
+ * @param dstColorSpace color space to convert to |
+ * @param buffer memory to read the rectangle from. |
+ * @param rowBytes number of bytes between consecutive rows. Zero means rows are tightly |
+ * packed. |
+ * @param colorSpaceOpsFlags See the GrContext::ColorSpaceOpsFlags enum. |
+ * |
+ * @return true if the write succeeded, false if not. The write can fail because of an |
+ * unsupported pixel config. |
+ */ |
+ bool writePixelsWithColorSpace(int left, int top, int width, int height, |
+ GrPixelConfig config, |
+ const SkColorSpace* srcColorSpace, |
+ const SkColorSpace* dstColorSpace, |
+ const void* buffer, |
+ size_t rowBytes = 0, |
+ uint32_t colorSpaceOpsFlags = 0); |
+ |
+ /** |
* After this returns any pending writes to the surface will be issued to the backend 3D API. |
*/ |
void flushWrites(); |