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