Chromium Code Reviews| Index: src/gpu/GrContext.cpp |
| diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
| index bb0f4fa9fab3ee573311c91a219f9ab9abb98aca..1c60f688b9184e77d4d893480486cbbbdb6f7ca7 100644 |
| --- a/src/gpu/GrContext.cpp |
| +++ b/src/gpu/GrContext.cpp |
| @@ -1703,6 +1703,21 @@ bool GrContext::isConfigRenderable(GrPixelConfig config, bool withMSAA) const { |
| return fGpu->caps()->isConfigRenderable(config, withMSAA); |
| } |
| +int GrContext::getRecommendedSampleCount(GrPixelConfig config, SkScalar dpi) const { |
| + if (!this->isConfigRenderable(config, true)) { |
| + return 0; |
| + } |
| + int chosenSampleCount = 0; |
| + if (fGpu->caps()->pathRenderingSupport()) { |
| + if (dpi >= 250.0f) { |
| + chosenSampleCount = 4; |
| + } else { |
| + chosenSampleCount = 16; |
| + } |
| + } |
| + return GrMin(fGpu->caps()->maxSampleCount(), chosenSampleCount); |
|
bsalomon
2014/03/07 18:35:36
maybe:
return chosenSampleCount < fGpu->caps()->m
|
| +} |
| + |
| void GrContext::setupDrawBuffer() { |
| SkASSERT(NULL == fDrawBuffer); |
| SkASSERT(NULL == fDrawBufferVBAllocPool); |