Changeset 73275 in webkit


Ignore:
Timestamp:
Dec 3, 2010 11:11:49 AM (13 years ago)
Author:
andersca@apple.com
Message:

The chunked update drawing area is flipped twice when drawing
https://bugs.webkit.org/show_bug.cgi?id=50465
<rdar://problem/8726836>

Reviewed by Dan Bernstein.

  • UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:

(WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
(WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore):
Flip the destination contexts, thus unflipping them. (Turns out two wrongs make a right here).

Location:
trunk/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r73267 r73275  
     12010-12-03  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        The chunked update drawing area is flipped twice when drawing
     6        https://bugs.webkit.org/show_bug.cgi?id=50465
     7        <rdar://problem/8726836>
     8
     9        * UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm:
     10        (WebKit::ChunkedUpdateDrawingAreaProxy::platformPaint):
     11        (WebKit::ChunkedUpdateDrawingAreaProxy::drawUpdateChunkIntoBackingStore):
     12        Flip the destination contexts, thus unflipping them. (Turns out two wrongs make a right here).
     13
    1142010-12-03  Jessie Berlin  <jberlin@apple.com>
    215
  • trunk/WebKit2/UIProcess/mac/ChunkedUpdateDrawingAreaProxyMac.mm

    r71780 r73275  
    6666        return;
    6767
     68    CGContextSaveGState(context);
     69
     70    // Flip the destination.
     71    CGContextScaleCTM(context, 1, -1);
     72    CGContextTranslateCTM(context, 0, -m_size.height());
     73
    6874    RetainPtr<CGImageRef> image(AdoptCF, CGBitmapContextCreateImage(m_bitmapContext.get()));
    6975    CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image.get()), CGImageGetHeight(image.get())), image.get());
     76
     77    CGContextRestoreGState(context);
    7078}
    7179
     
    7583
    7684    RetainPtr<CGImageRef> image(updateChunk->createImage());
    77     const IntRect& updateChunkRect = updateChunk->rect();
     85    IntRect updateChunkRect = updateChunk->rect();
    7886
    79     CGContextDrawImage(m_bitmapContext.get(), CGRectMake(updateChunkRect.x(), size().height() - updateChunkRect.bottom(),
    80                                                          updateChunkRect.width(), updateChunkRect.height()), image.get());
     87    // Flip the destination.
     88    CGContextSaveGState(m_bitmapContext.get());
     89    CGContextScaleCTM(m_bitmapContext.get(), 1, -1);
     90    CGContextTranslateCTM(m_bitmapContext.get(), 0, -(updateChunkRect.y() + updateChunkRect.bottom()));
     91
     92    CGContextDrawImage(m_bitmapContext.get(), updateChunkRect, image.get());
     93    CGContextRestoreGState(m_bitmapContext.get());
     94
    8195    [m_webView setNeedsDisplayInRect:NSRectFromCGRect(updateChunkRect)];
    8296}
Note: See TracChangeset for help on using the changeset viewer.