Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: src/gpu/GrRenderTarget.cpp

Issue 2467593002: Move memoization of multisample specs id to GrRenderTarget (Closed)
Patch Set: Move memoization of multisample specs id to GrRenderTarget Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrRenderTargetPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRenderTarget.cpp
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 0bcde3bafe8e6c0d8a7ea64ede2194b98d0a1400..09d43f99e4085764da7a58c4656490ab3a94b9df 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -105,7 +105,14 @@ int GrRenderTargetPriv::numStencilBits() const {
const GrGpu::MultisampleSpecs&
GrRenderTargetPriv::getMultisampleSpecs(const GrStencilSettings& stencil) const {
- return fRenderTarget->getGpu()->getMultisampleSpecs(fRenderTarget, stencil);
+ GrGpu* gpu = fRenderTarget->getGpu();
+ if (auto id = fRenderTarget->fMultisampleSpecsID) {
+ SkASSERT(gpu->queryMultisampleSpecs(fRenderTarget, stencil).fUniqueID == id);
+ return gpu->getMultisampleSpecs(id);
+ }
+ const GrGpu::MultisampleSpecs& specs = gpu->queryMultisampleSpecs(fRenderTarget, stencil);
+ fRenderTarget->fMultisampleSpecsID = specs.fUniqueID;
+ return specs;
}
int GrRenderTargetPriv::maxWindowRectangles() const {
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrRenderTargetPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698