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

Unified Diff: src/gpu/GrGpu.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.h ('k') | src/gpu/GrRenderTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrGpu.cpp
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index f5764248890a72fbdd8569a782fd967c4db69b39..bee578a764ac8cd2c849a77a5b24a2c5fbb8cd40 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -442,21 +442,13 @@ void GrGpu::didWriteToSurface(GrSurface* surface, const SkIRect* bounds, uint32_
}
}
-const GrGpu::MultisampleSpecs& GrGpu::getMultisampleSpecs(GrRenderTarget* rt,
- const GrStencilSettings& stencil) {
+const GrGpu::MultisampleSpecs& GrGpu::queryMultisampleSpecs(GrRenderTarget* rt,
+ const GrStencilSettings& stencil) {
SkASSERT(rt->desc().fSampleCnt > 1);
-#ifndef SK_DEBUG
- // In debug mode we query the multisample info every time to verify the caching is correct.
- if (uint8_t id = rt->renderTargetPriv().accessMultisampleSpecsID()) {
- SkASSERT(id > 0 && id < fMultisampleSpecs.count());
- return fMultisampleSpecs[id];
- }
-#endif
-
int effectiveSampleCnt;
SkSTArray<16, SkPoint, true> pattern;
- this->onGetMultisampleSpecs(rt, stencil, &effectiveSampleCnt, &pattern);
+ this->onQueryMultisampleSpecs(rt, stencil, &effectiveSampleCnt, &pattern);
SkASSERT(effectiveSampleCnt >= rt->desc().fSampleCnt);
uint8_t id;
@@ -479,10 +471,7 @@ const GrGpu::MultisampleSpecs& GrGpu::getMultisampleSpecs(GrRenderTarget* rt,
}
}
SkASSERT(id > 0);
- SkASSERT(!rt->renderTargetPriv().accessMultisampleSpecsID() ||
- rt->renderTargetPriv().accessMultisampleSpecsID() == id);
- rt->renderTargetPriv().accessMultisampleSpecsID() = id;
return fMultisampleSpecs[id];
}
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698