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 |
983 private: | 988 private: |
984 SkTypeface* fTypeface; | 989 SkTypeface* fTypeface; |
985 SkScalar fTextSize; | 990 SkScalar fTextSize; |
986 SkScalar fTextScaleX; | 991 SkScalar fTextScaleX; |
987 SkScalar fTextSkewX; | 992 SkScalar fTextSkewX; |
988 | 993 |
989 SkPathEffect* fPathEffect; | 994 SkPathEffect* fPathEffect; |
990 SkShader* fShader; | 995 SkShader* fShader; |
991 SkXfermode* fXfermode; | 996 SkXfermode* fXfermode; |
992 SkMaskFilter* fMaskFilter; | 997 SkMaskFilter* fMaskFilter; |
993 SkColorFilter* fColorFilter; | 998 SkColorFilter* fColorFilter; |
994 SkRasterizer* fRasterizer; | 999 SkRasterizer* fRasterizer; |
995 SkDrawLooper* fLooper; | 1000 SkDrawLooper* fLooper; |
996 SkImageFilter* fImageFilter; | 1001 SkImageFilter* fImageFilter; |
997 SkAnnotation* fAnnotation; | 1002 SkAnnotation* fAnnotation; |
998 | 1003 |
999 SkColor fColor; | 1004 SkColor fColor; |
1000 SkScalar fWidth; | 1005 SkScalar fWidth; |
1001 SkScalar fMiterLimit; | 1006 SkScalar fMiterLimit; |
1002 // all of these bitfields should add up to 32 | 1007 |
1003 unsigned fFlags : 16; | 1008 union { |
1004 unsigned fTextAlign : 2; | 1009 struct { |
1005 unsigned fCapType : 2; | 1010 // all of these bitfields should add up to 32 |
1006 unsigned fJoinType : 2; | 1011 unsigned fFlags : 16; |
1007 unsigned fStyle : 2; | 1012 unsigned fTextAlign : 2; |
1008 unsigned fTextEncoding : 2; // 3 values | 1013 unsigned fCapType : 2; |
1009 unsigned fHinting : 2; | 1014 unsigned fJoinType : 2; |
1010 //unsigned fFreeBits : 4; | 1015 unsigned fStyle : 2; |
| 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; |
1011 | 1026 |
1012 | 1027 |
1013 SkDrawCacheProc getDrawCacheProc() const; | 1028 SkDrawCacheProc getDrawCacheProc() const; |
1014 SkMeasureCacheProc getMeasureCacheProc(TextBufferDirection dir, | 1029 SkMeasureCacheProc getMeasureCacheProc(TextBufferDirection dir, |
1015 bool needFullMetrics) const; | 1030 bool needFullMetrics) const; |
1016 | 1031 |
1017 SkScalar measure_text(SkGlyphCache*, const char* text, size_t length, | 1032 SkScalar measure_text(SkGlyphCache*, const char* text, size_t length, |
1018 int* count, SkRect* bounds) const; | 1033 int* count, SkRect* bounds) const; |
1019 | 1034 |
1020 SkGlyphCache* detachCache(const SkDeviceProperties* deviceProperties, const
SkMatrix*) const; | 1035 SkGlyphCache* detachCache(const SkDeviceProperties* deviceProperties, const
SkMatrix*) const; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 #ifdef SK_BUILD_FOR_ANDROID | 1094 #ifdef SK_BUILD_FOR_ANDROID |
1080 SkPaintOptionsAndroid fPaintOptionsAndroid; | 1095 SkPaintOptionsAndroid fPaintOptionsAndroid; |
1081 | 1096 |
1082 // In order for the == operator to work properly this must be the last field | 1097 // In order for the == operator to work properly this must be the last field |
1083 // in the struct so that we can do a memcmp to this field's offset. | 1098 // in the struct so that we can do a memcmp to this field's offset. |
1084 uint32_t fGenerationID; | 1099 uint32_t fGenerationID; |
1085 #endif | 1100 #endif |
1086 }; | 1101 }; |
1087 | 1102 |
1088 #endif | 1103 #endif |
OLD | NEW |