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 "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 Loading... |
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 Loading... |
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 } |
OLD | NEW |