diff options
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPaint.h | 21 | ||||
-rw-r--r-- | include/core/SkScalerContext.h | 7 |
2 files changed, 22 insertions, 6 deletions
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h index eb5611bef9..9073e2049e 100644 --- a/include/core/SkPaint.h +++ b/include/core/SkPaint.h @@ -99,14 +99,15 @@ public: kLCDRenderText_Flag = 0x200, //!< mask to enable subpixel glyph renderering kEmbeddedBitmapText_Flag = 0x400, //!< mask to enable embedded bitmap strikes kAutoHinting_Flag = 0x800, //!< mask to force Freetype's autohinter + kVerticalText_Flag = 0x1000, // experimental/private - kForceAAText_Flag = 0x1000, + kForceAAText_Flag = 0x2000, // when adding extra flags, note that the fFlags member is specified // with a bit-width and you'll have to expand it. - kAllFlags = 0x1FFF + kAllFlags = 0x2FFF }; /** Return the paint's flags. Use the Flag enum to test flag values. @@ -203,6 +204,20 @@ public: */ void setAutohinted(bool useAutohinter); + bool isVerticalText() const { + return SkToBool(this->getFlags() & kVerticalText_Flag); + } + + /** + * Helper for setting or clearing the kVerticalText_Flag bit in + * setFlags(...). + * + * If this bit is set, then advances are treated as Y values rather than + * X values, and drawText will places its glyphs vertically rather than + * horizontally. + */ + void setVerticalText(bool); + /** Helper for getFlags(), returning true if kUnderlineText_Flag bit is set @return true if the underlineText bit is set in the paint's flags. */ @@ -847,7 +862,7 @@ private: SkColor fColor; SkScalar fWidth; SkScalar fMiterLimit; - unsigned fFlags : 13; + unsigned fFlags : 14; unsigned fTextAlign : 2; unsigned fCapType : 2; unsigned fJoinType : 2; diff --git a/include/core/SkScalerContext.h b/include/core/SkScalerContext.h index 71826e8b45..c9fb83b2c4 100644 --- a/include/core/SkScalerContext.h +++ b/include/core/SkScalerContext.h @@ -171,13 +171,14 @@ public: kEmbolden_Flag = 0x80, kSubpixelPositioning_Flag = 0x100, kAutohinting_Flag = 0x200, + kVertical_Flag = 0x400, // these should only ever be set if fMaskFormat is LCD16 or LCD32 - kLCD_Vertical_Flag = 0x400, // else Horizontal - kLCD_BGROrder_Flag = 0x800, // else RGB order + kLCD_Vertical_Flag = 0x0800, // else Horizontal + kLCD_BGROrder_Flag = 0x1000, // else RGB order // experimental - kForceAA_Flag = 0x1000 + kForceAA_Flag = 0x2000 }; private: enum { |