aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-02-14 13:53:55 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-14 19:58:14 +0000
commit9b009bb069aa81425438d5403a1a29f2d047f77f (patch)
treea3ff6b83971d9c1564d1de84e219a187f703ed8b /src/gpu/gl/GrGLGpu.h
parent95edb43251e8fcef4286c91d334c3259940a0095 (diff)
Prepare sRGB encoding conversion for the removal of GrPixelConfig
Standardizes that GrGpu subclass's onRead/WritePixels never do sRGB<->linear conversion. This means that they can eventually take a color type rather than config. It also means direct callers of GrGpu::read/writePixels can never expect conversion (which in practice is no change). Consolidate logic about whether to do sRGB<->linear encoding conversions in GrContext::read/writeSurfacePixels helpers. No change in when conversions are done (yet). This prepares this logic to operate on SkColorSpace and color type rather than config WRT the CPU data. Bug: skia:6718 Change-Id: I346d669624861578f1bb9ea465a7ab4b549117fa Reviewed-on: https://skia-review.googlesource.com/105286 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLGpu.h')
-rw-r--r--src/gpu/gl/GrGLGpu.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 48a0e2bcf9..93b4de167d 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -63,16 +63,6 @@ public:
void generateMipmaps(const GrSamplerState& params, bool allowSRGBInputs, GrGLTexture* texture,
GrSurfaceOrigin textureOrigin);
- bool onGetReadPixelsInfo(GrSurface* srcSurface, GrSurfaceOrigin srcOrigin,
- int readWidth, int readHeight, size_t rowBytes,
- GrPixelConfig readConfig, DrawPreference*,
- ReadPixelTempDrawInfo*) override;
-
- bool onGetWritePixelsInfo(GrSurface* dstSurface, GrSurfaceOrigin dstOrigin,
- int width, int height,
- GrPixelConfig srcConfig, DrawPreference*,
- WritePixelTempDrawInfo*) override;
-
// These functions should be used to bind GL objects. They track the GL state and skip redundant
// bindings. Making the equivalent glBind calls directly will confuse the state tracking.
void bindVertexArray(GrGLuint id) {
@@ -240,6 +230,12 @@ private:
// variations above, depending on whether the surface is a render target or not.
bool readPixelsSupported(GrSurface* surfaceForConfig, GrPixelConfig readConfig);
+ bool onGetReadPixelsInfo(GrSurface*, GrSurfaceOrigin, int width, int height, size_t rowBytes,
+ GrPixelConfig, DrawPreference*, ReadPixelTempDrawInfo*) override;
+
+ bool onGetWritePixelsInfo(GrSurface*, GrSurfaceOrigin, int width, int height, GrPixelConfig,
+ DrawPreference*, WritePixelTempDrawInfo*) override;
+
bool onReadPixels(GrSurface*, GrSurfaceOrigin,
int left, int top,
int width, int height,