OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 | 7 |
8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
9 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
11 | 11 |
12 #include "GrContext.h" | 12 #include "GrContext.h" |
13 #include "GrContextFactory.h" | 13 #include "GrContextFactory.h" |
| 14 #include "GrPath.h" |
| 15 #include "GrStrokeInfo.h" |
14 #include "SkBitmap.h" | 16 #include "SkBitmap.h" |
15 #include "SkCanvas.h" | 17 #include "SkCanvas.h" |
16 #include "SkColor.h" | 18 #include "SkColor.h" |
17 #include "SkPaint.h" | 19 #include "SkPaint.h" |
18 #include "SkPath.h" | 20 #include "SkPath.h" |
19 #include "SkDashPathEffect.h" | 21 #include "SkDashPathEffect.h" |
20 #include "SkRRect.h" | 22 #include "SkRRect.h" |
21 #include "SkRect.h" | 23 #include "SkRect.h" |
22 #include "SkSurface.h" | 24 #include "SkSurface.h" |
23 #include "Test.h" | 25 #include "Test.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 if (!grContext) { | 105 if (!grContext) { |
104 return; | 106 return; |
105 } | 107 } |
106 | 108 |
107 SkAutoTUnref<SkSurface> surface( | 109 SkAutoTUnref<SkSurface> surface( |
108 SkSurface::NewRenderTarget(grContext, SkSurface::kNo_Budgeted, | 110 SkSurface::NewRenderTarget(grContext, SkSurface::kNo_Budgeted, |
109 SkImageInfo::MakeN32Premul(255, 255), 4)); | 111 SkImageInfo::MakeN32Premul(255, 255), 4)); |
110 test_drawSameRectOvals(reporter, surface->getCanvas()); | 112 test_drawSameRectOvals(reporter, surface->getCanvas()); |
111 } | 113 } |
112 | 114 |
| 115 DEF_TEST(GrPathKeys, reporter) { |
| 116 // Keys should not ignore conic weights. |
| 117 SkPath path1, path2; |
| 118 path1.setIsVolatile(true); |
| 119 path2.setIsVolatile(true); |
| 120 SkPoint p0 = SkPoint::Make(100, 0); |
| 121 SkPoint p1 = SkPoint::Make(100, 100); |
| 122 |
| 123 path1.conicTo(p0, p1, .5f); |
| 124 path2.conicTo(p0, p1, .7f); |
| 125 |
| 126 bool isVolatile; |
| 127 GrUniqueKey key1, key2; |
| 128 GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); |
| 129 GrPath::ComputeKey(path1, stroke, &key1, &isVolatile); |
| 130 GrPath::ComputeKey(path2, stroke, &key2, &isVolatile); |
| 131 |
| 132 // https://bugs.chromium.org/p/skia/issues/detail?id=4580 |
| 133 // REPORTER_ASSERT(reporter, key1 != key2); |
| 134 } |
| 135 |
113 #endif | 136 #endif |
OLD | NEW |