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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 616923004: Create MSAA render target for blur mask texture (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698