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

Unified Diff: src/gpu/GrContext.cpp

Issue 188403003: Add API for GrContext to recommend rendertarget sample count (Closed) Base URL: https://skia.googlesource.com/skia.git@skpathobject
Patch Set: Created 6 years, 9 months 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 | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index bb0f4fa9fab3ee573311c91a219f9ab9abb98aca..aa31a3b0ba7760837044be1ff71233d3e38d090e 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1703,6 +1703,15 @@ bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const {
return fGpu->caps()->isConfigRenderable(config, withMSAA);
}
+int GrContext::getRecommendedSampleCount(GrPixelConfig config, float) const {
+ if (this->isConfigRenderable(config, true)) {
+ if (fGpu->caps()->pathRenderingSupport()) {
+ return 4;
bsalomon 2014/03/06 14:02:43 Should probably also check that 4 >= caps()->maxSa
+ }
+ }
+ return 0;
+}
+
void GrContext::setupDrawBuffer() {
SkASSERT(NULL == fDrawBuffer);
SkASSERT(NULL == fDrawBufferVBAllocPool);
« no previous file with comments | « include/gpu/GrContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698