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 "SkBicubicImageFilter.h" | 8 #include "SkBicubicImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 recordingCanvas->save(); | 288 recordingCanvas->save(); |
289 recordingCanvas->scale(SkIntToScalar(10), SkIntToScalar(10)); | 289 recordingCanvas->scale(SkIntToScalar(10), SkIntToScalar(10)); |
290 recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeWH(100, 100)), solidPain
t); | 290 recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeWH(100, 100)), solidPain
t); |
291 recordingCanvas->restore(); // scale | 291 recordingCanvas->restore(); // scale |
292 recordingCanvas->restore(); // saveLayer | 292 recordingCanvas->restore(); // saveLayer |
293 picture.endRecording(); | 293 picture.endRecording(); |
294 | 294 |
295 canvas.drawPicture(picture); | 295 canvas.drawPicture(picture); |
296 } | 296 } |
297 | 297 |
298 void test_huge_blur(SkBaseDevice* device, skiatest::Reporter* reporter) { | 298 static void test_huge_blur(SkBaseDevice* device, skiatest::Reporter* reporter) { |
299 SkCanvas canvas(device); | 299 SkCanvas canvas(device); |
300 | 300 |
301 SkBitmap bitmap; | 301 SkBitmap bitmap; |
302 bitmap.allocN32Pixels(100, 100); | 302 bitmap.allocN32Pixels(100, 100); |
303 bitmap.eraseARGB(0, 0, 0, 0); | 303 bitmap.eraseARGB(0, 0, 0, 0); |
304 | 304 |
305 // Check that a blur with an insane radius does not crash or assert. | 305 // Check that a blur with an insane radius does not crash or assert. |
306 SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(SkIntToScalar(1<<
30), SkIntToScalar(1<<30))); | 306 SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(SkIntToScalar(1<<
30), SkIntToScalar(1<<30))); |
307 | 307 |
308 SkPaint paint; | 308 SkPaint paint; |
(...skipping 19 matching lines...) Expand all Loading... |
328 } | 328 } |
329 | 329 |
330 DEF_GPUTEST(HugeBlurImageFilterGPU, reporter, factory) { | 330 DEF_GPUTEST(HugeBlurImageFilterGPU, reporter, factory) { |
331 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 331 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
332 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 332 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
333 SkImageInfo::MakeN32Pre
mul(100, 100), | 333 SkImageInfo::MakeN32Pre
mul(100, 100), |
334 0)); | 334 0)); |
335 test_huge_blur(device, reporter); | 335 test_huge_blur(device, reporter); |
336 } | 336 } |
337 #endif | 337 #endif |
OLD | NEW |