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

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

Issue 2127673002: Consolidate handling of infinitely thin primitives and aa bloat handing WRT batch bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@AAStrokeRect
Patch Set: update for instanced rendering Created 4 years, 5 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/GrTestBatch.h ('k') | src/gpu/instanced/InstancedRendering.cpp » ('j') | 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 4e82a62195c4d92ef2d705e1a5297d3c2a19972e..5949f1f8f2455252630bc7135fa9a4394dc28bd2 100644
--- a/src/gpu/effects/GrDashingEffect.cpp
+++ b/src/gpu/effects/GrDashingEffect.cpp
@@ -282,13 +282,17 @@ private:
// 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);
+ SkRect bounds;
+ bounds.set(geometry.fPtsRot[0], geometry.fPtsRot[1]);
+ bounds.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);
+
+ IsZeroArea zeroArea = geometry.fSrcStrokeWidth ? IsZeroArea::kNo : IsZeroArea::kYes;
+ HasAABloat aaBloat = (aaMode == AAMode::kNone) ? HasAABloat ::kNo : HasAABloat::kYes;
+ this->setTransformedBounds(bounds, combinedMatrix, aaBloat, zeroArea);
}
void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
@@ -655,7 +659,7 @@ private:
}
fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
- this->joinBounds(that->bounds());
+ this->joinBounds(*that);
return true;
}
« no previous file with comments | « src/gpu/batches/GrTestBatch.h ('k') | src/gpu/instanced/InstancedRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698