Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: include/gpu/GrContext.h

Issue 1919993002: Added --deepColor option to SampleApp, triggers creation of a ten-bit/channel buffer on Windows. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Plumb gamma to shader, fix window title Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index d59b2a28f0c7c98be5029f1cca0ab02f8183d8b9..6e6de38a850a494f247636f0fb264aa6f12d3321 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -283,6 +283,39 @@ public:
uint32_t pixelOpsFlags = 0);
/**
+ * These flags can be used with the color-space converting write pixels function below.
+ */
+ enum ColorSpaceOpsFlags {
+ /** Gamma curve of the destination needs to be done manually. */
+ kManualDstGamma_ColorSpaceOpsFlag = 0x1,
+ };
+
+ /**
+ * Writes a rectangle of pixels to a surface, performing color space conversion.
+ * @param surface the surface to write to.
+ * @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 conver to
+ * @param buffer memory to read pixels from
+ * @param rowBytes number of bytes between consecutive rows. Zero
+ * means rows are tightly packed.
+ * @param colorSpaceOpsFlags see ColorSpaceOpsFlags enum above.
+ * @return true if the write succeeded, false if not. The write can fail because of an
+ * unsupported combination of surface and src configs.
+ */
+ bool writeSurfacePixelsWithColorSpace(GrSurface* surface,
+ int left, int top, int width, int height,
+ GrPixelConfig srcConfig,
+ const SkColorSpace* srcColorSpace,
+ const SkColorSpace* dstColorSpace,
+ const void* buffer, size_t rowBytes,
+ uint32_t colorSpaceOpsFlags = 0);
+
+ /**
* Copies a rectangle of texels from src to dst.
* bounds.
* @param dst the surface to copy to.
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/GrSurface.h » ('j') | samplecode/SampleApp.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698