| OLD | NEW |
| 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 "Test.h" | 8 #include "Test.h" |
| 9 #include "SkPath.h" | 9 #include "SkPath.h" |
| 10 #include "SkPaint.h" | 10 #include "SkPaint.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 REPORTER_ASSERT(reporter, NGLYPHS == first); | 103 REPORTER_ASSERT(reporter, NGLYPHS == first); |
| 104 } else { | 104 } else { |
| 105 REPORTER_ASSERT(reporter, NGLYPHS > first); | 105 REPORTER_ASSERT(reporter, NGLYPHS > first); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 // temparary api for bicubic, just be sure we can set/clear it | 111 // temparary api for bicubic, just be sure we can set/clear it |
| 112 static void test_bicubic(skiatest::Reporter* reporter) { | 112 static void test_bicubic(skiatest::Reporter* reporter) { |
| 113 #if 0 |
| 113 SkPaint p0; | 114 SkPaint p0; |
| 114 REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitma
p_Flag)); | 115 REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitma
p_Flag)); |
| 115 p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag); | 116 p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag); |
| 116 REPORTER_ASSERT(reporter, 0 != (p0.getFlags() & SkPaint::kBicubicFilterBitma
p_Flag)); | 117 REPORTER_ASSERT(reporter, 0 != (p0.getFlags() & SkPaint::kBicubicFilterBitma
p_Flag)); |
| 117 SkPaint p1(p0); | 118 SkPaint p1(p0); |
| 118 REPORTER_ASSERT(reporter, 0 != (p1.getFlags() & SkPaint::kBicubicFilterBitma
p_Flag)); | 119 REPORTER_ASSERT(reporter, 0 != (p1.getFlags() & SkPaint::kBicubicFilterBitma
p_Flag)); |
| 119 p0.reset(); | 120 p0.reset(); |
| 120 REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitma
p_Flag)); | 121 REPORTER_ASSERT(reporter, 0 == (p0.getFlags() & SkPaint::kBicubicFilterBitma
p_Flag)); |
| 121 p0 = p1; | 122 p0 = p1; |
| 122 p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag); | 123 p0.setFlags(p0.getFlags() | SkPaint::kBicubicFilterBitmap_Flag); |
| 124 #endif |
| 123 } | 125 } |
| 124 | 126 |
| 125 static void test_copy(skiatest::Reporter* reporter) { | 127 static void test_copy(skiatest::Reporter* reporter) { |
| 126 SkPaint paint; | 128 SkPaint paint; |
| 127 // set a few member variables | 129 // set a few member variables |
| 128 paint.setStyle(SkPaint::kStrokeAndFill_Style); | 130 paint.setStyle(SkPaint::kStrokeAndFill_Style); |
| 129 paint.setTextAlign(SkPaint::kLeft_Align); | 131 paint.setTextAlign(SkPaint::kLeft_Align); |
| 130 paint.setStrokeWidth(SkIntToScalar(2)); | 132 paint.setStrokeWidth(SkIntToScalar(2)); |
| 131 // set a few pointers | 133 // set a few pointers |
| 132 SkLayerDrawLooper* looper = new SkLayerDrawLooper(); | 134 SkLayerDrawLooper* looper = new SkLayerDrawLooper(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 236 |
| 235 // need to implement charsToGlyphs on other backends (e.g. linux, win) | 237 // need to implement charsToGlyphs on other backends (e.g. linux, win) |
| 236 // before we can run this tests everywhere | 238 // before we can run this tests everywhere |
| 237 if (false) { | 239 if (false) { |
| 238 test_cmap(reporter); | 240 test_cmap(reporter); |
| 239 } | 241 } |
| 240 } | 242 } |
| 241 | 243 |
| 242 #include "TestClassDef.h" | 244 #include "TestClassDef.h" |
| 243 DEFINE_TESTCLASS("Paint", TestPaintClass, TestPaint) | 245 DEFINE_TESTCLASS("Paint", TestPaintClass, TestPaint) |
| OLD | NEW |