Changeset 259567 in webkit
- Timestamp:
- Apr 6, 2020, 1:03:17 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/images/image-orientation-none-canvas-expected.html (added)
-
LayoutTests/fast/images/image-orientation-none-canvas.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (modified) (3 diffs)
-
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r259562 r259567 1 2020-04-06 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 CanvasRenderingContext2D.drawImage should ignore the EXIF orientation if the image-orientation is none 4 https://bugs.webkit.org/show_bug.cgi?id=209849 5 6 Reviewed by Darin Adler. 7 8 * fast/images/image-orientation-none-canvas-expected.html: Added. 9 * fast/images/image-orientation-none-canvas.html: Added. 10 1 11 2020-04-05 Manuel Rego Casasnovas <rego@igalia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r259566 r259567 1 2020-04-06 Said Abou-Hallawa <sabouhallawa@apple.com> 2 3 CanvasRenderingContext2D.drawImage should ignore the EXIF orientation if the image-orientation is none 4 https://bugs.webkit.org/show_bug.cgi?id=209849 5 6 Reviewed by Darin Adler. 7 8 drawImage() will get the image-orientation of the HTMLImageElement from 9 its computed style. This will be passed to GraphicsContext::drawImage() 10 in the ImagePaintingOptions. Previously we were passing FromImage always. 11 12 Test: fast/images/image-orientation-none-canvas.html 13 14 * html/canvas/CanvasRenderingContext2DBase.cpp: 15 (WebCore::CanvasRenderingContext2DBase::drawImage): 16 * html/canvas/CanvasRenderingContext2DBase.h: 17 1 18 2020-04-05 Rob Buis <rbuis@igalia.com> 2 19 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
r259024 r259567 1465 1465 FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeType::BeforeDevicePixelRatio)); 1466 1466 1467 auto result = drawImage(imageElement.document(), imageElement.cachedImage(), imageElement.renderer(), imageRect, srcRect, dstRect, op, blendMode); 1467 auto orientation = ImageOrientation::FromImage; 1468 if (auto* computedStyle = imageElement.computedStyle()) 1469 orientation = computedStyle->imageOrientation(); 1470 1471 auto result = drawImage(imageElement.document(), imageElement.cachedImage(), imageElement.renderer(), imageRect, srcRect, dstRect, op, blendMode, orientation); 1468 1472 1469 1473 if (!result.hasException()) … … 1488 1492 #endif 1489 1493 1490 ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(Document& document, CachedImage* cachedImage, const RenderObject* renderer, const FloatRect& imageRect, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode )1494 ExceptionOr<void> CanvasRenderingContext2DBase::drawImage(Document& document, CachedImage* cachedImage, const RenderObject* renderer, const FloatRect& imageRect, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode, ImageOrientation orientation) 1491 1495 { 1492 1496 if (!std::isfinite(dstRect.x()) || !std::isfinite(dstRect.y()) || !std::isfinite(dstRect.width()) || !std::isfinite(dstRect.height()) … … 1544 1548 } 1545 1549 1546 ImagePaintingOptions options = { op, blendMode, ImageOrientation::FromImage};1550 ImagePaintingOptions options = { op, blendMode, orientation }; 1547 1551 1548 1552 if (rectContainsCanvas(normalizedDstRect)) { -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h
r258219 r259567 334 334 ExceptionOr<void> drawImage(HTMLImageElement&, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const BlendMode&); 335 335 ExceptionOr<void> drawImage(CanvasBase&, const FloatRect& srcRect, const FloatRect& dstRect); 336 ExceptionOr<void> drawImage(Document&, CachedImage*, const RenderObject*, const FloatRect& imageRect, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const BlendMode& );336 ExceptionOr<void> drawImage(Document&, CachedImage*, const RenderObject*, const FloatRect& imageRect, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator&, const BlendMode&, ImageOrientation = ImageOrientation::FromImage); 337 337 #if ENABLE(VIDEO) 338 338 ExceptionOr<void> drawImage(HTMLVideoElement&, const FloatRect& srcRect, const FloatRect& dstRect);
Note:
See TracChangeset
for help on using the changeset viewer.