| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
| 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
| 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
| 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 10 * | 10 * |
| (...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 return metrics.release(); | 1912 return metrics.release(); |
| 1913 } | 1913 } |
| 1914 | 1914 |
| 1915 void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
at y, bool fill, float maxWidth, bool useMaxWidth) | 1915 void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
at y, bool fill, float maxWidth, bool useMaxWidth) |
| 1916 { | 1916 { |
| 1917 // The style resolution required for rendering text is not available in fram
e-less documents. | 1917 // The style resolution required for rendering text is not available in fram
e-less documents. |
| 1918 if (!canvas()->document().frame()) | 1918 if (!canvas()->document().frame()) |
| 1919 return; | 1919 return; |
| 1920 | 1920 |
| 1921 // accessFont needs the style to be up to date, but updating style can cause
script to run, | 1921 // accessFont needs the style to be up to date, but updating style can cause
script to run, |
| 1922 // (e.g. due to autofocus) which can free the GraphicsContext, so update sty
le before grabbing | 1922 // which can free the GraphicsContext, so update style before grabbing the G
raphicsContext. |
| 1923 // the GraphicsContext. | 1923 // TODO(esprehn): This isn't needed in sky. |
| 1924 canvas()->document().updateRenderTreeIfNeeded(); | 1924 canvas()->document().updateRenderTreeIfNeeded(); |
| 1925 | 1925 |
| 1926 GraphicsContext* c = drawingContext(); | 1926 GraphicsContext* c = drawingContext(); |
| 1927 if (!c) | 1927 if (!c) |
| 1928 return; | 1928 return; |
| 1929 if (!state().m_invertibleCTM) | 1929 if (!state().m_invertibleCTM) |
| 1930 return; | 1930 return; |
| 1931 if (!std::isfinite(x) | !std::isfinite(y)) | 1931 if (!std::isfinite(x) | !std::isfinite(y)) |
| 1932 return; | 1932 return; |
| 1933 if (useMaxWidth && (!std::isfinite(maxWidth) || maxWidth <= 0)) | 1933 if (useMaxWidth && (!std::isfinite(maxWidth) || maxWidth <= 0)) |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2244 | 2244 |
| 2245 unsigned CanvasRenderingContext2D::hitRegionsCount() const | 2245 unsigned CanvasRenderingContext2D::hitRegionsCount() const |
| 2246 { | 2246 { |
| 2247 if (m_hitRegionManager) | 2247 if (m_hitRegionManager) |
| 2248 return m_hitRegionManager->getHitRegionsCount(); | 2248 return m_hitRegionManager->getHitRegionsCount(); |
| 2249 | 2249 |
| 2250 return 0; | 2250 return 0; |
| 2251 } | 2251 } |
| 2252 | 2252 |
| 2253 } // namespace blink | 2253 } // namespace blink |
| OLD | NEW |