Changeset 87169 in webkit


Ignore:
Timestamp:
May 24, 2011 10:45:53 AM (13 years ago)
Author:
kevino@webkit.org
Message:

Reviewed by Kevin Ollivier.

[wx] Make sure x and y adjustments are applied to all operations, and fix the calculations for the height and width checks to take into account x and y offsets.

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

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87168 r87169  
     12011-05-24  Robin Dunn  <robin@alldunn.com>
     2
     3        Reviewed by Kevin Ollivier.
     4
     5        [wx] Make sure x and y adjustments are applied to all operations, and fix the calculations
     6        for the height and width checks to take into account x and y offsets.
     7       
     8        https://bugs.webkit.org/show_bug.cgi?id=61367
     9
     10        * platform/graphics/wx/ImageWx.cpp:
     11        (WebCore::Image::drawPattern):
     12
    1132011-05-24  Tony Chang  <tony@chromium.org>
    214
  • trunk/Source/WebCore/platform/graphics/wx/ImageWx.cpp

    r56309 r87169  
    180180void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace, CompositeOperator, const FloatRect& dstRect)
    181181{
    182    
    183 
    184182#if USE(WXGC)
    185183    wxGCDC* context = (wxGCDC*)ctxt->platformContext();
     
    196194    ctxt->clip(IntRect(dstRect.x(), dstRect.y(), dstRect.width(), dstRect.height()));
    197195   
    198     float currentW = 0;
    199     float currentH = 0;
     196    float adjustedX = 0;
     197    float adjustedY = 0;
     198   
     199    adjustedX = phase.x() - dstRect.x() *
     200                      narrowPrecisionToFloat(patternTransform.a());
     201    adjustedY = (phase.y() - dstRect.y() *
     202                      narrowPrecisionToFloat(patternTransform.d()));
    200203   
    201204#if USE(WXGC)
    202205    wxGraphicsContext* gc = context->GetGraphicsContext();
    203 
    204     float adjustedX = phase.x() + srcRect.x() *
    205                       narrowPrecisionToFloat(patternTransform.a());
    206     float adjustedY = phase.y() + srcRect.y() *
    207                       narrowPrecisionToFloat(patternTransform.d());
    208                      
    209206    gc->ConcatTransform(patternTransform);
    210207#else
     
    213210#endif
    214211
    215     wxPoint origin(context->GetDeviceOrigin());
    216     wxSize clientSize(context->GetSize());
    217 
    218     while ( currentW < dstRect.width()  && currentW < clientSize.x - origin.x ) {
    219         while ( currentH < dstRect.height() && currentH < clientSize.y - origin.y) {
     212    float currentW = adjustedX;
     213    float currentH = adjustedY;
     214
     215    while (currentW <= dstRect.x() + dstRect.width()) {
     216        while (currentH <= dstRect.y() + dstRect.height()) {
    220217#if USE(WXGC)
    221218#if wxCHECK_VERSION(2,9,0)
    222             gc->DrawBitmap(*bitmap, adjustedX + currentW, adjustedY + currentH, (wxDouble)srcRect.width(), (wxDouble)srcRect.height());
    223 #else
    224             gc->DrawGraphicsBitmap(*bitmap, adjustedX + currentW, adjustedY + currentH, (wxDouble)srcRect.width(), (wxDouble)srcRect.height());
     219            gc->DrawBitmap(*bitmap, currentW, currentH, (wxDouble)srcRect.width(), (wxDouble)srcRect.height());
     220#else
     221            gc->DrawGraphicsBitmap(*bitmap, currentW, currentH, (wxDouble)srcRect.width(), (wxDouble)srcRect.height());
    225222#endif
    226223#else
     
    232229        }
    233230        currentW += srcRect.width();
    234         currentH = 0;
     231        currentH = adjustedY;
    235232    }
    236233    ctxt->restore();
Note: See TracChangeset for help on using the changeset viewer.