OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006-2012 The Android Open Source Project | 2 * Copyright 2006-2012 The Android Open Source Project |
3 * Copyright 2012 Mozilla Foundation | 3 * Copyright 2012 Mozilla Foundation |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 SkDEBUGFAIL("unsupported FT_Pixel_Mode for LCD16"); | 158 SkDEBUGFAIL("unsupported FT_Pixel_Mode for LCD16"); |
159 break; | 159 break; |
160 } | 160 } |
161 } | 161 } |
162 | 162 |
163 /** | 163 /** |
164 * Copies a FT_Bitmap into an SkMask with the same dimensions. | 164 * Copies a FT_Bitmap into an SkMask with the same dimensions. |
165 * | 165 * |
166 * Yes, No, Never Requested, Never Produced | 166 * Yes, No, Never Requested, Never Produced |
167 * | 167 * |
168 * kBW kA8 k3D kARGB32 kLCD16 kLCD32 | 168 * kBW kA8 k3D kARGB32 kLCD16 |
169 * FT_PIXEL_MODE_MONO Y Y NR N Y NR | 169 * FT_PIXEL_MODE_MONO Y Y NR N Y |
170 * FT_PIXEL_MODE_GRAY N Y NR N Y NR | 170 * FT_PIXEL_MODE_GRAY N Y NR N Y |
171 * FT_PIXEL_MODE_GRAY2 NP NP NR NP NP NR | 171 * FT_PIXEL_MODE_GRAY2 NP NP NR NP NP |
172 * FT_PIXEL_MODE_GRAY4 NP NP NR NP NP NR | 172 * FT_PIXEL_MODE_GRAY4 NP NP NR NP NP |
173 * FT_PIXEL_MODE_LCD NP NP NR NP NP NR | 173 * FT_PIXEL_MODE_LCD NP NP NR NP NP |
174 * FT_PIXEL_MODE_LCD_V NP NP NR NP NP NR | 174 * FT_PIXEL_MODE_LCD_V NP NP NR NP NP |
175 * FT_PIXEL_MODE_BGRA N N NR Y N NR | 175 * FT_PIXEL_MODE_BGRA N N NR Y N |
176 * | 176 * |
177 * TODO: All of these N need to be Y or otherwise ruled out. | 177 * TODO: All of these N need to be Y or otherwise ruled out. |
178 */ | 178 */ |
179 static void copyFTBitmap(const FT_Bitmap& srcFTBitmap, SkMask& dstMask) { | 179 static void copyFTBitmap(const FT_Bitmap& srcFTBitmap, SkMask& dstMask) { |
180 SkASSERT(dstMask.fBounds.width() == srcFTBitmap.width); | 180 SkASSERT(dstMask.fBounds.width() == srcFTBitmap.width); |
181 SkASSERT(dstMask.fBounds.height() == srcFTBitmap.rows); | 181 SkASSERT(dstMask.fBounds.height() == srcFTBitmap.rows); |
182 | 182 |
183 const uint8_t* src = reinterpret_cast<const uint8_t*>(srcFTBitmap.buffer); | 183 const uint8_t* src = reinterpret_cast<const uint8_t*>(srcFTBitmap.buffer); |
184 const FT_Pixel_Mode srcFormat = static_cast<FT_Pixel_Mode>(srcFTBitmap.pixel
_mode); | 184 const FT_Pixel_Mode srcFormat = static_cast<FT_Pixel_Mode>(srcFTBitmap.pixel
_mode); |
185 // FT_Bitmap::pitch is an int and allowed to be negative. | 185 // FT_Bitmap::pitch is an int and allowed to be negative. |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 556 |
557 FT_Error err = FT_Outline_Decompose(&face->glyph->outline, &funcs, path); | 557 FT_Error err = FT_Outline_Decompose(&face->glyph->outline, &funcs, path); |
558 | 558 |
559 if (err != 0) { | 559 if (err != 0) { |
560 path->reset(); | 560 path->reset(); |
561 return; | 561 return; |
562 } | 562 } |
563 | 563 |
564 path->close(); | 564 path->close(); |
565 } | 565 } |
OLD | NEW |