Title: [87169] trunk/Source/WebCore
Revision
87169
Author
[email protected]
Date
2011-05-24 10:45:53 -0700 (Tue, 24 May 2011)

Log 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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87168 => 87169)


--- trunk/Source/WebCore/ChangeLog	2011-05-24 17:43:55 UTC (rev 87168)
+++ trunk/Source/WebCore/ChangeLog	2011-05-24 17:45:53 UTC (rev 87169)
@@ -1,3 +1,15 @@
+2011-05-24  Robin Dunn  <[email protected]>
+
+        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
+
+        * platform/graphics/wx/ImageWx.cpp:
+        (WebCore::Image::drawPattern):
+
 2011-05-24  Tony Chang  <[email protected]>
 
         Reviewed by James Robinson.

Modified: trunk/Source/WebCore/platform/graphics/wx/ImageWx.cpp (87168 => 87169)


--- trunk/Source/WebCore/platform/graphics/wx/ImageWx.cpp	2011-05-24 17:43:55 UTC (rev 87168)
+++ trunk/Source/WebCore/platform/graphics/wx/ImageWx.cpp	2011-05-24 17:45:53 UTC (rev 87169)
@@ -179,8 +179,6 @@
 
 void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& srcRect, const AffineTransform& patternTransform, const FloatPoint& phase, ColorSpace, CompositeOperator, const FloatRect& dstRect)
 {
-    
-
 #if USE(WXGC)
     wxGCDC* context = (wxGCDC*)ctxt->platformContext();
     wxGraphicsBitmap* bitmap = nativeImageForCurrentFrame();
@@ -195,33 +193,32 @@
     ctxt->save();
     ctxt->clip(IntRect(dstRect.x(), dstRect.y(), dstRect.width(), dstRect.height()));
     
-    float currentW = 0;
-    float currentH = 0;
+    float adjustedX = 0;
+    float adjustedY = 0;
     
+    adjustedX = phase.x() - dstRect.x() *
+                      narrowPrecisionToFloat(patternTransform.a());
+    adjustedY = (phase.y() - dstRect.y() *
+                      narrowPrecisionToFloat(patternTransform.d()));
+    
 #if USE(WXGC)
     wxGraphicsContext* gc = context->GetGraphicsContext();
-
-    float adjustedX = phase.x() + srcRect.x() *
-                      narrowPrecisionToFloat(patternTransform.a());
-    float adjustedY = phase.y() + srcRect.y() *
-                      narrowPrecisionToFloat(patternTransform.d());
-                      
     gc->ConcatTransform(patternTransform);
 #else
     wxMemoryDC mydc;
     mydc.SelectObject(*bitmap);
 #endif
 
-    wxPoint origin(context->GetDeviceOrigin());
-    wxSize clientSize(context->GetSize());
+    float currentW = adjustedX;
+    float currentH = adjustedY;
 
-    while ( currentW < dstRect.width()  && currentW < clientSize.x - origin.x ) {
-        while ( currentH < dstRect.height() && currentH < clientSize.y - origin.y) {
+    while (currentW <= dstRect.x() + dstRect.width()) {
+        while (currentH <= dstRect.y() + dstRect.height()) {
 #if USE(WXGC)
 #if wxCHECK_VERSION(2,9,0)
-            gc->DrawBitmap(*bitmap, adjustedX + currentW, adjustedY + currentH, (wxDouble)srcRect.width(), (wxDouble)srcRect.height());
+            gc->DrawBitmap(*bitmap, currentW, currentH, (wxDouble)srcRect.width(), (wxDouble)srcRect.height());
 #else
-            gc->DrawGraphicsBitmap(*bitmap, adjustedX + currentW, adjustedY + currentH, (wxDouble)srcRect.width(), (wxDouble)srcRect.height());
+            gc->DrawGraphicsBitmap(*bitmap, currentW, currentH, (wxDouble)srcRect.width(), (wxDouble)srcRect.height());
 #endif
 #else
             context->Blit((wxCoord)dstRect.x() + currentW, (wxCoord)dstRect.y() + currentH,  
@@ -231,7 +228,7 @@
             currentH += srcRect.height();
         }
         currentW += srcRect.width();
-        currentH = 0;
+        currentH = adjustedY;
     }
     ctxt->restore();
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to