Changeset 276984 in webkit
- Timestamp:
- May 4, 2021 2:40:29 PM (15 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/images/image-orientation-background-size-bug-expected.html (added)
-
LayoutTests/fast/images/image-orientation-background-size-bug.html (added)
-
LayoutTests/fast/images/resources/green-504x378-90deg.jpg (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276971 r276984 1 2021-05-04 Cameron McCormack <heycam@apple.com> 2 3 Handle clamping of heights for images affected by background-size and EXIF orientation correctly 4 https://bugs.webkit.org/show_bug.cgi?id=221005 5 <rdar://problem/73692426> 6 7 Reviewed by Simon Fraser. 8 9 * fast/images/image-orientation-background-size-bug-expected.html: Added. 10 * fast/images/image-orientation-background-size-bug.html: Added. 11 * fast/images/resources/green-504x378-90deg.jpg: Added. This is a 12 solid green 504x378 JPEG with an EXIF orientation tag requiring a 13 90deg rotation. 14 1 15 2021-05-04 Sergio Villar Senin <svillar@igalia.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r276981 r276984 1 2021-05-04 Cameron McCormack <heycam@apple.com> 2 3 Handle clamping of heights for images affected by background-size and EXIF orientation correctly 4 https://bugs.webkit.org/show_bug.cgi?id=221005 5 <rdar://problem/73692426> 6 7 Reviewed by Simon Fraser. 8 9 GraphicsContext::drawPlatformImage handles requests with source rects 10 whose heights are greater than the image (which can happen due to 11 rounding issues) by clamping the source rect. This clamping incorrectly 12 looks at the CGImage's height, which for an image rotated 90deg due to 13 EXIF orientation metadata, is the wrong dimension. 14 15 Test: fast/images/image-orientation-background-size-bug.html 16 17 * platform/graphics/cg/GraphicsContextCG.cpp: 18 (WebCore::GraphicsContext::drawPlatformImage): 19 1 20 2021-05-04 Jer Noble <jer.noble@apple.com> 2 21 -
trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r275650 r276984 215 215 RetainPtr<CGImageRef> subImage(image); 216 216 217 float currHeight = options.orientation().usesWidthAsHeight() ? CGImageGetWidth(subImage.get()) : CGImageGetHeight(subImage.get()); 217 auto logicalHeight = [&](CGImageRef image) { 218 return options.orientation().usesWidthAsHeight() ? CGImageGetWidth(image) : CGImageGetHeight(image); 219 }; 220 221 float currHeight = logicalHeight(subImage.get()); 218 222 if (currHeight <= srcRect.y()) 219 223 return; … … 266 270 #endif 267 271 if (currHeight < srcRect.maxY()) { 268 ASSERT( CGImageGetHeight(subImage.get()) == currHeight - CGRectIntegral(srcRect).origin.y);269 adjustedDestRect.setHeight( CGImageGetHeight(subImage.get()) / yScale);272 ASSERT(logicalHeight(subImage.get()) == currHeight - CGRectIntegral(srcRect).origin.y); 273 adjustedDestRect.setHeight(logicalHeight(subImage.get()) / yScale); 270 274 } 271 275 } else {
Note: See TracChangeset
for help on using the changeset viewer.