| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 #define __STDC_LIMIT_MACROS | 7 #define __STDC_LIMIT_MACROS |
| 8 | 8 |
| 9 #include "SkDraw.h" | 9 #include "SkDraw.h" |
| 10 #include "SkBlitter.h" | 10 #include "SkBlitter.h" |
| (...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 SkMask mask; | 1497 SkMask mask; |
| 1498 | 1498 |
| 1499 left += glyph.fLeft; | 1499 left += glyph.fLeft; |
| 1500 top += glyph.fTop; | 1500 top += glyph.fTop; |
| 1501 | 1501 |
| 1502 mask.fBounds.set(left, top, left + glyph.fWidth, top + glyph.fHeight); | 1502 mask.fBounds.set(left, top, left + glyph.fWidth, top + glyph.fHeight); |
| 1503 SkRegion::Cliperator clipper(*state.fClip, mask.fBounds); | 1503 SkRegion::Cliperator clipper(*state.fClip, mask.fBounds); |
| 1504 | 1504 |
| 1505 if (!clipper.done()) { | 1505 if (!clipper.done()) { |
| 1506 const SkIRect& cr = clipper.rect(); | 1506 const SkIRect& cr = clipper.rect(); |
| 1507 const uint8_t* aa = (const uint8_t*)glyph.fImage; | 1507 const uint8_t* aa = (uint8_t*)state.fCache->findImage(glyph); |
| 1508 if (nullptr == aa) { | 1508 if (nullptr == aa) { |
| 1509 aa = (uint8_t*)state.fCache->findImage(glyph); | 1509 return; |
| 1510 if (nullptr == aa) { | |
| 1511 return; | |
| 1512 } | |
| 1513 } | 1510 } |
| 1514 | 1511 |
| 1515 mask.fRowBytes = glyph.rowBytes(); | 1512 mask.fRowBytes = glyph.rowBytes(); |
| 1516 mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat); | 1513 mask.fFormat = static_cast<SkMask::Format>(glyph.fMaskFormat); |
| 1517 mask.fImage = (uint8_t*)aa; | 1514 mask.fImage = (uint8_t*)aa; |
| 1518 do { | 1515 do { |
| 1519 state.blitMask(mask, cr); | 1516 state.blitMask(mask, cr); |
| 1520 clipper.next(); | 1517 clipper.next(); |
| 1521 } while (!clipper.done()); | 1518 } while (!clipper.done()); |
| 1522 } | 1519 } |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2258 mask->fImage = SkMask::AllocImage(size); | 2255 mask->fImage = SkMask::AllocImage(size); |
| 2259 memset(mask->fImage, 0, mask->computeImageSize()); | 2256 memset(mask->fImage, 0, mask->computeImageSize()); |
| 2260 } | 2257 } |
| 2261 | 2258 |
| 2262 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2259 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
| 2263 draw_into_mask(*mask, devPath, style); | 2260 draw_into_mask(*mask, devPath, style); |
| 2264 } | 2261 } |
| 2265 | 2262 |
| 2266 return true; | 2263 return true; |
| 2267 } | 2264 } |
| OLD | NEW |