Chromium Code Reviews| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 * FT_PIXEL_MODE_GRAY N Y NR N Y | 170 * FT_PIXEL_MODE_GRAY N Y NR N Y |
| 171 * FT_PIXEL_MODE_GRAY2 NP NP NR NP NP | 171 * FT_PIXEL_MODE_GRAY2 NP NP NR NP NP |
| 172 * FT_PIXEL_MODE_GRAY4 NP NP NR NP NP | 172 * FT_PIXEL_MODE_GRAY4 NP NP NR NP NP |
| 173 * FT_PIXEL_MODE_LCD NP NP NR NP NP | 173 * FT_PIXEL_MODE_LCD NP NP NR NP NP |
| 174 * FT_PIXEL_MODE_LCD_V NP NP NR NP NP | 174 * FT_PIXEL_MODE_LCD_V NP NP NR NP NP |
| 175 * FT_PIXEL_MODE_BGRA N N NR Y N | 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() == static_cast<int>(srcFTBitmap.width)); |
| 181 SkASSERT(dstMask.fBounds.height() == srcFTBitmap.rows); | 181 SkASSERT(dstMask.fBounds.height() == static_cast<int>(srcFTBitmap.rows)); |
|
sugoi1
2015/03/10 14:58:20
I had to also add this small fix (that's already i
| |
| 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. |
| 186 const int srcPitch = srcFTBitmap.pitch; | 186 const int srcPitch = srcFTBitmap.pitch; |
| 187 const size_t srcRowBytes = SkTAbs(srcPitch); | 187 const size_t srcRowBytes = SkTAbs(srcPitch); |
| 188 | 188 |
| 189 uint8_t* dst = dstMask.fImage; | 189 uint8_t* dst = dstMask.fImage; |
| 190 const SkMask::Format dstFormat = static_cast<SkMask::Format>(dstMask.fFormat ); | 190 const SkMask::Format dstFormat = static_cast<SkMask::Format>(dstMask.fFormat ); |
| 191 const size_t dstRowBytes = dstMask.fRowBytes; | 191 const size_t dstRowBytes = dstMask.fRowBytes; |
| (...skipping 364 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 |