| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
| 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 "Resources.h" | 8 #include "Resources.h" |
| 9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 // Filter was used in rendering; should be visited. | 423 // Filter was used in rendering; should be visited. |
| 424 REPORTER_ASSERT(reporter, filter->visited()); | 424 REPORTER_ASSERT(reporter, filter->visited()); |
| 425 } | 425 } |
| 426 | 426 |
| 427 // Check that PDF rendering of image filters successfully falls back to | 427 // Check that PDF rendering of image filters successfully falls back to |
| 428 // CPU rasterization. | 428 // CPU rasterization. |
| 429 DEF_TEST(PDFFontCanEmbedTypeface, reporter) { | 429 DEF_TEST(PDFFontCanEmbedTypeface, reporter) { |
| 430 SkPDFCanon canon; | 430 SkPDFCanon canon; |
| 431 | 431 |
| 432 const char resource[] = "fonts/Roboto2-Regular_NoEmbed.ttf"; | 432 const char resource[] = "fonts/Roboto2-Regular_NoEmbed.ttf"; |
| 433 sk_sp<SkTypeface> noEmbedTypeface(MakeResourceAsTypeface(resource)); | 433 sk_sp<SkTypeface> noEmbedTypeface(GetResourceAsTypeface(resource)); |
| 434 if (noEmbedTypeface) { | 434 if (noEmbedTypeface) { |
| 435 REPORTER_ASSERT(reporter, | 435 REPORTER_ASSERT(reporter, |
| 436 !SkPDFFont::CanEmbedTypeface(noEmbedTypeface.get(), &can
on)); | 436 !SkPDFFont::CanEmbedTypeface(noEmbedTypeface.get(), &can
on)); |
| 437 } | 437 } |
| 438 sk_sp<SkTypeface> portableTypeface( | 438 sk_sp<SkTypeface> portableTypeface( |
| 439 sk_tool_utils::create_portable_typeface(NULL, SkTypeface::kNormal)); | 439 sk_tool_utils::create_portable_typeface(NULL, SkTypeface::kNormal)); |
| 440 REPORTER_ASSERT(reporter, | 440 REPORTER_ASSERT(reporter, |
| 441 SkPDFFont::CanEmbedTypeface(portableTypeface.get(), &canon))
; | 441 SkPDFFont::CanEmbedTypeface(portableTypeface.get(), &canon))
; |
| 442 } | 442 } |
| 443 | 443 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 float alwaysCheck[] = { | 482 float alwaysCheck[] = { |
| 483 0.0f, -0.0f, 1.0f, -1.0f, SK_ScalarPI, 0.1f, FLT_MIN, FLT_MAX, | 483 0.0f, -0.0f, 1.0f, -1.0f, SK_ScalarPI, 0.1f, FLT_MIN, FLT_MAX, |
| 484 -FLT_MIN, -FLT_MAX, FLT_MIN / 16.0f, -FLT_MIN / 16.0f, | 484 -FLT_MIN, -FLT_MAX, FLT_MIN / 16.0f, -FLT_MIN / 16.0f, |
| 485 SK_FloatNaN, SK_FloatInfinity, SK_FloatNegativeInfinity, | 485 SK_FloatNaN, SK_FloatInfinity, SK_FloatNegativeInfinity, |
| 486 -FLT_MIN / 8388608.0 | 486 -FLT_MIN / 8388608.0 |
| 487 }; | 487 }; |
| 488 for (float inputFloat: alwaysCheck) { | 488 for (float inputFloat: alwaysCheck) { |
| 489 check_pdf_scalar_serialization(reporter, inputFloat); | 489 check_pdf_scalar_serialization(reporter, inputFloat); |
| 490 } | 490 } |
| 491 } | 491 } |
| OLD | NEW |