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

Side by Side Diff: tests/FlattenableFactoryToName.cpp

Issue 1893193002: Split AlphaThresholdEffect out into its own file (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix test 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/effects/SkAlphaThresholdFilter.cpp ('k') | no next file » | 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 "SkRegion.h"
10 #include "Test.h" 11 #include "Test.h"
11 12
12 static void test_flattenable(skiatest::Reporter* r, 13 static void test_flattenable(skiatest::Reporter* r,
13 const SkFlattenable* f, 14 const SkFlattenable* f,
14 const char* desc) { 15 const char* desc) {
15 if (f) { 16 if (f) {
16 SkFlattenable::Factory factory = f->getFactory(); 17 SkFlattenable::Factory factory = f->getFactory();
17 REPORTER_ASSERT(r, factory); 18 REPORTER_ASSERT(r, factory);
18 if (factory) { 19 if (factory) {
19 if (!SkFlattenable::FactoryToName(factory)) { 20 if (!SkFlattenable::FactoryToName(factory)) {
(...skipping 12 matching lines...) Expand all
32 sk_sp<SkImageFilter> filter(SkAlphaThresholdFilter::Make(region, 0.2f, 0.7f, nullptr)); 33 sk_sp<SkImageFilter> filter(SkAlphaThresholdFilter::Make(region, 0.2f, 0.7f, nullptr));
33 test_flattenable(r, filter.get(), "SkAlphaThresholdFilter()"); 34 test_flattenable(r, filter.get(), "SkAlphaThresholdFilter()");
34 35
35 SkBitmap bm; 36 SkBitmap bm;
36 bm.allocN32Pixels(8, 8); 37 bm.allocN32Pixels(8, 8);
37 bm.eraseColor(SK_ColorCYAN); 38 bm.eraseColor(SK_ColorCYAN);
38 sk_sp<SkImage> image(SkImage::MakeFromBitmap(bm)); 39 sk_sp<SkImage> image(SkImage::MakeFromBitmap(bm));
39 auto shader = image->makeShader(SkShader::kClamp_TileMode, SkShader::kClamp_ TileMode); 40 auto shader = image->makeShader(SkShader::kClamp_TileMode, SkShader::kClamp_ TileMode);
40 test_flattenable(r, shader.get(), "SkImage::newShader()"); 41 test_flattenable(r, shader.get(), "SkImage::newShader()");
41 } 42 }
OLDNEW
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698