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 #ifndef SkPaint_DEFINED | 8 #ifndef SkPaint_DEFINED |
9 #define SkPaint_DEFINED | 9 #define SkPaint_DEFINED |
10 | 10 |
11 #include "SkColor.h" | 11 #include "SkColor.h" |
12 #include "SkDrawLooper.h" | |
13 #include "SkFilterQuality.h" | 12 #include "SkFilterQuality.h" |
14 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
15 #include "SkXfermode.h" | 14 #include "SkXfermode.h" |
16 | 15 |
17 class SkAnnotation; | 16 class SkAnnotation; |
18 class SkAutoDescriptor; | 17 class SkAutoDescriptor; |
19 class SkAutoGlyphCache; | 18 class SkAutoGlyphCache; |
20 class SkColorFilter; | 19 class SkColorFilter; |
21 class SkData; | 20 class SkData; |
22 class SkDescriptor; | 21 class SkDescriptor; |
| 22 class SkDrawLooper; |
23 class SkReadBuffer; | 23 class SkReadBuffer; |
24 class SkWriteBuffer; | 24 class SkWriteBuffer; |
25 class SkGlyph; | 25 class SkGlyph; |
26 struct SkRect; | 26 struct SkRect; |
27 class SkGlyphCache; | 27 class SkGlyphCache; |
28 class SkImageFilter; | 28 class SkImageFilter; |
29 class SkMaskFilter; | 29 class SkMaskFilter; |
30 class SkPath; | 30 class SkPath; |
31 class SkPathEffect; | 31 class SkPathEffect; |
32 struct SkPoint; | 32 struct SkPoint; |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 // mean that we need not draw at all (e.g. SrcOver + 0-alpha) | 902 // mean that we need not draw at all (e.g. SrcOver + 0-alpha) |
903 bool nothingToDraw() const; | 903 bool nothingToDraw() const; |
904 | 904 |
905 /////////////////////////////////////////////////////////////////////////// | 905 /////////////////////////////////////////////////////////////////////////// |
906 // would prefer to make these private... | 906 // would prefer to make these private... |
907 | 907 |
908 /** Returns true if the current paint settings allow for fast computation of | 908 /** Returns true if the current paint settings allow for fast computation of |
909 bounds (i.e. there is nothing complex like a patheffect that would make | 909 bounds (i.e. there is nothing complex like a patheffect that would make |
910 the bounds computation expensive. | 910 the bounds computation expensive. |
911 */ | 911 */ |
912 bool canComputeFastBounds() const { | 912 bool canComputeFastBounds() const; |
913 if (this->getLooper()) { | |
914 return this->getLooper()->canComputeFastBounds(*this); | |
915 } | |
916 return !this->getRasterizer(); | |
917 } | |
918 | 913 |
919 /** Only call this if canComputeFastBounds() returned true. This takes a | 914 /** Only call this if canComputeFastBounds() returned true. This takes a |
920 raw rectangle (the raw bounds of a shape), and adjusts it for stylistic | 915 raw rectangle (the raw bounds of a shape), and adjusts it for stylistic |
921 effects in the paint (e.g. stroking). If needed, it uses the storage | 916 effects in the paint (e.g. stroking). If needed, it uses the storage |
922 rect parameter. It returns the adjusted bounds that can then be used | 917 rect parameter. It returns the adjusted bounds that can then be used |
923 for quickReject tests. | 918 for quickReject tests. |
924 | 919 |
925 The returned rect will either be orig or storage, thus the caller | 920 The returned rect will either be orig or storage, thus the caller |
926 should not rely on storage being set to the result, but should always | 921 should not rely on storage being set to the result, but should always |
927 use the retured value. It is legal for orig and storage to be the same | 922 use the retured value. It is legal for orig and storage to be the same |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 friend class GrStencilAndCoverTextContext; | 1089 friend class GrStencilAndCoverTextContext; |
1095 friend class GrPathRendering; | 1090 friend class GrPathRendering; |
1096 friend class GrTextContext; | 1091 friend class GrTextContext; |
1097 friend class GrGLPathRendering; | 1092 friend class GrGLPathRendering; |
1098 friend class SkScalerContext; | 1093 friend class SkScalerContext; |
1099 friend class SkTextToPathIter; | 1094 friend class SkTextToPathIter; |
1100 friend class SkCanonicalizePaint; | 1095 friend class SkCanonicalizePaint; |
1101 }; | 1096 }; |
1102 | 1097 |
1103 #endif | 1098 #endif |
OLD | NEW |