aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-05-12 11:36:10 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-12 16:32:57 +0000
commit7c8460e10135c05a42d0744b84838bbc24398ac2 (patch)
treeb4cb392726e4d997a47ccb7fa02552bd96698055 /include/private
parent0ff114fe11f9ac6ec869fa128321576764a76167 (diff)
Make GrRenderTarget[(Proxy)|(Context)]? advertise a "full scene aa type".
Bug: skia: Change-Id: I24549604e8305028e34e0022bfef992a8e8c33f7 Reviewed-on: https://skia-review.googlesource.com/16230 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/private')
-rw-r--r--include/private/GrInstancedPipelineInfo.h6
-rw-r--r--include/private/GrRenderTargetProxy.h26
2 files changed, 15 insertions, 17 deletions
diff --git a/include/private/GrInstancedPipelineInfo.h b/include/private/GrInstancedPipelineInfo.h
index 196c35b96f..c07425909a 100644
--- a/include/private/GrInstancedPipelineInfo.h
+++ b/include/private/GrInstancedPipelineInfo.h
@@ -16,9 +16,9 @@
*/
struct GrInstancedPipelineInfo {
GrInstancedPipelineInfo(const GrRenderTargetProxy* rtp)
- : fIsMultisampled(rtp->isStencilBufferMultisampled())
- , fIsMixedSampled(rtp->isMixedSampled())
- , fIsRenderingToFloat(GrPixelConfigIsFloatingPoint(rtp->desc().fConfig)) {}
+ : fIsMultisampled(GrFSAAType::kNone != rtp->fsaaType())
+ , fIsMixedSampled(GrFSAAType::kMixedSamples == rtp->fsaaType())
+ , fIsRenderingToFloat(GrPixelConfigIsFloatingPoint(rtp->desc().fConfig)) {}
bool canUseCoverageAA() const { return !fIsMultisampled || fIsMixedSampled; }
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h
index adc7553941..dd28b0f86d 100644
--- a/include/private/GrRenderTargetProxy.h
+++ b/include/private/GrRenderTargetProxy.h
@@ -26,28 +26,26 @@ public:
// Actually instantiate the backing rendertarget, if necessary.
GrRenderTarget* instantiate(GrResourceProvider* resourceProvider);
- bool isStencilBufferMultisampled() const { return fDesc.fSampleCnt > 0; }
-
- /**
- * For our purposes, "Mixed Sampled" means the stencil buffer is multisampled but the color
- * buffer is not.
- */
- bool isMixedSampled() const { return fRenderTargetFlags & GrRenderTarget::Flags::kMixedSampled; }
-
- /**
- * "Unified Sampled" means the stencil and color buffers are both multisampled.
- */
- bool isUnifiedMultisampled() const { return fDesc.fSampleCnt > 0 && !this->isMixedSampled(); }
-
/**
* Returns the number of samples/pixel in the stencil buffer (Zero if non-MSAA).
*/
int numStencilSamples() const { return fDesc.fSampleCnt; }
+ GrFSAAType fsaaType() const {
+ if (!fDesc.fSampleCnt) {
+ SkASSERT(!(fRenderTargetFlags & GrRenderTarget::Flags::kMixedSampled));
+ return GrFSAAType::kNone;
+ }
+ return (fRenderTargetFlags & GrRenderTarget::Flags::kMixedSampled)
+ ? GrFSAAType::kMixedSamples
+ : GrFSAAType::kUnifiedMSAA;
+ }
/**
* Returns the number of samples/pixel in the color buffer (Zero if non-MSAA or mixed sampled).
*/
- int numColorSamples() const { return this->isMixedSampled() ? 0 : fDesc.fSampleCnt; }
+ int numColorSamples() const {
+ return GrFSAAType::kMixedSamples == this->fsaaType() ? 0 : fDesc.fSampleCnt;
+ }
int maxWindowRectangles(const GrCaps& caps) const;