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 <cmath> | 8 #include <cmath> |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkGeometry.h" | 10 #include "SkGeometry.h" |
(...skipping 4018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4029 REPORTER_ASSERT(reporter, a != b); | 4029 REPORTER_ASSERT(reporter, a != b); |
4030 a.reset(); | 4030 a.reset(); |
4031 a.lineTo(1, 2); | 4031 a.lineTo(1, 2); |
4032 REPORTER_ASSERT(reporter, a == b); | 4032 REPORTER_ASSERT(reporter, a == b); |
4033 } | 4033 } |
4034 | 4034 |
4035 static void compare_dump(skiatest::Reporter* reporter, const SkPath& path, bool
force, | 4035 static void compare_dump(skiatest::Reporter* reporter, const SkPath& path, bool
force, |
4036 bool dumpAsHex, const char* str) { | 4036 bool dumpAsHex, const char* str) { |
4037 SkDynamicMemoryWStream wStream; | 4037 SkDynamicMemoryWStream wStream; |
4038 path.dump(&wStream, force, dumpAsHex); | 4038 path.dump(&wStream, force, dumpAsHex); |
4039 SkAutoDataUnref data(wStream.copyToData()); | 4039 sk_sp<SkData> data(wStream.copyToData()); |
4040 REPORTER_ASSERT(reporter, data->size() == strlen(str)); | 4040 REPORTER_ASSERT(reporter, data->size() == strlen(str)); |
4041 if (strlen(str) > 0) { | 4041 if (strlen(str) > 0) { |
4042 REPORTER_ASSERT(reporter, !memcmp(data->data(), str, strlen(str))); | 4042 REPORTER_ASSERT(reporter, !memcmp(data->data(), str, strlen(str))); |
4043 } else { | 4043 } else { |
4044 REPORTER_ASSERT(reporter, data->data() == nullptr || !memcmp(data->data(
), str, strlen(str))); | 4044 REPORTER_ASSERT(reporter, data->data() == nullptr || !memcmp(data->data(
), str, strlen(str))); |
4045 } | 4045 } |
4046 } | 4046 } |
4047 | 4047 |
4048 static void test_dump(skiatest::Reporter* reporter) { | 4048 static void test_dump(skiatest::Reporter* reporter) { |
4049 SkPath p; | 4049 SkPath p; |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4378 PathTest_Private::TestPathTo(reporter); | 4378 PathTest_Private::TestPathTo(reporter); |
4379 PathRefTest_Private::TestPathRef(reporter); | 4379 PathRefTest_Private::TestPathRef(reporter); |
4380 PathTest_Private::TestPathrefListeners(reporter); | 4380 PathTest_Private::TestPathrefListeners(reporter); |
4381 test_dump(reporter); | 4381 test_dump(reporter); |
4382 test_path_crbug389050(reporter); | 4382 test_path_crbug389050(reporter); |
4383 test_path_crbugskia2820(reporter); | 4383 test_path_crbugskia2820(reporter); |
4384 test_skbug_3469(reporter); | 4384 test_skbug_3469(reporter); |
4385 test_skbug_3239(reporter); | 4385 test_skbug_3239(reporter); |
4386 test_bounds_crbug_513799(reporter); | 4386 test_bounds_crbug_513799(reporter); |
4387 } | 4387 } |
OLD | NEW |