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

Unified Diff: src/gpu/GrAAHairLinePathRenderer.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/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAAHairLinePathRenderer.cpp
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 9ab5c8eef21aa110902dd7f2adb5f9829c306f8b..96e0677eceb691d8a457b44510d6627398f63423 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -699,7 +699,6 @@ public:
uint8_t fCoverage;
SkMatrix fViewMatrix;
SkPath fPath;
- SkDEBUGCODE(SkRect fDevBounds;)
SkIRect fDevClipBounds;
};
@@ -734,7 +733,6 @@ public:
fBatch.fUsesLocalCoords = init.fUsesLocalCoords;
fBatch.fCoverageIgnored = init.fCoverageIgnored;
fBatch.fCoverage = fGeoData[0].fCoverage;
- SkDEBUGCODE(fBatch.fDevBounds = fGeoData[0].fDevBounds;)
}
void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline) override;
@@ -753,6 +751,10 @@ private:
SkASSERT(linesIndexBuffer && quadsIndexBuffer);
this->initClassID<AAHairlineBatch>();
fGeoData.push_back(geometry);
+
+ // compute bounds
+ fBounds = geometry.fPath.getBounds();
+ geometry.fViewMatrix.mapRect(&fBounds);
}
bool onCombineIfPossible(GrBatch* t) override {
@@ -785,6 +787,7 @@ private:
}
fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
+ this->joinBounds(that->bounds());
return true;
}
@@ -1047,23 +1050,16 @@ bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target,
pipelineBuilder->clip().getConservativeBounds(pipelineBuilder->getRenderTarget(),
&devClipBounds);
- // This outset was determined experimentally by running skps and gms. It probably could be a
- // bit tighter
- SkRect devRect = path.getBounds();
- viewMatrix.mapRect(&devRect);
- devRect.outset(2, 2);
-
AAHairlineBatch::Geometry geometry;
geometry.fColor = color;
geometry.fCoverage = newCoverage;
geometry.fViewMatrix = viewMatrix;
geometry.fPath = path;
- SkDEBUGCODE(geometry.fDevBounds = devRect;)
geometry.fDevClipBounds = devClipBounds;
SkAutoTUnref<GrBatch> batch(AAHairlineBatch::Create(geometry, fLinesIndexBuffer,
fQuadsIndexBuffer));
- target->drawBatch(pipelineBuilder, batch, &devRect);
+ target->drawBatch(pipelineBuilder, batch);
return true;
}
« no previous file with comments | « src/gpu/GrAADistanceFieldPathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698