diff options
author | Brian Salomon <bsalomon@google.com> | 2017-10-24 12:52:33 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-24 20:43:02 +0000 |
commit | f3569f0f6d312570c7344b345f8b3a03a892f751 (patch) | |
tree | 2da4cd0b0bac2b4b47d6ce91e7db53fa3b5dcad7 /src/gpu/GrSurfaceContext.h | |
parent | 6dd0d8a2659d5976fdd2b6528f787ac7f0b0005b (diff) |
Add GrColorSpaceInfo and use in place of GrRenderTargetContext in paint conversion.
This moves us closer to making GrAtlasTextContext and related classes usable without a GrRenderTargetContext.
Change-Id: Ife52d69a3f925e23da88043acb4d8dc9f672a025
Reviewed-on: https://skia-review.googlesource.com/63304
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceContext.h')
-rw-r--r-- | src/gpu/GrSurfaceContext.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/gpu/GrSurfaceContext.h b/src/gpu/GrSurfaceContext.h index 0511fb1eb3..c499d0994c 100644 --- a/src/gpu/GrSurfaceContext.h +++ b/src/gpu/GrSurfaceContext.h @@ -9,7 +9,7 @@ #define GrSurfaceContext_DEFINED #include "../private/GrSurfaceProxy.h" - +#include "GrColorSpaceInfo.h" #include "SkRefCnt.h" class GrAuditTrail; @@ -33,9 +33,7 @@ class SK_API GrSurfaceContext : public SkRefCnt { public: ~GrSurfaceContext() override {} - SkColorSpace* getColorSpace() const { return fColorSpace.get(); } - sk_sp<SkColorSpace> refColorSpace() const { return fColorSpace; } - bool isGammaCorrect() const { return static_cast<bool>(fColorSpace); } + const GrColorSpaceInfo& colorSpaceInfo() const { return fColorSpaceInfo; } // TODO: these two calls would be way cooler if this object had a GrSurfaceProxy pointer int width() const { return this->asSurfaceProxy()->width(); } @@ -113,8 +111,8 @@ public: protected: friend class GrSurfaceContextPriv; - GrSurfaceContext(GrContext*, GrDrawingManager*, - sk_sp<SkColorSpace>, GrAuditTrail*, GrSingleOwner*); + GrSurfaceContext(GrContext*, GrDrawingManager*, GrPixelConfig, sk_sp<SkColorSpace>, + GrAuditTrail*, GrSingleOwner*); GrDrawingManager* drawingManager() { return fDrawingManager; } const GrDrawingManager* drawingManager() const { return fDrawingManager; } @@ -124,12 +122,13 @@ protected: SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; }) - GrContext* fContext; - sk_sp<SkColorSpace> fColorSpace; - GrAuditTrail* fAuditTrail; + GrContext* fContext; + GrAuditTrail* fAuditTrail; private: - GrDrawingManager* fDrawingManager; + GrColorSpaceInfo fColorSpaceInfo; + + GrDrawingManager* fDrawingManager; // In debug builds we guard against improper thread handling SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |