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

Side by Side Diff: gm/bug5252.cpp

Issue 1943403006: fix hairline clip (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixed indenting; removed debugging Created 4 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
« no previous file with comments | « no previous file | src/core/SkScan_Hairline.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "gm.h"
9 #include "SkCanvas.h"
10 #include "SkRect.h"
11 #include "SkPath.h"
12
13 DEF_SIMPLE_GM(bug5252, canvas, 500, 500) {
14 canvas->translate(SkIntToScalar(10), SkIntToScalar(20));
15
16 SkPath clip1;
17 clip1.addOval(SkRect::MakeWH(225, 200));
18 canvas->clipPath(clip1); // bug
19
20 SkPath clip2;
21 clip2.addRect(SkRect::MakeWH(220, 200));
22 //canvas->clipPath(clip2); // ok
23
24 SkPaint pa;
25 pa.setStyle(SkPaint::kStroke_Style);
26 pa.setAntiAlias(true);
27 pa.setStrokeWidth(1.0f);
28 for (int i = 0; i < 15; i++)
29 {
30 for (int j = 0; j < 10; j++)
31 {
32 SkAutoCanvasRestore acs(canvas, true);
33
34 canvas->translate(i * 15.f, j * 20.f);
35 canvas->drawRect(SkRect::MakeXYWH(5, 5, 10, 15),pa);
36 SkPath path;
37 path.moveTo(6, 6);
38 path.cubicTo(14, 10, 13, 12, 10, 12);
39 path.cubicTo(7, 15, 8, 17, 14, 18);
40 canvas->drawPath(path, pa);
41 }
42 }
43 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkScan_Hairline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698