aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Leon Scroggins <scroggo@google.com>2017-02-17 22:48:51 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-17 22:49:03 +0000
commite005edd3a5deb602beec59f59cdc8b14d3764d58 (patch)
tree79f88cfdeebefb4eb201853ecd72e04a53ee96ca /include
parentcc3c2ed9940e408b3155c073825ae9e1ca3387c5 (diff)
Revert "hide deprecated underline and strikethru"
This reverts commit a01bf9ab748836fc4bf271bd5024151bf1ce2e88. Reason for revert: Breaking Android merge. They access setUnderlineText on their <shudder> subclass of SkPaint. Original change's description: > hide deprecated underline and strikethru > > BUG=skia:6250 > > Change-Id: I85395e4960b16ab91237a74ff35e5b7588965512 > Reviewed-on: https://skia-review.googlesource.com/8600 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Mike Reed <reed@google.com> > TBR=bungeman@google.com,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6250 Change-Id: If55f69f061dc4439ca2faa62807a9c5694ebbeb4 Reviewed-on: https://skia-review.googlesource.com/8687 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/core/SkPaint.h33
1 files changed, 21 insertions, 12 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index f4b6db98c8..7a42238319 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -101,6 +101,8 @@ public:
enum Flags {
kAntiAlias_Flag = 0x01, //!< mask to enable antialiasing
kDither_Flag = 0x04, //!< mask to enable dithering
+ kUnderlineText_Flag = 0x08, //!< mask to enable underline text
+ kStrikeThruText_Flag = 0x10, //!< mask to enable strike-thru text
kFakeBoldText_Flag = 0x20, //!< mask to enable fake-bold text
kLinearText_Flag = 0x40, //!< mask to enable linear-text
kSubpixelText_Flag = 0x80, //!< mask to enable subpixel text positioning
@@ -113,12 +115,7 @@ public:
// when adding extra flags, note that the fFlags member is specified
// with a bit-width and you'll have to expand it.
- kAllFlags = 0xFFFF,
-
-#ifdef SK_SUPPORT_LEGACY_PAINT_TEXTDECORATION
- kUnderlineText_Flag = 0x08,
- kStrikeThruText_Flag = 0x10,
-#endif
+ kAllFlags = 0xFFFF
};
/** Return the paint's flags. Use the Flag enum to test flag values.
@@ -232,16 +229,28 @@ public:
/** Helper for getFlags(), returning true if kUnderlineText_Flag bit is set
@return true if the underlineText bit is set in the paint's flags.
*/
-#ifdef SK_SUPPORT_LEGACY_PAINT_TEXTDECORATION
- bool isUnderlineText() const { return false; }
-#endif
+ bool isUnderlineText() const {
+ return SkToBool(this->getFlags() & kUnderlineText_Flag);
+ }
+
+ /** Helper for setFlags(), setting or clearing the kUnderlineText_Flag bit
+ @param underlineText true to set the underlineText bit in the paint's
+ flags, false to clear it.
+ */
+ void setUnderlineText(bool underlineText);
/** Helper for getFlags(), returns true if kStrikeThruText_Flag bit is set
@return true if the strikeThruText bit is set in the paint's flags.
*/
-#ifdef SK_SUPPORT_LEGACY_PAINT_TEXTDECORATION
- bool isStrikeThruText() const { return false; }
-#endif
+ bool isStrikeThruText() const {
+ return SkToBool(this->getFlags() & kStrikeThruText_Flag);
+ }
+
+ /** Helper for setFlags(), setting or clearing the kStrikeThruText_Flag bit
+ @param strikeThruText true to set the strikeThruText bit in the
+ paint's flags, false to clear it.
+ */
+ void setStrikeThruText(bool strikeThruText);
/** Helper for getFlags(), returns true if kFakeBoldText_Flag bit is set
@return true if the kFakeBoldText_Flag bit is set in the paint's flags.