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

Unified Diff: src/gpu/batches/GrDrawPathBatch.h

Issue 1344373005: Reland of add a ClassID function to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/batches/GrDrawBatch.cpp ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawPathBatch.h
diff --git a/src/gpu/batches/GrDrawPathBatch.h b/src/gpu/batches/GrDrawPathBatch.h
index 71ef9d42b482de9dc5f5002c986162011fb894ed..228ad86617f234d40b892fb295a1883a350c7e23 100644
--- a/src/gpu/batches/GrDrawPathBatch.h
+++ b/src/gpu/batches/GrDrawPathBatch.h
@@ -30,8 +30,9 @@
void setStencilSettings(const GrStencilSettings& stencil) { fStencilSettings = stencil; }
protected:
- GrDrawPathBatchBase(const SkMatrix& viewMatrix, GrColor initialColor)
- : fViewMatrix(viewMatrix)
+ GrDrawPathBatchBase(uint32_t classID, const SkMatrix& viewMatrix, GrColor initialColor)
+ : INHERITED(classID)
+ , fViewMatrix(viewMatrix)
, fColor(initialColor) {}
const GrStencilSettings& stencilSettings() const { return fStencilSettings; }
@@ -55,6 +56,8 @@
class GrDrawPathBatch final : public GrDrawPathBatchBase {
public:
+ DEFINE_BATCH_CLASS_ID
+
// This can't return a more abstract type because we install the stencil settings late :(
static GrDrawPathBatchBase* Create(const SkMatrix& viewMatrix, GrColor color,
const GrPath* path) {
@@ -67,11 +70,10 @@
private:
GrDrawPathBatch(const SkMatrix& viewMatrix, GrColor color, const GrPath* path)
- : INHERITED(viewMatrix, color)
+ : INHERITED(ClassID(), viewMatrix, color)
, fPath(path) {
fBounds = path->getBounds();
viewMatrix.mapRect(&fBounds);
- this->initClassID<GrDrawPathBatch>();
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return false; }
@@ -147,7 +149,9 @@
// Template this if we decide to support index types other than 16bit
class GrDrawPathRangeBatch final : public GrDrawPathBatchBase {
public:
- // This can't return a more abstracet type because we install the stencil settings late :(
+ DEFINE_BATCH_CLASS_ID
+
+ // This can't return a more abstract type because we install the stencil settings late :(
static GrDrawPathBatchBase* Create(const SkMatrix& viewMatrix, const SkMatrix& localMatrix,
GrColor color, GrPathRangeDraw* pathRangeDraw) {
return SkNEW_ARGS(GrDrawPathRangeBatch, (viewMatrix, localMatrix, color, pathRangeDraw));
« no previous file with comments | « src/gpu/batches/GrDrawBatch.cpp ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698