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 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1631 SkPaint paint(origPaint); | 1631 SkPaint paint(origPaint); |
1632 SkScalar matrixScale = paint.setupForAsPaths(); | 1632 SkScalar matrixScale = paint.setupForAsPaths(); |
1633 | 1633 |
1634 SkMatrix matrix; | 1634 SkMatrix matrix; |
1635 matrix.setScale(matrixScale, matrixScale); | 1635 matrix.setScale(matrixScale, matrixScale); |
1636 | 1636 |
1637 // Temporarily jam in kFill, so we only ever ask for the raw outline from th
e cache. | 1637 // Temporarily jam in kFill, so we only ever ask for the raw outline from th
e cache. |
1638 paint.setStyle(SkPaint::kFill_Style); | 1638 paint.setStyle(SkPaint::kFill_Style); |
1639 paint.setPathEffect(nullptr); | 1639 paint.setPathEffect(nullptr); |
1640 | 1640 |
1641 SkPaint::GlyphCacheProc glyphCacheProc = paint.getGlyphCacheProc(true); | 1641 SkPaint::GlyphCacheProc glyphCacheProc = SkPaint::GetGlyphCacheProc(paint.ge
tTextEncoding(), |
| 1642 paint.is
DevKernText(), |
| 1643 true); |
1642 SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->scalerContextF
lags(), nullptr); | 1644 SkAutoGlyphCache cache(paint, &fDevice->surfaceProps(), this->scalerContextF
lags(), nullptr); |
1643 | 1645 |
1644 const char* stop = text + byteLength; | 1646 const char* stop = text + byteLength; |
1645 SkTextAlignProc alignProc(paint.getTextAlign()); | 1647 SkTextAlignProc alignProc(paint.getTextAlign()); |
1646 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition); | 1648 SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition); |
1647 | 1649 |
1648 // Now restore the original settings, so we "draw" with whatever style/strok
ing. | 1650 // Now restore the original settings, so we "draw" with whatever style/strok
ing. |
1649 paint.setStyle(origPaint.getStyle()); | 1651 paint.setStyle(origPaint.getStyle()); |
1650 paint.setPathEffect(sk_ref_sp(origPaint.getPathEffect())); | 1652 paint.setPathEffect(sk_ref_sp(origPaint.getPathEffect())); |
1651 | 1653 |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2105 mask->fImage = SkMask::AllocImage(size); | 2107 mask->fImage = SkMask::AllocImage(size); |
2106 memset(mask->fImage, 0, mask->computeImageSize()); | 2108 memset(mask->fImage, 0, mask->computeImageSize()); |
2107 } | 2109 } |
2108 | 2110 |
2109 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2111 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2110 draw_into_mask(*mask, devPath, style); | 2112 draw_into_mask(*mask, devPath, style); |
2111 } | 2113 } |
2112 | 2114 |
2113 return true; | 2115 return true; |
2114 } | 2116 } |
OLD | NEW |