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

Unified Diff: include/core/SkTypeface.h

Issue 667023002: Revert of Replace SkTypeface::Style with SkFontStyle. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkFontStyle.h ('k') | include/ports/SkFontStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTypeface.h
diff --git a/include/core/SkTypeface.h b/include/core/SkTypeface.h
index f7af5d2b61cd9d18eea19d4710f9198f1eebb2b9..a080d84bd8c87ab9538a2c2c932fa8a6b4c171a0 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 @@
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 true if style() has the kBold bit set. */
- bool isBold() const { return fStyle.weight() >= SkFontStyle::kSemiBold_Weight; }
-
- /** Returns true if style() has the kItalic bit set. */
- bool isItalic() const { return fStyle.slant() != SkFontStyle::kUpright_Slant; }
+ /** Returns the typeface's intrinsic style attributes
+ */
+ Style style() const { return fStyle; }
+
+ /** Returns true if getStyle() has the kBold bit set.
+ */
+ bool isBold() const { return (fStyle & kBold) != 0; }
+
+ /** 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 @@
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 @@
static void DeleteDefault(SkTypeface*);
SkFontID fUniqueID;
- SkFontStyle fStyle;
+ Style fStyle;
bool fIsFixedPitch;
friend class SkPaint;
« no previous file with comments | « include/core/SkFontStyle.h ('k') | include/ports/SkFontStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698