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 "SkTypes.h" | 8 #include "SkTypes.h" |
9 #if defined(SK_BUILD_FOR_WIN32) | 9 #if defined(SK_BUILD_FOR_WIN32) |
10 | 10 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 | 198 |
199 // returns false if there is any non-90-rotation or skew | 199 // returns false if there is any non-90-rotation or skew |
200 static bool is_axis_aligned(const SkScalerContext::Rec& rec) { | 200 static bool is_axis_aligned(const SkScalerContext::Rec& rec) { |
201 return 0 == rec.fPreSkewX && | 201 return 0 == rec.fPreSkewX && |
202 (both_zero(rec.fPost2x2[0][1], rec.fPost2x2[1][0]) || | 202 (both_zero(rec.fPost2x2[0][1], rec.fPost2x2[1][0]) || |
203 both_zero(rec.fPost2x2[0][0], rec.fPost2x2[1][1])); | 203 both_zero(rec.fPost2x2[0][0], rec.fPost2x2[1][1])); |
204 } | 204 } |
205 | 205 |
206 SkScalerContext_DW::SkScalerContext_DW(DWriteFontTypeface* typeface, | 206 SkScalerContext_DW::SkScalerContext_DW(DWriteFontTypeface* typeface, |
| 207 const SkScalerContextEffects& effects, |
207 const SkDescriptor* desc) | 208 const SkDescriptor* desc) |
208 : SkScalerContext(typeface, desc) | 209 : SkScalerContext(typeface, effects, desc) |
209 , fTypeface(SkRef(typeface)) | 210 , fTypeface(SkRef(typeface)) |
210 , fGlyphCount(-1) { | 211 , fGlyphCount(-1) { |
211 | 212 |
212 // In general, all glyphs should use CLEARTYPE_NATURAL_SYMMETRIC | 213 // In general, all glyphs should use CLEARTYPE_NATURAL_SYMMETRIC |
213 // except when bi-level rendering is requested or there are embedded | 214 // except when bi-level rendering is requested or there are embedded |
214 // bi-level bitmaps (and the embedded bitmap flag is set and no rotation). | 215 // bi-level bitmaps (and the embedded bitmap flag is set and no rotation). |
215 // | 216 // |
216 // DirectWrite's IDWriteFontFace::GetRecommendedRenderingMode does not do | 217 // DirectWrite's IDWriteFontFace::GetRecommendedRenderingMode does not do |
217 // this. As a result, determine the actual size of the text and then see if | 218 // this. As a result, determine the actual size of the text and then see if |
218 // there are any embedded bi-level bitmaps of that size. If there are, then | 219 // there are any embedded bi-level bitmaps of that size. If there are, then |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 FALSE, //sideways | 774 FALSE, //sideways |
774 FALSE, //rtl | 775 FALSE, //rtl |
775 geometryToPath.get()), | 776 geometryToPath.get()), |
776 "Could not create glyph outline."); | 777 "Could not create glyph outline."); |
777 } | 778 } |
778 | 779 |
779 path->transform(fSkXform); | 780 path->transform(fSkXform); |
780 } | 781 } |
781 | 782 |
782 #endif//defined(SK_BUILD_FOR_WIN32) | 783 #endif//defined(SK_BUILD_FOR_WIN32) |
OLD | NEW |