Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: include/core/SkPaint.h

Issue 193163003: Enable use of distance fields via SkPaint flag. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change HACK to TEMP Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/gpu.gypi ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 kStrikeThruText_Flag = 0x10, //!< mask to enable strike-thru text 111 kStrikeThruText_Flag = 0x10, //!< mask to enable strike-thru text
112 kFakeBoldText_Flag = 0x20, //!< mask to enable fake-bold text 112 kFakeBoldText_Flag = 0x20, //!< mask to enable fake-bold text
113 kLinearText_Flag = 0x40, //!< mask to enable linear-text 113 kLinearText_Flag = 0x40, //!< mask to enable linear-text
114 kSubpixelText_Flag = 0x80, //!< mask to enable subpixel text positi oning 114 kSubpixelText_Flag = 0x80, //!< mask to enable subpixel text positi oning
115 kDevKernText_Flag = 0x100, //!< mask to enable device kerning text 115 kDevKernText_Flag = 0x100, //!< mask to enable device kerning text
116 kLCDRenderText_Flag = 0x200, //!< mask to enable subpixel glyph rende rering 116 kLCDRenderText_Flag = 0x200, //!< mask to enable subpixel glyph rende rering
117 kEmbeddedBitmapText_Flag = 0x400, //!< mask to enable embedded bitmap st rikes 117 kEmbeddedBitmapText_Flag = 0x400, //!< mask to enable embedded bitmap st rikes
118 kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter 118 kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter
119 kVerticalText_Flag = 0x1000, 119 kVerticalText_Flag = 0x1000,
120 kGenA8FromLCD_Flag = 0x2000, // hack for GDI -- do not use if you can help it 120 kGenA8FromLCD_Flag = 0x2000, // hack for GDI -- do not use if you can help it
121 kDistanceFieldTextTEMP_Flag = 0x4000, //!< TEMPORARY mask to enable dist ance fields
122 // currently overrides LCD and sub pixel rendering
121 // when adding extra flags, note that the fFlags member is specified 123 // when adding extra flags, note that the fFlags member is specified
122 // with a bit-width and you'll have to expand it. 124 // with a bit-width and you'll have to expand it.
123 125
124 kAllFlags = 0xFFFF 126 kAllFlags = 0xFFFF
125 }; 127 };
126 128
127 /** Return the paint's flags. Use the Flag enum to test flag values. 129 /** Return the paint's flags. Use the Flag enum to test flag values.
128 @return the paint's flags (see enums ending in _Flag for bit masks) 130 @return the paint's flags (see enums ending in _Flag for bit masks)
129 */ 131 */
130 uint32_t getFlags() const { return fFlags; } 132 uint32_t getFlags() const { return fFlags; }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 bool isDevKernText() const { 279 bool isDevKernText() const {
278 return SkToBool(this->getFlags() & kDevKernText_Flag); 280 return SkToBool(this->getFlags() & kDevKernText_Flag);
279 } 281 }
280 282
281 /** Helper for setFlags(), setting or clearing the kKernText_Flag bit 283 /** Helper for setFlags(), setting or clearing the kKernText_Flag bit
282 @param kernText true to set the kKernText_Flag bit in the paint's 284 @param kernText true to set the kKernText_Flag bit in the paint's
283 flags, false to clear it. 285 flags, false to clear it.
284 */ 286 */
285 void setDevKernText(bool devKernText); 287 void setDevKernText(bool devKernText);
286 288
289 /** Helper for getFlags(), returns true if kDistanceFieldTextTEMP_Flag bit i s set
290 @return true if the distanceFieldText bit is set in the paint's flags.
291 */
292 bool isDistanceFieldTextTEMP() const {
293 return SkToBool(this->getFlags() & kDistanceFieldTextTEMP_Flag);
294 }
295
296 /** Helper for setFlags(), setting or clearing the kDistanceFieldTextTEMP_Fl ag bit
297 @param distanceFieldText true to set the kDistanceFieldTextTEMP_Flag bit in the paint's
298 flags, false to clear it.
299 */
300 void setDistanceFieldTextTEMP(bool distanceFieldText);
301
287 enum FilterLevel { 302 enum FilterLevel {
288 kNone_FilterLevel, 303 kNone_FilterLevel,
289 kLow_FilterLevel, 304 kLow_FilterLevel,
290 kMedium_FilterLevel, 305 kMedium_FilterLevel,
291 kHigh_FilterLevel 306 kHigh_FilterLevel
292 }; 307 };
293 308
294 /** 309 /**
295 * Return the filter level. This affects the quality (and performance) of 310 * Return the filter level. This affects the quality (and performance) of
296 * drawing scaled images. 311 * drawing scaled images.
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 unsigned fHinting : 2; 1071 unsigned fHinting : 2;
1057 //unsigned fFreeBits : 4; 1072 //unsigned fFreeBits : 4;
1058 }; 1073 };
1059 uint32_t fBitfields; 1074 uint32_t fBitfields;
1060 }; 1075 };
1061 uint32_t getBitfields() const { return fBitfields; } 1076 uint32_t getBitfields() const { return fBitfields; }
1062 void setBitfields(uint32_t bitfields); 1077 void setBitfields(uint32_t bitfields);
1063 1078
1064 uint32_t fDirtyBits; 1079 uint32_t fDirtyBits;
1065 1080
1066
1067 SkDrawCacheProc getDrawCacheProc() const; 1081 SkDrawCacheProc getDrawCacheProc() const;
1068 SkMeasureCacheProc getMeasureCacheProc(TextBufferDirection dir, 1082 SkMeasureCacheProc getMeasureCacheProc(TextBufferDirection dir,
1069 bool needFullMetrics) const; 1083 bool needFullMetrics) const;
1070 1084
1071 SkScalar measure_text(SkGlyphCache*, const char* text, size_t length, 1085 SkScalar measure_text(SkGlyphCache*, const char* text, size_t length,
1072 int* count, SkRect* bounds) const; 1086 int* count, SkRect* bounds) const;
1073 1087
1074 SkGlyphCache* detachCache(const SkDeviceProperties* deviceProperties, const SkMatrix*) const; 1088 SkGlyphCache* detachCache(const SkDeviceProperties* deviceProperties, const SkMatrix*) const;
1075 1089
1076 void descriptorProc(const SkDeviceProperties* deviceProperties, const SkMatr ix* deviceMatrix, 1090 void descriptorProc(const SkDeviceProperties* deviceProperties, const SkMatr ix* deviceMatrix,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 #ifdef SK_BUILD_FOR_ANDROID 1147 #ifdef SK_BUILD_FOR_ANDROID
1134 SkPaintOptionsAndroid fPaintOptionsAndroid; 1148 SkPaintOptionsAndroid fPaintOptionsAndroid;
1135 1149
1136 // In order for the == operator to work properly this must be the last field 1150 // In order for the == operator to work properly this must be the last field
1137 // in the struct so that we can do a memcmp to this field's offset. 1151 // in the struct so that we can do a memcmp to this field's offset.
1138 uint32_t fGenerationID; 1152 uint32_t fGenerationID;
1139 #endif 1153 #endif
1140 }; 1154 };
1141 1155
1142 #endif 1156 #endif
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698