OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |