diff options
author | Greg Daniel <egdaniel@google.com> | 2017-12-19 13:15:02 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-19 18:41:36 +0000 |
commit | faa095e9842b924c20de84dce1bcc1adad7fe2e4 (patch) | |
tree | 9651cd2720ae39bad1c364338540902b7910655c /include/gpu | |
parent | 040238bded7b932b916c84912cbaec1207aa29c0 (diff) |
Update SkSurface MakeFromBackend* factories to take an SkColorType.
Bug: skia:
Change-Id: Ib1b03b1181ec937843eac2e8d8cb03ebe53e32c1
Reviewed-on: https://skia-review.googlesource.com/86760
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/gpu')
-rw-r--r-- | include/gpu/GrBackendSurface.h | 18 | ||||
-rw-r--r-- | include/gpu/GrCaps.h | 11 | ||||
-rw-r--r-- | include/gpu/gl/GrGLTypes.h | 1 |
3 files changed, 20 insertions, 10 deletions
diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h index 9f77155e39..f2381c2d0d 100644 --- a/include/gpu/GrBackendSurface.h +++ b/include/gpu/GrBackendSurface.h @@ -83,12 +83,10 @@ public: private: // Friending for access to the GrPixelConfig + friend class SkImage; friend class SkSurface; - friend class GrCaps; friend class GrGpu; - friend class GrGLCaps; friend class GrGLGpu; - friend class GrVkCaps; friend class GrVkGpu; GrPixelConfig config() const { return fConfig; } @@ -112,6 +110,8 @@ public: // Creates an invalid backend texture. GrBackendRenderTarget() : fConfig(kUnknown_GrPixelConfig) {} + // GrGLTextureInfo::fFormat is ignored + // Deprecated: Should use version that does not take a GrPixelConfig instead GrBackendRenderTarget(int width, int height, int sampleCnt, @@ -119,6 +119,13 @@ public: GrPixelConfig config, const GrGLFramebufferInfo& glInfo); + // The GrGLTextureInfo must have a valid fFormat. + GrBackendRenderTarget(int width, + int height, + int sampleCnt, + int stencilBits, + const GrGLFramebufferInfo& glInfo); + #ifdef SK_VULKAN GrBackendRenderTarget(int width, int height, @@ -149,11 +156,10 @@ public: private: // Friending for access to the GrPixelConfig friend class SkSurface; - friend class GrCaps; + friend class SkSurface_Gpu; + friend class SkImage_Gpu; friend class GrGpu; - friend class GrGLCaps; friend class GrGLGpu; - friend class GrVkCaps; friend class GrVkGpu; GrPixelConfig config() const { return fConfig; } diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index 59e0528a23..0d5b3403cd 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -15,6 +15,7 @@ #include "SkRefCnt.h" #include "SkString.h" +class GrBackendRenderTarget; class GrBackendTexture; struct GrContextOptions; class GrRenderTargetProxy; @@ -174,10 +175,13 @@ public: /** * Returns true if the GrBackendTexutre can we used with the supplied SkColorType. If it is - * compatible, the GrPixelConfig on the GrBackendTexture will be set to a config that matches - * the backend format and requested SkColorType. + * compatible, the passed in GrPixelConfig will be set to a config that matches the backend + * format and requested SkColorType. */ - bool validateBackendTexture(GrBackendTexture* tex, SkColorType ct) const; + virtual bool validateBackendTexture(const GrBackendTexture& tex, SkColorType ct, + GrPixelConfig*) const = 0; + virtual bool validateBackendRenderTarget(const GrBackendRenderTarget&, SkColorType, + GrPixelConfig*) const = 0; protected: /** Subclasses must call this at the end of their constructors in order to apply caps @@ -238,7 +242,6 @@ protected: int fMaxClipAnalyticFPs; private: - virtual bool onValidateBackendTexture(GrBackendTexture* tex, SkColorType ct) const = 0; virtual void onApplyOptionsOverrides(const GrContextOptions&) {} virtual void onDumpJSON(SkJSONWriter*) const {} diff --git a/include/gpu/gl/GrGLTypes.h b/include/gpu/gl/GrGLTypes.h index 24e50d833e..aecba3cb8e 100644 --- a/include/gpu/gl/GrGLTypes.h +++ b/include/gpu/gl/GrGLTypes.h @@ -119,6 +119,7 @@ GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrGLTextureInfo*)); struct GrGLFramebufferInfo { GrGLuint fFBOID; + GrGLenum fFormat = 0; }; GR_STATIC_ASSERT(sizeof(GrBackendObject) >= sizeof(const GrGLFramebufferInfo*)); |