Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 18548003: Rename ExceptionCode constants to use the names in the spec (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012 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 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 { 1182 {
1183 return FloatRect(min(rect.x(), rect.maxX()), 1183 return FloatRect(min(rect.x(), rect.maxX()),
1184 min(rect.y(), rect.maxY()), 1184 min(rect.y(), rect.maxY()),
1185 max(rect.width(), -rect.width()), 1185 max(rect.width(), -rect.width()),
1186 max(rect.height(), -rect.height())); 1186 max(rect.height(), -rect.height()));
1187 } 1187 }
1188 1188
1189 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y, ExceptionCode& ec) 1189 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y, ExceptionCode& ec)
1190 { 1190 {
1191 if (!image) { 1191 if (!image) {
1192 ec = TYPE_MISMATCH_ERR; 1192 ec = TypeMismatchError;
1193 return; 1193 return;
1194 } 1194 }
1195 LayoutSize s = size(image); 1195 LayoutSize s = size(image);
1196 drawImage(image, x, y, s.width(), s.height(), ec); 1196 drawImage(image, x, y, s.width(), s.height(), ec);
1197 } 1197 }
1198 1198
1199 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, 1199 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image,
1200 float x, float y, float width, float height, ExceptionCode& ec) 1200 float x, float y, float width, float height, ExceptionCode& ec)
1201 { 1201 {
1202 if (!image) { 1202 if (!image) {
1203 ec = TYPE_MISMATCH_ERR; 1203 ec = TypeMismatchError;
1204 return; 1204 return;
1205 } 1205 }
1206 LayoutSize s = size(image); 1206 LayoutSize s = size(image);
1207 drawImage(image, FloatRect(0, 0, s.width(), s.height()), FloatRect(x, y, wid th, height), ec); 1207 drawImage(image, FloatRect(0, 0, s.width(), s.height()), FloatRect(x, y, wid th, height), ec);
1208 } 1208 }
1209 1209
1210 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, 1210 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image,
1211 float sx, float sy, float sw, float sh, 1211 float sx, float sy, float sw, float sh,
1212 float dx, float dy, float dw, float dh, ExceptionCode& ec) 1212 float dx, float dy, float dw, float dh, ExceptionCode& ec)
1213 { 1213 {
1214 drawImage(image, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec); 1214 drawImage(image, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
1215 } 1215 }
1216 1216
1217 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec t& srcRect, const FloatRect& dstRect, ExceptionCode& ec) 1217 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec t& srcRect, const FloatRect& dstRect, ExceptionCode& ec)
1218 { 1218 {
1219 drawImage(image, srcRect, dstRect, state().m_globalComposite, state().m_glob alBlend, ec); 1219 drawImage(image, srcRect, dstRect, state().m_globalComposite, state().m_glob alBlend, ec);
1220 } 1220 }
1221 1221
1222 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec t& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMo de& blendMode, ExceptionCode& ec) 1222 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRec t& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMo de& blendMode, ExceptionCode& ec)
1223 { 1223 {
1224 if (!image) { 1224 if (!image) {
1225 ec = TYPE_MISMATCH_ERR; 1225 ec = TypeMismatchError;
1226 return; 1226 return;
1227 } 1227 }
1228 1228
1229 ec = 0; 1229 ec = 0;
1230 1230
1231 if (!std::isfinite(dstRect.x()) || !std::isfinite(dstRect.y()) || !std::isfi nite(dstRect.width()) || !std::isfinite(dstRect.height()) 1231 if (!std::isfinite(dstRect.x()) || !std::isfinite(dstRect.y()) || !std::isfi nite(dstRect.width()) || !std::isfinite(dstRect.height())
1232 || !std::isfinite(srcRect.x()) || !std::isfinite(srcRect.y()) || !std::i sfinite(srcRect.width()) || !std::isfinite(srcRect.height())) 1232 || !std::isfinite(srcRect.x()) || !std::isfinite(srcRect.y()) || !std::i sfinite(srcRect.width()) || !std::isfinite(srcRect.height()))
1233 return; 1233 return;
1234 1234
1235 if (!dstRect.width() || !dstRect.height()) 1235 if (!dstRect.width() || !dstRect.height())
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 float sx, float sy, float sw, float sh, 1300 float sx, float sy, float sw, float sh,
1301 float dx, float dy, float dw, float dh, ExceptionCode& ec) 1301 float dx, float dy, float dw, float dh, ExceptionCode& ec)
1302 { 1302 {
1303 drawImage(sourceCanvas, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh) , ec); 1303 drawImage(sourceCanvas, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh) , ec);
1304 } 1304 }
1305 1305
1306 void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const FloatRect& srcRect, 1306 void CanvasRenderingContext2D::drawImage(HTMLCanvasElement* sourceCanvas, const FloatRect& srcRect,
1307 const FloatRect& dstRect, ExceptionCode& ec) 1307 const FloatRect& dstRect, ExceptionCode& ec)
1308 { 1308 {
1309 if (!sourceCanvas) { 1309 if (!sourceCanvas) {
1310 ec = TYPE_MISMATCH_ERR; 1310 ec = TypeMismatchError;
1311 return; 1311 return;
1312 } 1312 }
1313 1313
1314 FloatRect srcCanvasRect = FloatRect(FloatPoint(), sourceCanvas->size()); 1314 FloatRect srcCanvasRect = FloatRect(FloatPoint(), sourceCanvas->size());
1315 1315
1316 if (!srcCanvasRect.width() || !srcCanvasRect.height()) { 1316 if (!srcCanvasRect.width() || !srcCanvasRect.height()) {
1317 ec = INVALID_STATE_ERR; 1317 ec = InvalidStateError;
1318 return; 1318 return;
1319 } 1319 }
1320 1320
1321 if (!srcRect.width() || !srcRect.height()) { 1321 if (!srcRect.width() || !srcRect.height()) {
1322 ec = IndexSizeError; 1322 ec = IndexSizeError;
1323 return; 1323 return;
1324 } 1324 }
1325 1325
1326 ec = 0; 1326 ec = 0;
1327 1327
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 didDrawEntireCanvas(); 1360 didDrawEntireCanvas();
1361 } else { 1361 } else {
1362 c->drawImageBuffer(buffer, dstRect, srcRect, state().m_globalComposite, state().m_globalBlend); 1362 c->drawImageBuffer(buffer, dstRect, srcRect, state().m_globalComposite, state().m_globalBlend);
1363 didDraw(dstRect); 1363 didDraw(dstRect);
1364 } 1364 }
1365 } 1365 }
1366 1366
1367 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, float x, float y, ExceptionCode& ec) 1367 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, float x, float y, ExceptionCode& ec)
1368 { 1368 {
1369 if (!video) { 1369 if (!video) {
1370 ec = TYPE_MISMATCH_ERR; 1370 ec = TypeMismatchError;
1371 return; 1371 return;
1372 } 1372 }
1373 IntSize s = size(video); 1373 IntSize s = size(video);
1374 drawImage(video, x, y, s.width(), s.height(), ec); 1374 drawImage(video, x, y, s.width(), s.height(), ec);
1375 } 1375 }
1376 1376
1377 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, 1377 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video,
1378 float x, float y, float width, float he ight, ExceptionCode& ec) 1378 float x, float y, float width, float he ight, ExceptionCode& ec)
1379 { 1379 {
1380 if (!video) { 1380 if (!video) {
1381 ec = TYPE_MISMATCH_ERR; 1381 ec = TypeMismatchError;
1382 return; 1382 return;
1383 } 1383 }
1384 IntSize s = size(video); 1384 IntSize s = size(video);
1385 drawImage(video, FloatRect(0, 0, s.width(), s.height()), FloatRect(x, y, wid th, height), ec); 1385 drawImage(video, FloatRect(0, 0, s.width(), s.height()), FloatRect(x, y, wid th, height), ec);
1386 } 1386 }
1387 1387
1388 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, 1388 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video,
1389 float sx, float sy, float sw, float sh, 1389 float sx, float sy, float sw, float sh,
1390 float dx, float dy, float dw, float dh, ExceptionCode& ec) 1390 float dx, float dy, float dw, float dh, ExceptionCode& ec)
1391 { 1391 {
1392 drawImage(video, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec); 1392 drawImage(video, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), ec);
1393 } 1393 }
1394 1394
1395 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec t& srcRect, const FloatRect& dstRect, 1395 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRec t& srcRect, const FloatRect& dstRect,
1396 ExceptionCode& ec) 1396 ExceptionCode& ec)
1397 { 1397 {
1398 if (!video) { 1398 if (!video) {
1399 ec = TYPE_MISMATCH_ERR; 1399 ec = TypeMismatchError;
1400 return; 1400 return;
1401 } 1401 }
1402 1402
1403 ec = 0; 1403 ec = 0;
1404 1404
1405 if (video->readyState() == HTMLMediaElement::HAVE_NOTHING || video->readySta te() == HTMLMediaElement::HAVE_METADATA) 1405 if (video->readyState() == HTMLMediaElement::HAVE_NOTHING || video->readySta te() == HTMLMediaElement::HAVE_METADATA)
1406 return; 1406 return;
1407 1407
1408 FloatRect videoRect = FloatRect(FloatPoint(), size(video)); 1408 FloatRect videoRect = FloatRect(FloatPoint(), size(video));
1409 if (!srcRect.width() || !srcRect.height()) { 1409 if (!srcRect.width() || !srcRect.height()) {
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 } 1620 }
1621 1621
1622 RefPtr<CanvasGradient> gradient = CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1); 1622 RefPtr<CanvasGradient> gradient = CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1);
1623 return gradient.release(); 1623 return gradient.release();
1624 } 1624 }
1625 1625
1626 PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLImageEleme nt* image, 1626 PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLImageEleme nt* image,
1627 const String& repetitionType, ExceptionCode& ec) 1627 const String& repetitionType, ExceptionCode& ec)
1628 { 1628 {
1629 if (!image) { 1629 if (!image) {
1630 ec = TYPE_MISMATCH_ERR; 1630 ec = TypeMismatchError;
1631 return 0; 1631 return 0;
1632 } 1632 }
1633 bool repeatX, repeatY; 1633 bool repeatX, repeatY;
1634 ec = 0; 1634 ec = 0;
1635 CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec); 1635 CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
1636 if (ec) 1636 if (ec)
1637 return 0; 1637 return 0;
1638 1638
1639 if (!image->complete()) 1639 if (!image->complete())
1640 return 0; 1640 return 0;
1641 1641
1642 CachedImage* cachedImage = image->cachedImage(); 1642 CachedImage* cachedImage = image->cachedImage();
1643 Image* imageForRendering = cachedImage ? cachedImage->imageForRenderer(image ->renderer()) : 0; 1643 Image* imageForRendering = cachedImage ? cachedImage->imageForRenderer(image ->renderer()) : 0;
1644 if (!imageForRendering) 1644 if (!imageForRendering)
1645 return CanvasPattern::create(Image::nullImage(), repeatX, repeatY, true) ; 1645 return CanvasPattern::create(Image::nullImage(), repeatX, repeatY, true) ;
1646 1646
1647 // We need to synthesize a container size if a renderer is not available to provide one. 1647 // We need to synthesize a container size if a renderer is not available to provide one.
1648 if (!image->renderer() && imageForRendering->usesContainerSize()) 1648 if (!image->renderer() && imageForRendering->usesContainerSize())
1649 imageForRendering->setContainerSize(imageForRendering->size()); 1649 imageForRendering->setContainerSize(imageForRendering->size());
1650 1650
1651 bool originClean = isOriginClean(cachedImage, canvas()->securityOrigin()); 1651 bool originClean = isOriginClean(cachedImage, canvas()->securityOrigin());
1652 return CanvasPattern::create(imageForRendering, repeatX, repeatY, originClea n); 1652 return CanvasPattern::create(imageForRendering, repeatX, repeatY, originClea n);
1653 } 1653 }
1654 1654
1655 PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElem ent* canvas, 1655 PassRefPtr<CanvasPattern> CanvasRenderingContext2D::createPattern(HTMLCanvasElem ent* canvas,
1656 const String& repetitionType, ExceptionCode& ec) 1656 const String& repetitionType, ExceptionCode& ec)
1657 { 1657 {
1658 if (!canvas) { 1658 if (!canvas) {
1659 ec = TYPE_MISMATCH_ERR; 1659 ec = TypeMismatchError;
1660 return 0; 1660 return 0;
1661 } 1661 }
1662 if (!canvas->width() || !canvas->height()) { 1662 if (!canvas->width() || !canvas->height()) {
1663 ec = INVALID_STATE_ERR; 1663 ec = InvalidStateError;
1664 return 0; 1664 return 0;
1665 } 1665 }
1666 1666
1667 bool repeatX, repeatY; 1667 bool repeatX, repeatY;
1668 ec = 0; 1668 ec = 0;
1669 CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec); 1669 CanvasPattern::parseRepetitionType(repetitionType, repeatX, repeatY, ec);
1670 if (ec) 1670 if (ec)
1671 return 0; 1671 return 0;
1672 return CanvasPattern::create(canvas->copiedImage(), repeatX, repeatY, canvas ->originClean()); 1672 return CanvasPattern::create(canvas->copiedImage(), repeatX, repeatY, canvas ->originClean());
1673 } 1673 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 PassRefPtr<ImageData> CanvasRenderingContext2D::webkitGetImageDataHD(float sx, f loat sy, float sw, float sh, ExceptionCode& ec) const 1780 PassRefPtr<ImageData> CanvasRenderingContext2D::webkitGetImageDataHD(float sx, f loat sy, float sw, float sh, ExceptionCode& ec) const
1781 { 1781 {
1782 return getImageData(ImageBuffer::BackingStoreCoordinateSystem, sx, sy, sw, s h, ec); 1782 return getImageData(ImageBuffer::BackingStoreCoordinateSystem, sx, sy, sw, s h, ec);
1783 } 1783 }
1784 1784
1785 PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::Coordi nateSystem coordinateSystem, float sx, float sy, float sw, float sh, ExceptionCo de& ec) const 1785 PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::Coordi nateSystem coordinateSystem, float sx, float sy, float sw, float sh, ExceptionCo de& ec) const
1786 { 1786 {
1787 if (!canvas()->originClean()) { 1787 if (!canvas()->originClean()) {
1788 DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Unable to get image data from canvas because the canvas has been tainted by cross-origin data ."))); 1788 DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Unable to get image data from canvas because the canvas has been tainted by cross-origin data .")));
1789 canvas()->document()->addConsoleMessage(SecurityMessageSource, ErrorMess ageLevel, consoleMessage); 1789 canvas()->document()->addConsoleMessage(SecurityMessageSource, ErrorMess ageLevel, consoleMessage);
1790 ec = SECURITY_ERR; 1790 ec = SecurityError;
1791 return 0; 1791 return 0;
1792 } 1792 }
1793 1793
1794 if (!sw || !sh) { 1794 if (!sw || !sh) {
1795 ec = IndexSizeError; 1795 ec = IndexSizeError;
1796 return 0; 1796 return 0;
1797 } 1797 }
1798 if (!std::isfinite(sx) || !std::isfinite(sy) || !std::isfinite(sw) || !std:: isfinite(sh)) { 1798 if (!std::isfinite(sx) || !std::isfinite(sy) || !std::isfinite(sw) || !std:: isfinite(sh)) {
1799 ec = NotSupportedError; 1799 ec = NotSupportedError;
1800 return 0; 1800 return 0;
(...skipping 24 matching lines...) Expand all
1825 RefPtr<Uint8ClampedArray> byteArray = buffer->getUnmultipliedImageData(image DataRect, coordinateSystem); 1825 RefPtr<Uint8ClampedArray> byteArray = buffer->getUnmultipliedImageData(image DataRect, coordinateSystem);
1826 if (!byteArray) 1826 if (!byteArray)
1827 return 0; 1827 return 0;
1828 1828
1829 return ImageData::create(imageDataRect.size(), byteArray.release()); 1829 return ImageData::create(imageDataRect.size(), byteArray.release());
1830 } 1830 }
1831 1831
1832 void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, ExceptionCode& ec) 1832 void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, ExceptionCode& ec)
1833 { 1833 {
1834 if (!data) { 1834 if (!data) {
1835 ec = TYPE_MISMATCH_ERR; 1835 ec = TypeMismatchError;
1836 return; 1836 return;
1837 } 1837 }
1838 putImageData(data, dx, dy, 0, 0, data->width(), data->height(), ec); 1838 putImageData(data, dx, dy, 0, 0, data->width(), data->height(), ec);
1839 } 1839 }
1840 1840
1841 void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, f loat dy, ExceptionCode& ec) 1841 void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, f loat dy, ExceptionCode& ec)
1842 { 1842 {
1843 if (!data) { 1843 if (!data) {
1844 ec = TYPE_MISMATCH_ERR; 1844 ec = TypeMismatchError;
1845 return; 1845 return;
1846 } 1846 }
1847 webkitPutImageDataHD(data, dx, dy, 0, 0, data->width(), data->height(), ec); 1847 webkitPutImageDataHD(data, dx, dy, 0, 0, data->width(), data->height(), ec);
1848 } 1848 }
1849 1849
1850 void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY, 1850 void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY,
1851 float dirtyWidth, float dirtyHeight, ExceptionCode& ec) 1851 float dirtyWidth, float dirtyHeight, ExceptionCode& ec)
1852 { 1852 {
1853 putImageData(data, ImageBuffer::LogicalCoordinateSystem, dx, dy, dirtyX, dir tyY, dirtyWidth, dirtyHeight, ec); 1853 putImageData(data, ImageBuffer::LogicalCoordinateSystem, dx, dy, dirtyX, dir tyY, dirtyWidth, dirtyHeight, ec);
1854 } 1854 }
1855 1855
1856 void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, f loat dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, Except ionCode& ec) 1856 void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, f loat dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, Except ionCode& ec)
1857 { 1857 {
1858 putImageData(data, ImageBuffer::BackingStoreCoordinateSystem, dx, dy, dirtyX , dirtyY, dirtyWidth, dirtyHeight, ec); 1858 putImageData(data, ImageBuffer::BackingStoreCoordinateSystem, dx, dy, dirtyX , dirtyY, dirtyWidth, dirtyHeight, ec);
1859 } 1859 }
1860 1860
1861 void CanvasRenderingContext2D::putImageData(ImageData* data, ImageBuffer::Coordi nateSystem coordinateSystem, float dx, float dy, float dirtyX, float dirtyY, 1861 void CanvasRenderingContext2D::putImageData(ImageData* data, ImageBuffer::Coordi nateSystem coordinateSystem, float dx, float dy, float dirtyX, float dirtyY,
1862 float dirtyWidth, float dirtyHeight, ExceptionCode& ec) 1862 float dirtyWidth, float dirtyHeight, ExceptionCode& ec)
1863 { 1863 {
1864 if (!data) { 1864 if (!data) {
1865 ec = TYPE_MISMATCH_ERR; 1865 ec = TypeMismatchError;
1866 return; 1866 return;
1867 } 1867 }
1868 if (!std::isfinite(dx) || !std::isfinite(dy) || !std::isfinite(dirtyX) || !s td::isfinite(dirtyY) || !std::isfinite(dirtyWidth) || !std::isfinite(dirtyHeight )) { 1868 if (!std::isfinite(dx) || !std::isfinite(dy) || !std::isfinite(dirtyX) || !s td::isfinite(dirtyY) || !std::isfinite(dirtyWidth) || !std::isfinite(dirtyHeight )) {
1869 ec = NotSupportedError; 1869 ec = NotSupportedError;
1870 return; 1870 return;
1871 } 1871 }
1872 1872
1873 ImageBuffer* buffer = canvas()->buffer(); 1873 ImageBuffer* buffer = canvas()->buffer();
1874 if (!buffer) 1874 if (!buffer)
1875 return; 1875 return;
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 } 2228 }
2229 2229
2230 PassRefPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttrib utes() const 2230 PassRefPtr<Canvas2DContextAttributes> CanvasRenderingContext2D::getContextAttrib utes() const
2231 { 2231 {
2232 RefPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::cr eate(); 2232 RefPtr<Canvas2DContextAttributes> attributes = Canvas2DContextAttributes::cr eate();
2233 attributes->setAlpha(m_hasAlpha); 2233 attributes->setAlpha(m_hasAlpha);
2234 return attributes.release(); 2234 return attributes.release();
2235 } 2235 }
2236 2236
2237 } // namespace WebCore 2237 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/canvas/CanvasPattern.cpp ('k') | Source/core/html/canvas/WebGLRenderingContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698