Changeset 114150 in webkit


Ignore:
Timestamp:
Apr 13, 2012 11:20:25 AM (12 years ago)
Author:
mitz@apple.com
Message:

<rdar://problem/10912680> Pixel access canvas APIs do not operate at backing store resolution
https://bugs.webkit.org/show_bug.cgi?id=83836

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/canvas/2d.imageDataHD.html

Added getImageDataHD and putImageDataHD functions to CanvasRenderingContext2D, as proposed in
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-March/035112.html>. The functions
are prefixed with “webkit” for now.

  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::getImageData): Added this cover function that calls
through to getImageData with LogicalCoordinateSystem.
(WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Added. Calls through to
getImageData with BackingStoreCoordinateSystem.
(WebCore::CanvasRenderingContext2D::getImageData): Added a CoordinateSystem parameter to this
now-private function. It is passed through to ImageBuffer::getUnmultipliedImageData().
(WebCore::CanvasRenderingContext2D::putImageData): Added this cover function that calls
through to putImageData with LogicalCoordinateSystem.
(WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Added. Calls through to
putImageData with BackingStoreCoordinateSystem.
(WebCore::CanvasRenderingContext2D::putImageData): Added a CoordinateSystem parameter to this
function. It is passed through to ImageBuffer::putByteArray, and used to compute the rect to
invalidate after the drawing operation.

  • html/canvas/CanvasRenderingContext2D.h:
  • html/canvas/CanvasRenderingContext2D.idl: Added webkitPutImageDataHD() and

webkitGetImageDataHD().

  • platform/graphics/ImageBuffer.h: Added a CoordinateSystem enum with the values

LogicalCoordinateSystem and BackingStoreCoordinateSystem. Added a CoordinateSystem parameter,
which defaults to LogicalCoordinateSystem, to getUnmultipliedImageData,
getPremultipliedImageData, and putByteArray.

  • platform/graphics/cairo/ImageBufferCairo.cpp:

(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):
(WebCore::ImageBuffer::toDataURL):

  • platform/graphics/cg/ImageBufferCG.cpp:

(WebCore::ImageBuffer::getUnmultipliedImageData): Now uses the CoordinateSystem parameter to
decide whether to ask ImageBufferDaya::getData() to apply the resolution scale or not.
(WebCore::ImageBuffer::getPremultipliedImageData): Ditto.
(WebCore::ImageBuffer::putByteArray): Now uses the CoordinateSystem parameter to decide
whether to maintain the resolution scale while drawing or not.
(WebCore::ImageBuffer::toDataURL):

  • platform/graphics/gtk/ImageBufferGtk.cpp:

(WebCore::ImageBuffer::toDataURL):

  • platform/graphics/qt/ImageBufferQt.cpp:

(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):
(WebCore::ImageBuffer::toDataURL):

  • platform/graphics/skia/ImageBufferSkia.cpp:

(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):
(WebCore::ImageBuffer::toDataURL):

  • platform/graphics/wince/ImageBufferWinCE.cpp:

(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):
(WebCore::ImageBuffer::toDataURL):

  • platform/graphics/wx/ImageBufferWx.cpp:

(WebCore::ImageBuffer::getUnmultipliedImageData):
(WebCore::ImageBuffer::getPremultipliedImageData):
(WebCore::ImageBuffer::putByteArray):
(WebCore::ImageBuffer::toDataURL):

LayoutTests:

  • fast/canvas/2d.imageDataHD-expected.txt: Added.
  • fast/canvas/2d.imageDataHD.html: Added.
Location:
trunk
Files:
4 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r114148 r114150  
     12012-04-13  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/10912680> Pixel access canvas APIs do not operate at backing store resolution
     4        https://bugs.webkit.org/show_bug.cgi?id=83836
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/canvas/2d.imageDataHD-expected.txt: Added.
     9        * fast/canvas/2d.imageDataHD.html: Added.
     10
    1112012-04-13  Anders Carlsson  <andersca@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r114147 r114150  
     12012-04-13  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/10912680> Pixel access canvas APIs do not operate at backing store resolution
     4        https://bugs.webkit.org/show_bug.cgi?id=83836
     5
     6        Reviewed by Darin Adler.
     7
     8        Test: fast/canvas/2d.imageDataHD.html
     9
     10        Added getImageDataHD and putImageDataHD functions to CanvasRenderingContext2D, as proposed in
     11        <http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-March/035112.html>. The functions
     12        are prefixed with “webkit” for now.
     13
     14        * html/canvas/CanvasRenderingContext2D.cpp:
     15        (WebCore::CanvasRenderingContext2D::getImageData): Added this cover function that calls
     16        through to getImageData with LogicalCoordinateSystem.
     17        (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Added. Calls through to
     18        getImageData with BackingStoreCoordinateSystem.
     19        (WebCore::CanvasRenderingContext2D::getImageData): Added a CoordinateSystem parameter to this
     20        now-private function. It is passed through to ImageBuffer::getUnmultipliedImageData().
     21        (WebCore::CanvasRenderingContext2D::putImageData): Added this cover function that calls
     22        through to putImageData with LogicalCoordinateSystem.
     23        (WebCore::CanvasRenderingContext2D::webkitPutImageDataHD): Added. Calls through to
     24        putImageData with BackingStoreCoordinateSystem.
     25        (WebCore::CanvasRenderingContext2D::putImageData): Added a CoordinateSystem parameter to this
     26        function. It is passed through to ImageBuffer::putByteArray, and used to compute the rect to
     27        invalidate after the drawing operation.
     28        * html/canvas/CanvasRenderingContext2D.h:
     29        * html/canvas/CanvasRenderingContext2D.idl: Added webkitPutImageDataHD() and
     30        webkitGetImageDataHD().
     31        * platform/graphics/ImageBuffer.h: Added a CoordinateSystem enum with the values
     32        LogicalCoordinateSystem and BackingStoreCoordinateSystem. Added a CoordinateSystem parameter,
     33        which defaults to LogicalCoordinateSystem, to getUnmultipliedImageData,
     34        getPremultipliedImageData, and putByteArray.
     35        * platform/graphics/cairo/ImageBufferCairo.cpp:
     36        (WebCore::ImageBuffer::getUnmultipliedImageData):
     37        (WebCore::ImageBuffer::getPremultipliedImageData):
     38        (WebCore::ImageBuffer::putByteArray):
     39        (WebCore::ImageBuffer::toDataURL):
     40        * platform/graphics/cg/ImageBufferCG.cpp:
     41        (WebCore::ImageBuffer::getUnmultipliedImageData): Now uses the CoordinateSystem parameter to
     42        decide whether to ask ImageBufferDaya::getData() to apply the resolution scale or not.
     43        (WebCore::ImageBuffer::getPremultipliedImageData): Ditto.
     44        (WebCore::ImageBuffer::putByteArray): Now uses the CoordinateSystem parameter to decide
     45        whether to maintain the resolution scale while drawing or not.
     46        (WebCore::ImageBuffer::toDataURL):
     47        * platform/graphics/gtk/ImageBufferGtk.cpp:
     48        (WebCore::ImageBuffer::toDataURL):
     49        * platform/graphics/qt/ImageBufferQt.cpp:
     50        (WebCore::ImageBuffer::getUnmultipliedImageData):
     51        (WebCore::ImageBuffer::getPremultipliedImageData):
     52        (WebCore::ImageBuffer::putByteArray):
     53        (WebCore::ImageBuffer::toDataURL):
     54        * platform/graphics/skia/ImageBufferSkia.cpp:
     55        (WebCore::ImageBuffer::getUnmultipliedImageData):
     56        (WebCore::ImageBuffer::getPremultipliedImageData):
     57        (WebCore::ImageBuffer::putByteArray):
     58        (WebCore::ImageBuffer::toDataURL):
     59        * platform/graphics/wince/ImageBufferWinCE.cpp:
     60        (WebCore::ImageBuffer::getUnmultipliedImageData):
     61        (WebCore::ImageBuffer::getPremultipliedImageData):
     62        (WebCore::ImageBuffer::putByteArray):
     63        (WebCore::ImageBuffer::toDataURL):
     64        * platform/graphics/wx/ImageBufferWx.cpp:
     65        (WebCore::ImageBuffer::getUnmultipliedImageData):
     66        (WebCore::ImageBuffer::getPremultipliedImageData):
     67        (WebCore::ImageBuffer::putByteArray):
     68        (WebCore::ImageBuffer::toDataURL):
     69
    1702012-04-12  Shawn Singh  <shawnsingh@chromium.org>
    271
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r113457 r114150  
    5252#include "HTMLNames.h"
    5353#include "HTMLVideoElement.h"
    54 #include "ImageBuffer.h"
    5554#include "ImageData.h"
    5655#include "KURL.h"
     
    17901789PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(float sx, float sy, float sw, float sh, ExceptionCode& ec) const
    17911790{
     1791    return getImageData(ImageBuffer::LogicalCoordinateSystem, sx, sy, sw, sh, ec);
     1792}
     1793
     1794PassRefPtr<ImageData> CanvasRenderingContext2D::webkitGetImageDataHD(float sx, float sy, float sw, float sh, ExceptionCode& ec) const
     1795{
     1796    return getImageData(ImageBuffer::BackingStoreCoordinateSystem, sx, sy, sw, sh, ec);
     1797}
     1798
     1799PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::CoordinateSystem coordinateSystem, float sx, float sy, float sw, float sh, ExceptionCode& ec) const
     1800{
    17921801    if (!canvas()->originClean()) {
    17931802        DEFINE_STATIC_LOCAL(String, consoleMessage, ("Unable to get image data from canvas because the canvas has been tainted by cross-origin data."));
     
    17961805        return 0;
    17971806    }
     1807
    17981808    if (!sw || !sh) {
    17991809        ec = INDEX_SIZE_ERR;
     
    18131823        sh = -sh;
    18141824    }
    1815    
     1825
    18161826    FloatRect logicalRect(sx, sy, sw, sh);
    18171827    if (logicalRect.width() < 1)
     
    18271837        return createEmptyImageData(imageDataRect.size());
    18281838
    1829     RefPtr<ByteArray> byteArray = buffer->getUnmultipliedImageData(imageDataRect);
     1839    RefPtr<ByteArray> byteArray = buffer->getUnmultipliedImageData(imageDataRect, coordinateSystem);
    18301840    if (!byteArray)
    18311841        return 0;
     
    18431853}
    18441854
     1855void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, float dy, ExceptionCode& ec)
     1856{
     1857    if (!data) {
     1858        ec = TYPE_MISMATCH_ERR;
     1859        return;
     1860    }
     1861    webkitPutImageDataHD(data, dx, dy, 0, 0, data->width(), data->height(), ec);
     1862}
     1863
    18451864void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, float dirtyX, float dirtyY,
     1865                                            float dirtyWidth, float dirtyHeight, ExceptionCode& ec)
     1866{
     1867    putImageData(data, ImageBuffer::LogicalCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, ec);
     1868}
     1869
     1870void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode& ec)
     1871{
     1872    putImageData(data, ImageBuffer::BackingStoreCoordinateSystem, dx, dy, dirtyX, dirtyY, dirtyWidth, dirtyHeight, ec);
     1873}
     1874
     1875void CanvasRenderingContext2D::putImageData(ImageData* data, ImageBuffer::CoordinateSystem coordinateSystem, float dx, float dy, float dirtyX, float dirtyY,
    18461876                                            float dirtyWidth, float dirtyHeight, ExceptionCode& ec)
    18471877{
     
    18741904    IntRect destRect = enclosingIntRect(clipRect);
    18751905    destRect.move(destOffset);
    1876     destRect.intersect(IntRect(IntPoint(), buffer->internalSize()));
     1906    destRect.intersect(IntRect(IntPoint(), coordinateSystem == ImageBuffer::LogicalCoordinateSystem ? buffer->logicalSize() : buffer->internalSize()));
    18771907    if (destRect.isEmpty())
    18781908        return;
     
    18801910    sourceRect.move(-destOffset);
    18811911
    1882     buffer->putByteArray(Unmultiplied, data->data()->data(), IntSize(data->width(), data->height()), sourceRect, IntPoint(destOffset));
     1912    buffer->putByteArray(Unmultiplied, data->data()->data(), IntSize(data->width(), data->height()), sourceRect, IntPoint(destOffset), coordinateSystem);
     1913
     1914    if (coordinateSystem == ImageBuffer::BackingStoreCoordinateSystem) {
     1915        FloatRect dirtyRect = destRect;
     1916        dirtyRect.scale(1 / canvas()->deviceScaleFactor());
     1917        destRect = enclosingIntRect(dirtyRect);
     1918    }
    18831919    didDraw(destRect, CanvasDidDrawApplyNone); // ignore transform, shadow and clip
    18841920}
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h

    r113780 r114150  
    3535#include "Font.h"
    3636#include "GraphicsTypes.h"
     37#include "ImageBuffer.h"
    3738#include "Path.h"
    3839#include "PlatformString.h"
     
    198199    PassRefPtr<ImageData> createImageData(float width, float height, ExceptionCode&) const;
    199200    PassRefPtr<ImageData> getImageData(float sx, float sy, float sw, float sh, ExceptionCode&) const;
     201    PassRefPtr<ImageData> webkitGetImageDataHD(float sx, float sy, float sw, float sh, ExceptionCode&) const;
    200202    void putImageData(ImageData*, float dx, float dy, ExceptionCode&);
    201203    void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&);
     204    void webkitPutImageDataHD(ImageData*, float dx, float dy, ExceptionCode&);
     205    void webkitPutImageDataHD(ImageData*, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&);
    202206
    203207    float webkitBackingStorePixelRatio() const { return canvas()->deviceScaleFactor(); }
     
    314318    void prepareGradientForDashboard(CanvasGradient* gradient) const;
    315319
     320    PassRefPtr<ImageData> getImageData(ImageBuffer::CoordinateSystem, float sx, float sy, float sw, float sh, ExceptionCode&) const;
     321    void putImageData(ImageData*, ImageBuffer::CoordinateSystem, float dx, float dy, float dirtyX, float dirtyY, float dirtyWidth, float dirtyHeight, ExceptionCode&);
     322
    316323    Vector<State, 1> m_stateStack;
    317324    bool m_usesCSSCompatibilityParseMode;
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl

    r113780 r114150  
    205205            raises(DOMException);
    206206
     207        void webkitPutImageDataHD(in ImageData imagedata, in float dx, in float dy)
     208            raises(DOMException);
     209        void webkitPutImageDataHD(in ImageData imagedata, in float dx, in float dy, in float dirtyX, in float dirtyY, in float dirtyWidth, in float dirtyHeight)
     210            raises(DOMException);
     211
    207212        CanvasPattern createPattern(in HTMLCanvasElement canvas, in [TreatNullAs=NullString] DOMString repetitionType)
    208213            raises (DOMException);
     
    222227            raises(DOMException);
    223228
     229        ImageData webkitGetImageDataHD(in [Optional=DefaultIsUndefined] float sx, in [Optional=DefaultIsUndefined] float sy,
     230                                       in [Optional=DefaultIsUndefined] float sw, in [Optional=DefaultIsUndefined] float sh)
     231            raises(DOMException);
     232
    224233        readonly attribute float webkitBackingStorePixelRatio;
    225234    };
  • trunk/Source/WebCore/platform/graphics/ImageBuffer.h

    r113457 r114150  
    9797        PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore) const;
    9898
    99         PassRefPtr<ByteArray> getUnmultipliedImageData(const IntRect&) const;
    100         PassRefPtr<ByteArray> getPremultipliedImageData(const IntRect&) const;
     99        enum CoordinateSystem { LogicalCoordinateSystem, BackingStoreCoordinateSystem };
    101100
    102         void putByteArray(Multiply multiplied, ByteArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint);
     101        PassRefPtr<ByteArray> getUnmultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const;
     102        PassRefPtr<ByteArray> getPremultipliedImageData(const IntRect&, CoordinateSystem = LogicalCoordinateSystem) const;
     103
     104        void putByteArray(Multiply multiplied, ByteArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem = LogicalCoordinateSystem);
    103105       
    104106        void convertToLuminanceMask();
    105107       
    106         String toDataURL(const String& mimeType, const double* quality = 0) const;
     108        String toDataURL(const String& mimeType, const double* quality = 0, CoordinateSystem = LogicalCoordinateSystem) const;
    107109#if !USE(CG)
    108110        AffineTransform baseTransform() const { return AffineTransform(); }
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r113486 r114150  
    191191}
    192192
    193 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect) const
     193PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    194194{
    195195    return getImageData<Unmultiplied>(rect, m_data, m_size);
    196196}
    197197
    198 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect) const
     198PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    199199{
    200200    return getImageData<Premultiplied>(rect, m_data, m_size);
    201201}
    202202
    203 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     203void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    204204{
    205205    ASSERT(cairo_surface_get_type(m_data.m_surface) == CAIRO_SURFACE_TYPE_IMAGE);
     
    266266}
    267267
    268 String ImageBuffer::toDataURL(const String& mimeType, const double*) const
     268String ImageBuffer::toDataURL(const String& mimeType, const double*, CoordinateSystem) const
    269269{
    270270    cairo_surface_t* image = cairo_get_target(context()->platformContext()->cr());
  • trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp

    r113457 r114150  
    307307}
    308308
    309 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect) const
     309PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem coordinateSystem) const
    310310{
    311311    if (m_context->isAcceleratedContext()) {
     
    315315#endif
    316316    }
    317     return m_data.getData(rect, internalSize(), m_context->isAcceleratedContext(), true, m_resolutionScale);
    318 }
    319 
    320 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect) const
     317    return m_data.getData(rect, internalSize(), m_context->isAcceleratedContext(), true, coordinateSystem == LogicalCoordinateSystem ? m_resolutionScale : 1);
     318}
     319
     320PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem coordinateSystem) const
    321321{
    322322    if (m_context->isAcceleratedContext()) {
     
    326326#endif
    327327    }
    328     return m_data.getData(rect, internalSize(), m_context->isAcceleratedContext(), false, m_resolutionScale);
    329 }
    330 
    331 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     328    return m_data.getData(rect, internalSize(), m_context->isAcceleratedContext(), false, coordinateSystem == LogicalCoordinateSystem ? m_resolutionScale : 1);
     329}
     330
     331void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem coordinateSystem)
    332332{
    333333    if (!m_context->isAcceleratedContext()) {
    334         m_data.putData(source, sourceSize, sourceRect, destPoint, internalSize(), m_context->isAcceleratedContext(), multiplied == Unmultiplied, m_resolutionScale);
     334        m_data.putData(source, sourceSize, sourceRect, destPoint, internalSize(), m_context->isAcceleratedContext(), multiplied == Unmultiplied, coordinateSystem == LogicalCoordinateSystem ? m_resolutionScale : 1);
    335335        return;
    336336    }
     
    348348    CGContextRef destContext = context()->platformContext();
    349349    CGContextSaveGState(destContext);
    350     CGContextConcatCTM(destContext, AffineTransform(wkGetUserToBaseCTM(destContext)).inverse());
     350    if (coordinateSystem == LogicalCoordinateSystem)
     351        CGContextConcatCTM(destContext, AffineTransform(wkGetUserToBaseCTM(destContext)).inverse());
     352    else
     353        CGContextConcatCTM(destContext, AffineTransform(CGContextGetCTM(destContext)).inverse());
    351354    wkCGContextResetClip(destContext);
    352355    CGContextSetInterpolationQuality(destContext, kCGInterpolationNone);
     
    356359
    357360    // Draw the image in CG coordinate space
    358     IntPoint destPointInCGCoords(destPoint.x() + sourceRect.x(), logicalSize().height() - (destPoint.y()+sourceRect.y()) - sourceRect.height());
     361    IntPoint destPointInCGCoords(destPoint.x() + sourceRect.x(), (coordinateSystem == LogicalCoordinateSystem ? logicalSize() : internalSize()).height() - (destPoint.y() + sourceRect.y()) - sourceRect.height());
    359362    IntRect destRectInCGCoords(destPointInCGCoords, sourceCopySize);
    360363    RetainPtr<CGImageRef> sourceCopyImage(AdoptCF, sourceCopy->copyNativeImage());
     
    431434}
    432435
    433 String ImageBuffer::toDataURL(const String& mimeType, const double* quality) const
     436String ImageBuffer::toDataURL(const String& mimeType, const double* quality, CoordinateSystem) const
    434437{
    435438    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
  • trunk/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp

    r113833 r114150  
    5555}
    5656
    57 String ImageBuffer::toDataURL(const String& mimeType, const double* quality) const
     57String ImageBuffer::toDataURL(const String& mimeType, const double* quality, CoordinateSystem) const
    5858{
    5959    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
  • trunk/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp

    r113949 r114150  
    272272}
    273273
    274 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect) const
     274PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    275275{
    276276    return getImageData<Unmultiplied>(rect, m_data, m_size);
    277277}
    278278
    279 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect) const
     279PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    280280{
    281281    return getImageData<Premultiplied>(rect, m_data, m_size);
     
    298298}
    299299
    300 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     300void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    301301{
    302302    ASSERT(sourceRect.width() > 0);
     
    392392}
    393393
    394 String ImageBuffer::toDataURL(const String& mimeType, const double* quality) const
     394String ImageBuffer::toDataURL(const String& mimeType, const double* quality, CoordinateSystem) const
    395395{
    396396    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
  • trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp

    r113828 r114150  
    263263}
    264264
    265 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect) const
     265PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    266266{
    267267    return getImageData<Unmultiplied>(rect, context()->platformContext()->canvas(), m_size);
    268268}
    269269
    270 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect) const
     270PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    271271{
    272272    return getImageData<Premultiplied>(rect, context()->platformContext()->canvas(), m_size);
    273273}
    274274
    275 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     275void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    276276{
    277277    SkCanvas* canvas = context()->platformContext()->canvas();
     
    344344}
    345345
    346 String ImageBuffer::toDataURL(const String& mimeType, const double* quality) const
     346String ImageBuffer::toDataURL(const String& mimeType, const double* quality, CoordinateSystem) const
    347347{
    348348    ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
  • trunk/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp

    r113486 r114150  
    171171}
    172172
    173 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect) const
     173PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    174174{
    175175    return getImageData<false>(rect, m_data.m_bitmap.get());
    176176}
    177177
    178 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect) const
     178PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    179179{
    180180    return getImageData<true>(rect, m_data.m_bitmap.get());
    181181}
    182182
    183 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     183void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    184184{
    185185    SharedBitmap* bitmap = m_data.m_bitmap.get();
     
    232232}
    233233
    234 String ImageBuffer::toDataURL(const String& mimeType, const double*) const
     234String ImageBuffer::toDataURL(const String& mimeType, const double*, CoordinateSystem) const
    235235{
    236236    if (!m_data.m_bitmap->bytes())
  • trunk/Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp

    r113486 r114150  
    123123}
    124124
    125 PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect) const
     125PassRefPtr<ByteArray> ImageBuffer::getUnmultipliedImageData(const IntRect& rect, CoordinateSystem) const
    126126{
    127127    notImplemented();
     
    129129}
    130130
    131 PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect) const
     131PassRefPtr<ByteArray> ImageBuffer::getPremultipliedImageData(const IntRect& rect, CoordinateSystem) const
    132132{
    133133    notImplemented();
     
    135135}
    136136
    137 void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     137void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, CoordinateSystem)
    138138{
    139139    notImplemented();
    140140}
    141141   
    142 String ImageBuffer::toDataURL(const String& mimeType, const double*) const
     142String ImageBuffer::toDataURL(const String& mimeType, const double*, CoordinateSystem) const
    143143{
    144144    notImplemented();
Note: See TracChangeset for help on using the changeset viewer.