Changeset 83888 in webkit
- Timestamp:
- Apr 14, 2011 1:31:43 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r83887 r83888 1 2011-04-14 Matthew Delaney <mdelaney@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Have canvas drawImageFromRect just redirect to use drawImage 6 https://bugs.webkit.org/show_bug.cgi?id=58516 7 8 * fast/canvas/drawImageFromRect_withToDataURLAsSource-expected.txt: Added. 9 * fast/canvas/drawImageFromRect_withToDataURLAsSource.html: Added. 10 1 11 2011-04-14 James Robinson <jamesr@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r83887 r83888 1 2011-04-14 Matthew Delaney <mdelaney@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Have canvas drawImageFromRect just redirect to use drawImage 6 https://bugs.webkit.org/show_bug.cgi?id=58516 7 8 Test: fast/canvas/drawImageFromRect_withToDataURLAsSource.html 9 10 * html/canvas/CanvasRenderingContext2D.cpp: 11 (WebCore::CanvasRenderingContext2D::drawImage): 12 (WebCore::CanvasRenderingContext2D::drawImageFromRect): 13 * html/canvas/CanvasRenderingContext2D.h: 14 1 15 2011-04-14 James Robinson <jamesr@chromium.org> 2 16 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r83457 r83888 1238 1238 } 1239 1239 1240 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect& srcRect, const FloatRect& dstRect, 1241 ExceptionCode& ec) 1240 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode& ec) 1241 { 1242 drawImage(image, srcRect, dstRect, state().m_globalComposite, ec); 1243 } 1244 1245 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, ExceptionCode& ec) 1242 1246 { 1243 1247 if (!image) { … … 1281 1285 FloatRect sourceRect = c->roundToDevicePixels(normalizedSrcRect); 1282 1286 FloatRect destRect = c->roundToDevicePixels(normalizedDstRect); 1283 c->drawImage(cachedImage->image(), ColorSpaceDeviceRGB, destRect, sourceRect, state().m_globalComposite);1287 c->drawImage(cachedImage->image(), ColorSpaceDeviceRGB, destRect, sourceRect, op); 1284 1288 didDraw(destRect); 1285 1289 } … … 1440 1444 #endif 1441 1445 1442 // FIXME: Why isn't this just another overload of drawImage? Why have a different name?1443 1446 void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement* image, 1444 1447 float sx, float sy, float sw, float sh, … … 1446 1449 const String& compositeOperation) 1447 1450 { 1448 if (!image)1449 return;1450 1451 CachedImage* cachedImage = image->cachedImage();1452 if (!cachedImage)1453 return;1454 1455 checkOrigin(image);1456 1457 GraphicsContext* c = drawingContext();1458 if (!c)1459 return;1460 if (!state().m_invertibleCTM)1461 return;1462 1463 1451 CompositeOperator op; 1464 1452 if (!parseCompositeOperator(compositeOperation, op)) 1465 1453 op = CompositeSourceOver; 1466 1454 1467 FloatRect destRect = FloatRect(dx, dy, dw, dh); 1468 c->drawImage(cachedImage->image(), ColorSpaceDeviceRGB, destRect, FloatRect(sx, sy, sw, sh), op); 1469 didDraw(destRect); 1455 ExceptionCode ec; 1456 drawImage(image, FloatRect(sx, sy, sw, sh), FloatRect(dx, dy, dw, dh), op, ec); 1470 1457 } 1471 1458 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
r83451 r83888 176 176 void drawImage(HTMLCanvasElement*, float sx, float sy, float sw, float sh, float dx, float dy, float dw, float dh, ExceptionCode&); 177 177 void drawImage(HTMLCanvasElement*, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionCode&); 178 void drawImage(HTMLImageElement*, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, ExceptionCode&); 178 179 #if ENABLE(VIDEO) 179 180 void drawImage(HTMLVideoElement*, float x, float y, ExceptionCode&);
Note: See TracChangeset
for help on using the changeset viewer.