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

Side by Side Diff: tests/ImageNewShaderTest.cpp

Issue 1817383002: switch surface to sk_sp (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/ImageIsOpaqueTest.cpp ('k') | tests/ImageTest.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 2014 Google Inc. 2 * Copyright 2014 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkImage.h" 9 #include "SkImage.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 for (int x = 1; x < info.width(); x++) { 97 for (int x = 1; x < info.width(); x++) {
98 REPORTER_ASSERT(reporter, 0xFFDEDEDE == bmt.getColor(x, y)); 98 REPORTER_ASSERT(reporter, 0xFFDEDEDE == bmt.getColor(x, y));
99 } 99 }
100 } 100 }
101 } 101 }
102 } 102 }
103 103
104 DEF_TEST(ImageNewShader, reporter) { 104 DEF_TEST(ImageNewShader, reporter) {
105 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); 105 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5);
106 106
107 SkAutoTUnref<SkSurface> sourceSurface(SkSurface::NewRaster(info)); 107 auto sourceSurface(SkSurface::MakeRaster(info));
108 SkAutoTUnref<SkSurface> destinationSurface(SkSurface::NewRaster(info)); 108 auto destinationSurface(SkSurface::MakeRaster(info));
109 109
110 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info) ; 110 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info) ;
111 } 111 }
112 112
113 #if SK_SUPPORT_GPU 113 #if SK_SUPPORT_GPU
114 114
115 void gpuToGpu(skiatest::Reporter* reporter, GrContext* context) { 115 void gpuToGpu(skiatest::Reporter* reporter, GrContext* context) {
116 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); 116 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5);
117 117
118 SkAutoTUnref<SkSurface> sourceSurface( 118 auto sourceSurface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, inf o));
119 SkSurface::NewRenderTarget(context, SkBudgeted::kNo, info)); 119 auto destinationSurface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo , info));
120 SkAutoTUnref<SkSurface> destinationSurface(
121 SkSurface::NewRenderTarget(context, SkBudgeted::kNo, info));
122 120
123 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info) ; 121 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info) ;
124 } 122 }
125 123
126 void gpuToRaster(skiatest::Reporter* reporter, GrContext* context) { 124 void gpuToRaster(skiatest::Reporter* reporter, GrContext* context) {
127 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); 125 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5);
128 126
129 SkAutoTUnref<SkSurface> sourceSurface(SkSurface::NewRenderTarget(context, 127 auto sourceSurface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, inf o));
130 SkBudgeted::kNo, info)); 128 auto destinationSurface(SkSurface::MakeRaster(info));
131 SkAutoTUnref<SkSurface> destinationSurface(SkSurface::NewRaster(info));
132 129
133 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info) ; 130 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info) ;
134 } 131 }
135 132
136 void rasterToGpu(skiatest::Reporter* reporter, GrContext* context) { 133 void rasterToGpu(skiatest::Reporter* reporter, GrContext* context) {
137 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5); 134 SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5);
138 135
139 SkAutoTUnref<SkSurface> sourceSurface(SkSurface::NewRaster(info)); 136 auto sourceSurface(SkSurface::MakeRaster(info));
140 SkAutoTUnref<SkSurface> destinationSurface(SkSurface::NewRenderTarget(contex t, 137 auto destinationSurface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo , info));
141 SkBudgeted::kNo, info));
142 138
143 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info) ; 139 runShaderTest(reporter, sourceSurface.get(), destinationSurface.get(), info) ;
144 } 140 }
145 141
146 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageNewShader_GPU, reporter, context) { 142 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageNewShader_GPU, reporter, context) {
147 // GPU -> GPU 143 // GPU -> GPU
148 gpuToGpu(reporter, context); 144 gpuToGpu(reporter, context);
149 145
150 // GPU -> RASTER 146 // GPU -> RASTER
151 gpuToRaster(reporter, context); 147 gpuToRaster(reporter, context);
152 148
153 // RASTER -> GPU 149 // RASTER -> GPU
154 rasterToGpu(reporter, context); 150 rasterToGpu(reporter, context);
155 } 151 }
156 152
157 #endif 153 #endif
OLDNEW
« no previous file with comments | « tests/ImageIsOpaqueTest.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698