Changeset 268176 in webkit
- Timestamp:
- Oct 8, 2020 5:40:31 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r268174 r268176 1 2020-10-08 Lauro Moura <lmoura@igalia.com> 2 3 [GTK][WPE] Missing Exif Orientation support 4 https://bugs.webkit.org/show_bug.cgi?id=95299 5 6 Reviewed by Carlos Alberto Lopez Perez. 7 8 Update expectations after partial EXIF support 9 10 * platform/gtk/TestExpectations: 11 * platform/wpe/TestExpectations: 12 1 13 2020-10-08 Diego Pino Garcia <dpino@igalia.com> 2 14 -
trunk/LayoutTests/platform/gtk/TestExpectations
r268113 r268176 3401 3401 webkit.org/b/201981 http/wpt/resource-timing/rt-resources-per-worker.html [ Failure Pass ] 3402 3402 3403 webkit.org/b/201982 fast/images/exif-orientation-background.html [ ImageOnlyFailure ]3404 webkit.org/b/201982 fast/images/exif-orientation-canvas.html [ ImageOnlyFailure ]3405 webkit.org/b/201982 fast/images/exif-orientation-composited.html [ ImageOnlyFailure ]3406 webkit.org/b/201982 fast/images/exif-orientation-content.html [ ImageOnlyFailure ]3407 webkit.org/b/201982 fast/images/exif-orientation-element-object-fit.html [ ImageOnlyFailure ]3408 webkit.org/b/201982 fast/images/exif-orientation-element.html [ ImageOnlyFailure ]3409 webkit.org/b/201982 fast/images/exif-orientation-image-document.html [ ImageOnlyFailure ]3410 webkit.org/b/201982 fast/images/exif-orientation-image-object.html [ ImageOnlyFailure ]3411 webkit.org/b/201982 fast/images/exif-orientation-svg-feimage.html [ ImageOnlyFailure ]3412 webkit.org/b/201982 fast/images/exif-orientation-svg-image.html [ ImageOnlyFailure ]3413 webkit.org/b/201982 fast/images/exif-orientation-webgl-texture.html [ ImageOnlyFailure ]3414 webkit.org/b/201982 fast/images/exif-orientation-background-image-no-repeat.html [ ImageOnlyFailure ]3415 3403 webkit.org/b/201982 fast/images/exif-orientation-background-image-repeat.html [ ImageOnlyFailure ] 3416 3404 webkit.org/b/201982 fast/images/exif-orientation-border-image.html [ ImageOnlyFailure ] 3417 webkit.org/b/201982 fast/images/image-orientation-dynamic-from-image.html [ ImageOnlyFailure ]3418 3405 3419 3406 webkit.org/b/202225 accessibility/misspelling-range.html [ Failure ] -
trunk/LayoutTests/platform/wpe/TestExpectations
r268051 r268176 1854 1854 webkit.org/b/201981 imported/w3c/web-platform-tests/service-workers/service-worker/windowclient-navigate.https.html [ Failure ] 1855 1855 1856 webkit.org/b/201982 fast/images/exif-orientation-background.html [ ImageOnlyFailure ]1857 webkit.org/b/201982 fast/images/exif-orientation-canvas.html [ ImageOnlyFailure ]1858 webkit.org/b/201982 fast/images/exif-orientation-composited.html [ ImageOnlyFailure ]1859 webkit.org/b/201982 fast/images/exif-orientation-content.html [ ImageOnlyFailure ]1860 webkit.org/b/201982 fast/images/exif-orientation-element-object-fit.html [ ImageOnlyFailure ]1861 webkit.org/b/201982 fast/images/exif-orientation-element.html [ ImageOnlyFailure ]1862 webkit.org/b/201982 fast/images/exif-orientation-image-document.html [ ImageOnlyFailure ]1863 webkit.org/b/201982 fast/images/exif-orientation-image-object.html [ ImageOnlyFailure ]1864 webkit.org/b/201982 fast/images/exif-orientation-svg-feimage.html [ ImageOnlyFailure ]1865 webkit.org/b/201982 fast/images/exif-orientation-svg-image.html [ ImageOnlyFailure ]1866 webkit.org/b/201982 fast/images/exif-orientation-webgl-texture.html [ ImageOnlyFailure ]1867 webkit.org/b/201982 fast/images/image-orientation-dynamic-from-image.html [ ImageOnlyFailure ]1868 webkit.org/b/201982 fast/images/exif-orientation-background-image-no-repeat.html [ ImageOnlyFailure ]1869 1856 webkit.org/b/201982 fast/images/exif-orientation-background-image-repeat.html [ ImageOnlyFailure ] 1870 1857 webkit.org/b/201982 fast/images/exif-orientation-border-image.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r268173 r268176 1 2020-10-08 Lauro Moura <lmoura@igalia.com> 2 3 [GTK][WPE] Missing Exif Orientation support 4 https://bugs.webkit.org/show_bug.cgi?id=95299 5 6 Reviewed by Carlos Alberto Lopez Perez. 7 8 CairoOperations::drawSurface is not taking 90/270 degrees orientation 9 changes in account correctly. 10 11 As in these operations the size of the surfaces will be the same but 12 not exactly equal (by transposing width and height), drawSurface 13 currently wrongly presumes the need for some some padding. The same 14 happens to the scale factors. 15 16 Covered by existing tests. 17 18 * platform/graphics/cairo/CairoOperations.cpp: 19 (WebCore::Cairo::drawNativeImage): Forward usesWidthAsHeight to 20 drawSurface. 21 (WebCore::Cairo::drawSurface): use correct scaling/padding when 22 getting surfaces from images rotated 90/270 degrees. 23 * platform/graphics/cairo/CairoOperations.h: Add new enum to forward 24 Orientation.usesWidthAsHeight. 25 1 26 2020-10-07 Antoine Quint <graouts@webkit.org> 2 27 -
trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp
r265648 r268176 884 884 } 885 885 886 drawSurface(platformContext, surface, dst, srcRect, options.interpolationQuality(), globalAlpha, shadowState); 886 auto orientationSizing = options.orientation().usesWidthAsHeight() ? OrientationSizing::WidthAsHeight : OrientationSizing::Normal; 887 drawSurface(platformContext, surface, dst, srcRect, options.interpolationQuality(), globalAlpha, shadowState, orientationSizing); 887 888 platformContext.restore(); 888 889 } … … 894 895 } 895 896 896 void drawSurface(PlatformContextCairo& platformContext, cairo_surface_t* surface, const FloatRect& destRect, const FloatRect& originalSrcRect, InterpolationQuality imageInterpolationQuality, float globalAlpha, const ShadowState& shadowState )897 void drawSurface(PlatformContextCairo& platformContext, cairo_surface_t* surface, const FloatRect& destRect, const FloatRect& originalSrcRect, InterpolationQuality imageInterpolationQuality, float globalAlpha, const ShadowState& shadowState, OrientationSizing orientationSizing) 897 898 { 898 899 // Avoid invalid cairo matrix with small values. … … 915 916 float leftPadding = 0; 916 917 float topPadding = 0; 917 if (srcRect.x() || srcRect.y() || srcRect.size() != cairoSurfaceSize(surface)) { 918 auto surfaceSize = cairoSurfaceSize(surface); 919 bool didUseWidthAsHeight = orientationSizing == OrientationSizing::WidthAsHeight; 920 bool differentSize = srcRect.size() != (didUseWidthAsHeight ? surfaceSize.transposedSize() : surfaceSize); 921 if (srcRect.x() || srcRect.y() || differentSize) { 918 922 // Cairo subsurfaces don't support floating point boundaries well, so we expand the rectangle. 919 923 IntRect expandedSrcRect(enclosingIntRect(srcRect)); … … 950 954 // by expanding floating point source rectangle sizes. It's important to take the absolute value 951 955 // of the scale since the original width and height might be negative. 952 float scaleX = std::fabs(srcRect.width() / destRect.width()); 953 float scaleY = std::fabs(srcRect.height() / destRect.height()); 956 float scaleX = 1; 957 float scaleY = 1; 958 if (didUseWidthAsHeight) { 959 scaleX = std::fabs(srcRect.width() / destRect.height()); 960 scaleY = std::fabs(srcRect.height() / destRect.width()); 961 } else { 962 scaleX = std::fabs(srcRect.width() / destRect.width()); 963 scaleY = std::fabs(srcRect.height() / destRect.height()); 964 } 954 965 cairo_matrix_t matrix = { scaleX, 0, 0, scaleY, leftPadding, topPadding }; 955 966 cairo_pattern_set_matrix(pattern.get(), &matrix); -
trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.h
r254506 r268176 72 72 } // namespace State 73 73 74 enum class OrientationSizing { 75 Normal, 76 WidthAsHeight 77 }; 78 74 79 struct FillSource { 75 80 FillSource() = default; … … 141 146 void drawNativeImage(PlatformContextCairo&, cairo_surface_t*, const FloatRect&, const FloatRect&, const ImagePaintingOptions&, float, const ShadowState&); 142 147 void drawPattern(PlatformContextCairo&, cairo_surface_t*, const IntSize&, const FloatRect&, const FloatRect&, const AffineTransform&, const FloatPoint&, const ImagePaintingOptions&); 143 WEBCORE_EXPORT void drawSurface(PlatformContextCairo&, cairo_surface_t*, const FloatRect&, const FloatRect&, InterpolationQuality, float, const ShadowState& );148 WEBCORE_EXPORT void drawSurface(PlatformContextCairo&, cairo_surface_t*, const FloatRect&, const FloatRect&, InterpolationQuality, float, const ShadowState&, OrientationSizing operationSizing = OrientationSizing::Normal); 144 149 145 150 void drawRect(PlatformContextCairo&, const FloatRect&, float, const Color&, StrokeStyle, const Color&);
Note: See TracChangeset
for help on using the changeset viewer.