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

Unified Diff: src/core/SkScalerContext.h

Issue 1740163002: Improve horizontal baseline detection. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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
Index: src/core/SkScalerContext.h
diff --git a/src/core/SkScalerContext.h b/src/core/SkScalerContext.h
index 302698ee4e581548179bea34ed021af4bc4a87fa..49a79b13a91e8decd342a496221ae01feaee4668 100644
--- a/src/core/SkScalerContext.h
+++ b/src/core/SkScalerContext.h
@@ -20,6 +20,12 @@ class SkMaskFilter;
class SkPathEffect;
class SkRasterizer;
+enum SkAxisAlignment {
+ kNone_SkAxisAlignment,
+ kX_SkAxisAlignment,
+ kY_SkAxisAlignment
+};
+
/*
* To allow this to be forward-declared, it must be its own typename, rather
* than a nested struct inside SkScalerContext (where it started).
@@ -245,6 +251,15 @@ public:
const Rec& getRec() const { return fRec; }
+ /**
+ * Return the axis (if any) that the baseline for horizontal text should land on.
+ * As an example, the identity matrix will return kX_SkAxisAlignment
+ * If glyphs landing on the baseline is not significant (no hinting), returns
+ * kNone_SkAxisAlignment.
+ */
+ SkAxisAlignment computeAxisAlignmentForHText();
+
+
protected:
Rec fRec;
@@ -340,22 +355,6 @@ private:
///////////////////////////////////////////////////////////////////////////////
-enum SkAxisAlignment {
- kNone_SkAxisAlignment,
- kX_SkAxisAlignment,
- kY_SkAxisAlignment
-};
-
-/**
- * Return the axis (if any) that the baseline for horizontal text will land on
- * after running through the specified matrix.
- *
- * As an example, the identity matrix will return kX_SkAxisAlignment
- */
-SkAxisAlignment SkComputeAxisAlignmentForHText(const SkMatrix& matrix);
-
-///////////////////////////////////////////////////////////////////////////////
-
SkPaint::Hinting SkScalerContextRec::getHinting() const {
unsigned hint = (fFlags & SkScalerContext::kHinting_Mask) >>
SkScalerContext::kHinting_Shift;

Powered by Google App Engine
This is Rietveld 408576698