aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-08-18 06:05:14 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-18 06:05:14 -0700
commite46f9feb44780a6269c6dcfe993f4215427fd98e (patch)
tree8aad4e37b1fffdf3d49d509c01ad5b672db12d4f /src
parentcf9c4759039c1d6dc5834d653fb36e465e3166d1 (diff)
Privatize GrBatch subclass overrides
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrAAConvexPathRenderer.cpp3
-rwxr-xr-xsrc/gpu/GrAADistanceFieldPathRenderer.cpp2
-rw-r--r--src/gpu/GrAAHairLinePathRenderer.cpp2
-rw-r--r--src/gpu/GrAALinearizingConvexPathRenderer.cpp2
-rw-r--r--src/gpu/GrAtlasTextContext.cpp45
-rw-r--r--src/gpu/GrDefaultPathRenderer.cpp2
-rw-r--r--src/gpu/GrOvalRenderer.cpp11
-rw-r--r--src/gpu/GrTessellatingPathRenderer.cpp2
-rw-r--r--src/gpu/batches/GrAAFillRectBatch.cpp53
-rw-r--r--src/gpu/batches/GrAAStrokeRectBatch.cpp1
-rw-r--r--src/gpu/batches/GrAAStrokeRectBatch.h3
-rw-r--r--src/gpu/batches/GrBWFillRectBatch.cpp40
-rw-r--r--src/gpu/batches/GrDrawAtlasBatch.h10
-rw-r--r--src/gpu/batches/GrDrawVerticesBatch.h3
-rw-r--r--src/gpu/batches/GrStrokeRectBatch.h3
-rw-r--r--src/gpu/effects/GrDashingEffect.cpp46
16 files changed, 113 insertions, 115 deletions
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 9ef506d88c..0eabe66c9d 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -761,6 +761,8 @@ public:
out->setUnknownSingleComponent();
}
+private:
+
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -929,7 +931,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
AAConvexPathBatch(const Geometry& geometry) {
this->initClassID<AAConvexPathBatch>();
fGeoData.push_back(geometry);
diff --git a/src/gpu/GrAADistanceFieldPathRenderer.cpp b/src/gpu/GrAADistanceFieldPathRenderer.cpp
index 6bf217bd72..905bde9eab 100755
--- a/src/gpu/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/GrAADistanceFieldPathRenderer.cpp
@@ -139,6 +139,7 @@ public:
out->setUnknownSingleComponent();
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -273,7 +274,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
AADistanceFieldPathBatch(const Geometry& geometry, GrColor color, const SkMatrix& viewMatrix,
GrBatchAtlas* atlas,
PathCache* pathCache, PathDataList* pathList) {
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index c9ffb797ad..02ff48e0ec 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -694,6 +694,7 @@ public:
out->setUnknownSingleComponent();
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -711,7 +712,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
void onPrepareDraws(Target*) override;
typedef SkTArray<SkPoint, true> PtArray;
diff --git a/src/gpu/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/GrAALinearizingConvexPathRenderer.cpp
index c7b1da0627..fc72a8f60f 100644
--- a/src/gpu/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/GrAALinearizingConvexPathRenderer.cpp
@@ -139,6 +139,7 @@ public:
out->setUnknownSingleComponent();
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -254,7 +255,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
AAFlatteningConvexPathBatch(const Geometry& geometry) {
this->initClassID<AAFlatteningConvexPathBatch>();
fGeoData.push_back(geometry);
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index fbfb2e1c94..56486e9ccb 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -1488,6 +1488,28 @@ public:
return batch;
}
+ // to avoid even the initial copy of the struct, we have a getter for the first item which
+ // is used to seed the batch with its initial geometry. After seeding, the client should call
+ // init() so the Batch can initialize itself
+ Geometry& geometry() { return fGeoData[0]; }
+
+ void init() {
+ const Geometry& geo = fGeoData[0];
+ fBatch.fColor = geo.fColor;
+ fBatch.fViewMatrix = geo.fBlob->fViewMatrix;
+
+ // We don't yet position distance field text on the cpu, so we have to map the vertex bounds
+ // into device space
+ const Run& run = geo.fBlob->fRuns[geo.fRun];
+ if (run.fSubRunInfo[geo.fSubRun].fDrawAsDistanceFields) {
+ SkRect bounds = run.fVertexBounds;
+ fBatch.fViewMatrix.mapRect(&bounds);
+ this->setBounds(bounds);
+ } else {
+ this->setBounds(run.fVertexBounds);
+ }
+ }
+
const char* name() const override { return "TextBatch"; }
void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
@@ -1514,6 +1536,7 @@ public:
}
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -1762,28 +1785,6 @@ public:
this->flush(target, &flushInfo);
}
- // to avoid even the initial copy of the struct, we have a getter for the first item which
- // is used to seed the batch with its initial geometry. After seeding, the client should call
- // init() so the Batch can initialize itself
- Geometry& geometry() { return fGeoData[0]; }
- void init() {
- const Geometry& geo = fGeoData[0];
- fBatch.fColor = geo.fColor;
- fBatch.fViewMatrix = geo.fBlob->fViewMatrix;
-
- // We don't yet position distance field text on the cpu, so we have to map the vertex bounds
- // into device space
- const Run& run = geo.fBlob->fRuns[geo.fRun];
- if (run.fSubRunInfo[geo.fSubRun].fDrawAsDistanceFields) {
- SkRect bounds = run.fVertexBounds;
- fBatch.fViewMatrix.mapRect(&bounds);
- this->setBounds(bounds);
- } else {
- this->setBounds(run.fVertexBounds);
- }
- }
-
-private:
TextBatch() {} // initialized in factory functions.
~TextBatch() {
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 8c663390cc..b7faf68108 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -234,6 +234,7 @@ public:
out->setKnownSingleComponent(this->coverage());
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -375,7 +376,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
DefaultPathBatch(const Geometry& geometry, uint8_t coverage, const SkMatrix& viewMatrix,
bool isHairline, const SkRect& devBounds) {
this->initClassID<DefaultPathBatch>();
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index bd5042c027..c9d6f1fc09 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -651,6 +651,7 @@ public:
out->setUnknownSingleComponent();
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -727,7 +728,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
CircleBatch(const Geometry& geometry) {
this->initClassID<CircleBatch>();
fGeoData.push_back(geometry);
@@ -869,6 +869,7 @@ public:
out->setUnknownSingleComponent();
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsCoverage()) {
@@ -950,7 +951,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
EllipseBatch(const Geometry& geometry) {
this->initClassID<EllipseBatch>();
fGeoData.push_back(geometry);
@@ -1137,6 +1137,8 @@ public:
out->setUnknownSingleComponent();
}
+private:
+
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -1209,7 +1211,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
DIEllipseBatch(const Geometry& geometry, const SkRect& bounds) {
this->initClassID<DIEllipseBatch>();
fGeoData.push_back(geometry);
@@ -1488,6 +1489,7 @@ public:
out->setUnknownSingleComponent();
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -1586,7 +1588,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
RRectCircleRendererBatch(const Geometry& geometry) {
this->initClassID<RRectCircleRendererBatch>();
fGeoData.push_back(geometry);
@@ -1664,6 +1665,7 @@ public:
out->setUnknownSingleComponent();
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -1772,7 +1774,6 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-private:
RRectEllipseRendererBatch(const Geometry& geometry) {
this->initClassID<RRectEllipseRendererBatch>();
fGeoData.push_back(geometry);
diff --git a/src/gpu/GrTessellatingPathRenderer.cpp b/src/gpu/GrTessellatingPathRenderer.cpp
index 8126c6c381..6a70a90283 100644
--- a/src/gpu/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/GrTessellatingPathRenderer.cpp
@@ -1405,6 +1405,7 @@ public:
out->setUnknownSingleComponent();
}
+private:
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -1570,7 +1571,6 @@ public:
bool onCombineIfPossible(GrBatch*, const GrCaps&) override { return false; }
-private:
TessellatingPathBatch(const GrColor& color,
const SkPath& path,
const GrStrokeInfo& stroke,
diff --git a/src/gpu/batches/GrAAFillRectBatch.cpp b/src/gpu/batches/GrAAFillRectBatch.cpp
index 098c6bdae4..335dbedd8b 100644
--- a/src/gpu/batches/GrAAFillRectBatch.cpp
+++ b/src/gpu/batches/GrAAFillRectBatch.cpp
@@ -97,6 +97,32 @@ public:
fBatch.fCanTweakAlphaForCoverage = opt.canTweakAlphaForCoverage();
}
+ SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
+
+ // to avoid even the initial copy of the struct, we have a getter for the first item which
+ // is used to seed the batch with its initial geometry. After seeding, the client should call
+ // init() so the Batch can initialize itself
+ Geometry* geometry() { return &fGeoData[0]; }
+ void init() {
+ const Geometry& geo = fGeoData[0];
+ this->setBounds(geo.fDevRect);
+ }
+
+private:
+ AAFillRectBatch() {
+ this->initClassID<AAFillRectBatch<Base>>();
+
+ // Push back an initial geometry
+ fGeoData.push_back();
+ }
+
+ GrColor color() const { return fBatch.fColor; }
+ bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
+ bool canTweakAlphaForCoverage() const { return fBatch.fCanTweakAlphaForCoverage; }
+ bool colorIgnored() const { return fBatch.fColorIgnored; }
+ const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
+ bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
+
void onPrepareDraws(Target* target) override {
bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage();
@@ -137,33 +163,6 @@ public:
helper.recordDraw(target);
}
- SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-
- // to avoid even the initial copy of the struct, we have a getter for the first item which
- // is used to seed the batch with its initial geometry. After seeding, the client should call
- // init() so the Batch can initialize itself
- Geometry* geometry() { return &fGeoData[0]; }
- void init() {
- const Geometry& geo = fGeoData[0];
- this->setBounds(geo.fDevRect);
- }
-
-
-private:
- AAFillRectBatch() {
- this->initClassID<AAFillRectBatch<Base>>();
-
- // Push back an initial geometry
- fGeoData.push_back();
- }
-
- GrColor color() const { return fBatch.fColor; }
- bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
- bool canTweakAlphaForCoverage() const { return fBatch.fCanTweakAlphaForCoverage; }
- bool colorIgnored() const { return fBatch.fColorIgnored; }
- const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
- bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
-
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
AAFillRectBatch* that = t->cast<AAFillRectBatch>();
if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
diff --git a/src/gpu/batches/GrAAStrokeRectBatch.cpp b/src/gpu/batches/GrAAStrokeRectBatch.cpp
index bab5f02580..1a55a0715c 100644
--- a/src/gpu/batches/GrAAStrokeRectBatch.cpp
+++ b/src/gpu/batches/GrAAStrokeRectBatch.cpp
@@ -43,7 +43,6 @@ static const GrGeometryProcessor* create_stroke_rect_gp(bool tweakAlphaForCovera
return CreateForDeviceSpace(color, coverage, localCoords, viewMatrix);
}
-
void GrAAStrokeRectBatch::initBatchTracker(const GrPipelineOptimizations& opt) {
// Handle any color overrides
if (!opt.readsColor()) {
diff --git a/src/gpu/batches/GrAAStrokeRectBatch.h b/src/gpu/batches/GrAAStrokeRectBatch.h
index 2c6b0dbcf0..f74c33c634 100644
--- a/src/gpu/batches/GrAAStrokeRectBatch.h
+++ b/src/gpu/batches/GrAAStrokeRectBatch.h
@@ -42,12 +42,11 @@ public:
out->setUnknownSingleComponent();
}
- void initBatchTracker(const GrPipelineOptimizations&) override;
-
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
private:
void onPrepareDraws(Target*) override;
+ void initBatchTracker(const GrPipelineOptimizations&) override;
GrAAStrokeRectBatch(const Geometry& geometry, const SkMatrix& viewMatrix) {
this->initClassID<GrAAStrokeRectBatch>();
diff --git a/src/gpu/batches/GrBWFillRectBatch.cpp b/src/gpu/batches/GrBWFillRectBatch.cpp
index f797e9ef4d..6430cf2022 100644
--- a/src/gpu/batches/GrBWFillRectBatch.cpp
+++ b/src/gpu/batches/GrBWFillRectBatch.cpp
@@ -44,6 +44,26 @@ public:
out->setKnownSingleComponent(0xff);
}
+ SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
+
+private:
+ BWFillRectBatch(const Geometry& geometry) {
+ this->initClassID<BWFillRectBatch>();
+ fGeoData.push_back(geometry);
+
+ fBounds = geometry.fRect;
+ geometry.fViewMatrix.mapRect(&fBounds);
+ }
+
+ GrColor color() const { return fBatch.fColor; }
+ bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
+ bool colorIgnored() const { return fBatch.fColorIgnored; }
+ const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
+ const SkMatrix& localMatrix() const { return fGeoData[0].fLocalMatrix; }
+ bool hasLocalRect() const { return fGeoData[0].fHasLocalRect; }
+ bool hasLocalMatrix() const { return fGeoData[0].fHasLocalMatrix; }
+ bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
+
void initBatchTracker(const GrPipelineOptimizations& init) override {
// Handle any color overrides
if (!init.readsColor()) {
@@ -113,26 +133,6 @@ public:
helper.recordDraw(target);
}
- SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-
-private:
- BWFillRectBatch(const Geometry& geometry) {
- this->initClassID<BWFillRectBatch>();
- fGeoData.push_back(geometry);
-
- fBounds = geometry.fRect;
- geometry.fViewMatrix.mapRect(&fBounds);
- }
-
- GrColor color() const { return fBatch.fColor; }
- bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
- bool colorIgnored() const { return fBatch.fColorIgnored; }
- const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
- const SkMatrix& localMatrix() const { return fGeoData[0].fLocalMatrix; }
- bool hasLocalRect() const { return fGeoData[0].fHasLocalRect; }
- bool hasLocalMatrix() const { return fGeoData[0].fHasLocalMatrix; }
- bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
-
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
BWFillRectBatch* that = t->cast<BWFillRectBatch>();
if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
diff --git a/src/gpu/batches/GrDrawAtlasBatch.h b/src/gpu/batches/GrDrawAtlasBatch.h
index c7ee9f3e37..e7dd9bfbd0 100644
--- a/src/gpu/batches/GrDrawAtlasBatch.h
+++ b/src/gpu/batches/GrDrawAtlasBatch.h
@@ -40,17 +40,17 @@ public:
void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
out->setKnownSingleComponent(0xff);
}
-
- void initBatchTracker(const GrPipelineOptimizations&) override;
-
+
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-
+
private:
void onPrepareDraws(Target*) override;
+ void initBatchTracker(const GrPipelineOptimizations&) override;
+
GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix, int spriteCount,
const SkRSXform* xforms, const SkRect* rects, const SkColor* colors);
-
+
GrColor color() const { return fColor; }
bool colorIgnored() const { return fColorIgnored; }
const SkMatrix& viewMatrix() const { return fViewMatrix; }
diff --git a/src/gpu/batches/GrDrawVerticesBatch.h b/src/gpu/batches/GrDrawVerticesBatch.h
index 8864b16898..18ddee0a3b 100644
--- a/src/gpu/batches/GrDrawVerticesBatch.h
+++ b/src/gpu/batches/GrDrawVerticesBatch.h
@@ -45,12 +45,11 @@ public:
void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override;
- void initBatchTracker(const GrPipelineOptimizations&) override;
-
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
private:
void onPrepareDraws(Target*) override;
+ void initBatchTracker(const GrPipelineOptimizations&) override;
GrDrawVerticesBatch(const Geometry& geometry, GrPrimitiveType primitiveType,
const SkMatrix& viewMatrix,
diff --git a/src/gpu/batches/GrStrokeRectBatch.h b/src/gpu/batches/GrStrokeRectBatch.h
index 2e81cc237f..ee053d723e 100644
--- a/src/gpu/batches/GrStrokeRectBatch.h
+++ b/src/gpu/batches/GrStrokeRectBatch.h
@@ -36,10 +36,9 @@ public:
out->setKnownSingleComponent(0xff);
}
- void initBatchTracker(const GrPipelineOptimizations&) override;
-
private:
void onPrepareDraws(Target*) override;
+ void initBatchTracker(const GrPipelineOptimizations&) override;
GrStrokeRectBatch(const Geometry& geometry, bool snapToPixelCenters);
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index e888f6d88c..5fb45a3aab 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -272,6 +272,29 @@ public:
out->setUnknownSingleComponent();
}
+ SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
+
+private:
+ DashBatch(const Geometry& geometry, SkPaint::Cap cap, DashAAMode aaMode, bool fullDash) {
+ this->initClassID<DashBatch>();
+ fGeoData.push_back(geometry);
+
+ fBatch.fAAMode = aaMode;
+ fBatch.fCap = cap;
+ fBatch.fFullDash = fullDash;
+
+ // compute bounds
+ SkScalar halfStrokeWidth = 0.5f * geometry.fSrcStrokeWidth;
+ SkScalar xBloat = SkPaint::kButt_Cap == cap ? 0 : halfStrokeWidth;
+ fBounds.set(geometry.fPtsRot[0], geometry.fPtsRot[1]);
+ fBounds.outset(xBloat, halfStrokeWidth);
+
+ // Note, we actually create the combined matrix here, and save the work
+ SkMatrix& combinedMatrix = fGeoData[0].fSrcRotInv;
+ combinedMatrix.postConcat(geometry.fViewMatrix);
+ combinedMatrix.mapRect(&fBounds);
+ }
+
void initBatchTracker(const GrPipelineOptimizations& opt) override {
// Handle any color overrides
if (!opt.readsColor()) {
@@ -594,29 +617,6 @@ public:
helper.recordDraw(target);
}
- SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-
-private:
- DashBatch(const Geometry& geometry, SkPaint::Cap cap, DashAAMode aaMode, bool fullDash) {
- this->initClassID<DashBatch>();
- fGeoData.push_back(geometry);
-
- fBatch.fAAMode = aaMode;
- fBatch.fCap = cap;
- fBatch.fFullDash = fullDash;
-
- // compute bounds
- SkScalar halfStrokeWidth = 0.5f * geometry.fSrcStrokeWidth;
- SkScalar xBloat = SkPaint::kButt_Cap == cap ? 0 : halfStrokeWidth;
- fBounds.set(geometry.fPtsRot[0], geometry.fPtsRot[1]);
- fBounds.outset(xBloat, halfStrokeWidth);
-
- // Note, we actually create the combined matrix here, and save the work
- SkMatrix& combinedMatrix = fGeoData[0].fSrcRotInv;
- combinedMatrix.postConcat(geometry.fViewMatrix);
- combinedMatrix.mapRect(&fBounds);
- }
-
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
DashBatch* that = t->cast<DashBatch>();
if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),