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 |
11 #ifndef SkPaint_DEFINED | 11 #ifndef SkPaint_DEFINED |
12 #define SkPaint_DEFINED | 12 #define SkPaint_DEFINED |
13 | 13 |
14 #include "SkColor.h" | 14 #include "SkColor.h" |
15 #include "SkDrawLooper.h" | 15 #include "SkDrawLooper.h" |
16 #include "SkMatrix.h" | 16 #include "SkMatrix.h" |
17 #include "SkXfermode.h" | 17 #include "SkXfermode.h" |
18 #ifdef SK_BUILD_FOR_ANDROID | |
19 #include "SkPaintOptionsAndroid.h" | |
20 #endif | |
21 | 18 |
22 class SkAnnotation; | 19 class SkAnnotation; |
23 class SkAutoGlyphCache; | 20 class SkAutoGlyphCache; |
24 class SkColorFilter; | 21 class SkColorFilter; |
25 class SkDescriptor; | 22 class SkDescriptor; |
26 struct SkDeviceProperties; | 23 struct SkDeviceProperties; |
27 class SkReadBuffer; | 24 class SkReadBuffer; |
28 class SkWriteBuffer; | 25 class SkWriteBuffer; |
29 struct SkGlyph; | 26 struct SkGlyph; |
30 struct SkRect; | 27 struct SkRect; |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 */ | 931 */ |
935 void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y, | 932 void getTextPath(const void* text, size_t length, SkScalar x, SkScalar y, |
936 SkPath* path) const; | 933 SkPath* path) const; |
937 | 934 |
938 void getPosTextPath(const void* text, size_t length, | 935 void getPosTextPath(const void* text, size_t length, |
939 const SkPoint pos[], SkPath* path) const; | 936 const SkPoint pos[], SkPath* path) const; |
940 | 937 |
941 #ifdef SK_BUILD_FOR_ANDROID | 938 #ifdef SK_BUILD_FOR_ANDROID |
942 uint32_t getGenerationID() const; | 939 uint32_t getGenerationID() const; |
943 void setGenerationID(uint32_t generationID); | 940 void setGenerationID(uint32_t generationID); |
944 | |
945 const SkPaintOptionsAndroid& getPaintOptionsAndroid() const { | |
946 return fPaintOptionsAndroid; | |
947 } | |
948 void setPaintOptionsAndroid(const SkPaintOptionsAndroid& options); | |
949 #endif | 941 #endif |
950 | 942 |
951 // returns true if the paint's settings (e.g. xfermode + alpha) resolve to | 943 // returns true if the paint's settings (e.g. xfermode + alpha) resolve to |
952 // mean that we need not draw at all (e.g. SrcOver + 0-alpha) | 944 // mean that we need not draw at all (e.g. SrcOver + 0-alpha) |
953 bool nothingToDraw() const; | 945 bool nothingToDraw() const; |
954 | 946 |
955 /////////////////////////////////////////////////////////////////////////// | 947 /////////////////////////////////////////////////////////////////////////// |
956 // would prefer to make these private... | 948 // would prefer to make these private... |
957 | 949 |
958 /** Returns true if the current paint settings allow for fast computation of | 950 /** Returns true if the current paint settings allow for fast computation of |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 friend class SkDraw; | 1123 friend class SkDraw; |
1132 friend class SkGraphics; // So Term() can be called. | 1124 friend class SkGraphics; // So Term() can be called. |
1133 friend class SkPDFDevice; | 1125 friend class SkPDFDevice; |
1134 friend class GrBitmapTextContext; | 1126 friend class GrBitmapTextContext; |
1135 friend class GrDistanceFieldTextContext; | 1127 friend class GrDistanceFieldTextContext; |
1136 friend class GrStencilAndCoverTextContext; | 1128 friend class GrStencilAndCoverTextContext; |
1137 friend class SkTextToPathIter; | 1129 friend class SkTextToPathIter; |
1138 friend class SkCanonicalizePaint; | 1130 friend class SkCanonicalizePaint; |
1139 | 1131 |
1140 #ifdef SK_BUILD_FOR_ANDROID | 1132 #ifdef SK_BUILD_FOR_ANDROID |
1141 SkPaintOptionsAndroid fPaintOptionsAndroid; | |
1142 | |
1143 // In order for the == operator to work properly this must be the last field | 1133 // In order for the == operator to work properly this must be the last field |
1144 // in the struct so that we can do a memcmp to this field's offset. | 1134 // in the struct so that we can do a memcmp to this field's offset. |
1145 uint32_t fGenerationID; | 1135 uint32_t fGenerationID; |
1146 #endif | 1136 #endif |
1147 }; | 1137 }; |
1148 | 1138 |
1149 #endif | 1139 #endif |
OLD | NEW |