shouldRespectImageOrientation should be a value in ImageOrientation
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2019 01:58:53 +0000 (01:58 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2019 01:58:53 +0000 (01:58 +0000)
commitf32e7e4657f86e929fca99a07076e2e8f987dcc0
treea51067ea9fd7d5bb357072da33c59c028e6811c4
parentacb9d1734f231413ee31e0302a71a314ab353779
shouldRespectImageOrientation should be a value in ImageOrientation
https://bugs.webkit.org/show_bug.cgi?id=200553

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-08-13
Reviewed by Simon Fraser.

Source/WebCore:

This patch is a step towards implementing the css image-orientation.

Instead of having ImageOrientationEnum, ImageOrientationDescription,
ImageOrientation and RespectImageOrientationEnum we are going to have a
single structure named 'ImageOrientation' which is a wrapper for the enum
type "Orientation".

This structure will have a constructor and casting operator such that
assigning an enum value and comparing with an enum value will be done
implicitly.

RespectImageOrientation is represented as a new enum value 'FromImage'.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ImageOrientation const):
(WebCore::CSSPrimitiveValue::operator ImageOrientationEnum const): Deleted.
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::createDragImage const):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::paint):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::imageSizeForRenderer const):
* page/DragController.cpp:
(WebCore::DragController::doImageDrag):
* platform/DragImage.cpp:
(WebCore::createDragImageFromSnapshot):
(WebCore::createDragImageFromImage):
* platform/DragImage.h:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
(WebCore::BitmapImage::drawPattern):
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.cpp:
(WebCore::CrossfadeGeneratedImage::draw):
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::draw):
* platform/graphics/CustomPaintImage.h:
* platform/graphics/GeneratedImage.h:
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::draw):
* platform/graphics/GradientImage.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
* platform/graphics/GraphicsContext.h:
(WebCore::ImagePaintingOptions::ImagePaintingOptions):
* platform/graphics/GraphicsContextImpl.cpp:
(WebCore::GraphicsContextImpl::drawImageImpl):
(WebCore::GraphicsContextImpl::drawTiledImageImpl):
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/Image.h:
* platform/graphics/ImageFrame.h:
* platform/graphics/ImageOrientation.cpp: Removed.
* platform/graphics/ImageOrientation.h:
(WebCore::ImageOrientation::ImageOrientation):
(WebCore::ImageOrientation::fromEXIFValue):
(WebCore::ImageOrientation::operator Orientation const):
(WebCore::ImageOrientation::usesWidthAsHeight const):
(WebCore::ImageOrientation::transformFromDefault const):
(WebCore::ImageOrientation::isValidOrientation):
(WebCore::ImageOrientation::isValidEXIFOrientation):
(WebCore::ImageOrientationDescription::ImageOrientationDescription): Deleted.
(WebCore::ImageOrientationDescription::setRespectImageOrientation): Deleted.
(WebCore::ImageOrientationDescription::respectImageOrientation): Deleted.
(WebCore::ImageOrientationDescription::setImageOrientationEnum): Deleted.
(WebCore::ImageOrientationDescription::imageOrientation): Deleted.
(WebCore::ImageOrientation::operator ImageOrientationEnum const): Deleted.
(WebCore::ImageOrientation::operator== const): Deleted.
(WebCore::ImageOrientation::operator!= const): Deleted.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::dump):
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw):
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/NativeImage.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjC::frameOrientationAtIndex const):
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawShadowLayerBuffer):
(WebCore::Cairo::drawShadowImage):
(WebCore::Cairo::drawNativeImage):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::draw):
* platform/graphics/cairo/NativeImageCairo.cpp:
(WebCore::drawNativeImage):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawNativeImage):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::orientationFromProperties):
(WebCore::ImageDecoderCG::frameOrientationAtIndex const):
* platform/graphics/cg/NativeImageCG.cpp:
(WebCore::drawNativeImage):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::draw):
* platform/graphics/cg/PDFDocumentImage.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
(WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
(WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
* platform/graphics/win/Direct2DOperations.cpp:
(WebCore::Direct2D::drawNativeImage):
* platform/graphics/win/ImageCGWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
* platform/graphics/win/ImageDirect2D.cpp:
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/NativeImageDirect2D.cpp:
(WebCore::drawNativeImage):
* platform/gtk/DragImageGtk.cpp:
(WebCore::createDragImageFromImage):
* platform/image-decoders/ScalableImageDecoderFrame.h:
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore::readImageOrientation):
* platform/ios/DragImageIOS.mm:
(WebCore::createDragImageFromImage):
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageFromImage):
* platform/win/DragImageCGWin.cpp:
(WebCore::createDragImageFromImage):
* platform/win/DragImageCairoWin.cpp:
(WebCore::createDragImageFromImage):
* platform/win/DragImageDirect2D.cpp:
(WebCore::createDragImageFromImage):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::imageOrientation const):
(WebCore::RenderElement::shouldRespectImageOrientation const): Deleted.
* rendering/RenderElement.h:
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paintSnapshotImage):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
(WebCore::RenderImage::paintIntoRect):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::paintSnapshot):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setImageOrientation):
(WebCore::RenderStyle::initialImageOrientation):
(WebCore::RenderStyle::imageOrientation const):
* rendering/style/StyleRareInheritedData.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawForContainer):
(WebCore::SVGImage::nativeImageForCurrentFrame):
(WebCore::SVGImage::nativeImage):
(WebCore::SVGImage::draw):
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageForContainer.cpp:
(WebCore::SVGImageForContainer::draw):
* svg/graphics/SVGImageForContainer.h:

Source/WebKit:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::imagePositionInformation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248657 268f45cc-cd09-0410-ab3c-d52691b4dbfc
74 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/dom/DataTransfer.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/platform/DragImage.cpp
Source/WebCore/platform/DragImage.h
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp
Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h
Source/WebCore/platform/graphics/CustomPaintImage.cpp
Source/WebCore/platform/graphics/CustomPaintImage.h
Source/WebCore/platform/graphics/GeneratedImage.h
Source/WebCore/platform/graphics/GradientImage.cpp
Source/WebCore/platform/graphics/GradientImage.h
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/GraphicsContextImpl.cpp
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/ImageFrame.h
Source/WebCore/platform/graphics/ImageOrientation.cpp [deleted file]
Source/WebCore/platform/graphics/ImageOrientation.h
Source/WebCore/platform/graphics/ImageSource.cpp
Source/WebCore/platform/graphics/NamedImageGeneratedImage.cpp
Source/WebCore/platform/graphics/NamedImageGeneratedImage.h
Source/WebCore/platform/graphics/NativeImage.h
Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm
Source/WebCore/platform/graphics/cairo/CairoOperations.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp
Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp
Source/WebCore/platform/graphics/cg/NativeImageCG.cpp
Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
Source/WebCore/platform/graphics/cg/PDFDocumentImage.h
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h
Source/WebCore/platform/graphics/win/Direct2DOperations.cpp
Source/WebCore/platform/graphics/win/ImageCGWin.cpp
Source/WebCore/platform/graphics/win/ImageCairoWin.cpp
Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp
Source/WebCore/platform/graphics/win/ImageDirect2D.cpp
Source/WebCore/platform/graphics/win/NativeImageDirect2D.cpp
Source/WebCore/platform/gtk/DragImageGtk.cpp
Source/WebCore/platform/image-decoders/ScalableImageDecoderFrame.h
Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
Source/WebCore/platform/ios/DragImageIOS.mm
Source/WebCore/platform/mac/DragImageMac.mm
Source/WebCore/platform/win/DragImageCGWin.cpp
Source/WebCore/platform/win/DragImageCairoWin.cpp
Source/WebCore/platform/win/DragImageDirect2D.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderElement.h
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/StyleRareInheritedData.h
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/svg/graphics/SVGImage.h
Source/WebCore/svg/graphics/SVGImageForContainer.cpp
Source/WebCore/svg/graphics/SVGImageForContainer.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm