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

Side by Side Diff: Source/core/platform/graphics/win/FontPlatformDataWin.cpp

Issue 25512005: Enable experimental support for sub-pixel font scaling (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007 Apple Computer, Inc. 2 * Copyright (C) 2006, 2007 Apple Computer, Inc.
3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved. 3 * Copyright (c) 2006, 2007, 2008, 2009, 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 namespace WebCore { 52 namespace WebCore {
53 53
54 void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context) cons t 54 void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext* context) cons t
55 { 55 {
56 const float ts = m_textSize >= 0 ? m_textSize : 12; 56 const float ts = m_textSize >= 0 ? m_textSize : 12;
57 paint->setTextSize(SkFloatToScalar(m_textSize)); 57 paint->setTextSize(SkFloatToScalar(m_textSize));
58 paint->setTypeface(typeface()); 58 paint->setTypeface(typeface());
59 paint->setFakeBoldText(m_fakeBold); 59 paint->setFakeBoldText(m_fakeBold);
60 paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0); 60 paint->setTextSkewX(m_fakeItalic ? -SK_Scalar1 / 4 : 0);
61 if (RuntimeEnabledFeatures::subpixelFontScalingEnabled()) 61
62 // Subpixel text positioning is not supported by the GDI backend.
63 if (RuntimeEnabledFeatures::directWriteEnabled()
64 && RuntimeEnabledFeatures::subpixelFontScalingEnabled())
62 paint->setSubpixelText(true); 65 paint->setSubpixelText(true);
63 66
64 int textFlags = paintTextFlags(); 67 int textFlags = paintTextFlags();
65 // Only set painting flags when we're actually painting. 68 // Only set painting flags when we're actually painting.
66 if (context && !context->couldUseLCDRenderedText()) { 69 if (context && !context->couldUseLCDRenderedText()) {
67 textFlags &= ~SkPaint::kLCDRenderText_Flag; 70 textFlags &= ~SkPaint::kLCDRenderText_Flag;
68 // If we *just* clear our request for LCD, then GDI seems to 71 // If we *just* clear our request for LCD, then GDI seems to
69 // sometimes give us AA text, and sometimes give us BW text. Since the 72 // sometimes give us AA text, and sometimes give us BW text. Since the
70 // original intent was LCD, we want to force AA (rather than BW), so we 73 // original intent was LCD, we want to force AA (rather than BW), so we
71 // add a special bit to tell Skia to do its best to avoid the BW: by 74 // add a special bit to tell Skia to do its best to avoid the BW: by
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 #endif 426 #endif
424 427
425 #ifndef NDEBUG 428 #ifndef NDEBUG
426 String FontPlatformData::description() const 429 String FontPlatformData::description() const
427 { 430 {
428 return String(); 431 return String();
429 } 432 }
430 #endif 433 #endif
431 434
432 } 435 }
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp ('k') | Source/core/rendering/LineWidth.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698