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

Unified Diff: src/gpu/effects/GrDashingEffect.cpp

Issue 1301663002: Privatize GrBatch subclass overrides (Closed) Base URL: https://skia.googlesource.com/skia.git@drawsonvb
Patch Set: more Created 5 years, 4 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/GrStrokeRectBatch.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDashingEffect.cpp
diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp
index e888f6d88c4f96f0e6405e0bdab5033c3224af6a..5fb45a3aabf9316fc82f09ee846cb83abe66d784 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(),
« no previous file with comments | « src/gpu/batches/GrStrokeRectBatch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698