Index: src/gpu/SkGpuDevice.cpp |
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
index 09206052f0d6c568dcb30569fef719a7811b5d6d..0fa24f3ca9a60b9f04d7b18a05770a69d874dcc1 100644 |
--- a/src/gpu/SkGpuDevice.cpp |
+++ b/src/gpu/SkGpuDevice.cpp |
@@ -40,6 +40,7 @@ |
#include "SkVertState.h" |
#include "SkXfermode.h" |
#include "batches/GrRectBatchFactory.h" |
+#include "draws/GrDrawRect.h" |
#include "effects/GrBicubicEffect.h" |
#include "effects/GrDashingEffect.h" |
#include "effects/GrSimpleTextureEffect.h" |
@@ -506,6 +507,10 @@ void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect, |
usePath = true; |
} |
+ if (strokeInfo.isDashed()) { |
+ usePath = true; |
+ } |
+ |
if (usePath) { |
SkPath path; |
path.setIsVolatile(true); |
@@ -514,12 +519,8 @@ void SkGpuDevice::drawRect(const SkDraw& draw, const SkRect& rect, |
return; |
} |
- GrPaint grPaint; |
- if (!SkPaint2GrPaint(this->context(), paint, *draw.fMatrix, true, &grPaint)) { |
- return; |
- } |
- |
- fDrawContext->drawRect(fRenderTarget, fClip, grPaint, *draw.fMatrix, rect, &strokeInfo); |
+ GrDrawRect grDraw(fRenderTarget, fContext, fClip, paint, *draw.fMatrix, rect, &strokeInfo); |
+ grDraw.execute(fDrawContext); |
} |
/////////////////////////////////////////////////////////////////////////////// |
@@ -1019,9 +1020,6 @@ static void draw_aa_bitmap(GrDrawContext* drawContext, GrContext* context, |
// Setup dst rect and final matrix |
SkRect dstRect = {0, 0, dstSize.fWidth, dstSize.fHeight}; |
- SkRect devRect; |
- viewMatrix.mapRect(&devRect, dstRect); |
- |
SkMatrix matrix; |
matrix.setIDiv(bitmapPtr->width(), bitmapPtr->height()); |
@@ -1034,8 +1032,7 @@ static void draw_aa_bitmap(GrDrawContext* drawContext, GrContext* context, |
SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateAAFill(grPaint.getColor(), |
viewMatrix, |
matrix, |
- dstRect, |
- devRect)); |
+ dstRect)); |
drawContext->drawBatch(renderTarget, clip, grPaint, batch); |
} |