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 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 | 1608 |
1609 SkPaint::GlyphCacheProc glyphCacheProc = paint.getGlyphCacheProc(true); | 1609 SkPaint::GlyphCacheProc glyphCacheProc = paint.getGlyphCacheProc(true); |
1610 SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->fakeGam
ma(), nullptr); | 1610 SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->fakeGam
ma(), nullptr); |
1611 | 1611 |
1612 const char* stop = text + byteLength; | 1612 const char* stop = text + byteLength; |
1613 SkTextAlignProc alignProc(paint.getTextAlign()); | 1613 SkTextAlignProc alignProc(paint.getTextAlign()); |
1614 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition); | 1614 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition); |
1615 | 1615 |
1616 // Now restore the original settings, so we "draw" with whatever style/strok
ing. | 1616 // Now restore the original settings, so we "draw" with whatever style/strok
ing. |
1617 paint.setStyle(origPaint.getStyle()); | 1617 paint.setStyle(origPaint.getStyle()); |
1618 paint.setPathEffect(origPaint.getPathEffect()); | 1618 paint.setPathEffect(sk_ref_sp(origPaint.getPathEffect())); |
1619 | 1619 |
1620 while (text < stop) { | 1620 while (text < stop) { |
1621 const SkGlyph& glyph = glyphCacheProc(cache.get(), &text); | 1621 const SkGlyph& glyph = glyphCacheProc(cache.get(), &text); |
1622 if (glyph.fWidth) { | 1622 if (glyph.fWidth) { |
1623 const SkPath* path = cache->findPath(glyph); | 1623 const SkPath* path = cache->findPath(glyph); |
1624 if (path) { | 1624 if (path) { |
1625 SkPoint tmsLoc; | 1625 SkPoint tmsLoc; |
1626 tmsProc(pos, &tmsLoc); | 1626 tmsProc(pos, &tmsLoc); |
1627 SkPoint loc; | 1627 SkPoint loc; |
1628 alignProc(tmsLoc, glyph, &loc); | 1628 alignProc(tmsLoc, glyph, &loc); |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2071 mask->fImage = SkMask::AllocImage(size); | 2071 mask->fImage = SkMask::AllocImage(size); |
2072 memset(mask->fImage, 0, mask->computeImageSize()); | 2072 memset(mask->fImage, 0, mask->computeImageSize()); |
2073 } | 2073 } |
2074 | 2074 |
2075 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2075 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2076 draw_into_mask(*mask, devPath, style); | 2076 draw_into_mask(*mask, devPath, style); |
2077 } | 2077 } |
2078 | 2078 |
2079 return true; | 2079 return true; |
2080 } | 2080 } |
OLD | NEW |