Index: src/gpu/SkGpuDevice.cpp |
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
index 7ce3446b72e59289f8741fd20bf8355ae3bfd4a3..5be3c80f2e660970b913fe09f5cb5bb9880896f2 100644 |
--- a/src/gpu/SkGpuDevice.cpp |
+++ b/src/gpu/SkGpuDevice.cpp |
@@ -21,6 +21,7 @@ |
#include "GrRecordReplaceDraw.h" |
#include "GrStrokeInfo.h" |
#include "GrTracing.h" |
+#include "GrGpu.h" |
#include "SkGrTexturePixelRef.h" |
@@ -647,10 +648,15 @@ bool create_mask_GPU(GrContext* context, |
desc.fFlags = kRenderTarget_GrTextureFlagBit; |
desc.fWidth = SkScalarCeilToInt(maskRect.width()); |
desc.fHeight = SkScalarCeilToInt(maskRect.height()); |
+ // try multisampled target if possible |
bsalomon
2014/10/02 16:59:16
Why don't we just pass the sample count of the SkG
|
+ int maxSampleCnt = context->getGpu()->caps()->maxSampleCount(); |
+ desc.fSampleCnt = maxSampleCnt >= 4 ? 4 : maxSampleCnt; |
// We actually only need A8, but it often isn't supported as a |
// render target so default to RGBA_8888 |
desc.fConfig = kRGBA_8888_GrPixelConfig; |
- if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, false)) { |
+ |
+ bool msaa = desc.fSampleCnt > 0; |
+ if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, msaa)) { |
desc.fConfig = kAlpha_8_GrPixelConfig; |
} |