summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 22:37:24 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 22:37:24 +0000
commitf8a50aaa2fab4d8817571d7942b796f6f86349f2 (patch)
treeddcc12700eff3513bfea12a0717f0083c2fa4e1e
parentc5b71a6ab79207f4d802200d901c98241d750f44 (diff)
downloadchromium_src-f8a50aaa2fab4d8817571d7942b796f6f86349f2.zip
chromium_src-f8a50aaa2fab4d8817571d7942b796f6f86349f2.tar.gz
chromium_src-f8a50aaa2fab4d8817571d7942b796f6f86349f2.tar.bz2
Skia: break XRange into XMax and XMin
This is one of Mike Reed's requests for upstreaming this work since he has a use for the XMin value. (also pulls in the WebKit side of this change) http://codereview.chromium.org/62118 https://bugs.webkit.org/show_bug.cgi?id=25081 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13295 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rw-r--r--skia/include/SkPaint.h6
-rw-r--r--skia/ports/SkFontHost_FreeType.cpp9
3 files changed, 9 insertions, 8 deletions
diff --git a/DEPS b/DEPS
index 24fd394..d73f05a 100644
--- a/DEPS
+++ b/DEPS
@@ -19,7 +19,7 @@ deps = {
"http://googletest.googlecode.com/svn/trunk@214",
"src/third_party/WebKit":
- "/trunk/deps/third_party/WebKit@13198",
+ "/trunk/deps/third_party/WebKit@13293",
"src/third_party/icu38":
"/trunk/deps/third_party/icu38@13083",
diff --git a/skia/include/SkPaint.h b/skia/include/SkPaint.h
index dea8de6..b871bda 100644
--- a/skia/include/SkPaint.h
+++ b/skia/include/SkPaint.h
@@ -618,10 +618,8 @@ public:
SkScalar fLeading; //!< The recommended distance to add between lines of text (will be >= 0)
SkScalar fHeight; //!< the vertical distance between two consecutive baselines (>= 0)
SkScalar fAvgCharWidth; //!< the average charactor width (>= 0)
- SkScalar fXRange; //!< This is the maximum range of X bounding box points
- // in units of em. It's used to calculate a value which
- // matches Windows's GetTextMetrics tmMaxCharWidth
- // member exactly.
+ SkScalar fXMin; //!< The minimum bounding box x value for all glyphs
+ SkScalar fXMax; //!< The maximum bounding box x value for all glyphs
SkScalar fXHeight; //!< the height of an 'x' in px, or 0 if no 'x' in face
// VDMX values are exact ascent and descent values for scalable fonts at
diff --git a/skia/ports/SkFontHost_FreeType.cpp b/skia/ports/SkFontHost_FreeType.cpp
index 56ea08d..8ffb3ca 100644
--- a/skia/ports/SkFontHost_FreeType.cpp
+++ b/skia/ports/SkFontHost_FreeType.cpp
@@ -867,7 +867,8 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx,
SkFixed scaleY = fScaleY;
SkFixed mxy = fMatrix22.xy;
SkFixed myy = fMatrix22.yy;
- SkScalar xrange = static_cast<SkScalar>(face->bbox.xMax - face->bbox.xMin) / upem;
+ SkScalar xmin = static_cast<SkScalar>(face->bbox.xMin) / upem;
+ SkScalar xmax = static_cast<SkScalar>(face->bbox.xMax) / upem;
int leading = face->height - face->ascender + face->descender;
if (leading < 0) {
@@ -918,7 +919,8 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx,
mx->fLeading = pts[4].fX;
mx->fHeight = pts[5].fX;
mx->fAvgCharWidth = pts[6].fX;
- mx->fXRange = xrange;
+ mx->fXMin = xmin;
+ mx->fXMax = xmax;
mx->fXHeight = x_height;
// The VDMX metrics only make sense in the horizontal direction
@@ -933,7 +935,8 @@ void SkScalerContext_FreeType::generateFontMetrics(SkPaint::FontMetrics* mx,
my->fLeading = pts[4].fY;
my->fHeight = pts[5].fY;
my->fAvgCharWidth = pts[6].fY;
- my->fXRange = xrange;
+ my->fXMin = xmin;
+ my->fXMax = xmax;
my->fXHeight = x_height;
my->fVDMXMetricsValid = false;