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 | 7 |
8 #include "SkDraw.h" | 8 #include "SkDraw.h" |
9 #include "SkBlitter.h" | 9 #include "SkBlitter.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 SkTextMapStateProc tmsProc(*fMatrix, offset, scalarsPerPosition); | 1745 SkTextMapStateProc tmsProc(*fMatrix, offset, scalarsPerPosition); |
1746 | 1746 |
1747 if (cache->isSubpixel()) { | 1747 if (cache->isSubpixel()) { |
1748 // maybe we should skip the rounding if linearText is set | 1748 // maybe we should skip the rounding if linearText is set |
1749 SkAxisAlignment baseline = SkComputeAxisAlignmentForHText(*fMatrix); | 1749 SkAxisAlignment baseline = SkComputeAxisAlignmentForHText(*fMatrix); |
1750 | 1750 |
1751 SkFixed fxMask = ~0; | 1751 SkFixed fxMask = ~0; |
1752 SkFixed fyMask = ~0; | 1752 SkFixed fyMask = ~0; |
1753 if (kX_SkAxisAlignment == baseline) { | 1753 if (kX_SkAxisAlignment == baseline) { |
1754 fyMask = 0; | 1754 fyMask = 0; |
1755 #ifndef SK_IGNORE_SUBPIXEL_AXIS_ALIGN_FIX | |
1756 d1g.fHalfSampleY = SK_FixedHalf; | 1755 d1g.fHalfSampleY = SK_FixedHalf; |
1757 #endif | |
1758 } else if (kY_SkAxisAlignment == baseline) { | 1756 } else if (kY_SkAxisAlignment == baseline) { |
1759 fxMask = 0; | 1757 fxMask = 0; |
1760 #ifndef SK_IGNORE_SUBPIXEL_AXIS_ALIGN_FIX | |
1761 d1g.fHalfSampleX = SK_FixedHalf; | 1758 d1g.fHalfSampleX = SK_FixedHalf; |
1762 #endif | |
1763 } | 1759 } |
1764 | 1760 |
1765 if (SkPaint::kLeft_Align == paint.getTextAlign()) { | 1761 if (SkPaint::kLeft_Align == paint.getTextAlign()) { |
1766 while (text < stop) { | 1762 while (text < stop) { |
1767 SkPoint tmsLoc; | 1763 SkPoint tmsLoc; |
1768 tmsProc(pos, &tmsLoc); | 1764 tmsProc(pos, &tmsLoc); |
1769 SkFixed fx = SkScalarToFixed(tmsLoc.fX) + d1g.fHalfSampleX; | 1765 SkFixed fx = SkScalarToFixed(tmsLoc.fX) + d1g.fHalfSampleX; |
1770 SkFixed fy = SkScalarToFixed(tmsLoc.fY) + d1g.fHalfSampleY; | 1766 SkFixed fy = SkScalarToFixed(tmsLoc.fY) + d1g.fHalfSampleY; |
1771 | 1767 |
1772 const SkGlyph& glyph = glyphCacheProc(cache, &text, | 1768 const SkGlyph& glyph = glyphCacheProc(cache, &text, |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2378 mask->fImage = SkMask::AllocImage(size); | 2374 mask->fImage = SkMask::AllocImage(size); |
2379 memset(mask->fImage, 0, mask->computeImageSize()); | 2375 memset(mask->fImage, 0, mask->computeImageSize()); |
2380 } | 2376 } |
2381 | 2377 |
2382 if (SkMask::kJustComputeBounds_CreateMode != mode) { | 2378 if (SkMask::kJustComputeBounds_CreateMode != mode) { |
2383 draw_into_mask(*mask, devPath, style); | 2379 draw_into_mask(*mask, devPath, style); |
2384 } | 2380 } |
2385 | 2381 |
2386 return true; | 2382 return true; |
2387 } | 2383 } |
OLD | NEW |