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

Unified Diff: Source/platform/fonts/mac/FontPlatformDataMac.mm

Issue 755613007: Restore more webkit-font-smoothing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add rebaselines. Created 6 years, 1 month 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/mac/FontPlatformDataMac.mm
diff --git a/Source/platform/fonts/mac/FontPlatformDataMac.mm b/Source/platform/fonts/mac/FontPlatformDataMac.mm
index f8b9fdbc105f7bcbf9d0836e36a06297f0445df2..6a5da23dd7d1eaf84777db8d5f1d406284c21570 100644
--- a/Source/platform/fonts/mac/FontPlatformDataMac.mm
+++ b/Source/platform/fonts/mac/FontPlatformDataMac.mm
@@ -50,10 +50,29 @@ void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext*, const Font*
bool shouldSmoothFonts = true;
bool shouldAntialias = true;
- shouldAntialias = shouldAntialias && (!LayoutTestSupport::isRunningLayoutTest()
- || LayoutTestSupport::isFontAntialiasingEnabledForTest());
+ if (font) {
+ switch (font->fontDescription().fontSmoothing()) {
+ case Antialiased:
+ shouldSmoothFonts = false;
+ break;
+ case SubpixelAntialiased:
+ break;
+ case NoSmoothing:
+ shouldAntialias = false;
+ shouldSmoothFonts = false;
+ break;
+ case AutoSmoothing:
+ // For the AutoSmooth case, don't do anything! Keep the default settings.
+ break;
+ }
+ }
+
+ if (LayoutTestSupport::isRunningLayoutTest()) {
+ shouldSmoothFonts = false;
+ shouldAntialias = shouldAntialias && LayoutTestSupport::isFontAntialiasingEnabledForTest();
+ }
+
bool useSubpixelText = RuntimeEnabledFeatures::subpixelFontScalingEnabled();
- shouldSmoothFonts = shouldSmoothFonts && !LayoutTestSupport::isRunningLayoutTest();
paint->setAntiAlias(shouldAntialias);
paint->setEmbeddedBitmapText(false);
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698