Changeset 73310 in webkit


Ignore:
Timestamp:
Dec 3, 2010 3:16:20 PM (13 years ago)
Author:
andersca@apple.com
Message:

Flip the destination context when painting a backing store into the destination
https://bugs.webkit.org/show_bug.cgi?id=50491

Reviewed by Dan Bernstein.

  • Shared/cg/BackingStoreCG.cpp:

(WebKit::BackingStore::paint):

Location:
trunk/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r73301 r73310  
    173173
    174174        * UIProcess/API/qt/qwkpage.cpp:
     175
     1762010-12-03  Anders Carlsson  <andersca@apple.com>
     177
     178        Reviewed by Dan Bernstein.
     179
     180        Flip the destination context when painting a backing store into the destination
     181        https://bugs.webkit.org/show_bug.cgi?id=50491
     182
     183        * Shared/cg/BackingStoreCG.cpp:
     184        (WebKit::BackingStore::paint):
    175185
    1761862010-12-03  Anders Carlsson  <andersca@apple.com>
  • trunk/WebKit2/Shared/cg/BackingStoreCG.cpp

    r71640 r73310  
    6565   
    6666    CGContextSaveGState(cgContext);
     67
    6768    CGContextClipToRect(cgContext, CGRectMake(dstPoint.x(), dstPoint.y(), srcRect.width(), srcRect.height()));
    68     CGContextTranslateCTM(cgContext, -srcRect.x(), -srcRect.y());
    69     CGContextDrawImage(cgContext, CGRectMake(dstPoint.x(), dstPoint.y(), CGImageGetWidth(image.get()), CGImageGetHeight(image.get())), image.get());
     69    CGContextScaleCTM(cgContext, 1, -1);
     70
     71    CGFloat imageHeight = CGImageGetHeight(image.get());
     72    CGFloat imageWidth = CGImageGetWidth(image.get());
     73
     74    CGFloat destX = dstPoint.x() - srcRect.x();
     75    CGFloat destY = -imageHeight - dstPoint.y() + srcRect.y();
     76
     77    CGContextDrawImage(cgContext, CGRectMake(destX, destY, imageWidth, imageHeight), image.get());
    7078    CGContextRestoreGState(cgContext);
    7179}
Note: See TracChangeset for help on using the changeset viewer.