aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-11 17:07:15 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-03-11 17:07:15 +0000
commitb97c3ffddf15ac65a0aae6823eb408b3b2772751 (patch)
tree7c567fc3d98c3c7b5bfcaf6164543023b0a9c556 /include/core
parent8065ec50f1937c1562810bfe2b216abfb98362b3 (diff)
Enable use of distance fields via SkPaint flag.
Now that distance field generation is fast enough to make it practical, this makes distances field fonts easily available to anyone who wants to try them out (i.e Chromium). BUG=skia:2173 R=reed@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/193163003 git-svn-id: http://skia.googlecode.com/svn/trunk@13741 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkPaint.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 7d553ec8e0..2b30a7cda5 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -118,6 +118,8 @@ public:
kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter
kVerticalText_Flag = 0x1000,
kGenA8FromLCD_Flag = 0x2000, // hack for GDI -- do not use if you can help it
+ kDistanceFieldTextTEMP_Flag = 0x4000, //!< TEMPORARY mask to enable distance fields
+ // currently overrides LCD and subpixel rendering
// when adding extra flags, note that the fFlags member is specified
// with a bit-width and you'll have to expand it.
@@ -284,6 +286,19 @@ public:
*/
void setDevKernText(bool devKernText);
+ /** Helper for getFlags(), returns true if kDistanceFieldTextTEMP_Flag bit is set
+ @return true if the distanceFieldText bit is set in the paint's flags.
+ */
+ bool isDistanceFieldTextTEMP() const {
+ return SkToBool(this->getFlags() & kDistanceFieldTextTEMP_Flag);
+ }
+
+ /** Helper for setFlags(), setting or clearing the kDistanceFieldTextTEMP_Flag bit
+ @param distanceFieldText true to set the kDistanceFieldTextTEMP_Flag bit in the paint's
+ flags, false to clear it.
+ */
+ void setDistanceFieldTextTEMP(bool distanceFieldText);
+
enum FilterLevel {
kNone_FilterLevel,
kLow_FilterLevel,
@@ -1063,7 +1078,6 @@ private:
uint32_t fDirtyBits;
-
SkDrawCacheProc getDrawCacheProc() const;
SkMeasureCacheProc getMeasureCacheProc(TextBufferDirection dir,
bool needFullMetrics) const;