OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "Test.h" | 8 #include "Test.h" |
9 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
11 #include "SkLayerDrawLooper.h" | 11 #include "SkLayerDrawLooper.h" |
12 #include "SkBlurMaskFilter.h" | 12 #include "SkBlurMaskFilter.h" |
13 | 13 |
14 // temparary api for bicubic, just be sure we can set/clear it | 14 // temparary api for bicubic, just be sure we can set/clear it |
15 static void test_bicubic(skiatest::Reporter* reporter) { | 15 static void test_bicubic(skiatest::Reporter* reporter) { |
16 SkPaint p0; | 16 SkPaint p0; |
17 REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitma p_Flag)); | 17 REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kHighQualityFilterB itmap_Flag)); |
reed1
2013/06/18 20:21:21
I suggest (in SkPaint.h) that this change is unnec
humper
2013/06/19 20:49:26
I made one an alias of the other, so I will revert
| |
18 p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag); | 18 p0.setFlags(p0.getFlags() | SkPaint::kHighQualityFilterBitmap_Flag); |
19 REPORTER_ASSERT(reporter, 0 != (p0.getFlags() & SkPaint::kBicubicFilterBitma p_Flag)); | 19 REPORTER_ASSERT(reporter, 0 != (p0.getFlags() & SkPaint::kHighQualityFilterB itmap_Flag)); |
20 SkPaint p1(p0); | 20 SkPaint p1(p0); |
21 REPORTER_ASSERT(reporter, 0 != (p1.getFlags() & SkPaint::kBicubicFilterBitma p_Flag)); | 21 REPORTER_ASSERT(reporter, 0 != (p1.getFlags() & SkPaint::kHighQualityFilterB itmap_Flag)); |
22 p0.reset(); | 22 p0.reset(); |
23 REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitma p_Flag)); | 23 REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kHighQualityFilterB itmap_Flag)); |
24 p0 = p1; | 24 p0 = p1; |
25 p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag); | 25 p0.setFlags(p0.getFlags() | SkPaint::kHighQualityFilterBitmap_Flag); |
26 } | 26 } |
27 | 27 |
28 static void test_copy(skiatest::Reporter* reporter) { | 28 static void test_copy(skiatest::Reporter* reporter) { |
29 SkPaint paint; | 29 SkPaint paint; |
30 // set a few member variables | 30 // set a few member variables |
31 paint.setStyle(SkPaint::kStrokeAndFill_Style); | 31 paint.setStyle(SkPaint::kStrokeAndFill_Style); |
32 paint.setTextAlign(SkPaint::kLeft_Align); | 32 paint.setTextAlign(SkPaint::kLeft_Align); |
33 paint.setStrokeWidth(SkIntToScalar(2)); | 33 paint.setStrokeWidth(SkIntToScalar(2)); |
34 // set a few pointers | 34 // set a few pointers |
35 SkLayerDrawLooper* looper = new SkLayerDrawLooper(); | 35 SkLayerDrawLooper* looper = new SkLayerDrawLooper(); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 | 131 |
132 // regression tests | 132 // regression tests |
133 regression_cubic(reporter); | 133 regression_cubic(reporter); |
134 regression_measureText(reporter); | 134 regression_measureText(reporter); |
135 | 135 |
136 test_bicubic(reporter); | 136 test_bicubic(reporter); |
137 } | 137 } |
138 | 138 |
139 #include "TestClassDef.h" | 139 #include "TestClassDef.h" |
140 DEFINE_TESTCLASS("Paint", TestPaintClass, TestPaint) | 140 DEFINE_TESTCLASS("Paint", TestPaintClass, TestPaint) |
OLD | NEW |