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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 DEF_TEST(ImageFilterMatrixTest, reporter) { | 271 DEF_TEST(ImageFilterMatrixTest, reporter) { |
272 SkBitmap temp; | 272 SkBitmap temp; |
273 temp.allocN32Pixels(100, 100); | 273 temp.allocN32Pixels(100, 100); |
274 SkBitmapDevice device(temp); | 274 SkBitmapDevice device(temp); |
275 SkCanvas canvas(&device); | 275 SkCanvas canvas(&device); |
276 canvas.scale(SkIntToScalar(2), SkIntToScalar(2)); | 276 canvas.scale(SkIntToScalar(2), SkIntToScalar(2)); |
277 | 277 |
278 SkMatrix expectedMatrix = canvas.getTotalMatrix(); | 278 SkMatrix expectedMatrix = canvas.getTotalMatrix(); |
279 | 279 |
280 SkAutoTUnref<SkPictureFactory> factory(SkNEW(SkRTreePictureFactory)); | 280 SkRTreeFactory factory; |
281 SkPictureRecorder recorder(factory); | 281 SkPictureRecorder recorder; |
282 SkCanvas* recordingCanvas = recorder.beginRecording(100, 100); | 282 SkCanvas* recordingCanvas = recorder.beginRecording(100, 100, &factory, 0); |
283 | 283 |
284 SkPaint paint; | 284 SkPaint paint; |
285 SkAutoTUnref<MatrixTestImageFilter> imageFilter( | 285 SkAutoTUnref<MatrixTestImageFilter> imageFilter( |
286 new MatrixTestImageFilter(reporter, expectedMatrix)); | 286 new MatrixTestImageFilter(reporter, expectedMatrix)); |
287 paint.setImageFilter(imageFilter.get()); | 287 paint.setImageFilter(imageFilter.get()); |
288 SkCanvas::SaveFlags saveFlags = static_cast<SkCanvas::SaveFlags>( | 288 SkCanvas::SaveFlags saveFlags = static_cast<SkCanvas::SaveFlags>( |
289 SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag); | 289 SkCanvas::kHasAlphaLayer_SaveFlag | SkCanvas::kFullColorLayer_SaveFlag); |
290 recordingCanvas->saveLayer(NULL, &paint, saveFlags); | 290 recordingCanvas->saveLayer(NULL, &paint, saveFlags); |
291 SkPaint solidPaint; | 291 SkPaint solidPaint; |
292 solidPaint.setColor(0xFFFFFFFF); | 292 solidPaint.setColor(0xFFFFFFFF); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 } | 444 } |
445 | 445 |
446 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { | 446 DEF_GPUTEST(XfermodeImageFilterCroppedInputGPU, reporter, factory) { |
447 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); | 447 GrContext* context = factory->get(static_cast<GrContextFactory::GLContextTyp
e>(0)); |
448 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, | 448 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(context, |
449 SkImageInfo::MakeN32Pre
mul(1, 1), | 449 SkImageInfo::MakeN32Pre
mul(1, 1), |
450 0)); | 450 0)); |
451 test_xfermode_cropped_input(device, reporter); | 451 test_xfermode_cropped_input(device, reporter); |
452 } | 452 } |
453 #endif | 453 #endif |
OLD | NEW |