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

Unified Diff: src/gpu/GrDrawTarget.h

Issue 209413006: Make it possible to draw multiple paths at once to a draw target (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comment Created 6 years, 9 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 | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.h
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index 19ce16f64a68818512f0d32b7192c90a06dd6b4e..03e603a5b5c119e70e55ebfea38f78190ab4085b 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -15,6 +15,7 @@
#include "SkClipStack.h"
#include "SkMatrix.h"
#include "SkPath.h"
+#include "SkStrokeRec.h"
#include "SkTArray.h"
#include "SkTLazy.h"
#include "SkTypes.h"
@@ -24,7 +25,6 @@ class GrClipData;
class GrDrawTargetCaps;
class GrPath;
class GrVertexBuffer;
-class SkStrokeRec;
class GrDrawTarget : public SkRefCnt {
protected:
@@ -344,6 +344,19 @@ public:
void drawPath(const GrPath*, SkPath::FillType fill);
/**
+ * Draws many paths. It will respect the HW
+ * antialias flag on the draw state (if possible in the 3D API).
+ *
+ * @param transforms array of 2d affine transformations, one for each path.
+ * @param fill the fill type for drawing all the paths. Fill must not be a
+ * hairline.
+ * @param stroke the stroke for drawing all the paths.
+ */
+ void drawPaths(size_t pathCount, const GrPath** paths,
+ const SkMatrix* transforms, SkPath::FillType fill,
+ SkStrokeRec::Style stroke);
+
+ /**
* Helper function for drawing rects. It performs a geometry src push and pop
* and thus will finalize any reserved geometry.
*
@@ -487,6 +500,16 @@ public:
this->onDrawPath(path, fill, dstCopy);
}
+ /**
+ * For subclass internal use to invoke a call to onDrawPaths().
+ */
+ void executeDrawPaths(size_t pathCount, const GrPath** paths,
+ const SkMatrix* transforms, SkPath::FillType fill,
+ SkStrokeRec::Style stroke,
+ const GrDeviceCoordTexture* dstCopy) {
+ this->onDrawPaths(pathCount, paths, transforms, fill, stroke, dstCopy);
+ }
+
////////////////////////////////////////////////////////////////////////////
/**
@@ -867,6 +890,9 @@ private:
virtual void onStencilPath(const GrPath*, SkPath::FillType) = 0;
virtual void onDrawPath(const GrPath*, SkPath::FillType,
const GrDeviceCoordTexture* dstCopy) = 0;
+ virtual void onDrawPaths(size_t, const GrPath**, const SkMatrix*,
+ SkPath::FillType, SkStrokeRec::Style,
+ const GrDeviceCoordTexture* dstCopy) = 0;
virtual void onInstantGpuTraceEvent(const char* marker) = 0;
virtual void onPushGpuTraceEvent(const char* marker) = 0;
« no previous file with comments | « no previous file | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698