Changeset 106836 in webkit


Ignore:
Timestamp:
Feb 6, 2012 12:54:13 PM (12 years ago)
Author:
mdelaney@apple.com
Message:

toDataURL() uses stale data after putImageData()
https://bugs.webkit.org/show_bug.cgi?id=65767

Source/WebCore:

This patch fixes the issue we've encountered of getting back
stale copies of the CGContext of accelerated ImageBuffers who have seen
putImageData calls but have not been drawn into via the CG API.
This issue is fixed by modifying the way we implement putImageData
in ImageBufferCG to draw the bits wrapped in a CGImage while the CGContext
is in a state where the data will effectively be copied (as is needed for
implementing putImageData) instead of directly modifying the bits of the IOSurface.

Reviewed by Chris Marrin.

Test: fast/canvas/check-stale-putImageData, pixel test to check that the canvas is in fact painted.

  • platform/graphics/cg/ImageBufferCG.cpp: Implement new way of putting image data.
  • platform/graphics/ImageBuffer.h: Merged two previously separate put data calls

into a single and more sensibly named 'putByteArray', since that's what it does!

  • WebCore.exp.in: Added new WKSI call for use in ImageBufferCG.cpp
  • platform/mac/WebCoreSystemInterface.h:
  • platform/mac/WebCoreSystemInterface.mm:

Using new method name.

  • html/canvas/CanvasRenderingContext2D.cpp:
  • platform/graphics/ImageBuffer.cpp:
  • platform/graphics/ShadowBlur.cpp:
  • platform/graphics/filters/FEColorMatrix.cpp:
  • platform/graphics/filters/FEDropShadow.cpp:
  • platform/graphics/filters/FilterEffect.cpp:

Updated other ports' ImageBuffers to use new method.

  • platform/graphics/cairo/ImageBufferCairo.cpp:
  • platform/graphics/qt/ImageBufferQt.cpp:
  • platform/graphics/skia/ImageBufferSkia.cpp:
  • platform/graphics/wince/ImageBufferWinCE.cpp:
  • platform/graphics/wx/ImageBufferWx.cpp:

Source/WebKit/chromium:

Reviewed by Chris Marrin.

  • src/WebViewImpl.cpp: Updated method name.

(WebKit::WebViewImpl::doPixelReadbackToCanvas):

Source/WebKit/mac:

Reviewed by Chris Marrin.

  • WebCoreSupport/WebSystemInterface.mm:

Source/WebKit2:

Reviewed by Chris Marrin.

  • WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:

(InitWebCoreSystemInterface):

WebKitLibraries:

Added WKCGContextResetClip for use in reseting clip for new putByteArray method.

Reviewed by Chris Marrin.

  • WebKitSystemInterface.h: Added WKCGContextResetClip.
  • libWebKitSystemInterfaceLeopard.a:
  • libWebKitSystemInterfaceSnowLeopard.a:
  • libWebKitSystemInterfaceLion.a:
Location:
trunk
Files:
3 added
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106833 r106836  
     12012-02-06  Matthew Delaney  <mdelaney@apple.com>
     2
     3        toDataURL() uses stale data after putImageData()
     4        https://bugs.webkit.org/show_bug.cgi?id=65767
     5
     6        This patch fixes the issue we've encountered of getting back
     7        stale copies of the CGContext of accelerated ImageBuffers who have seen
     8        putImageData calls but have not been drawn into via the CG API.
     9        This issue is fixed by modifying the way we implement putImageData
     10        in ImageBufferCG to draw the bits wrapped in a CGImage while the CGContext
     11        is in a state where the data will effectively be copied (as is needed for
     12        implementing putImageData) instead of directly modifying the bits of the IOSurface.
     13
     14        Reviewed by Chris Marrin.
     15
     16        Test: fast/canvas/check-stale-putImageData, pixel test to check that the canvas is in fact painted.
     17
     18        * platform/graphics/cg/ImageBufferCG.cpp: Implement new way of putting image data.
     19        * platform/graphics/ImageBuffer.h: Merged two previously separate put data calls
     20            into a single and more sensibly named 'putByteArray', since that's what it does!
     21
     22        * WebCore.exp.in: Added new WKSI call for use in ImageBufferCG.cpp
     23        * platform/mac/WebCoreSystemInterface.h:
     24        * platform/mac/WebCoreSystemInterface.mm:
     25
     26        Using new method name.
     27        * html/canvas/CanvasRenderingContext2D.cpp:
     28        * platform/graphics/ImageBuffer.cpp:
     29        * platform/graphics/ShadowBlur.cpp:       
     30        * platform/graphics/filters/FEColorMatrix.cpp:
     31        * platform/graphics/filters/FEDropShadow.cpp:
     32        * platform/graphics/filters/FilterEffect.cpp:
     33
     34        Updated other ports' ImageBuffers to use new method.
     35        * platform/graphics/cairo/ImageBufferCairo.cpp:
     36        * platform/graphics/qt/ImageBufferQt.cpp:
     37        * platform/graphics/skia/ImageBufferSkia.cpp:
     38        * platform/graphics/wince/ImageBufferWinCE.cpp:
     39        * platform/graphics/wx/ImageBufferWx.cpp:
     40
    1412012-02-06  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    242
  • trunk/Source/WebCore/WebCore.exp.in

    r106752 r106836  
    14881488_wkAdvanceDefaultButtonPulseAnimation
    14891489_wkCGContextGetShouldSmoothFonts
     1490_wkCGContextResetClip
    14901491_wkCGPatternCreateWithImageAndTransform
    14911492_wkCopyCFLocalizationPreferredName
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r106729 r106836  
    19721972    sourceRect.move(-destOffset);
    19731973
    1974     buffer->putUnmultipliedImageData(data->data()->data(), IntSize(data->width(), data->height()), sourceRect, IntPoint(destOffset));
     1974    buffer->putByteArray(Unmultiplied, data->data()->data(), IntSize(data->width(), data->height()), sourceRect, IntPoint(destOffset));
    19751975    didDraw(destRect, CanvasDidDrawApplyNone); // ignore transform, shadow and clip
    19761976}
  • trunk/Source/WebCore/platform/graphics/ImageBuffer.cpp

    r95901 r106836  
    8787        srcPixelArray->set(pixelOffset + 3, luma);
    8888    }
    89     putUnmultipliedImageData(srcPixelArray.get(), luminanceRect.size(), luminanceRect, IntPoint());
     89    putByteArray(Unmultiplied, srcPixelArray.get(), luminanceRect.size(), luminanceRect, IntPoint());
    9090}
    9191
  • trunk/Source/WebCore/platform/graphics/ImageBuffer.h

    r106500 r106836  
    102102        PassRefPtr<ByteArray> getPremultipliedImageData(const IntRect&) const;
    103103
    104         void putUnmultipliedImageData(ByteArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint);
    105         void putPremultipliedImageData(ByteArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint);
     104        void putByteArray(Multiply multiplied, ByteArray*, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint);
    106105       
    107106        void convertToLuminanceMask();
  • trunk/Source/WebCore/platform/graphics/ShadowBlur.cpp

    r95901 r106836  
    829829    RefPtr<ByteArray> layerData = m_layerImage->getUnmultipliedImageData(blurRect);
    830830    blurLayerImage(layerData->data(), blurRect.size(), blurRect.width() * 4);
    831     m_layerImage->putUnmultipliedImageData(layerData.get(), blurRect.size(), blurRect, IntPoint());
     831    m_layerImage->putByteArray(Unmultiplied, layerData.get(), blurRect.size(), blurRect, IntPoint());
    832832}
    833833
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r106500 r106836  
    205205}
    206206
    207 template <Multiply multiplied>
    208 void putImageData(ByteArray*& source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, ImageBufferData& data, const IntSize& size)
    209 {
    210     ASSERT(cairo_surface_get_type(data.m_surface) == CAIRO_SURFACE_TYPE_IMAGE);
    211 
    212     unsigned char* dataDst = cairo_image_surface_get_data(data.m_surface);
     207void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     208{
     209    ASSERT(cairo_surface_get_type(m_data.m_surface) == CAIRO_SURFACE_TYPE_IMAGE);
     210
     211    unsigned char* dataDst = cairo_image_surface_get_data(m_data.m_surface);
    213212
    214213    ASSERT(sourceRect.width() > 0);
     
    218217    int destx = destPoint.x() + sourceRect.x();
    219218    ASSERT(destx >= 0);
    220     ASSERT(destx < size.width());
     219    ASSERT(destx < m_size.width());
    221220    ASSERT(originx >= 0);
    222221    ASSERT(originx <= sourceRect.maxX());
    223222
    224223    int endx = destPoint.x() + sourceRect.maxX();
    225     ASSERT(endx <= size.width());
     224    ASSERT(endx <= m_size.width());
    226225
    227226    int numColumns = endx - destx;
     
    230229    int desty = destPoint.y() + sourceRect.y();
    231230    ASSERT(desty >= 0);
    232     ASSERT(desty < size.height());
     231    ASSERT(desty < m_size.height());
    233232    ASSERT(originy >= 0);
    234233    ASSERT(originy <= sourceRect.maxY());
    235234
    236235    int endy = destPoint.y() + sourceRect.maxY();
    237     ASSERT(endy <= size.height());
     236    ASSERT(endy <= m_size.height());
    238237    int numRows = endy - desty;
    239238
    240239    unsigned srcBytesPerRow = 4 * sourceSize.width();
    241     int stride = cairo_image_surface_get_stride(data.m_surface);
     240    int stride = cairo_image_surface_get_stride(m_data.m_surface);
    242241
    243242    unsigned char* srcRows = source->data() + originy * srcBytesPerRow + originx * 4;
     
    258257        srcRows += srcBytesPerRow;
    259258    }
    260     cairo_surface_mark_dirty_rectangle (data.m_surface,
     259    cairo_surface_mark_dirty_rectangle(m_data.m_surface,
    261260                                        destx, desty,
    262261                                        numColumns, numRows);
    263 }
    264 
    265 void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    266 {
    267     putImageData<Unmultiplied>(source, sourceSize, sourceRect, destPoint, m_data, m_size);
    268 }
    269 
    270 void ImageBuffer::putPremultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    271 {
    272     putImageData<Premultiplied>(source, sourceSize, sourceRect, destPoint, m_data, m_size);
    273262}
    274263
  • trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp

    r106500 r106836  
    308308}
    309309
    310 void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    311 {
    312     if (m_context->isAcceleratedContext()) {
    313         CGContextFlush(context()->platformContext());
    314 #if defined(BUILDING_ON_LION)
    315         m_data.m_lastFlushTime = currentTimeMS();
    316 #endif
    317     }
    318     m_data.putData(source, sourceSize, sourceRect, destPoint, m_size, m_context->isAcceleratedContext(), true);
    319 }
    320 
    321 void ImageBuffer::putPremultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    322 {
    323     if (m_context->isAcceleratedContext()) {
    324         CGContextFlush(context()->platformContext());
    325 #if defined(BUILDING_ON_LION)
    326         m_data.m_lastFlushTime = currentTimeMS();
    327 #endif
    328     }
    329     m_data.putData(source, sourceSize, sourceRect, destPoint, m_size, m_context->isAcceleratedContext(), false);
     310void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     311{
     312    if (!m_context->isAcceleratedContext()) {
     313        m_data.putData(source, sourceSize, sourceRect, destPoint, m_size, m_context->isAcceleratedContext(), multiplied == Unmultiplied);
     314        return;
     315    }
     316
     317    // Make a copy of the source to ensure the bits don't change before being drawn
     318    IntSize sourceCopySize(sourceRect.width(), sourceRect.height());
     319    OwnPtr<ImageBuffer> sourceCopy = ImageBuffer::create(sourceCopySize, ColorSpaceDeviceRGB, Unaccelerated);
     320    if (!sourceCopy)
     321        return;
     322    sourceCopy->m_data.putData(source, sourceSize, sourceRect, IntPoint(-sourceRect.x(), -sourceRect.y()), sourceCopy->size(), sourceCopy->context()->isAcceleratedContext(), multiplied == Unmultiplied);
     323
     324    // Set up context for using drawImage as a direct bit copy
     325    CGContextRef destContext = context()->platformContext();
     326    CGContextSaveGState(destContext);
     327    CGContextConcatCTM(destContext, AffineTransform(CGContextGetCTM(destContext)).inverse());
     328    wkCGContextResetClip(destContext);
     329    CGContextSetInterpolationQuality(destContext, kCGInterpolationNone);
     330    CGContextSetAlpha(destContext, 1.0);
     331    CGContextSetBlendMode(destContext, kCGBlendModeCopy);
     332    CGContextSetShadowWithColor(destContext, CGSizeZero, 0, 0);
     333
     334    // Draw the image in CG coordinate space
     335    IntPoint destPointInCGCoords(destPoint.x() + sourceRect.x(), m_size.height() - (destPoint.y()+sourceRect.y()) - sourceRect.height());
     336    IntRect destRectInCGCoords(destPointInCGCoords, sourceCopySize);
     337    RetainPtr<CGImageRef> sourceCopyImage(AdoptCF, sourceCopy->copyNativeImage());
     338    CGContextDrawImage(destContext, destRectInCGCoords, sourceCopyImage.get());
     339    CGContextRestoreGState(destContext);
    330340}
    331341
  • trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp

    r97853 r106836  
    188188    }
    189189
    190     resultImage->putUnmultipliedImageData(pixelArray.get(), imageRect.size(), imageRect, IntPoint());
     190    resultImage->putByteArray(Unmultiplied, pixelArray.get(), imageRect.size(), imageRect, IntPoint());
    191191}
    192192
  • trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp

    r103076 r106836  
    109109    contextShadow.blurLayerImage(srcPixelArray->data(), shadowArea.size(), 4 * shadowArea.size().width());
    110110
    111     resultImage->putPremultipliedImageData(srcPixelArray.get(), shadowArea.size(), shadowArea, IntPoint());
     111    resultImage->putByteArray(Premultiplied, srcPixelArray.get(), shadowArea.size(), shadowArea, IntPoint());
    112112
    113113    resultContext->setCompositeOperation(CompositeSourceIn);
  • trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp

    r104566 r106836  
    131131    IntRect destinationRect(IntPoint(), m_absolutePaintRect.size());
    132132    if (m_premultipliedImageResult)
    133         m_imageBufferResult->putPremultipliedImageData(m_premultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
     133        m_imageBufferResult->putByteArray(Premultiplied, m_premultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
    134134    else
    135         m_imageBufferResult->putUnmultipliedImageData(m_unmultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
     135        m_imageBufferResult->putByteArray(Unmultiplied, m_unmultipliedImageResult.get(), destinationRect.size(), destinationRect, IntPoint());
    136136    return m_imageBufferResult.get();
    137137}
  • trunk/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp

    r106804 r106836  
    302302}
    303303
    304 template <Multiply multiplied>
    305 void putImageData(ByteArray*& source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, ImageBufferData& data, const IntSize& size)
     304void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    306305{
    307306    ASSERT(sourceRect.width() > 0);
     
    311310    int destx = destPoint.x() + sourceRect.x();
    312311    ASSERT(destx >= 0);
    313     ASSERT(destx < size.width());
     312    ASSERT(destx < m_size.width());
    314313    ASSERT(originx >= 0);
    315314    ASSERT(originx <= sourceRect.maxX());
    316315
    317316    int endx = destPoint.x() + sourceRect.maxX();
    318     ASSERT(endx <= size.width());
     317    ASSERT(endx <= m_size.width());
    319318
    320319    int numColumns = endx - destx;
     
    323322    int desty = destPoint.y() + sourceRect.y();
    324323    ASSERT(desty >= 0);
    325     ASSERT(desty < size.height());
     324    ASSERT(desty < m_size.height());
    326325    ASSERT(originy >= 0);
    327326    ASSERT(originy <= sourceRect.maxY());
    328327
    329328    int endy = destPoint.y() + sourceRect.maxY();
    330     ASSERT(endy <= size.height());
     329    ASSERT(endy <= m_size.height());
    331330    int numRows = endy - desty;
    332331
     
    362361    }
    363362
    364     bool isPainting = data.m_painter->isActive();
     363    bool isPainting = m_data.m_painter->isActive();
    365364    if (!isPainting)
    366         data.m_painter->begin(&data.m_pixmap);
     365        m_data.m_painter->begin(&m_data.m_pixmap);
    367366    else {
    368         data.m_painter->save();
     367        m_data.m_painter->save();
    369368
    370369        // putImageData() should be unaffected by painter state
    371         data.m_painter->resetTransform();
    372         data.m_painter->setOpacity(1.0);
    373         data.m_painter->setClipping(false);
    374     }
    375 
    376     data.m_painter->setCompositionMode(QPainter::CompositionMode_Source);
    377     data.m_painter->drawImage(destx, desty, image);
     370        m_data.m_painter->resetTransform();
     371        m_data.m_painter->setOpacity(1.0);
     372        m_data.m_painter->setClipping(false);
     373    }
     374
     375    m_data.m_painter->setCompositionMode(QPainter::CompositionMode_Source);
     376    m_data.m_painter->drawImage(destx, desty, image);
    378377
    379378    if (!isPainting)
    380         data.m_painter->end();
     379        m_data.m_painter->end();
    381380    else
    382         data.m_painter->restore();
    383 }
    384 
    385 void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    386 {
    387     putImageData<Unmultiplied>(source, sourceSize, sourceRect, destPoint, m_data, m_size);
    388 }
    389 
    390 void ImageBuffer::putPremultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    391 {
    392     putImageData<Premultiplied>(source, sourceSize, sourceRect, destPoint, m_data, m_size);
     381        m_data.m_painter->restore();
    393382}
    394383
  • trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp

    r106670 r106836  
    276276}
    277277
    278 template <Multiply multiplied>
    279 void putImageData(ByteArray*& source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint,
    280                   SkCanvas* canvas, const IntSize& size)
    281 {
     278void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     279{
     280    SkCanvas* canvas = context()->platformContext()->canvas();
    282281    ASSERT(sourceRect.width() > 0);
    283282    ASSERT(sourceRect.height() > 0);
     
    286285    int destX = destPoint.x() + sourceRect.x();
    287286    ASSERT(destX >= 0);
    288     ASSERT(destX < size.width());
     287    ASSERT(destX < m_size.width());
    289288    ASSERT(originX >= 0);
    290289    ASSERT(originX < sourceRect.maxX());
    291290
    292291    int endX = destPoint.x() + sourceRect.maxX();
    293     ASSERT(endX <= size.width());
     292    ASSERT(endX <= m_size.width());
    294293
    295294    int numColumns = endX - destX;
     
    298297    int destY = destPoint.y() + sourceRect.y();
    299298    ASSERT(destY >= 0);
    300     ASSERT(destY < size.height());
     299    ASSERT(destY < m_size.height());
    301300    ASSERT(originY >= 0);
    302301    ASSERT(originY < sourceRect.maxY());
    303302
    304303    int endY = destPoint.y() + sourceRect.maxY();
    305     ASSERT(endY <= size.height());
     304    ASSERT(endY <= m_size.height());
    306305    int numRows = endY - destY;
    307306
     
    318317
    319318    canvas->writePixels(srcBitmap, destX, destY, config8888);
    320 }
    321 
    322 void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    323 {
    324     putImageData<Unmultiplied>(source, sourceSize, sourceRect, destPoint, context()->platformContext()->canvas(), m_size);
    325 }
    326 
    327 void ImageBuffer::putPremultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    328 {
    329     putImageData<Premultiplied>(source, sourceSize, sourceRect, destPoint, context()->platformContext()->canvas(), m_size);
    330319}
    331320
  • trunk/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp

    r106500 r106836  
    184184}
    185185
    186 template <bool premultiplied>
    187 static void putImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint, SharedBitmap* bitmap)
    188 {
     186void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     187{
     188    SharedBitmap* bitmap = m_data.m_bitmap.get();
    189189    unsigned char* dst = (unsigned char*)bitmap->bytes();
    190190    if (!dst)
     
    212212            int blue = *src++;
    213213            int alpha = *src++;
    214             if (premultiplied) {
     214            if (multiplied == Premultiplied) {
    215215                *dst++ = static_cast<unsigned char>(blue * 255 / alpha);
    216216                *dst++ = static_cast<unsigned char>(green * 255 / alpha);
     
    229229}
    230230
    231 void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    232 {
    233     putImageData<false>(source, sourceSize, sourceRect, destPoint, m_data.m_bitmap.get());
    234 }
    235 
    236 void ImageBuffer::putPremultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    237 {
    238     putImageData<true>(source, sourceSize, sourceRect, destPoint, m_data.m_bitmap.get());
    239 }
    240 
    241231void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
    242232{
  • trunk/Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp

    r106500 r106836  
    7373}
    7474
    75 void ImageBuffer::putUnmultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    76 {
    77     notImplemented();
    78 }
    79 
    80 void ImageBuffer::putPremultipliedImageData(ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
     75void ImageBuffer::putByteArray(Multiply multiplied, ByteArray* source, const IntSize& sourceSize, const IntRect& sourceRect, const IntPoint& destPoint)
    8176{
    8277    notImplemented();
  • trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h

    r106091 r106836  
    114114} wkPatternTiling;
    115115extern CGPatternRef (*wkCGPatternCreateWithImageAndTransform)(CGImageRef, CGAffineTransform, int);
     116extern void (*wkCGContextResetClip)(CGContextRef);
    116117extern CFReadStreamRef (*wkCreateCustomCFReadStream)(void *(*formCreate)(CFReadStreamRef, void *),
    117118    void (*formFinalize)(CFReadStreamRef, void *),
  • trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm

    r105234 r106836  
    133133CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniChar* (*provide)(CFIndex stringIndex, CFIndex* charCount, CFDictionaryRef* attributes, void*), void (*dispose)(const UniChar* chars, void*), void*, CFDictionaryRef options);
    134134
     135void (*wkCGContextResetClip)(CGContextRef);
    135136CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
    136137CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
  • trunk/Source/WebKit/chromium/ChangeLog

    r106833 r106836  
     12012-02-06  Matthew Delaney  <mdelaney@apple.com>
     2
     3        toDataURL() uses stale data after putImageData()
     4        https://bugs.webkit.org/show_bug.cgi?id=65767
     5
     6        Reviewed by Chris Marrin.
     7
     8        * src/WebViewImpl.cpp: Updated method name.
     9        (WebKit::WebViewImpl::doPixelReadbackToCanvas):
     10
    1112012-02-06  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    212
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r106401 r106836  
    12071207    if (imageBuffer && pixelArray) {
    12081208        m_layerTreeHost->compositeAndReadback(pixelArray->data(), invertRect);
    1209         imageBuffer->putPremultipliedImageData(pixelArray.get(), rect.size(), IntRect(IntPoint(), rect.size()), IntPoint());
     1209        imageBuffer->putByteArray(Premultiplied, pixelArray.get(), rect.size(), IntRect(IntPoint(), rect.size()), IntPoint());
    12101210        gc.save();
    12111211        gc.translate(IntSize(0, bitmapHeight));
  • trunk/Source/WebKit/mac/ChangeLog

    r106695 r106836  
     12012-02-06  Matthew Delaney  <mdelaney@apple.com>
     2
     3        toDataURL() uses stale data after putImageData()
     4        https://bugs.webkit.org/show_bug.cgi?id=65767
     5
     6        Reviewed by Chris Marrin.
     7
     8        * WebCoreSupport/WebSystemInterface.mm:
     9
    1102012-02-03  Antti Koivisto  <antti@apple.com>
    211
  • trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm

    r105234 r106836  
    4646    INIT(CGContextGetShouldSmoothFonts);
    4747    INIT(CGPatternCreateWithImageAndTransform);
     48    INIT(CGContextResetClip);
    4849    INIT(CopyCFLocalizationPreferredName);
    4950    INIT(CopyCONNECTProxyResponse);
  • trunk/Source/WebKit2/ChangeLog

    r106824 r106836  
     12012-02-06  Matthew Delaney  <mdelaney@apple.com>
     2
     3        toDataURL() uses stale data after putImageData()
     4        https://bugs.webkit.org/show_bug.cgi?id=65767
     5
     6        Reviewed by Chris Marrin.
     7
     8        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
     9        (InitWebCoreSystemInterface):
     10
    1112012-02-06  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm

    r105234 r106836  
    4141        INIT(CGContextGetShouldSmoothFonts);
    4242        INIT(CGPatternCreateWithImageAndTransform);
     43        INIT(CGContextResetClip);
    4344        INIT(CopyCONNECTProxyResponse);
    4445        INIT(CopyNSURLResponseStatusLine);
  • trunk/WebKitLibraries/ChangeLog

    r106593 r106836  
     12012-02-06  Matthew Delaney  <mdelaney@apple.com>
     2
     3        toDataURL() uses stale data after putImageData()
     4        https://bugs.webkit.org/show_bug.cgi?id=65767
     5
     6        Added WKCGContextResetClip for use in reseting clip for new putByteArray method.
     7
     8        Reviewed by Chris Marrin.
     9       
     10        * WebKitSystemInterface.h: Added WKCGContextResetClip.
     11        * libWebKitSystemInterfaceLeopard.a:
     12        * libWebKitSystemInterfaceSnowLeopard.a:
     13        * libWebKitSystemInterfaceLion.a:
     14
    1152012-02-02  Chris Marrin  <cmarrin@apple.com>
    216
  • trunk/WebKitLibraries/WebKitSystemInterface.h

    r100033 r106836  
    455455
    456456#endif
    457    
     457
     458#if !defined(BUILDING_ON_SNOW_LEOPARD) && !defined(BUILDING_ON_LION)
     459NSString *WKGetMacOSXVersionString(void);
     460#endif
     461
    458462#ifdef __cplusplus
    459463}
Note: See TracChangeset for help on using the changeset viewer.