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

Side by Side Diff: tests/GpuDrawPathTest.cpp

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « tests/GLProgramsTest.cpp ('k') | tests/GrSurfaceTest.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 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
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, SkBudgeted::kNo, info, 85 SkSurface::NewRenderTarget(context, SkSurface::kNo_Budgeted, inf o,
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
OLDNEW
« no previous file with comments | « tests/GLProgramsTest.cpp ('k') | tests/GrSurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698