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 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 */ | 282 */ |
283 void setDevKernText(bool devKernText); | 283 void setDevKernText(bool devKernText); |
284 | 284 |
285 /** | 285 /** |
286 * Return the filter level. This affects the quality (and performance) of | 286 * Return the filter level. This affects the quality (and performance) of |
287 * drawing scaled images. | 287 * drawing scaled images. |
288 */ | 288 */ |
289 SkFilterQuality getFilterQuality() const { | 289 SkFilterQuality getFilterQuality() const { |
290 return (SkFilterQuality)fBitfields.fFilterQuality; | 290 return (SkFilterQuality)fBitfields.fFilterQuality; |
291 } | 291 } |
292 | 292 |
293 /** | 293 /** |
294 * Set the filter quality. This affects the quality (and performance) of | 294 * Set the filter quality. This affects the quality (and performance) of |
295 * drawing scaled images. | 295 * drawing scaled images. |
296 */ | 296 */ |
297 void setFilterQuality(SkFilterQuality quality); | 297 void setFilterQuality(SkFilterQuality quality); |
298 | 298 |
299 /** Styles apply to rect, oval, path, and text. | 299 /** Styles apply to rect, oval, path, and text. |
300 Bitmaps are always drawn in "fill", and lines are always drawn in | 300 Bitmaps are always drawn in "fill", and lines are always drawn in |
301 "stroke". | 301 "stroke". |
302 | 302 |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 void (*proc)(SkTypeface*, const SkDescriptor*, void*), | 1039 void (*proc)(SkTypeface*, const SkDescriptor*, void*), |
1040 void* context, bool ignoreGamma) const; | 1040 void* context, bool ignoreGamma) const; |
1041 | 1041 |
1042 /* | 1042 /* |
1043 * The luminance color is used to determine which Gamma Canonical color to m
ap to. This is | 1043 * The luminance color is used to determine which Gamma Canonical color to m
ap to. This is |
1044 * really only used by backends which want to cache glyph masks, and need so
me way to know if | 1044 * really only used by backends which want to cache glyph masks, and need so
me way to know if |
1045 * they need to generate new masks based off a given color. | 1045 * they need to generate new masks based off a given color. |
1046 */ | 1046 */ |
1047 SkColor computeLuminanceColor() const; | 1047 SkColor computeLuminanceColor() const; |
1048 | 1048 |
| 1049 static void Term(); |
| 1050 |
1049 enum { | 1051 enum { |
1050 /* This is the size we use when we ask for a glyph's path. We then | 1052 /* This is the size we use when we ask for a glyph's path. We then |
1051 * post-transform it as we draw to match the request. | 1053 * post-transform it as we draw to match the request. |
1052 * This is done to try to re-use cache entries for the path. | 1054 * This is done to try to re-use cache entries for the path. |
1053 * | 1055 * |
1054 * This value is somewhat arbitrary. In theory, it could be 1, since | 1056 * This value is somewhat arbitrary. In theory, it could be 1, since |
1055 * we store paths as floats. However, we get the path from the font | 1057 * we store paths as floats. However, we get the path from the font |
1056 * scaler, and it may represent its paths as fixed-point (or 26.6), | 1058 * scaler, and it may represent its paths as fixed-point (or 26.6), |
1057 * so we shouldn't ask for something too big (might overflow 16.16) | 1059 * so we shouldn't ask for something too big (might overflow 16.16) |
1058 * or too small (underflow 26.6). | 1060 * or too small (underflow 26.6). |
(...skipping 22 matching lines...) Expand all Loading... |
1081 static SkScalar MaxCacheSize2() { | 1083 static SkScalar MaxCacheSize2() { |
1082 static const SkScalar kMaxSize = SkIntToScalar(kMaxSizeForGlyphCache); | 1084 static const SkScalar kMaxSize = SkIntToScalar(kMaxSizeForGlyphCache); |
1083 static const SkScalar kMag2Max = kMaxSize * kMaxSize; | 1085 static const SkScalar kMag2Max = kMaxSize * kMaxSize; |
1084 return kMag2Max; | 1086 return kMag2Max; |
1085 } | 1087 } |
1086 | 1088 |
1087 friend class SkAutoGlyphCache; | 1089 friend class SkAutoGlyphCache; |
1088 friend class SkAutoGlyphCacheNoGamma; | 1090 friend class SkAutoGlyphCacheNoGamma; |
1089 friend class SkCanvas; | 1091 friend class SkCanvas; |
1090 friend class SkDraw; | 1092 friend class SkDraw; |
| 1093 friend class SkGraphics; // So Term() can be called. |
1091 friend class SkPDFDevice; | 1094 friend class SkPDFDevice; |
1092 friend class GrBitmapTextContext; | 1095 friend class GrBitmapTextContext; |
1093 friend class GrAtlasTextContext; | 1096 friend class GrAtlasTextContext; |
1094 friend class GrDistanceFieldTextContext; | 1097 friend class GrDistanceFieldTextContext; |
1095 friend class GrStencilAndCoverTextContext; | 1098 friend class GrStencilAndCoverTextContext; |
1096 friend class GrPathRendering; | 1099 friend class GrPathRendering; |
1097 friend class GrTextContext; | 1100 friend class GrTextContext; |
1098 friend class GrGLPathRendering; | 1101 friend class GrGLPathRendering; |
1099 friend class SkScalerContext; | 1102 friend class SkScalerContext; |
1100 friend class SkTextToPathIter; | 1103 friend class SkTextToPathIter; |
1101 friend class SkCanonicalizePaint; | 1104 friend class SkCanonicalizePaint; |
1102 }; | 1105 }; |
1103 | 1106 |
1104 #endif | 1107 #endif |
OLD | NEW |