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

Side by Side Diff: tests/ImageFilterTest.cpp

Issue 1829303002: move setshader to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: addressing comments from #8 Created 4 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
« no previous file with comments | « src/utils/SkLua.cpp ('k') | tools/VisualBench/VisualBenchmarkStream.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 /* 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 SkRTreeFactory factory; 129 SkRTreeFactory factory;
130 SkPictureRecorder recorder; 130 SkPictureRecorder recorder;
131 SkCanvas* recordingCanvas = recorder.beginRecording(64, 64, &factory, 0) ; 131 SkCanvas* recordingCanvas = recorder.beginRecording(64, 64, &factory, 0) ;
132 132
133 SkPaint greenPaint; 133 SkPaint greenPaint;
134 greenPaint.setColor(SK_ColorGREEN); 134 greenPaint.setColor(SK_ColorGREEN);
135 recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 30, 20) ), greenPaint); 135 recordingCanvas->drawRect(SkRect::Make(SkIRect::MakeXYWH(10, 10, 30, 20) ), greenPaint);
136 sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture()); 136 sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture());
137 SkAutoTUnref<SkImageFilter> pictureFilter(SkPictureImageFilter::Create(p icture.get())); 137 SkAutoTUnref<SkImageFilter> pictureFilter(SkPictureImageFilter::Create(p icture.get()));
138 SkAutoTUnref<SkShader> shader(SkPerlinNoiseShader::CreateTurbulence( 138 sk_sp<SkShader> shader(SkPerlinNoiseShader::MakeTurbulence(SK_Scalar1, S K_Scalar1, 1, 0));
139 SK_Scalar1, SK_Scalar1, 1, 0));
140 139
141 SkPaint paint; 140 SkPaint paint;
142 paint.setShader(shader); 141 paint.setShader(shader);
143 SkAutoTUnref<SkImageFilter> paintFilter(SkPaintImageFilter::Create(paint )); 142 SkAutoTUnref<SkImageFilter> paintFilter(SkPaintImageFilter::Create(paint ));
144 143
145 sk_sp<SkShader> greenColorShader(SkShader::MakeColorShader(SK_ColorGREEN )); 144 sk_sp<SkShader> greenColorShader(SkShader::MakeColorShader(SK_ColorGREEN ));
146 SkPaint greenColorShaderPaint; 145 SkPaint greenColorShaderPaint;
147 greenColorShaderPaint.setShader(greenColorShader); 146 greenColorShaderPaint.setShader(greenColorShader);
148 SkImageFilter::CropRect leftSideCropRect(SkRect::MakeXYWH(0, 0, 32, 64)) ; 147 SkImageFilter::CropRect leftSideCropRect(SkRect::MakeXYWH(0, 0, 32, 64)) ;
149 SkAutoTUnref<SkImageFilter> paintFilterLeft(SkPaintImageFilter::Create( 148 SkAutoTUnref<SkImageFilter> paintFilterLeft(SkPaintImageFilter::Create(
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 1592
1594 test_xfermode_cropped_input(&canvas, reporter); 1593 test_xfermode_cropped_input(&canvas, reporter);
1595 } 1594 }
1596 1595
1597 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) { 1596 DEF_GPUTEST_FOR_ALL_CONTEXTS(BlurLargeImage_Gpu, reporter, context) {
1598 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, 1597 auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kYes,
1599 SkImageInfo::MakeN32Premul(100, 100 ))); 1598 SkImageInfo::MakeN32Premul(100, 100 )));
1600 test_large_blur_input(reporter, surface->getCanvas()); 1599 test_large_blur_input(reporter, surface->getCanvas());
1601 } 1600 }
1602 #endif 1601 #endif
OLDNEW
« no previous file with comments | « src/utils/SkLua.cpp ('k') | tools/VisualBench/VisualBenchmarkStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698