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

Side by Side Diff: tests/FlattenableFactoryToName.cpp

Issue 1785473002: SkImage now has makeShader to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use build guard for impl of newShader Created 4 years, 9 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') | tests/ImageNewShaderTest.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 2015 Google Inc. 2 * Copyright 2015 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 "SkAlphaThresholdFilter.h" 8 #include "SkAlphaThresholdFilter.h"
9 #include "SkImage.h" 9 #include "SkImage.h"
10 #include "Test.h" 10 #include "Test.h"
(...skipping 18 matching lines...) Expand all
29 rects[1] = SkIRect::MakeXYWH(150, 0, 200, 500); 29 rects[1] = SkIRect::MakeXYWH(150, 0, 200, 500);
30 SkRegion region; 30 SkRegion region;
31 region.setRects(rects, 2); 31 region.setRects(rects, 2);
32 SkAutoTUnref<SkImageFilter> filter( SkAlphaThresholdFilter::Create(region, 0 .2f, 0.7f)); 32 SkAutoTUnref<SkImageFilter> filter( SkAlphaThresholdFilter::Create(region, 0 .2f, 0.7f));
33 test_flattenable(r, filter, "SkAlphaThresholdFilter()"); 33 test_flattenable(r, filter, "SkAlphaThresholdFilter()");
34 34
35 SkBitmap bm; 35 SkBitmap bm;
36 bm.allocN32Pixels(8, 8); 36 bm.allocN32Pixels(8, 8);
37 bm.eraseColor(SK_ColorCYAN); 37 bm.eraseColor(SK_ColorCYAN);
38 SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bm)); 38 SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bm));
39 SkAutoTUnref<SkShader> shader(image->newShader(SkShader::kClamp_TileMode, 39 auto shader = image->makeShader(SkShader::kClamp_TileMode, SkShader::kClamp_ TileMode);
40 SkShader::kClamp_TileMode)); 40 test_flattenable(r, shader.get(), "SkImage::newShader()");
41 test_flattenable(r, shader, "SkImage::newShader()");
42 } 41 }
OLDNEW
« no previous file with comments | « src/utils/SkLua.cpp ('k') | tests/ImageNewShaderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698