aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@google.com>2014-10-20 12:54:31 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-20 12:54:31 -0700
commit802ad83dca2efd57fde6c7ba666555ea78b5324c (patch)
treede3ef90d0e9906ee2c16388b58e17e12976d833b /include
parent43b8b36b20ae00e2d78421c4cda1f3f922983a20 (diff)
Revert of Replace SkTypeface::Style with SkFontStyle. (patchset #9 id:160001 of https://codereview.chromium.org/488143002/)
Reason for revert: CrOS GM failures: [*] 2 ExpectationsMismatch: fontmgr_iter_565.png fontmgr_iter_8888.png Original issue's description: > Replace SkTypeface::Style with SkFontStyle. > > Committed: https://skia.googlesource.com/skia/+/43b8b36b20ae00e2d78421c4cda1f3f922983a20 TBR=reed@google.com,bungeman@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/667023002
Diffstat (limited to 'include')
-rw-r--r--include/core/SkTypeface.h31
-rw-r--r--include/ports/SkFontStyle.h (renamed from include/core/SkFontStyle.h)2
2 files changed, 11 insertions, 22 deletions
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h
index f7af5d2b61..a080d84bd8 100644
--- a/include/core/SkTypeface.h
+++ b/include/core/SkTypeface.h
@@ -11,7 +11,6 @@
#define SkTypeface_DEFINED
#include "SkAdvancedTypefaceMetrics.h"
-#include "SkFontStyle.h"
#include "SkWeakRefCnt.h"
class SkDescriptor;
@@ -50,25 +49,17 @@ public:
kBoldItalic = 0x03
};
- /** Returns the typeface's intrinsic style attributes. */
- SkFontStyle fontStyle() const {
- return fStyle;
- }
-
- /** Returns the typeface's intrinsic style attributes.
- * @deprecated use fontStyle() instead.
- */
- Style style() const {
- return static_cast<Style>(
- (fStyle.weight() >= SkFontStyle::kSemiBold_Weight ? kBold : kNormal) |
- (fStyle.slant() != SkFontStyle::kUpright_Slant ? kItalic : kNormal));
- }
+ /** Returns the typeface's intrinsic style attributes
+ */
+ Style style() const { return fStyle; }
- /** Returns true if style() has the kBold bit set. */
- bool isBold() const { return fStyle.weight() >= SkFontStyle::kSemiBold_Weight; }
+ /** Returns true if getStyle() has the kBold bit set.
+ */
+ bool isBold() const { return (fStyle & kBold) != 0; }
- /** Returns true if style() has the kItalic bit set. */
- bool isItalic() const { return fStyle.slant() != SkFontStyle::kUpright_Slant; }
+ /** Returns true if getStyle() has the kItalic bit set.
+ */
+ bool isItalic() const { return (fStyle & kItalic) != 0; }
/** Returns true if the typeface claims to be fixed-pitch.
* This is a style bit, advance widths may vary even if this returns true.
@@ -294,7 +285,7 @@ public:
protected:
/** uniqueID must be unique and non-zero
*/
- SkTypeface(const SkFontStyle& style, SkFontID uniqueID, bool isFixedPitch = false);
+ SkTypeface(Style style, SkFontID uniqueID, bool isFixedPitch = false);
virtual ~SkTypeface();
/** Sets the fixedPitch bit. If used, must be called in the constructor. */
@@ -360,7 +351,7 @@ private:
static void DeleteDefault(SkTypeface*);
SkFontID fUniqueID;
- SkFontStyle fStyle;
+ Style fStyle;
bool fIsFixedPitch;
friend class SkPaint;
diff --git a/include/core/SkFontStyle.h b/include/ports/SkFontStyle.h
index f42d7dd470..9d9a912d7d 100644
--- a/include/core/SkFontStyle.h
+++ b/include/ports/SkFontStyle.h
@@ -43,8 +43,6 @@ public:
SkFontStyle();
SkFontStyle(int weight, int width, Slant);
- /** oldStyle means the style-bits in SkTypeface::Style: bold=1, italic=2 */
- explicit SkFontStyle(unsigned oldStyle);
bool operator==(const SkFontStyle& rhs) const {
return fUnion.fU32 == rhs.fUnion.fU32;