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

Unified Diff: src/gpu/GrDefaultPathRenderer.cpp

Issue 1121463002: Move bounds to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweak Created 5 years, 8 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/GrContext.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultPathRenderer.cpp
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index acc18715c205eaf51da9948915d675b5d39e9199..93d64abab25936ba881a842312643cfde1784778 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -217,12 +217,12 @@ public:
GrColor fColor;
SkPath fPath;
SkScalar fTolerance;
- SkDEBUGCODE(SkRect fDevBounds;)
};
static GrBatch* Create(const Geometry& geometry, uint8_t coverage, const SkMatrix& viewMatrix,
- bool isHairline) {
- return SkNEW_ARGS(DefaultPathBatch, (geometry, coverage, viewMatrix, isHairline));
+ bool isHairline, const SkRect& devBounds) {
+ return SkNEW_ARGS(DefaultPathBatch, (geometry, coverage, viewMatrix, isHairline,
+ devBounds));
}
const char* name() const override { return "DefaultPathBatch"; }
@@ -393,12 +393,14 @@ public:
private:
DefaultPathBatch(const Geometry& geometry, uint8_t coverage, const SkMatrix& viewMatrix,
- bool isHairline) {
+ bool isHairline, const SkRect& devBounds) {
this->initClassID<DefaultPathBatch>();
fBatch.fCoverage = coverage;
fBatch.fIsHairline = isHairline;
fBatch.fViewMatrix = viewMatrix;
fGeoData.push_back(geometry);
+
+ this->setBounds(devBounds);
}
bool onCombineIfPossible(GrBatch* t) override {
@@ -421,6 +423,7 @@ private:
}
fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
+ this->joinBounds(that->bounds());
return true;
}
@@ -704,12 +707,11 @@ bool GrDefaultPathRenderer::internalDrawPath(GrDrawTarget* target,
geometry.fColor = color;
geometry.fPath = path;
geometry.fTolerance = srcSpaceTol;
- SkDEBUGCODE(geometry.fDevBounds = devBounds;)
SkAutoTUnref<GrBatch> batch(DefaultPathBatch::Create(geometry, newCoverage, viewMatrix,
- isHairline));
+ isHairline, devBounds));
- target->drawBatch(pipelineBuilder, batch, &devBounds);
+ target->drawBatch(pipelineBuilder, batch);
}
}
return true;
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698