OLD | NEW |
1 | 1 |
2 | 2 |
3 /* | 3 /* |
4 * Copyright 2006 The Android Open Source Project | 4 * Copyright 2006 The Android Open Source Project |
5 * | 5 * |
6 * Use of this source code is governed by a BSD-style license that can be | 6 * Use of this source code is governed by a BSD-style license that can be |
7 * found in the LICENSE file. | 7 * found in the LICENSE file. |
8 */ | 8 */ |
9 | 9 |
10 | 10 |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 } | 973 } |
974 return matrix; | 974 return matrix; |
975 } | 975 } |
976 | 976 |
977 SkMatrix* setTextMatrix(SkMatrix* matrix) const { | 977 SkMatrix* setTextMatrix(SkMatrix* matrix) const { |
978 return SetTextMatrix(matrix, fTextSize, fTextScaleX, fTextSkewX); | 978 return SetTextMatrix(matrix, fTextSize, fTextScaleX, fTextSkewX); |
979 } | 979 } |
980 | 980 |
981 SkDEVCODE(void toString(SkString*) const;) | 981 SkDEVCODE(void toString(SkString*) const;) |
982 | 982 |
983 struct FlatteningTraits { | |
984 static void Flatten(SkWriteBuffer& buffer, const SkPaint& paint); | |
985 static void Unflatten(SkReadBuffer& buffer, SkPaint* paint); | |
986 }; | |
987 | |
988 private: | 983 private: |
989 SkTypeface* fTypeface; | 984 SkTypeface* fTypeface; |
990 SkScalar fTextSize; | 985 SkScalar fTextSize; |
991 SkScalar fTextScaleX; | 986 SkScalar fTextScaleX; |
992 SkScalar fTextSkewX; | 987 SkScalar fTextSkewX; |
993 | 988 |
994 SkPathEffect* fPathEffect; | 989 SkPathEffect* fPathEffect; |
995 SkShader* fShader; | 990 SkShader* fShader; |
996 SkXfermode* fXfermode; | 991 SkXfermode* fXfermode; |
997 SkMaskFilter* fMaskFilter; | 992 SkMaskFilter* fMaskFilter; |
998 SkColorFilter* fColorFilter; | 993 SkColorFilter* fColorFilter; |
999 SkRasterizer* fRasterizer; | 994 SkRasterizer* fRasterizer; |
1000 SkDrawLooper* fLooper; | 995 SkDrawLooper* fLooper; |
1001 SkImageFilter* fImageFilter; | 996 SkImageFilter* fImageFilter; |
1002 SkAnnotation* fAnnotation; | 997 SkAnnotation* fAnnotation; |
1003 | 998 |
1004 SkColor fColor; | 999 SkColor fColor; |
1005 SkScalar fWidth; | 1000 SkScalar fWidth; |
1006 SkScalar fMiterLimit; | 1001 SkScalar fMiterLimit; |
1007 | 1002 // all of these bitfields should add up to 32 |
1008 union { | 1003 unsigned fFlags : 16; |
1009 struct { | 1004 unsigned fTextAlign : 2; |
1010 // all of these bitfields should add up to 32 | 1005 unsigned fCapType : 2; |
1011 unsigned fFlags : 16; | 1006 unsigned fJoinType : 2; |
1012 unsigned fTextAlign : 2; | 1007 unsigned fStyle : 2; |
1013 unsigned fCapType : 2; | 1008 unsigned fTextEncoding : 2; // 3 values |
1014 unsigned fJoinType : 2; | 1009 unsigned fHinting : 2; |
1015 unsigned fStyle : 2; | 1010 //unsigned fFreeBits : 4; |
1016 unsigned fTextEncoding : 2; // 3 values | |
1017 unsigned fHinting : 2; | |
1018 //unsigned fFreeBits : 4; | |
1019 }; | |
1020 uint32_t fBitfields; | |
1021 }; | |
1022 uint32_t getBitfields() const { return fBitfields; } | |
1023 void setBitfields(uint32_t bitfields); | |
1024 | |
1025 uint32_t fDirtyBits; | |
1026 | 1011 |
1027 | 1012 |
1028 SkDrawCacheProc getDrawCacheProc() const; | 1013 SkDrawCacheProc getDrawCacheProc() const; |
1029 SkMeasureCacheProc getMeasureCacheProc(TextBufferDirection dir, | 1014 SkMeasureCacheProc getMeasureCacheProc(TextBufferDirection dir, |
1030 bool needFullMetrics) const; | 1015 bool needFullMetrics) const; |
1031 | 1016 |
1032 SkScalar measure_text(SkGlyphCache*, const char* text, size_t length, | 1017 SkScalar measure_text(SkGlyphCache*, const char* text, size_t length, |
1033 int* count, SkRect* bounds) const; | 1018 int* count, SkRect* bounds) const; |
1034 | 1019 |
1035 SkGlyphCache* detachCache(const SkDeviceProperties* deviceProperties, const
SkMatrix*) const; | 1020 SkGlyphCache* detachCache(const SkDeviceProperties* deviceProperties, const
SkMatrix*) const; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 #ifdef SK_BUILD_FOR_ANDROID | 1079 #ifdef SK_BUILD_FOR_ANDROID |
1095 SkPaintOptionsAndroid fPaintOptionsAndroid; | 1080 SkPaintOptionsAndroid fPaintOptionsAndroid; |
1096 | 1081 |
1097 // In order for the == operator to work properly this must be the last field | 1082 // In order for the == operator to work properly this must be the last field |
1098 // in the struct so that we can do a memcmp to this field's offset. | 1083 // in the struct so that we can do a memcmp to this field's offset. |
1099 uint32_t fGenerationID; | 1084 uint32_t fGenerationID; |
1100 #endif | 1085 #endif |
1101 }; | 1086 }; |
1102 | 1087 |
1103 #endif | 1088 #endif |
OLD | NEW |