Changeset 106095 in webkit


Ignore:
Timestamp:
Jan 26, 2012 11:23:22 PM (12 years ago)
Author:
mdelaney@apple.com
Message:

ImageBuffer::draw should deep copy if drawing to an accelerated context
https://bugs.webkit.org/show_bug.cgi?id=77185

Reviewed by Simon Fraser.

No new tests since any test for this issue would be flaky at best.

  • platform/graphics/cg/ImageBufferCG.cpp: Deep copy when drawing ourself into

an accelerated context for both draw and drawPattern.

(WebCore::ImageBuffer::draw):
(WebCore::ImageBuffer::drawPattern):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106091 r106095  
     12012-01-26  Matthew Delaney  <mdelaney@apple.com>
     2
     3        ImageBuffer::draw should deep copy if drawing to an accelerated context
     4        https://bugs.webkit.org/show_bug.cgi?id=77185
     5
     6        Reviewed by Simon Fraser.
     7
     8        No new tests since any test for this issue would be flaky at best.
     9
     10        * platform/graphics/cg/ImageBufferCG.cpp: Deep copy when drawing ourself into
     11            an accelerated context for both draw and drawPattern.
     12        (WebCore::ImageBuffer::draw):
     13        (WebCore::ImageBuffer::drawPattern):
     14
    1152012-01-26  Kevin Ollivier  <kevino@theolliviers.com>
    216
  • trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp

    r98171 r106095  
    242242
    243243    RetainPtr<CGImageRef> image;
    244     if (destContext == m_context)
     244    if (destContext == m_context || destContext->isAcceleratedContext())
    245245        image.adoptCF(copyNativeImage(CopyBackingStore)); // Drawing into our own buffer, need to deep copy.
    246246    else
     
    250250}
    251251
    252 void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
     252void ImageBuffer::drawPattern(GraphicsContext* destContext, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator op, const FloatRect& destRect)
    253253{
    254254    if (!m_context->isAcceleratedContext()) {
    255         if (context == m_context) {
     255        if (destContext == m_context || destContext->isAcceleratedContext()) {
    256256            RefPtr<Image> copy = copyImage(CopyBackingStore); // Drawing into our own buffer, need to deep copy.
    257             copy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
     257            copy->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
    258258        } else {
    259259            RefPtr<Image> imageForRendering = copyImage(DontCopyBackingStore);
    260             imageForRendering->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
     260            imageForRendering->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
    261261        }
    262262    } else {
    263263        RefPtr<Image> copy = copyImage(CopyBackingStore);
    264         copy->drawPattern(context, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
     264        copy->drawPattern(destContext, srcRect, patternTransform, phase, styleColorSpace, op, destRect);
    265265    }
    266266}
Note: See TracChangeset for help on using the changeset viewer.