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

Side by Side Diff: gm/cubicpaths.cpp

Issue 15924003: don't overclamp cubics (see skbug.com/1316) (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/core/SkEdgeClipper.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "gm.h" 7 #include "gm.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
11 11
12 // skbug.com/1316 shows that this cubic, when slightly clipped, creates big 12 // skbug.com/1316 shows that this cubic, when slightly clipped, creates big
13 // (incorrect) changes to its control points. 13 // (incorrect) changes to its control points.
14 class ClippedCubicGM : public skiagm::GM { 14 class ClippedCubicGM : public skiagm::GM {
15 public: 15 public:
16 ClippedCubicGM() {} 16 ClippedCubicGM() {}
17 17
18 protected: 18 protected:
19 SkString onShortName() { 19 SkString onShortName() {
20 return SkString("cubicpath"); 20 return SkString("clippedcubic");
21 } 21 }
22 22
23 SkISize onISize() { return SkISize::Make(1240, 390); } 23 SkISize onISize() { return SkISize::Make(1240, 390); }
24 24
25 virtual void onDraw(SkCanvas* canvas) { 25 virtual void onDraw(SkCanvas* canvas) {
26 SkPath path; 26 SkPath path;
27 path.moveTo(0, 0); 27 path.moveTo(0, 0);
28 path.cubicTo(140, 150, 40, 10, 170, 150); 28 path.cubicTo(140, 150, 40, 10, 170, 150);
29 29
30 SkPaint paint; 30 SkPaint paint;
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 private: 336 private:
337 typedef skiagm::GM INHERITED; 337 typedef skiagm::GM INHERITED;
338 }; 338 };
339 339
340 ////////////////////////////////////////////////////////////////////////////// 340 //////////////////////////////////////////////////////////////////////////////
341 341
342 DEF_GM( return new CubicPathGM; ) 342 DEF_GM( return new CubicPathGM; )
343 DEF_GM( return new CubicClosePathGM; ) 343 DEF_GM( return new CubicClosePathGM; )
344 DEF_GM( return new ClippedCubicGM; ) 344 DEF_GM( return new ClippedCubicGM; )
OLDNEW
« no previous file with comments | « no previous file | src/core/SkEdgeClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698