Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: tests/PDFPrimitivesTest.cpp

Issue 1933393002: Move SkTypeface to sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Restore deleted Android code. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/FontObjTest.cpp ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(GetResourceAsTypeface(resource)); 433 sk_sp<SkTypeface> noEmbedTypeface(MakeResourceAsTypeface(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
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 }
OLDNEW
« no previous file with comments | « tests/FontObjTest.cpp ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698