diff options
author | 2018-02-02 20:32:49 -0500 | |
---|---|---|
committer | 2018-02-03 01:59:59 +0000 | |
commit | bdecacfbe47bc7211336bb847bb33c00ef85ea3e (patch) | |
tree | fdaac47f9254d9a8e3de61604b899eae8cb718ff /include/gpu/GrCaps.h | |
parent | 816acee9be62d9de323ff5144017451e443b3329 (diff) |
Revert "Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend.""""""
This reverts commit 3a2cc2c2ec124de36d2544b2a523ef1dd317ca32.
Fix code with samplecnt=0 that slipped in between trybots/CQ and landing of previous version
Change-Id: Iab19f2e8d1e9901601c8c76244d7a88c5d707fab
Reviewed-on: https://skia-review.googlesource.com/103181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/gpu/GrCaps.h')
-rw-r--r-- | include/gpu/GrCaps.h | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index f4d6e06280..0f03f162f0 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -134,10 +134,6 @@ public: int maxRasterSamples() const { return fMaxRasterSamples; } - // Find a sample count greater than or equal to the requested count which is supported for a - // color buffer of the given config. If MSAA is not support for the config we will return 0. - virtual int getSampleCount(int requestedCount, GrPixelConfig config) const = 0; - int maxWindowRectangles() const { return fMaxWindowRectangles; } // A tuned, platform-specific value for the maximum number of analytic fragment processors we @@ -145,9 +141,32 @@ public: int maxClipAnalyticFPs() const { return fMaxClipAnalyticFPs; } virtual bool isConfigTexturable(GrPixelConfig) const = 0; - virtual bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const = 0; + // Returns whether a texture of the given config can be copied to a texture of the same config. - virtual bool isConfigCopyable(GrPixelConfig config) const = 0; + virtual bool isConfigCopyable(GrPixelConfig) const = 0; + + // Returns the maximum supported sample count for a config. 0 means the config is not renderable + // 1 means the config is renderable but doesn't support MSAA. + virtual int maxRenderTargetSampleCount(GrPixelConfig) const = 0; + + bool isConfigRenderable(GrPixelConfig config) const { + return this->maxRenderTargetSampleCount(config) > 0; + } + + // TODO: Remove this after Flutter updated to no longer use it. + bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const { + return this->maxRenderTargetSampleCount(config) > (withMSAA ? 1 : 0); + } + + // Find a sample count greater than or equal to the requested count which is supported for a + // color buffer of the given config or 0 if no such sample count is supported. If the requested + // sample count is 1 then 1 will be returned if non-MSAA rendering is supported, otherwise 0. + // For historical reasons requestedCount==0 is handled identically to requestedCount==1. + virtual int getRenderTargetSampleCount(int requestedCount, GrPixelConfig) const = 0; + // TODO: Remove. Legacy name used by Chrome. + int getSampleCount(int requestedCount, GrPixelConfig config) const { + return this->getRenderTargetSampleCount(requestedCount, config); + } bool suppressPrints() const { return fSuppressPrints; } @@ -178,6 +197,8 @@ public: virtual bool initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc* desc, bool* rectsMustMatch, bool* disallowSubrect) const = 0; + bool validateSurfaceDesc(const GrSurfaceDesc&, GrMipMapped) const; + /** * Returns true if the GrBackendTexutre can we used with the supplied SkColorType. If it is * compatible, the passed in GrPixelConfig will be set to a config that matches the backend |