OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 4 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
5 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 7 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 8 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 10 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 CHECK(m_stateStack.front() | 165 CHECK(m_stateStack.front() |
166 .get()); // Temporary for investigating crbug.com/648510 | 166 .get()); // Temporary for investigating crbug.com/648510 |
167 } | 167 } |
168 | 168 |
169 bool CanvasRenderingContext2D::isAccelerated() const { | 169 bool CanvasRenderingContext2D::isAccelerated() const { |
170 if (!canvas()->hasImageBuffer()) | 170 if (!canvas()->hasImageBuffer()) |
171 return false; | 171 return false; |
172 return canvas()->buffer()->isAccelerated(); | 172 return canvas()->buffer()->isAccelerated(); |
173 } | 173 } |
174 | 174 |
| 175 bool CanvasRenderingContext2D::isComposited() const { |
| 176 return isAccelerated(); |
| 177 } |
| 178 |
175 void CanvasRenderingContext2D::stop() { | 179 void CanvasRenderingContext2D::stop() { |
176 if (!isContextLost()) { | 180 if (!isContextLost()) { |
177 // Never attempt to restore the context because the page is being torn down. | 181 // Never attempt to restore the context because the page is being torn down. |
178 loseContext(SyntheticLostContext); | 182 loseContext(SyntheticLostContext); |
179 } | 183 } |
180 } | 184 } |
181 | 185 |
182 bool CanvasRenderingContext2D::isContextLost() const { | 186 bool CanvasRenderingContext2D::isContextLost() const { |
183 return m_contextLostMode != NotLostContext; | 187 return m_contextLostMode != NotLostContext; |
184 } | 188 } |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 | 822 |
819 if (!std::isfinite(x) || !std::isfinite(y)) | 823 if (!std::isfinite(x) || !std::isfinite(y)) |
820 return; | 824 return; |
821 if (maxWidth && (!std::isfinite(*maxWidth) || *maxWidth <= 0)) | 825 if (maxWidth && (!std::isfinite(*maxWidth) || *maxWidth <= 0)) |
822 return; | 826 return; |
823 | 827 |
824 // Currently, SkPictureImageFilter does not support subpixel text | 828 // Currently, SkPictureImageFilter does not support subpixel text |
825 // anti-aliasing, which is expected when !creationAttributes().alpha(), so we | 829 // anti-aliasing, which is expected when !creationAttributes().alpha(), so we |
826 // need to fall out of display list mode when drawing text to an opaque | 830 // need to fall out of display list mode when drawing text to an opaque |
827 // canvas. crbug.com/583809 | 831 // canvas. crbug.com/583809 |
828 if (!creationAttributes().alpha() && !isAccelerated()) { | 832 if (!creationAttributes().alpha() && !isComposited()) { |
829 canvas()->disableDeferral( | 833 canvas()->disableDeferral( |
830 DisableDeferralReasonSubPixelTextAntiAliasingSupport); | 834 DisableDeferralReasonSubPixelTextAntiAliasingSupport); |
831 } | 835 } |
832 | 836 |
833 const Font& font = accessFont(); | 837 const Font& font = accessFont(); |
834 font.getFontDescription().setSubpixelAscentDescent(true); | 838 font.getFontDescription().setSubpixelAscentDescent(true); |
835 const SimpleFontData* fontData = font.primaryFont(); | 839 const SimpleFontData* fontData = font.primaryFont(); |
836 DCHECK(fontData); | 840 DCHECK(fontData); |
837 if (!fontData) | 841 if (!fontData) |
838 return; | 842 return; |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 } | 1163 } |
1160 return true; | 1164 return true; |
1161 } | 1165 } |
1162 | 1166 |
1163 void CanvasRenderingContext2D::resetUsageTracking() { | 1167 void CanvasRenderingContext2D::resetUsageTracking() { |
1164 UsageCounters newCounters; | 1168 UsageCounters newCounters; |
1165 m_usageCounters = newCounters; | 1169 m_usageCounters = newCounters; |
1166 } | 1170 } |
1167 | 1171 |
1168 } // namespace blink | 1172 } // namespace blink |
OLD | NEW |