| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkBBoxHierarchy.h" | 8 #include "SkBBoxHierarchy.h" |
| 9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 REPORTER_ASSERT(reporter, hasData->uniqueID() != SK_InvalidGenID); | 1109 REPORTER_ASSERT(reporter, hasData->uniqueID() != SK_InvalidGenID); |
| 1110 | 1110 |
| 1111 // both pictures should have different ids | 1111 // both pictures should have different ids |
| 1112 REPORTER_ASSERT(reporter, hasData->uniqueID() != empty->uniqueID()); | 1112 REPORTER_ASSERT(reporter, hasData->uniqueID() != empty->uniqueID()); |
| 1113 } | 1113 } |
| 1114 | 1114 |
| 1115 static void test_typeface(skiatest::Reporter* reporter) { | 1115 static void test_typeface(skiatest::Reporter* reporter) { |
| 1116 SkPictureRecorder recorder; | 1116 SkPictureRecorder recorder; |
| 1117 SkCanvas* canvas = recorder.beginRecording(10, 10); | 1117 SkCanvas* canvas = recorder.beginRecording(10, 10); |
| 1118 SkPaint paint; | 1118 SkPaint paint; |
| 1119 paint.setTypeface(SkTypeface::MakeFromName("Arial", SkTypeface::kItalic)); | 1119 paint.setTypeface(SkTypeface::MakeFromName("Arial", |
| 1120 SkFontStyle::FromOldStyle(SkTypef
ace::kItalic))); |
| 1120 canvas->drawText("Q", 1, 0, 10, paint); | 1121 canvas->drawText("Q", 1, 0, 10, paint); |
| 1121 sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture()); | 1122 sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture()); |
| 1122 SkDynamicMemoryWStream stream; | 1123 SkDynamicMemoryWStream stream; |
| 1123 picture->serialize(&stream); | 1124 picture->serialize(&stream); |
| 1124 } | 1125 } |
| 1125 | 1126 |
| 1126 DEF_TEST(Picture, reporter) { | 1127 DEF_TEST(Picture, reporter) { |
| 1127 test_typeface(reporter); | 1128 test_typeface(reporter); |
| 1128 #ifdef SK_DEBUG | 1129 #ifdef SK_DEBUG |
| 1129 test_deleting_empty_picture(); | 1130 test_deleting_empty_picture(); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 REPORTER_ASSERT(r, analyzer.suitableForGpuRasterization()); | 1377 REPORTER_ASSERT(r, analyzer.suitableForGpuRasterization()); |
| 1377 | 1378 |
| 1378 recorder.beginRecording(10, 10)->drawPicture(vetoPicture); | 1379 recorder.beginRecording(10, 10)->drawPicture(vetoPicture); |
| 1379 sk_sp<SkPicture> nestedVetoPicture(recorder.finishRecordingAsPicture()); | 1380 sk_sp<SkPicture> nestedVetoPicture(recorder.finishRecordingAsPicture()); |
| 1380 | 1381 |
| 1381 analyzer.analyze(nestedVetoPicture.get()); | 1382 analyzer.analyze(nestedVetoPicture.get()); |
| 1382 REPORTER_ASSERT(r, !analyzer.suitableForGpuRasterization()); | 1383 REPORTER_ASSERT(r, !analyzer.suitableForGpuRasterization()); |
| 1383 } | 1384 } |
| 1384 | 1385 |
| 1385 #endif // SK_SUPPORT_GPU | 1386 #endif // SK_SUPPORT_GPU |
| OLD | NEW |