| 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 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 const SkScalar intervals[] = { 1, 1 }; | 75 const SkScalar intervals[] = { 1, 1 }; |
| 76 SkAutoTUnref<SkPathEffect> dashEffect(SkDashPathEffect::Create(intervals, 2,
0)); | 76 SkAutoTUnref<SkPathEffect> dashEffect(SkDashPathEffect::Create(intervals, 2,
0)); |
| 77 fill_and_stroke(canvas, oval1, oval2, dashEffect); | 77 fill_and_stroke(canvas, oval1, oval2, dashEffect); |
| 78 } | 78 } |
| 79 | 79 |
| 80 DEF_GPUTEST_FOR_ALL_CONTEXTS(GpuDrawPath, reporter, context) { | 80 DEF_GPUTEST_FOR_ALL_CONTEXTS(GpuDrawPath, reporter, context) { |
| 81 for (auto& test_func : { &test_drawPathEmpty, &test_drawSameRectOvals }) { | 81 for (auto& test_func : { &test_drawPathEmpty, &test_drawSameRectOvals }) { |
| 82 for (auto& sampleCount : {0, 4, 16}) { | 82 for (auto& sampleCount : {0, 4, 16}) { |
| 83 SkImageInfo info = SkImageInfo::MakeN32Premul(255, 255); | 83 SkImageInfo info = SkImageInfo::MakeN32Premul(255, 255); |
| 84 SkAutoTUnref<SkSurface> surface( | 84 SkAutoTUnref<SkSurface> surface( |
| 85 SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, inf
o, | 85 SkSurface::NewRenderTarget(context, SkBudgeted::kNo, info, |
| 86 sampleCount, nullptr)); | 86 sampleCount, nullptr)); |
| 87 if (!surface) { | 87 if (!surface) { |
| 88 continue; | 88 continue; |
| 89 } | 89 } |
| 90 test_func(reporter, surface->getCanvas()); | 90 test_func(reporter, surface->getCanvas()); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 DEF_GPUTEST(GrPathKeys, reporter, /*factory*/) { | 95 DEF_GPUTEST(GrPathKeys, reporter, /*factory*/) { |
| 96 // Keys should not ignore conic weights. | 96 // Keys should not ignore conic weights. |
| 97 SkPath path1, path2; | 97 SkPath path1, path2; |
| 98 path1.setIsVolatile(true); | 98 path1.setIsVolatile(true); |
| 99 path2.setIsVolatile(true); | 99 path2.setIsVolatile(true); |
| 100 SkPoint p0 = SkPoint::Make(100, 0); | 100 SkPoint p0 = SkPoint::Make(100, 0); |
| 101 SkPoint p1 = SkPoint::Make(100, 100); | 101 SkPoint p1 = SkPoint::Make(100, 100); |
| 102 | 102 |
| 103 path1.conicTo(p0, p1, .5f); | 103 path1.conicTo(p0, p1, .5f); |
| 104 path2.conicTo(p0, p1, .7f); | 104 path2.conicTo(p0, p1, .7f); |
| 105 | 105 |
| 106 bool isVolatile; | 106 bool isVolatile; |
| 107 GrUniqueKey key1, key2; | 107 GrUniqueKey key1, key2; |
| 108 GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); | 108 GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); |
| 109 GrPath::ComputeKey(path1, stroke, &key1, &isVolatile); | 109 GrPath::ComputeKey(path1, stroke, &key1, &isVolatile); |
| 110 GrPath::ComputeKey(path2, stroke, &key2, &isVolatile); | 110 GrPath::ComputeKey(path2, stroke, &key2, &isVolatile); |
| 111 REPORTER_ASSERT(reporter, key1 != key2); | 111 REPORTER_ASSERT(reporter, key1 != key2); |
| 112 } | 112 } |
| 113 | 113 |
| 114 #endif | 114 #endif |
| OLD | NEW |