Chromium Code Reviews| Index: src/gpu/SkGpuDevice.cpp |
| diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
| index 09206052f0d6c568dcb30569fef719a7811b5d6d..916f09630bdf1ec6a5639e20f5fec00a366c8e33 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; |
| } |
|
robertphillips
2015/09/25 12:48:48
Where did this use to get handled ?
joshualitt
2015/09/25 18:17:12
at the SkGpuDevice::drawRect level
|
| + 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); |
| + fDrawContext->draw(grDraw); |
| } |
| /////////////////////////////////////////////////////////////////////////////// |
| @@ -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); |
| } |