| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 uint32_t flags = paint->getFlags(); | 56 uint32_t flags = paint->getFlags(); |
| 57 static const uint32_t textFlagsMask = SkPaint::kAntiAlias_Flag | | 57 static const uint32_t textFlagsMask = SkPaint::kAntiAlias_Flag | |
| 58 SkPaint::kLCDRenderText_Flag | | 58 SkPaint::kLCDRenderText_Flag | |
| 59 SkPaint::kGenA8FromLCD_Flag; | 59 SkPaint::kGenA8FromLCD_Flag; |
| 60 flags &= ~textFlagsMask; | 60 flags &= ~textFlagsMask; |
| 61 | 61 |
| 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 if (m_useSubpixelPositioning) | 66 if (m_useSubpixelPositioning && ts >= m_minSizeForSubpixel) |
| 67 flags |= SkPaint::kSubpixelText_Flag; | 67 flags |= SkPaint::kSubpixelText_Flag; |
| 68 | 68 |
| 69 // Only set painting flags when we're actually painting. | 69 // Only set painting flags when we're actually painting. |
| 70 if (context && !context->couldUseLCDRenderedText()) { | 70 if (context && !context->couldUseLCDRenderedText()) { |
| 71 textFlags &= ~SkPaint::kLCDRenderText_Flag; | 71 textFlags &= ~SkPaint::kLCDRenderText_Flag; |
| 72 // If we *just* clear our request for LCD, then GDI seems to | 72 // If we *just* clear our request for LCD, then GDI seems to |
| 73 // sometimes give us AA text, and sometimes give us BW text. Since t
he | 73 // sometimes give us AA text, and sometimes give us BW text. Since t
he |
| 74 // original intent was LCD, we want to force AA (rather than BW), so
we | 74 // original intent was LCD, we want to force AA (rather than BW), so
we |
| 75 // add a special bit to tell Skia to do its best to avoid the BW: by | 75 // add a special bit to tell Skia to do its best to avoid the BW: by |
| 76 // drawing LCD offscreen and downsampling that to AA. | 76 // drawing LCD offscreen and downsampling that to AA. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 { | 145 { |
| 146 m_paintTextFlags = computePaintTextFlags(fontFamilyName()); | 146 m_paintTextFlags = computePaintTextFlags(fontFamilyName()); |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool FontPlatformData::defaultUseSubpixelPositioning() | 149 bool FontPlatformData::defaultUseSubpixelPositioning() |
| 150 { | 150 { |
| 151 return FontCache::fontCache()->useSubpixelPositioning(); | 151 return FontCache::fontCache()->useSubpixelPositioning(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace WebCore | 154 } // namespace WebCore |
| OLD | NEW |