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

Side by Side Diff: tests/ShaderOpacityTest.cpp

Issue 308683005: setConfig -> setInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: missed one setConfig (release only) Created 6 years, 6 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/SerializationTest.cpp ('k') | tests/WritePixelsTest.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 2011 Google Inc. 2 * Copyright 2011 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 "SkColorShader.h" 8 #include "SkColorShader.h"
9 #include "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
11 #include "Test.h" 11 #include "Test.h"
12 12
13 static void test_bitmap(skiatest::Reporter* reporter) { 13 static void test_bitmap(skiatest::Reporter* reporter) {
14 SkImageInfo info = SkImageInfo::MakeN32Premul(2, 2); 14 SkImageInfo info = SkImageInfo::MakeN32Premul(2, 2);
15 15
16 SkBitmap bmp; 16 SkBitmap bmp;
17 bmp.setConfig(info); 17 bmp.setInfo(info);
18 18
19 // test 1: bitmap without pixel data 19 // test 1: bitmap without pixel data
20 SkShader* shader = SkShader::CreateBitmapShader(bmp, 20 SkShader* shader = SkShader::CreateBitmapShader(bmp,
21 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode); 21 SkShader::kClamp_TileMode, SkShader::kClamp_TileMode);
22 REPORTER_ASSERT(reporter, shader); 22 REPORTER_ASSERT(reporter, shader);
23 REPORTER_ASSERT(reporter, !shader->isOpaque()); 23 REPORTER_ASSERT(reporter, !shader->isOpaque());
24 shader->unref(); 24 shader->unref();
25 25
26 // From this point on, we have pixels 26 // From this point on, we have pixels
27 bmp.allocPixels(info); 27 bmp.allocPixels(info);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 REPORTER_ASSERT(reporter, colorShader2.isOpaque()); 103 REPORTER_ASSERT(reporter, colorShader2.isOpaque());
104 SkColorShader colorShader3(SkColorSetARGB(0x7F,0,0,0)); 104 SkColorShader colorShader3(SkColorSetARGB(0x7F,0,0,0));
105 REPORTER_ASSERT(reporter, !colorShader3.isOpaque()); 105 REPORTER_ASSERT(reporter, !colorShader3.isOpaque());
106 } 106 }
107 107
108 DEF_TEST(ShaderOpacity, reporter) { 108 DEF_TEST(ShaderOpacity, reporter) {
109 test_gradient(reporter); 109 test_gradient(reporter);
110 test_color(reporter); 110 test_color(reporter);
111 test_bitmap(reporter); 111 test_bitmap(reporter);
112 } 112 }
OLDNEW
« no previous file with comments | « tests/SerializationTest.cpp ('k') | tests/WritePixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698