| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 if (ts <= kMaxSizeForEmbeddedBitmap) | 62 if (ts <= kMaxSizeForEmbeddedBitmap) |
| 63 flags |= SkPaint::kEmbeddedBitmapText_Flag; | 63 flags |= SkPaint::kEmbeddedBitmapText_Flag; |
| 64 | 64 |
| 65 if (ts >= m_minSizeForAntiAlias) { | 65 if (ts >= m_minSizeForAntiAlias) { |
| 66 | 66 |
| 67 // Subpixel text positioning looks pretty bad without font smoothing. | 67 // Subpixel text positioning looks pretty bad without font smoothing. |
| 68 // Disable it unless some type of font smoothing is used. As most tests | 68 // Disable it unless some type of font smoothing is used. As most tests |
| 69 // run without font smoothing we enable it for tests to ensure we get | 69 // run without font smoothing we enable it for tests to ensure we get |
| 70 // good test coverage matching the more common smoothing enabled | 70 // good test coverage matching the more common smoothing enabled |
| 71 // behavior. | 71 // behavior. |
| 72 if (m_useSubpixelPositioning | 72 if (m_useSubpixelPositioning && ts >= m_minSizeForSubpixel |
| 73 && ((textFlags & SkPaint::kAntiAlias_Flag) || LayoutTestSupport::isR
unningLayoutTest())) | 73 && ((textFlags & SkPaint::kAntiAlias_Flag) || LayoutTestSupport::isR
unningLayoutTest())) |
| 74 flags |= SkPaint::kSubpixelText_Flag; | 74 flags |= SkPaint::kSubpixelText_Flag; |
| 75 | 75 |
| 76 // Only set painting flags when we're actually painting. | 76 // Only set painting flags when we're actually painting. |
| 77 if (context && !context->couldUseLCDRenderedText()) { | 77 if (context && !context->couldUseLCDRenderedText()) { |
| 78 textFlags &= ~SkPaint::kLCDRenderText_Flag; | 78 textFlags &= ~SkPaint::kLCDRenderText_Flag; |
| 79 // If we *just* clear our request for LCD, then GDI seems to | 79 // If we *just* clear our request for LCD, then GDI seems to |
| 80 // sometimes give us AA text, and sometimes give us BW text. Since t
he | 80 // sometimes give us AA text, and sometimes give us BW text. Since t
he |
| 81 // original intent was LCD, we want to force AA (rather than BW), so
we | 81 // original intent was LCD, we want to force AA (rather than BW), so
we |
| 82 // add a special bit to tell Skia to do its best to avoid the BW: by | 82 // add a special bit to tell Skia to do its best to avoid the BW: by |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 { | 152 { |
| 153 m_paintTextFlags = computePaintTextFlags(fontFamilyName()); | 153 m_paintTextFlags = computePaintTextFlags(fontFamilyName()); |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool FontPlatformData::defaultUseSubpixelPositioning() | 156 bool FontPlatformData::defaultUseSubpixelPositioning() |
| 157 { | 157 { |
| 158 return FontCache::fontCache()->useSubpixelPositioning(); | 158 return FontCache::fontCache()->useSubpixelPositioning(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace blink | 161 } // namespace blink |
| OLD | NEW |