LEFT | RIGHT |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
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 <vector> | 9 #include <vector> |
10 #ifdef SK_BUILD_FOR_MAC | 10 #ifdef SK_BUILD_FOR_MAC |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 fCGFont = CTFontCopyGraphicsFont(fCTFont, NULL); | 659 fCGFont = CTFontCopyGraphicsFont(fCTFont, NULL); |
660 if (fVertical) { | 660 if (fVertical) { |
661 CGAffineTransform rotateLeft = CGAffineTransformMake(0, -1, 1, 0, 0, 0); | 661 CGAffineTransform rotateLeft = CGAffineTransformMake(0, -1, 1, 0, 0, 0); |
662 transform = CGAffineTransformConcat(rotateLeft, transform); | 662 transform = CGAffineTransformConcat(rotateLeft, transform); |
663 fCTVerticalFont = CTFontCreateCopyWithAttributes(ctFont, unitFontSize, | 663 fCTVerticalFont = CTFontCreateCopyWithAttributes(ctFont, unitFontSize, |
664 &transform, NULL); | 664 &transform, NULL); |
665 fVerticalMatrix = fUnitMatrix; | 665 fVerticalMatrix = fUnitMatrix; |
666 if (isSnowLeopard()) { | 666 if (isSnowLeopard()) { |
667 SkScalar scale = SkScalarMul(fRec.fTextSize, getFontScale(fCGFont)); | 667 SkScalar scale = SkScalarMul(fRec.fTextSize, getFontScale(fCGFont)); |
668 fVerticalMatrix.preScale(scale, scale); | 668 fVerticalMatrix.preScale(scale, scale); |
669 } else { | 669 } else { |
670 fVerticalMatrix.preRotate(90); | 670 fVerticalMatrix.preRotate(SkIntToScalar(90)); |
671 } | 671 } |
672 } | 672 } |
673 fGlyphCount = SkToU16(numGlyphs); | 673 fGlyphCount = SkToU16(numGlyphs); |
674 fDoSubPosition = SkToBool(fRec.fFlags & kSubpixelPositioning_Flag); | 674 fDoSubPosition = SkToBool(fRec.fFlags & kSubpixelPositioning_Flag); |
675 } | 675 } |
676 | 676 |
677 SkScalerContext_Mac::~SkScalerContext_Mac() { | 677 SkScalerContext_Mac::~SkScalerContext_Mac() { |
678 delete[] fAdjustBad; | 678 delete[] fAdjustBad; |
679 CFSafeRelease(fCTFont); | 679 CFSafeRelease(fCTFont); |
680 CFSafeRelease(fCTVerticalFont); | 680 CFSafeRelease(fCTVerticalFont); |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1808 | 1808 |
1809 if (offset >= theSize) | 1809 if (offset >= theSize) |
1810 return 0; | 1810 return 0; |
1811 | 1811 |
1812 if ((offset + length) > theSize) | 1812 if ((offset + length) > theSize) |
1813 length = theSize - offset; | 1813 length = theSize - offset; |
1814 | 1814 |
1815 memcpy(data, CFDataGetBytePtr(cfData) + offset, length); | 1815 memcpy(data, CFDataGetBytePtr(cfData) + offset, length); |
1816 return(length); | 1816 return(length); |
1817 } | 1817 } |
LEFT | RIGHT |