OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(SkImageInfo::MakeN32Pre
mul(100, 100))); | 1322 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(SkImageInfo::MakeN32Pre
mul(100, 100))); |
1323 test_large_blur_input(reporter, surface->getCanvas()); | 1323 test_large_blur_input(reporter, surface->getCanvas()); |
1324 } | 1324 } |
1325 | 1325 |
1326 #if SK_SUPPORT_GPU | 1326 #if SK_SUPPORT_GPU |
1327 | 1327 |
1328 DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterCropRect_Gpu, reporter, context) { | 1328 DEF_GPUTEST_FOR_NATIVE_CONTEXT(ImageFilterCropRect_Gpu, reporter, context) { |
1329 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 1329 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
1330 | 1330 |
1331 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1331 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
1332 SkBudgeted::kNo, | 1332 SkSurface::kNo_Budgeted
, |
1333 SkImageInfo::MakeN32Pre
mul(100, 100), | 1333 SkImageInfo::MakeN32Pre
mul(100, 100), |
1334 0, | 1334 0, |
1335 &props, | 1335 &props, |
1336 SkGpuDevice::kUninit_In
itContents)); | 1336 SkGpuDevice::kUninit_In
itContents)); |
1337 SkImageFilter::DeviceProxy proxy(device); | 1337 SkImageFilter::DeviceProxy proxy(device); |
1338 | 1338 |
1339 test_crop_rects(&proxy, reporter); | 1339 test_crop_rects(&proxy, reporter); |
1340 } | 1340 } |
1341 | 1341 |
1342 DEF_GPUTEST_FOR_NATIVE_CONTEXT(HugeBlurImageFilter_Gpu, reporter, context) { | 1342 DEF_GPUTEST_FOR_NATIVE_CONTEXT(HugeBlurImageFilter_Gpu, reporter, context) { |
1343 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 1343 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
1344 | 1344 |
1345 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1345 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
1346 SkBudgeted::kNo, | 1346 SkSurface::kNo_Budgeted
, |
1347 SkImageInfo::MakeN32Pre
mul(100, 100), | 1347 SkImageInfo::MakeN32Pre
mul(100, 100), |
1348 0, | 1348 0, |
1349 &props, | 1349 &props, |
1350 SkGpuDevice::kUninit_In
itContents)); | 1350 SkGpuDevice::kUninit_In
itContents)); |
1351 SkCanvas canvas(device); | 1351 SkCanvas canvas(device); |
1352 | 1352 |
1353 test_huge_blur(&canvas, reporter); | 1353 test_huge_blur(&canvas, reporter); |
1354 } | 1354 } |
1355 | 1355 |
1356 DEF_GPUTEST_FOR_NATIVE_CONTEXT(XfermodeImageFilterCroppedInput_Gpu, reporter, co
ntext) { | 1356 DEF_GPUTEST_FOR_NATIVE_CONTEXT(XfermodeImageFilterCroppedInput_Gpu, reporter, co
ntext) { |
1357 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 1357 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
1358 | 1358 |
1359 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1359 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
1360 SkBudgeted::kNo, | 1360 SkSurface::kNo_Budgeted
, |
1361 SkImageInfo::MakeN32Pre
mul(1, 1), | 1361 SkImageInfo::MakeN32Pre
mul(1, 1), |
1362 0, | 1362 0, |
1363 &props, | 1363 &props, |
1364 SkGpuDevice::kUninit_In
itContents)); | 1364 SkGpuDevice::kUninit_In
itContents)); |
1365 SkCanvas canvas(device); | 1365 SkCanvas canvas(device); |
1366 | 1366 |
1367 test_xfermode_cropped_input(&canvas, reporter); | 1367 test_xfermode_cropped_input(&canvas, reporter); |
1368 } | 1368 } |
1369 | 1369 |
1370 DEF_GPUTEST_FOR_NATIVE_CONTEXT(TestNegativeBlurSigma_Gpu, reporter, context) { | 1370 DEF_GPUTEST_FOR_NATIVE_CONTEXT(TestNegativeBlurSigma_Gpu, reporter, context) { |
1371 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); | 1371 const SkSurfaceProps props(SkSurfaceProps::kLegacyFontHost_InitType); |
1372 | 1372 |
1373 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 1373 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
1374 SkBudgeted::kNo, | 1374 SkSurface::kNo_Budgeted
, |
1375 SkImageInfo::MakeN32Pre
mul(1, 1), | 1375 SkImageInfo::MakeN32Pre
mul(1, 1), |
1376 0, | 1376 0, |
1377 &props, | 1377 &props, |
1378 SkGpuDevice::kUninit_In
itContents)); | 1378 SkGpuDevice::kUninit_In
itContents)); |
1379 SkImageFilter::DeviceProxy proxy(device); | 1379 SkImageFilter::DeviceProxy proxy(device); |
1380 | 1380 |
1381 test_negative_blur_sigma(&proxy, reporter); | 1381 test_negative_blur_sigma(&proxy, reporter); |
1382 } | 1382 } |
1383 | 1383 |
1384 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) { | 1384 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) { |
1385 SkAutoTUnref<SkSurface> surface( | 1385 SkAutoTUnref<SkSurface> surface( |
1386 SkSurface::NewRenderTarget(context, SkBudgeted::kYes, | 1386 SkSurface::NewRenderTarget(context, SkSurface::kYes_Budgeted, |
1387 SkImageInfo::MakeN32Premul(100, 100))); | 1387 SkImageInfo::MakeN32Premul(100, 100))); |
1388 test_large_blur_input(reporter, surface->getCanvas()); | 1388 test_large_blur_input(reporter, surface->getCanvas()); |
1389 } | 1389 } |
1390 #endif | 1390 #endif |
OLD | NEW |