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

Side by Side Diff: tests/ImageFilterTest.cpp

Issue 238273012: Staged removal of SkPicture-derived classes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: have SkPicture only friend SkPictureRecorder once Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « tests/CanvasTest.cpp ('k') | tests/PictureTest.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 "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
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
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
OLDNEW
« no previous file with comments | « tests/CanvasTest.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698