summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/skia/FontSkia.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-17 16:21:14 +0200
commit8995b83bcbfbb68245f779b64e5517627c6cc6ea (patch)
tree17985605dab9263cc2444bd4d45f189e142cca7c /Source/WebCore/platform/graphics/skia/FontSkia.cpp
parentb9c9652036d5e9f1e29c574f40bc73a35c81ace6 (diff)
Imported WebKit commit cf4f8fc6f19b0629f51860cb2d4b25e139d07e00 (http://svn.webkit.org/repository/webkit/trunk@131592)
New snapshot that includes the build fixes for Mac OS X 10.6 and earlier as well as the previously cherry-picked changes
Diffstat (limited to 'Source/WebCore/platform/graphics/skia/FontSkia.cpp')
-rw-r--r--Source/WebCore/platform/graphics/skia/FontSkia.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/skia/FontSkia.cpp b/Source/WebCore/platform/graphics/skia/FontSkia.cpp
index 03f1417fb..c8097e349 100644
--- a/Source/WebCore/platform/graphics/skia/FontSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/FontSkia.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "Font.h"
+#include "FontSmoothingMode.h"
#include "GlyphBuffer.h"
#include "GraphicsContext.h"
#include "LayoutTestSupport.h"
@@ -71,6 +72,16 @@ static void setupPaint(SkPaint* paint, const SimpleFontData* fontData, const Fon
paint->setAutohinted(false); // freetype specific
paint->setLCDRenderText(shouldSmoothFonts);
paint->setSubpixelText(true);
+
+#if OS(DARWIN)
+ // When using CoreGraphics, disable hinting when webkit-font-smoothing:antialiased is used.
+ // See crbug.com/152304
+ if (font->fontDescription().fontSmoothing() == Antialiased)
+ paint->setHinting(SkPaint::kNo_Hinting);
+#endif
+
+ if (font->fontDescription().textRenderingMode() == GeometricPrecision)
+ paint->setHinting(SkPaint::kNo_Hinting);
}
// TODO: This needs to be split into helper functions to better scope the
@@ -120,8 +131,8 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
for (int i = 0; i < numGlyphs; i++) {
pos[i].set(x, y);
- x += SkFloatToScalar(adv[i].width);
- y += SkFloatToScalar(adv[i].height);
+ x += SkFloatToScalar(adv[i].width());
+ y += SkFloatToScalar(adv[i].height());
}
SkCanvas* canvas = gc->platformContext()->canvas();