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

Unified Diff: samplecode/SampleQuadStroker.cpp

Issue 1144883003: handle large conic strokes better (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix dm-driven very large curve case Created 5 years, 7 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 | « gm/strokes.cpp ('k') | src/core/SkGeometry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleQuadStroker.cpp
diff --git a/samplecode/SampleQuadStroker.cpp b/samplecode/SampleQuadStroker.cpp
index 73373a2c979f415e14e573743c147e65f21b7372..05b6204026bb9a3e18fbd1dac3d936160e1bea78 100644
--- a/samplecode/SampleQuadStroker.cpp
+++ b/samplecode/SampleQuadStroker.cpp
@@ -304,10 +304,10 @@ protected:
void draw_stroke(SkCanvas* canvas, const SkPath& path, SkScalar width, SkScalar scale,
bool drawText) {
- SkRect bounds = path.getBounds();
- if (bounds.isEmpty()) {
+ if (path.isEmpty()) {
return;
}
+ SkRect bounds = path.getBounds();
this->setWHZ(SkScalarCeilToInt(bounds.right()), drawText
? SkScalarRoundToInt(scale * 3 / 2) : SkScalarRoundToInt(scale),
SkScalarRoundToInt(950.0f / scale));
« no previous file with comments | « gm/strokes.cpp ('k') | src/core/SkGeometry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698