| 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 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 } else { | 1298 } else { |
| 1299 c->clearShadow(); | 1299 c->clearShadow(); |
| 1300 } | 1300 } |
| 1301 } | 1301 } |
| 1302 | 1302 |
| 1303 bool CanvasRenderingContext2D::shouldDrawShadows() const | 1303 bool CanvasRenderingContext2D::shouldDrawShadows() const |
| 1304 { | 1304 { |
| 1305 return alphaChannel(state().m_shadowColor) && (state().m_shadowBlur || !stat
e().m_shadowOffset.isZero()); | 1305 return alphaChannel(state().m_shadowColor) && (state().m_shadowBlur || !stat
e().m_shadowOffset.isZero()); |
| 1306 } | 1306 } |
| 1307 | 1307 |
| 1308 enum ImageSizeType { | |
| 1309 ImageSizeAfterDevicePixelRatio, | |
| 1310 ImageSizeBeforeDevicePixelRatio | |
| 1311 }; | |
| 1312 | |
| 1313 static inline FloatRect normalizeRect(const FloatRect& rect) | 1308 static inline FloatRect normalizeRect(const FloatRect& rect) |
| 1314 { | 1309 { |
| 1315 return FloatRect(min(rect.x(), rect.maxX()), | 1310 return FloatRect(min(rect.x(), rect.maxX()), |
| 1316 min(rect.y(), rect.maxY()), | 1311 min(rect.y(), rect.maxY()), |
| 1317 max(rect.width(), -rect.width()), | 1312 max(rect.width(), -rect.width()), |
| 1318 max(rect.height(), -rect.height())); | 1313 max(rect.height(), -rect.height())); |
| 1319 } | 1314 } |
| 1320 | 1315 |
| 1321 static inline void clipRectsToImageRect(const FloatRect& imageRect, FloatRect* s
rcRect, FloatRect* dstRect) | 1316 static inline void clipRectsToImageRect(const FloatRect& imageRect, FloatRect* s
rcRect, FloatRect* dstRect) |
| 1322 { | 1317 { |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1710 | 1705 |
| 1711 IntSize size = expandedIntSize(logicalSize); | 1706 IntSize size = expandedIntSize(logicalSize); |
| 1712 if (size.width() < 1) | 1707 if (size.width() < 1) |
| 1713 size.setWidth(1); | 1708 size.setWidth(1); |
| 1714 if (size.height() < 1) | 1709 if (size.height() < 1) |
| 1715 size.setHeight(1); | 1710 size.setHeight(1); |
| 1716 | 1711 |
| 1717 return createEmptyImageData(size); | 1712 return createEmptyImageData(size); |
| 1718 } | 1713 } |
| 1719 | 1714 |
| 1720 PassRefPtr<ImageData> CanvasRenderingContext2D::webkitGetImageDataHD(float sx, f
loat sy, float sw, float sh, ExceptionState& exceptionState) const | |
| 1721 { | |
| 1722 return getImageData(sx, sy, sw, sh, exceptionState); | |
| 1723 } | |
| 1724 | |
| 1725 PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(float sx, float sy,
float sw, float sh, ExceptionState& exceptionState) const | 1715 PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(float sx, float sy,
float sw, float sh, ExceptionState& exceptionState) const |
| 1726 { | 1716 { |
| 1727 if (!canvas()->originClean()) | 1717 if (!canvas()->originClean()) |
| 1728 exceptionState.throwSecurityError("The canvas has been tainted by cross-
origin data."); | 1718 exceptionState.throwSecurityError("The canvas has been tainted by cross-
origin data."); |
| 1729 else if (!sw || !sh) | 1719 else if (!sw || !sh) |
| 1730 exceptionState.throwDOMException(IndexSizeError, String::format("The sou
rce %s is 0.", sw ? "height" : "width")); | 1720 exceptionState.throwDOMException(IndexSizeError, String::format("The sou
rce %s is 0.", sw ? "height" : "width")); |
| 1731 else if (!std::isfinite(sx)) | 1721 else if (!std::isfinite(sx)) |
| 1732 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::n
otAFiniteNumber(sx, "source X")); | 1722 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::n
otAFiniteNumber(sx, "source X")); |
| 1733 else if (!std::isfinite(sy)) | 1723 else if (!std::isfinite(sy)) |
| 1734 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::n
otAFiniteNumber(sy, "source Y")); | 1724 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::n
otAFiniteNumber(sy, "source Y")); |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2306 c->setAlphaAsFloat(1.0); | 2296 c->setAlphaAsFloat(1.0); |
| 2307 c->clearShadow(); | 2297 c->clearShadow(); |
| 2308 c->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); | 2298 c->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); |
| 2309 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); | 2299 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); |
| 2310 c->restore(); | 2300 c->restore(); |
| 2311 | 2301 |
| 2312 didDraw(dirtyRect); | 2302 didDraw(dirtyRect); |
| 2313 } | 2303 } |
| 2314 | 2304 |
| 2315 } // namespace WebCore | 2305 } // namespace WebCore |
| OLD | NEW |