| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2006, 2007, 2008, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext*) const | 75 void FontPlatformData::setupPaint(SkPaint* paint, GraphicsContext*) const |
| 76 { | 76 { |
| 77 paint->setAntiAlias(m_style.useAntiAlias); | 77 paint->setAntiAlias(m_style.useAntiAlias); |
| 78 paint->setHinting(static_cast<SkPaint::Hinting>(m_style.hintStyle)); | 78 paint->setHinting(static_cast<SkPaint::Hinting>(m_style.hintStyle)); |
| 79 paint->setEmbeddedBitmapText(m_style.useBitmaps); | 79 paint->setEmbeddedBitmapText(m_style.useBitmaps); |
| 80 paint->setAutohinted(m_style.useAutoHint); | 80 paint->setAutohinted(m_style.useAutoHint); |
| 81 if (m_style.useAntiAlias) | 81 if (m_style.useAntiAlias) |
| 82 paint->setLCDRenderText(m_style.useSubpixelRendering); | 82 paint->setLCDRenderText(m_style.useSubpixelRendering); |
| 83 | 83 |
| 84 // TestRunner specifically toggles the subpixel positioning flag. | 84 // TestRunner specifically toggles the subpixel positioning flag. |
| 85 if (RuntimeEnabledFeatures::subpixelFontScalingEnabled() && !isRunningLayout
Test()) | 85 if (RuntimeEnabledFeatures::subpixelFontScalingEnabled() |
| 86 && paint->getHinting() != SkPaint::kFull_Hinting |
| 87 && !isRunningLayoutTest()) |
| 86 paint->setSubpixelText(true); | 88 paint->setSubpixelText(true); |
| 87 else | 89 else |
| 88 paint->setSubpixelText(m_style.useSubpixelPositioning); | 90 paint->setSubpixelText(m_style.useSubpixelPositioning); |
| 89 | 91 |
| 90 const float ts = m_textSize >= 0 ? m_textSize : 12; | 92 const float ts = m_textSize >= 0 ? m_textSize : 12; |
| 91 paint->setTextSize(SkFloatToScalar(ts)); | 93 paint->setTextSize(SkFloatToScalar(ts)); |
| 92 paint->setTypeface(m_typeface.get()); | 94 paint->setTypeface(m_typeface.get()); |
| 93 paint->setFakeBoldText(m_syntheticBold); | 95 paint->setFakeBoldText(m_syntheticBold); |
| 94 paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0); | 96 paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0); |
| 95 } | 97 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 || isRunningLayoutTest()) | 142 || isRunningLayoutTest()) |
| 141 m_style.useSubpixelPositioning = useSkiaSubpixelPositioning; | 143 m_style.useSubpixelPositioning = useSkiaSubpixelPositioning; |
| 142 } | 144 } |
| 143 | 145 |
| 144 bool FontPlatformData::defaultUseSubpixelPositioning() | 146 bool FontPlatformData::defaultUseSubpixelPositioning() |
| 145 { | 147 { |
| 146 return FontDescription::subpixelPositioning(); | 148 return FontDescription::subpixelPositioning(); |
| 147 } | 149 } |
| 148 | 150 |
| 149 } // namespace WebCore | 151 } // namespace WebCore |
| OLD | NEW |