Changeset 38309 in webkit


Ignore:
Timestamp:
Nov 11, 2008 11:50:18 AM (15 years ago)
Author:
hyatt@apple.com
Message:

2008-11-11 David Hyatt <hyatt@apple.com>

https://bugs.webkit.org/show_bug.cgi?id=17997

Stop using the new Leopard API tiling call for scaled tiles when drawing background images. The method
is buggy. Fall back to using the slower (and more correct) pattern tiling that Tiger still uses. This
is a Leopard-only workaround, since the API has been fixed on Snow Leopard.

Reviewed by John Sullivan

  • platform/graphics/cg/ImageCG.cpp: (WebCore::Image::drawPattern):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r38307 r38309  
     12008-11-11  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=17997
     4
     5        Stop using the new Leopard API tiling call for scaled tiles when drawing background images.  The method
     6        is buggy.  Fall back to using the slower (and more correct) pattern tiling that Tiger still uses.  This
     7        is a Leopard-only workaround, since the API has been fixed on Snow Leopard.
     8
     9        Reviewed by John Sullivan
     10
     11        * platform/graphics/cg/ImageCG.cpp:
     12        (WebCore::Image::drawPattern):
     13
    1142008-11-10  David Hyatt  <hyatt@apple.com>
    215
  • trunk/WebCore/platform/graphics/cg/ImageCG.cpp

    r37825 r38309  
    252252    // overall image buffer needs to tile with "gaps", we can't use the optimized tiling call in that case.
    253253    // FIXME: Could create WebKitSystemInterface SPI for CGCreatePatternWithImage2 and probably make Tiger tile faster as well.
     254    // FIXME: We cannot use CGContextDrawTiledImage with scaled tiles on Leopard, because it suffers from rounding errors.  Snow Leopard is ok.
    254255    float scaledTileWidth = tileRect.width() * narrowPrecisionToFloat(patternTransform.a());
    255256    float w = CGImageGetWidth(tileImage);
     257#ifdef BUILDING_ON_LEOPARD
     258    if (w == size().width() && h == size().height() && scaledTileWidth == tileRect.width() && scaledTileHeight == tileRect.height())
     259#else
    256260    if (w == size().width() && h == size().height())
     261#endif
    257262        CGContextDrawTiledImage(context, FloatRect(adjustedX, adjustedY, scaledTileWidth, scaledTileHeight), subImage);
    258263    else {
Note: See TracChangeset for help on using the changeset viewer.