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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1355353002: Create GrDraw and start fast pathing src over rects (Closed) Base URL: https://skia.googlesource.com/skia.git@strokerect2
Patch Set: tweaks Created 5 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 | « src/gpu/GrDrawTarget.h ('k') | src/gpu/batches/GrAAFillRectBatch.h » ('j') | 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 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);
}
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/batches/GrAAFillRectBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698