aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrRenderTarget.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-30 13:13:42 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-30 13:13:56 +0000
commit7f861927fcd4f9fdef958b5ed9d50b1362ee3232 (patch)
treef7c60f611d039539676ae4eb2466d81798e81cd7 /src/gpu/GrRenderTarget.cpp
parent2f5b8d81c231ef4acb4b5671c0956a249f0ef4cf (diff)
Revert "Drop support for unused MSAA extensions"
This reverts commit 7df27465c4ecc8a4a0cdd95e9785c342903c2de9. Reason for revert: experimental revert to see if this is the cause of the tree redness Original change's description: > Drop support for unused MSAA extensions > > Bug: skia: > Change-Id: I113b80e3f991f195155148625ceb29242ea82776 > Reviewed-on: https://skia-review.googlesource.com/101403 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Chris Dalton <csmartdalton@google.com> TBR=bsalomon@google.com,csmartdalton@google.com,ethannicholas@google.com Change-Id: I4fa4123e2d176bef88cd76a09a14053d9ac5809f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/101680 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTarget.cpp')
-rw-r--r--src/gpu/GrRenderTarget.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index fa56ae74b2..3090219751 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -24,6 +24,7 @@ GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc,
: INHERITED(gpu, desc)
, fSampleCnt(desc.fSampleCnt)
, fStencilAttachment(stencil)
+ , fMultisampleSpecsID(0)
, fFlags(flags) {
SkASSERT(desc.fFlags & kRenderTarget_GrSurfaceFlag);
SkASSERT(!(fFlags & GrRenderTargetFlags::kMixedSampled) || fSampleCnt > 0);
@@ -93,3 +94,16 @@ int GrRenderTargetPriv::numStencilBits() const {
return this->getStencilAttachment()->bits();
}
+const GrGpu::MultisampleSpecs&
+GrRenderTargetPriv::getMultisampleSpecs(const GrPipeline& pipeline) const {
+ SkASSERT(fRenderTarget == pipeline.renderTarget()); // TODO: remove RT from pipeline.
+ GrGpu* gpu = fRenderTarget->getGpu();
+ if (auto id = fRenderTarget->fMultisampleSpecsID) {
+ SkASSERT(gpu->queryMultisampleSpecs(pipeline).fUniqueID == id);
+ return gpu->getMultisampleSpecs(id);
+ }
+ const GrGpu::MultisampleSpecs& specs = gpu->queryMultisampleSpecs(pipeline);
+ fRenderTarget->fMultisampleSpecsID = specs.fUniqueID;
+ return specs;
+}
+