diff options
author | 2014-10-06 12:19:12 -0700 | |
---|---|---|
committer | 2014-10-06 12:19:12 -0700 | |
commit | f4555aa53c62a4cb396c77aeed809b5c103349e0 (patch) | |
tree | cc390ef35d51da2f3956abfeae5e18f4a39b0a83 | |
parent | 307796bc2e3731099d96773db7385fe70cb94f7d (diff) |
Create MSAA render target for blur mask texture
Original Author: Henry Song <henrysong@samsung.com>
Review URL: https://codereview.chromium.org/616923004
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 6eaed89828..6a9c31de3f 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" @@ -643,15 +644,19 @@ bool create_mask_GPU(GrContext* context, const SkPath& devPath, const GrStrokeInfo& strokeInfo, bool doAA, - GrAutoScratchTexture* mask) { + GrAutoScratchTexture* mask, + int SampleCnt) { GrTextureDesc desc; desc.fFlags = kRenderTarget_GrTextureFlagBit; desc.fWidth = SkScalarCeilToInt(maskRect.width()); desc.fHeight = SkScalarCeilToInt(maskRect.height()); + desc.fSampleCnt = SampleCnt; // 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)) { + + if (context->isConfigRenderable(kAlpha_8_GrPixelConfig, + desc.fSampleCnt > 0)) { desc.fConfig = kAlpha_8_GrPixelConfig; } @@ -785,7 +790,7 @@ void SkGpuDevice::drawPath(const SkDraw& draw, const SkPath& origSrcPath, GrAutoScratchTexture mask; if (create_mask_GPU(fContext, maskRect, *devPathPtr, strokeInfo, - grPaint.isAntiAlias(), &mask)) { + grPaint.isAntiAlias(), &mask, fRenderTarget->numSamples())) { GrTexture* filtered; if (paint.getMaskFilter()->filterMaskGPU(mask.texture(), |