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

Side by Side Diff: tests/FontHostStreamTest.cpp

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Android fix + nit fix Created 4 years, 6 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 | « src/utils/SkWhitelistTypefaces.cpp ('k') | tests/FontHostTest.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 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 return true; 63 return true;
64 } 64 }
65 65
66 DEF_TEST(FontHostStream, reporter) { 66 DEF_TEST(FontHostStream, reporter) {
67 { 67 {
68 SkPaint paint; 68 SkPaint paint;
69 paint.setColor(SK_ColorGRAY); 69 paint.setColor(SK_ColorGRAY);
70 paint.setTextSize(SkIntToScalar(30)); 70 paint.setTextSize(SkIntToScalar(30));
71 71
72 paint.setTypeface(SkTypeface::MakeFromName("Georgia", SkTypeface::kNorma l)); 72 paint.setTypeface(SkTypeface::MakeFromName("Georgia", SkFontStyle()));
73 73
74 SkIRect origRect = SkIRect::MakeWH(64, 64); 74 SkIRect origRect = SkIRect::MakeWH(64, 64);
75 SkBitmap origBitmap; 75 SkBitmap origBitmap;
76 create(&origBitmap, origRect); 76 create(&origBitmap, origRect);
77 SkCanvas origCanvas(origBitmap); 77 SkCanvas origCanvas(origBitmap);
78 78
79 SkIRect streamRect = SkIRect::MakeWH(64, 64); 79 SkIRect streamRect = SkIRect::MakeWH(64, 64);
80 SkBitmap streamBitmap; 80 SkBitmap streamBitmap;
81 create(&streamBitmap, streamRect); 81 create(&streamBitmap, streamRect);
82 SkCanvas streamCanvas(streamBitmap); 82 SkCanvas streamCanvas(streamBitmap);
(...skipping 18 matching lines...) Expand all
101 paint.setTypeface(streamTypeface); 101 paint.setTypeface(streamTypeface);
102 drawBG(&streamCanvas); 102 drawBG(&streamCanvas);
103 streamCanvas.drawPosText("A", 1, &point, paint); 103 streamCanvas.drawPosText("A", 1, &point, paint);
104 104
105 REPORTER_ASSERT(reporter, 105 REPORTER_ASSERT(reporter,
106 compare(origBitmap, origRect, streamBitmap, streamRect)) ; 106 compare(origBitmap, origRect, streamBitmap, streamRect)) ;
107 } 107 }
108 //Make sure the typeface is deleted and removed. 108 //Make sure the typeface is deleted and removed.
109 SkGraphics::PurgeFontCache(); 109 SkGraphics::PurgeFontCache();
110 } 110 }
OLDNEW
« no previous file with comments | « src/utils/SkWhitelistTypefaces.cpp ('k') | tests/FontHostTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698