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

Side by Side Diff: tests/ImageFilterTest.cpp

Issue 1205643002: Make SkGpuDevice know its alpha type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix bench pictures :( Created 5 years, 6 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 | « src/image/SkSurface_Gpu.cpp ('k') | tests/PremulAlphaRoundTripTest.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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapDevice.h" 9 #include "SkBitmapDevice.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0)); 1145 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0));
1146 if (NULL == context) { 1146 if (NULL == context) {
1147 return; 1147 return;
1148 } 1148 }
1149 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); 1149 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType);
1150 1150
1151 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, 1151 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context,
1152 SkSurface::kNo_Budgeted , 1152 SkSurface::kNo_Budgeted ,
1153 SkImageInfo::MakeN32Pre mul(100, 100), 1153 SkImageInfo::MakeN32Pre mul(100, 100),
1154 0, 1154 0,
1155 &props)); 1155 &props,
1156 SkGpuDevice::kUninit_In itContents));
1156 SkImageFilter::Proxy proxy(device); 1157 SkImageFilter::Proxy proxy(device);
1157 1158
1158 test_crop_rects(&proxy, reporter); 1159 test_crop_rects(&proxy, reporter);
1159 } 1160 }
1160 1161
1161 DEF_GPUTEST(HugeBlurImageFilterGPU, reporter, factory) { 1162 DEF_GPUTEST(HugeBlurImageFilterGPU, reporter, factory) {
1162 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0)); 1163 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0));
1163 if (NULL == context) { 1164 if (NULL == context) {
1164 return; 1165 return;
1165 } 1166 }
1166 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); 1167 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType);
1167 1168
1168 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, 1169 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context,
1169 SkSurface::kNo_Budgeted , 1170 SkSurface::kNo_Budgeted ,
1170 SkImageInfo::MakeN32Pre mul(100, 100), 1171 SkImageInfo::MakeN32Pre mul(100, 100),
1171 0, 1172 0,
1172 &props)); 1173 &props,
1174 SkGpuDevice::kUninit_In itContents));
1173 SkCanvas canvas(device); 1175 SkCanvas canvas(device);
1174 1176
1175 test_huge_blur(&canvas, reporter); 1177 test_huge_blur(&canvas, reporter);
1176 } 1178 }
1177 1179
1178 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { 1180 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) {
1179 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0)); 1181 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0));
1180 if (NULL == context) { 1182 if (NULL == context) {
1181 return; 1183 return;
1182 } 1184 }
1183 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); 1185 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType);
1184 1186
1185 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, 1187 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context,
1186 SkSurface::kNo_Budgeted , 1188 SkSurface::kNo_Budgeted ,
1187 SkImageInfo::MakeN32Pre mul(1, 1), 1189 SkImageInfo::MakeN32Pre mul(1, 1),
1188 0, 1190 0,
1189 &props)); 1191 &props,
1192 SkGpuDevice::kUninit_In itContents));
1190 SkCanvas canvas(device); 1193 SkCanvas canvas(device);
1191 1194
1192 test_xfermode_cropped_input(&canvas, reporter); 1195 test_xfermode_cropped_input(&canvas, reporter);
1193 } 1196 }
1194 1197
1195 DEF_GPUTEST(TestNegativeBlurSigmaGPU, reporter, factory) { 1198 DEF_GPUTEST(TestNegativeBlurSigmaGPU, reporter, factory) {
1196 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0)); 1199 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp e>(0));
1197 if (NULL == context) { 1200 if (NULL == context) {
1198 return; 1201 return;
1199 } 1202 }
1200 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); 1203 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType);
1201 1204
1202 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, 1205 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context,
1203 SkSurface::kNo_Budgeted , 1206 SkSurface::kNo_Budgeted ,
1204 SkImageInfo::MakeN32Pre mul(1, 1), 1207 SkImageInfo::MakeN32Pre mul(1, 1),
1205 0, 1208 0,
1206 &props)); 1209 &props,
1210 SkGpuDevice::kUninit_In itContents));
1207 SkImageFilter::Proxy proxy(device); 1211 SkImageFilter::Proxy proxy(device);
1208 1212
1209 test_negative_blur_sigma(&proxy, reporter); 1213 test_negative_blur_sigma(&proxy, reporter);
1210 } 1214 }
1211 #endif 1215 #endif
OLDNEW
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | tests/PremulAlphaRoundTripTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698