Changeset 157909 in webkit


Ignore:
Timestamp:
Oct 23, 2013 8:40:10 PM (11 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

Integrate css3-images image-orientation with existing EXIF support
https://bugs.webkit.org/show_bug.cgi?id=91566

Reviewed by Beth Dakin.

Source/WebCore:

Original patch by David Barr(davidbarr@chromium.org).

This patch passes an information of image orientation into existing EXIF support functions
(draw() functions of image classes mainly). We need to let the functions to know the information
in order to meet the image-orientation requirement.

Spec: http://dev.w3.org/csswg/css-images-3/#the-image-orientation
The css3-images module specification is at last call.

Test: fast/css/image-orientation/image-orientation.html
Image orientation test is to check if incorrect rotation value can be fixed with correct orientation.

  • loader/cache/CachedImage.cpp:

(WebCore::CachedImage::imageSizeForRenderer):

  • page/DragController.cpp:

(WebCore::DragController::doImageDrag):

  • page/Frame.cpp:

(WebCore::Frame::nodeImage):

  • platform/graphics/BitmapImage.cpp:

(WebCore::BitmapImage::updateSize):
(WebCore::BitmapImage::sizeRespectingOrientation):
(WebCore::BitmapImage::drawPattern):

  • platform/graphics/BitmapImage.h:
  • platform/graphics/CrossfadeGeneratedImage.cpp:

(WebCore::CrossfadeGeneratedImage::draw):

  • platform/graphics/CrossfadeGeneratedImage.h:
  • platform/graphics/GeneratedImage.h:
  • platform/graphics/GradientImage.cpp:

(WebCore::GradientImage::draw):

  • platform/graphics/GradientImage.h:
  • platform/graphics/Image.cpp:

(WebCore::Image::draw):
(WebCore::Image::drawTiled):

  • platform/graphics/Image.h:
  • platform/graphics/blackberry/ImageBlackBerry.cpp:
  • platform/graphics/cairo/BitmapImageCairo.cpp:

(WebCore::BitmapImage::draw):

  • platform/graphics/cg/BitmapImageCG.cpp:
  • platform/graphics/cg/PDFDocumentImage.cpp:

(WebCore::PDFDocumentImage::draw):

  • platform/graphics/cg/PDFDocumentImage.h:
  • platform/graphics/win/ImageCGWin.cpp:

(WebCore::BitmapImage::getHBITMAPOfSize):
(WebCore::BitmapImage::drawFrameMatchingSourceSize):

  • platform/graphics/wince/ImageBufferWinCE.cpp:

(WebCore::BufferedImage::draw):

  • platform/graphics/wince/ImageWinCE.cpp:

(WebCore::BitmapImage::draw):

  • platform/mac/DragImageMac.mm:

(WebCore::createDragImageFromImage):

  • rendering/RenderEmbeddedObject.cpp:

(WebCore::RenderEmbeddedObject::paintSnapshotImage):

  • rendering/RenderImage.cpp:

(WebCore::RenderImage::styleDidChange):

  • rendering/RenderSnapshottedPlugIn.cpp:

(WebCore::RenderSnapshottedPlugIn::paintSnapshot):

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeRequiresLayout):

  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImage::drawForContainer):
(WebCore::SVGImage::nativeImageForCurrentFrame):
(WebCore::SVGImage::draw):

  • svg/graphics/SVGImage.h:
  • svg/graphics/SVGImageForContainer.cpp:

(WebCore::SVGImageForContainer::draw):

  • svg/graphics/SVGImageForContainer.h:

Source/WebKit:

  • WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Update export symbols for draw functions.

LayoutTests:

  • fast/css/image-orientation/image-orientation-expected.txt: Fixed wrong description.
  • fast/css/image-orientation/image-orientation.html: Remove a space.
Location:
trunk
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r157904 r157909  
     12013-10-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Integrate css3-images image-orientation with existing EXIF support
     4        https://bugs.webkit.org/show_bug.cgi?id=91566
     5
     6        Reviewed by Beth Dakin.
     7
     8        * fast/css/image-orientation/image-orientation-expected.txt: Fixed wrong description.
     9        * fast/css/image-orientation/image-orientation.html: Remove a space.
     10
    1112013-10-23  Roger Fong  <roger_fong@apple.com>
    212
  • trunk/LayoutTests/fast/css/image-orientation/image-orientation-expected.txt

    r122895 r157909  
    1 Apply image-resolution property and check computed style.
     1Apply image-orientation property and check computed style.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    44
    55
    6 PASS p.style.cssText is "image-orientation: -360deg; "
     6PASS p.style.cssText is "image-orientation: -360deg;"
    77PASS getComputedStyle(p).imageOrientation is "0deg"
    8 PASS p.style.cssText is "image-orientation: -315deg; "
     8PASS p.style.cssText is "image-orientation: -315deg;"
    99PASS getComputedStyle(p).imageOrientation is "0deg"
    10 PASS p.style.cssText is "image-orientation: 0deg; "
     10PASS p.style.cssText is "image-orientation: 0deg;"
    1111PASS getComputedStyle(p).imageOrientation is "0deg"
    12 PASS p.style.cssText is "image-orientation: 315deg; "
     12PASS p.style.cssText is "image-orientation: 315deg;"
    1313PASS getComputedStyle(p).imageOrientation is "0deg"
    14 PASS p.style.cssText is "image-orientation: 360deg; "
     14PASS p.style.cssText is "image-orientation: 360deg;"
    1515PASS getComputedStyle(p).imageOrientation is "0deg"
    16 PASS p.style.cssText is "image-orientation: -270deg; "
     16PASS p.style.cssText is "image-orientation: -270deg;"
    1717PASS getComputedStyle(p).imageOrientation is "90deg"
    18 PASS p.style.cssText is "image-orientation: -225deg; "
     18PASS p.style.cssText is "image-orientation: -225deg;"
    1919PASS getComputedStyle(p).imageOrientation is "90deg"
    20 PASS p.style.cssText is "image-orientation: 45deg; "
     20PASS p.style.cssText is "image-orientation: 45deg;"
    2121PASS getComputedStyle(p).imageOrientation is "90deg"
    22 PASS p.style.cssText is "image-orientation: 90deg; "
     22PASS p.style.cssText is "image-orientation: 90deg;"
    2323PASS getComputedStyle(p).imageOrientation is "90deg"
    24 PASS p.style.cssText is "image-orientation: -180deg; "
     24PASS p.style.cssText is "image-orientation: -180deg;"
    2525PASS getComputedStyle(p).imageOrientation is "180deg"
    26 PASS p.style.cssText is "image-orientation: -135deg; "
     26PASS p.style.cssText is "image-orientation: -135deg;"
    2727PASS getComputedStyle(p).imageOrientation is "180deg"
    28 PASS p.style.cssText is "image-orientation: 135deg; "
     28PASS p.style.cssText is "image-orientation: 135deg;"
    2929PASS getComputedStyle(p).imageOrientation is "180deg"
    30 PASS p.style.cssText is "image-orientation: -180deg; "
     30PASS p.style.cssText is "image-orientation: -180deg;"
    3131PASS getComputedStyle(p).imageOrientation is "180deg"
    32 PASS p.style.cssText is "image-orientation: -90deg; "
     32PASS p.style.cssText is "image-orientation: -90deg;"
    3333PASS getComputedStyle(p).imageOrientation is "270deg"
    34 PASS p.style.cssText is "image-orientation: -45deg; "
     34PASS p.style.cssText is "image-orientation: -45deg;"
    3535PASS getComputedStyle(p).imageOrientation is "270deg"
    36 PASS p.style.cssText is "image-orientation: 225deg; "
     36PASS p.style.cssText is "image-orientation: 225deg;"
    3737PASS getComputedStyle(p).imageOrientation is "270deg"
    38 PASS p.style.cssText is "image-orientation: 270deg; "
     38PASS p.style.cssText is "image-orientation: 270deg;"
    3939PASS getComputedStyle(p).imageOrientation is "270deg"
    4040PASS successfullyParsed is true
  • trunk/LayoutTests/fast/css/image-orientation/image-orientation.html

    r155410 r157909  
    66<body>
    77<script>
    8 description('Apply image-resolution property and check computed style.');
     8description('Apply image-orientation property and check computed style.');
    99
    1010var expectations = {
     
    2020        p.style.imageOrientation = '';
    2121        p.style.imageOrientation = test;
    22         shouldBe('p.style.cssText', '"image-orientation: ' + test + '; "');
     22        shouldBe('p.style.cssText', '"image-orientation: ' + test + ';"');
    2323        shouldBe('getComputedStyle(p).imageOrientation', '"' + expected + '"');
    2424    });
  • trunk/Source/WebCore/ChangeLog

    r157908 r157909  
     12013-10-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Integrate css3-images image-orientation with existing EXIF support
     4        https://bugs.webkit.org/show_bug.cgi?id=91566
     5
     6        Reviewed by Beth Dakin.
     7
     8        Original patch by David Barr(davidbarr@chromium.org).
     9
     10        This patch passes an information of image orientation into existing EXIF support functions
     11        (draw() functions of image classes mainly). We need to let the functions to know the information
     12        in order to meet the image-orientation requirement.
     13
     14        Spec: http://dev.w3.org/csswg/css-images-3/#the-image-orientation
     15        The css3-images module specification is at last call.
     16
     17        Test: fast/css/image-orientation/image-orientation.html
     18        Image orientation test is to check if incorrect rotation value can be fixed with correct orientation.
     19
     20        * loader/cache/CachedImage.cpp:
     21        (WebCore::CachedImage::imageSizeForRenderer):
     22        * page/DragController.cpp:
     23        (WebCore::DragController::doImageDrag):
     24        * page/Frame.cpp:
     25        (WebCore::Frame::nodeImage):
     26        * platform/graphics/BitmapImage.cpp:
     27        (WebCore::BitmapImage::updateSize):
     28        (WebCore::BitmapImage::sizeRespectingOrientation):
     29        (WebCore::BitmapImage::drawPattern):
     30        * platform/graphics/BitmapImage.h:
     31        * platform/graphics/CrossfadeGeneratedImage.cpp:
     32        (WebCore::CrossfadeGeneratedImage::draw):
     33        * platform/graphics/CrossfadeGeneratedImage.h:
     34        * platform/graphics/GeneratedImage.h:
     35        * platform/graphics/GradientImage.cpp:
     36        (WebCore::GradientImage::draw):
     37        * platform/graphics/GradientImage.h:
     38        * platform/graphics/Image.cpp:
     39        (WebCore::Image::draw):
     40        (WebCore::Image::drawTiled):
     41        * platform/graphics/Image.h:
     42        * platform/graphics/blackberry/ImageBlackBerry.cpp:
     43        * platform/graphics/cairo/BitmapImageCairo.cpp:
     44        (WebCore::BitmapImage::draw):
     45        * platform/graphics/cg/BitmapImageCG.cpp:
     46        * platform/graphics/cg/PDFDocumentImage.cpp:
     47        (WebCore::PDFDocumentImage::draw):
     48        * platform/graphics/cg/PDFDocumentImage.h:
     49        * platform/graphics/win/ImageCGWin.cpp:
     50        (WebCore::BitmapImage::getHBITMAPOfSize):
     51        (WebCore::BitmapImage::drawFrameMatchingSourceSize):
     52        * platform/graphics/wince/ImageBufferWinCE.cpp:
     53        (WebCore::BufferedImage::draw):
     54        * platform/graphics/wince/ImageWinCE.cpp:
     55        (WebCore::BitmapImage::draw):
     56        * platform/mac/DragImageMac.mm:
     57        (WebCore::createDragImageFromImage):
     58        * rendering/RenderEmbeddedObject.cpp:
     59        (WebCore::RenderEmbeddedObject::paintSnapshotImage):
     60        * rendering/RenderImage.cpp:
     61        (WebCore::RenderImage::styleDidChange):
     62        * rendering/RenderSnapshottedPlugIn.cpp:
     63        (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
     64        * rendering/style/RenderStyle.cpp:
     65        (WebCore::RenderStyle::changeRequiresLayout):
     66        * svg/graphics/SVGImage.cpp:
     67        (WebCore::SVGImage::drawForContainer):
     68        (WebCore::SVGImage::nativeImageForCurrentFrame):
     69        (WebCore::SVGImage::draw):
     70        * svg/graphics/SVGImage.h:
     71        * svg/graphics/SVGImageForContainer.cpp:
     72        (WebCore::SVGImageForContainer::draw):
     73        * svg/graphics/SVGImageForContainer.h:
     74
    1752013-10-23  Andreas Kling  <akling@apple.com>
    276
  • trunk/Source/WebCore/loader/cache/CachedImage.cpp

    r156918 r157909  
    261261    LayoutSize imageSize;
    262262
     263#if ENABLE(CSS_IMAGE_ORIENTATION)
     264    if (!renderer)
     265        return IntSize();
     266
     267    ImageOrientationDescription orientationDescription(renderer->shouldRespectImageOrientation());
     268    orientationDescription.setImageOrientationEnum(renderer->style()->imageOrientation());
     269
     270    if (m_image->isBitmapImage()
     271        && (orientationDescription.respectImageOrientation() == RespectImageOrientation && orientationDescription.imageOrientation() != DefaultImageOrientation))
     272        imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrientation(orientationDescription);
     273#else
    263274    if (m_image->isBitmapImage() && (renderer && renderer->shouldRespectImageOrientation() == RespectImageOrientation))
    264275        imageSize = static_cast<BitmapImage*>(m_image.get())->sizeRespectingOrientation();
     276#endif
     277
    265278#if ENABLE(SVG)
    266279    else if (m_image->isSVGImage() && sizeType == UsedSize) {
  • trunk/Source/WebCore/page/DragController.cpp

    r157058 r157909  
    855855    IntPoint origin;
    856856
     857    if (!element.renderer())
     858        return;
     859
     860    ImageOrientationDescription orientationDescription(element.renderer()->shouldRespectImageOrientation());
     861#if ENABLE(CSS_IMAGE_ORIENTATION)
     862    orientationDescription.setImageOrientationEnum(element.renderer()->style()->imageOrientation());
     863#endif
     864
    857865    Image* image = getImage(element);
    858866    if (image && image->size().height() * image->size().width() <= MaxOriginalImageArea
    859         && (dragImage = createDragImageFromImage(image, element.renderer() ? ImageOrientationDescription(element.renderer()->shouldRespectImageOrientation()) : ImageOrientationDescription()))) {
     867        && (dragImage = createDragImageFromImage(image, element.renderer() ? orientationDescription : ImageOrientationDescription()))) {
    860868        IntSize originalSize = rect.size();
    861869        origin = rect.location();
  • trunk/Source/WebCore/page/Frame.cpp

    r157373 r157909  
    10341034
    10351035    RefPtr<Image> image = buffer->copyImage();
    1036     return createDragImageFromImage(image.get(), ImageOrientationDescription(renderer->shouldRespectImageOrientation()));
     1036
     1037    ImageOrientationDescription orientationDescription(renderer->shouldRespectImageOrientation());
     1038#if ENABLE(CSS_IMAGE_ORIENTATION)
     1039    orientationDescription.setImageOrientationEnum(renderer->style()->imageOrientation());
     1040#endif
     1041    return createDragImageFromImage(image.get(), orientationDescription);
    10371042}
    10381043
  • trunk/Source/WebCore/platform/graphics/BitmapImage.cpp

    r157337 r157909  
    181181}
    182182
    183 void BitmapImage::updateSize() const
    184 {
    185     if (!m_sizeAvailable || m_haveSize)
    186         return;
    187 
    188     m_size = m_source.size();
    189     m_sizeRespectingOrientation = m_source.size(ImageOrientationDescription(RespectImageOrientation));
     183void BitmapImage::updateSize(ImageOrientationDescription description) const
     184{
     185    if (!m_sizeAvailable || (m_haveSize
     186#if ENABLE(CSS_IMAGE_ORIENTATION)
     187        && description.imageOrientation() == static_cast<ImageOrientationEnum>(m_imageOrientation)
     188        && description.respectImageOrientation() == static_cast<RespectImageOrientationEnum>(m_shouldRespectImageOrientation)
     189#endif
     190        ))
     191        return;
     192
     193    m_size = m_source.size(description);
     194    m_sizeRespectingOrientation = m_source.size(ImageOrientationDescription(RespectImageOrientation, description.imageOrientation()));
     195    m_imageOrientation = static_cast<unsigned>(description.imageOrientation());
     196    m_shouldRespectImageOrientation = static_cast<unsigned>(description.respectImageOrientation());
    190197    m_haveSize = true;
    191198    didDecodeProperties();
     
    198205}
    199206
    200 IntSize BitmapImage::sizeRespectingOrientation() const
    201 {
    202     updateSize();
     207IntSize BitmapImage::sizeRespectingOrientation(ImageOrientationDescription description) const
     208{
     209    updateSize(description);
    203210    return m_sizeRespectingOrientation;
    204211}
     
    519526        setImageObserver(0);
    520527
    521         draw(buffer->context(), tileRect, tileRect, styleColorSpace, op, blendMode);
     528        draw(buffer->context(), tileRect, tileRect, styleColorSpace, op, blendMode, ImageOrientationDescription());
    522529
    523530        setImageObserver(observer);
  • trunk/Source/WebCore/platform/graphics/BitmapImage.h

    r157337 r157909  
    122122
    123123    virtual IntSize size() const OVERRIDE;
    124     IntSize sizeRespectingOrientation() const;
     124    IntSize sizeRespectingOrientation(ImageOrientationDescription = ImageOrientationDescription()) const;
    125125    IntSize currentFrameSize() const;
    126126    virtual bool getHotSpot(IntPoint&) const OVERRIDE;
     
    173173
    174174private:
    175     void updateSize() const;
     175    void updateSize(ImageOrientationDescription = ImageOrientationDescription()) const;
    176176
    177177protected:
     
    188188    virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) OVERRIDE;
    189189#endif
    190     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode) OVERRIDE;
    191 #if USE(CG) || USE(CAIRO) || PLATFORM(BLACKBERRY)
    192190    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) OVERRIDE;
    193 #endif
    194191
    195192#if USE(WINGDI)
     
    269266    mutable IntSize m_size; // The size to use for the overall image (will just be the size of the first image).
    270267    mutable IntSize m_sizeRespectingOrientation;
     268    mutable unsigned m_imageOrientation : 4; // ImageOrientationEnum
     269    mutable unsigned m_shouldRespectImageOrientation : 1; // RespectImageOrientationEnum
    271270
    272271    size_t m_currentFrame; // The index of the current frame of animation.
  • trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.cpp

    r157045 r157909  
    8686}
    8787
    88 void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode)
     88void CrossfadeGeneratedImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode, ImageOrientationDescription)
    8989{
    9090    GraphicsContextStateSaver stateSaver(*context);
  • trunk/Source/WebCore/platform/graphics/CrossfadeGeneratedImage.h

    r155721 r157909  
    5252
    5353protected:
    54     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode) OVERRIDE;
     54    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) OVERRIDE;
    5555    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& dstRect, BlendMode) OVERRIDE;
    5656
  • trunk/Source/WebCore/platform/graphics/GeneratedImage.h

    r155721 r157909  
    5151
    5252protected:
    53     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode) OVERRIDE = 0;
     53    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) OVERRIDE = 0;
    5454    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
    5555        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) OVERRIDE = 0;
  • trunk/Source/WebCore/platform/graphics/GradientImage.cpp

    r156391 r157909  
    3333namespace WebCore {
    3434
    35 void GradientImage::draw(GraphicsContext* destContext, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode)
     35void GradientImage::draw(GraphicsContext* destContext, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
    3636{
    3737    GraphicsContextStateSaver stateSaver(*destContext);
  • trunk/Source/WebCore/platform/graphics/GradientImage.h

    r156226 r157909  
    4646
    4747protected:
    48     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode) OVERRIDE;
     48    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) OVERRIDE;
    4949    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
    5050        const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect, BlendMode) OVERRIDE;
  • trunk/Source/WebCore/platform/graphics/Image.cpp

    r156391 r157909  
    9191}
    9292
    93 void Image::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode, ImageOrientationDescription)
     93void Image::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode, ImageOrientationDescription description)
    9494{
    95     draw(ctx, dstRect, srcRect, styleColorSpace, op, blendMode);
     95    draw(ctx, dstRect, srcRect, styleColorSpace, op, blendMode, description);
    9696}
    9797
     
    127127        visibleSrcRect.setWidth(destRect.width() / scale.width());
    128128        visibleSrcRect.setHeight(destRect.height() / scale.height());
    129         draw(ctxt, destRect, visibleSrcRect, styleColorSpace, op, blendMode);
     129        draw(ctxt, destRect, visibleSrcRect, styleColorSpace, op, blendMode, ImageOrientationDescription());
    130130        return;
    131131    }
  • trunk/Source/WebCore/platform/graphics/Image.h

    r156795 r157909  
    196196    virtual void drawFrameMatchingSourceSize(GraphicsContext*, const FloatRect& dstRect, const IntSize& srcSize, ColorSpace styleColorSpace, CompositeOperator) { }
    197197#endif
    198     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode) = 0;
    199198    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription);
    200199    void drawTiled(GraphicsContext*, const FloatRect& dstRect, const FloatPoint& srcPoint, const FloatSize& tileSize, ColorSpace styleColorSpace,
  • trunk/Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp

    r154088 r157909  
    120120}
    121121
    122 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
    123 {
    124     draw(context, dstRect, srcRect, styleColorSpace, op, blendMode, ImageOrientationDescription());
    125 
    126122void BitmapImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator op, BlendMode, ImageOrientationDescription description)
    127123{
  • trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp

    r157337 r157909  
    6262}
    6363
    64 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
    65 {
    66     draw(context, dst, src, styleColorSpace, op, blendMode, ImageOrientationDescription());
    67 }
    68 
    6964void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op,
    7065    BlendMode blendMode, ImageOrientationDescription description)
     
    9994#endif
    10095
    101     ImageOrientation orientation;
     96    ImageOrientation frameOrientation(description.imageOrientation());
    10297    if (description.respectImageOrientation() == RespectImageOrientation)
    103         orientation = frameOrientationAtIndex(m_currentFrame);
     98        frameOrientation = frameOrientationAtIndex(m_currentFrame);
    10499
    105100    FloatRect dstRect = dst;
    106101
    107     if (orientation != DefaultImageOrientation) {
     102    if (frameOrientation != DefaultImageOrientation) {
    108103        // ImageOrientation expects the origin to be at (0, 0).
    109104        context->translate(dstRect.x(), dstRect.y());
    110105        dstRect.setLocation(FloatPoint());
    111         context->concatCTM(orientation.transformFromDefault(dstRect.size()));
    112         if (orientation.usesWidthAsHeight()) {
     106        context->concatCTM(frameOrientation.transformFromDefault(dstRect.size()));
     107        if (frameOrientation.usesWidthAsHeight()) {
    113108            // The destination rectangle will have it's width and height already reversed for the orientation of
    114109            // the image, as it was needed for page layout, so we need to reverse it back here.
  • trunk/Source/WebCore/platform/graphics/cg/BitmapImageCG.cpp

    r157337 r157909  
    161161}
    162162
    163 void BitmapImage::draw(GraphicsContext* ctx, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode)
    164 {
    165     draw(ctx, dstRect, srcRect, styleColorSpace, op, blendMode, ImageOrientationDescription());
    166 }
    167 
    168163void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& destRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription description)
    169164{
  • trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp

    r155665 r157909  
    177177}
    178178
    179 void PDFDocumentImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator op, BlendMode)
     179void PDFDocumentImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator op, BlendMode, ImageOrientationDescription)
    180180{
    181181    if (!m_document || !m_hasPage)
  • trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h

    r155665 r157909  
    7171    virtual IntSize size() const OVERRIDE;
    7272
    73     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode) OVERRIDE;
     73    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) OVERRIDE;
    7474
    7575    // FIXME: Implement this to be less conservative.
  • trunk/Source/WebCore/platform/graphics/win/ImageCGWin.cpp

    r155570 r157909  
    7979        drawFrameMatchingSourceSize(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), *size, ColorSpaceDeviceRGB, CompositeCopy);
    8080    else
    81         draw(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), ColorSpaceDeviceRGB, CompositeCopy, BlendModeNormal);
     81        draw(&gc, FloatRect(0.0f, 0.0f, bmpInfo.bmWidth, bmpInfo.bmHeight), FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), ColorSpaceDeviceRGB, CompositeCopy, BlendModeNormal, ImageOrientationDescription());
    8282
    8383    // Do cleanup
     
    9595            size_t currentFrame = m_currentFrame;
    9696            m_currentFrame = i;
    97             draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), styleColorSpace, compositeOp, BlendModeNormal);
     97            draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, srcSize.width(), srcSize.height()), styleColorSpace, compositeOp, BlendModeNormal, ImageOrientationDescription());
    9898            m_currentFrame = currentFrame;
    9999            return;
     
    103103    // No image of the correct size was found, fallback to drawing the current frame
    104104    IntSize imageSize = BitmapImage::size();
    105     draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), styleColorSpace, compositeOp, BlendModeNormal);
     105    draw(ctxt, dstRect, FloatRect(0.0f, 0.0f, imageSize.width(), imageSize.height()), styleColorSpace, compositeOp, BlendModeNormal, ImageOrientationDescription());
    106106}
    107107
  • trunk/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp

    r154088 r157909  
    4242    virtual void destroyDecodedData(bool destroyAll = true) {}
    4343    virtual unsigned decodedSize() const { return 0; }
    44     virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode);
     44    virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription);
    4545    virtual void drawPattern(GraphicsContext*, const FloatRect& srcRect, const AffineTransform& patternTransform,
    4646                             const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);
     
    4949};
    5050
    51 void BufferedImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode)
     51void BufferedImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
    5252{
    5353    IntRect intDstRect = enclosingIntRect(dstRect);
  • trunk/Source/WebCore/platform/graphics/wince/ImageWinCE.cpp

    r147837 r157909  
    109109}
    110110
    111 void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRectIn, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode)
     111void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dstRect, const FloatRect& srcRectIn, ColorSpace styleColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
    112112{
    113113    if (!m_source.initialized())
  • trunk/Source/WebCore/platform/mac/DragImageMac.mm

    r156860 r157909  
    8888        ImageOrientation orientation;
    8989        BitmapImage* bitmapImage = static_cast<BitmapImage *>(image);
    90         IntSize sizeRespectingOrientation = bitmapImage->sizeRespectingOrientation();
     90        IntSize sizeRespectingOrientation = bitmapImage->sizeRespectingOrientation(description);
    9191
    9292        if (description.respectImageOrientation() == RespectImageOrientation)
  • trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp

    r157535 r157909  
    207207
    208208    bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
    209     context->drawImage(image, style()->colorSpace(), alignedRect, CompositeSourceOver, ImageOrientationDescription(shouldRespectImageOrientation()), useLowQualityScaling);
     209    ImageOrientationDescription orientationDescription(shouldRespectImageOrientation());
     210#if ENABLE(CSS_IMAGE_ORIENTATION)
     211    orientationDescription.setImageOrientationEnum(style()->imageOrientation());
     212#endif
     213    context->drawImage(image, style()->colorSpace(), alignedRect, CompositeSourceOver, orientationDescription, useLowQualityScaling);
    210214}
    211215
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r157665 r157909  
    161161        m_needsToSetSizeForAltText = false;
    162162    }
     163#if ENABLE(CSS_IMAGE_ORIENTATION)
     164    if (diff == StyleDifferenceLayout && oldStyle->imageOrientation() != style()->imageOrientation())
     165        return imageDimensionsChanged(true /* imageSizeChanged */);
     166#endif
     167
    163168#if ENABLE(CSS_IMAGE_RESOLUTION)
    164169    if (diff == StyleDifferenceLayout
  • trunk/Source/WebCore/rendering/RenderSnapshottedPlugIn.cpp

    r155806 r157909  
    140140    bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, image, alignedRect.size());
    141141
    142     ImageOrientationDescription orientationDescription;
     142    ImageOrientationDescription orientationDescription(shouldRespectImageOrientation());
    143143#if ENABLE(CSS_IMAGE_ORIENTATION)
    144144    orientationDescription.setImageOrientationEnum(style()->imageOrientation());
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r157823 r157909  
    553553            || rareInheritedData->m_lineBoxContain != other->rareInheritedData->m_lineBoxContain
    554554            || rareInheritedData->m_lineGrid != other->rareInheritedData->m_lineGrid
     555#if ENABLE(CSS_IMAGE_ORIENTATION)
     556            || rareInheritedData->m_imageOrientation != other->rareInheritedData->m_imageOrientation
     557#endif
    555558#if ENABLE(CSS_IMAGE_RESOLUTION)
    556559            || rareInheritedData->m_imageResolutionSource != other->rareInheritedData->m_imageResolutionSource
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r156978 r157909  
    158158    scaledSrc.setSize(adjustedSrcSize);
    159159
    160     draw(context, dstRect, scaledSrc, colorSpace, compositeOp, blendMode);
     160    draw(context, dstRect, scaledSrc, colorSpace, compositeOp, blendMode, ImageOrientationDescription());
    161161
    162162    setImageObserver(observer);
     
    175175        return 0;
    176176
    177     draw(buffer->context(), rect(), rect(), ColorSpaceDeviceRGB, CompositeSourceOver, BlendModeNormal);
     177    draw(buffer->context(), rect(), rect(), ColorSpaceDeviceRGB, CompositeSourceOver, BlendModeNormal, ImageOrientationDescription());
    178178
    179179    // FIXME: WK(Bug 113657): We should use DontCopyBackingStore here.
     
    217217}
    218218
    219 void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode)
     219void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
    220220{
    221221    if (!m_page)
  • trunk/Source/WebCore/svg/graphics/SVGImage.h

    r155721 r157909  
    9292
    9393    SVGImage(ImageObserver*);
    94     virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode) OVERRIDE;
     94    virtual void draw(GraphicsContext*, const FloatRect& fromRect, const FloatRect& toRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) OVERRIDE;
    9595    void drawForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode);
    9696    void drawPatternForContainer(GraphicsContext*, const FloatSize, float, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace,
  • trunk/Source/WebCore/svg/graphics/SVGImageForContainer.cpp

    r154875 r157909  
    3838
    3939void SVGImageForContainer::draw(GraphicsContext* context, const FloatRect& dstRect,
    40     const FloatRect& srcRect, ColorSpace colorSpace, CompositeOperator compositeOp, BlendMode blendMode)
     40    const FloatRect& srcRect, ColorSpace colorSpace, CompositeOperator compositeOp, BlendMode blendMode, ImageOrientationDescription)
    4141{
    4242    m_image->drawForContainer(context, m_containerSize, m_zoom, dstRect, srcRect, colorSpace, compositeOp, blendMode);
  • trunk/Source/WebCore/svg/graphics/SVGImageForContainer.h

    r155721 r157909  
    5656    }
    5757
    58     virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode) OVERRIDE;
     58    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, ColorSpace, CompositeOperator, BlendMode, ImageOrientationDescription) OVERRIDE;
    5959
    6060    virtual void drawPattern(GraphicsContext*, const FloatRect&, const AffineTransform&, const FloatPoint&, ColorSpace, CompositeOperator, const FloatRect&, BlendMode) OVERRIDE;
  • trunk/Source/WebKit/ChangeLog

    r157464 r157909  
     12013-10-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Integrate css3-images image-orientation with existing EXIF support
     4        https://bugs.webkit.org/show_bug.cgi?id=91566
     5
     6        Reviewed by Beth Dakin.
     7
     8        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Update export symbols for draw functions.
     9
    1102013-10-15  Andy Estes  <aestes@apple.com>
    211
  • trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in

    r157702 r157909  
    373373        symbolWithPointer(?getFirstCGImageRefOfSize@BitmapImage@WebCore@@UAEPAUCGImage@@ABVIntSize@2@@Z, ?getFirstCGImageRefOfSize@BitmapImage@WebCore@@UEAAPEAUCGImage@@AEBVIntSize@2@@Z)
    374374        symbolWithPointer(?getCGImageArray@BitmapImage@WebCore@@UAE?AV?$RetainPtr@PBU__CFArray@@@WTF@@XZ, ?getCGImageArray@BitmapImage@WebCore@@UEAA?AV?$RetainPtr@PEBU__CFArray@@@WTF@@XZ)
    375         symbolWithPointer(?draw@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4BlendMode@2@@Z, ?draw@BitmapImage@WebCore@@MEAAXPEAVGraphicsContext@2@AEBVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4BlendMode@2@@Z)
    376375#elif USE(CAIRO)
    377376        symbolWithPointer(?nativeImageForCurrentFrame@BitmapImage@WebCore@@UAE?AV?$PassRefPtr@U_cairo_surface@@@WTF@@XZ, ?nativeImageForCurrentFrame@BitmapImage@WebCore@@UEAA?AV?$PassRefPtr@U_cairo_surface@@@WTF@@XZ)
    378377        symbolWithPointer(?draw@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4BlendMode@2@UImageOrientationDescription@2@@Z, ?draw@BitmapImage@WebCore@@MEAAXPEAVGraphicsContext@2@AEBVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4BlendMode@2@UImageOrientationDescription@2@@Z)
    379         symbolWithPointer(?draw@BitmapImage@WebCore@@MAEXPAVGraphicsContext@2@ABVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4BlendMode@2@@Z, ?draw@BitmapImage@WebCore@@MEAAXPEAVGraphicsContext@2@AEBVFloatRect@2@1W4ColorSpace@2@W4CompositeOperator@2@W4BlendMode@2@@Z)
    380378#endif
    381379        symbolWithPointer(?getHBITMAP@BitmapImage@WebCore@@UAE_NPAUHBITMAP__@@@Z, ?getHBITMAP@BitmapImage@WebCore@@UEAA_NPEAUHBITMAP__@@@Z)
Note: See TracChangeset for help on using the changeset viewer.