Follow on fix for https://bugs.webkit.org/show_bug.cgi?id=58926
authorpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Apr 2011 05:45:59 +0000 (05:45 +0000)
committerpsolanki@apple.com <psolanki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Apr 2011 05:45:59 +0000 (05:45 +0000)
Reviewed by Simon Fraser.

Move the assert from Image::drawPattern() to Image::drawTiled() so we don't hit it when
trying to paint GeneratedImages.

* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
* platform/graphics/cg/ImageCG.cpp:
(WebCore::Image::drawPattern):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84344 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/Image.cpp
Source/WebCore/platform/graphics/cg/ImageCG.cpp

index db4b4b0..349b9c6 100644 (file)
@@ -1,3 +1,17 @@
+2011-04-19  Pratik Solanki  <psolanki@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Follow on fix for https://bugs.webkit.org/show_bug.cgi?id=58926
+
+        Move the assert from Image::drawPattern() to Image::drawTiled() so we don't hit it when
+        trying to paint GeneratedImages.
+
+        * platform/graphics/Image.cpp:
+        (WebCore::Image::drawTiled):
+        * platform/graphics/cg/ImageCG.cpp:
+        (WebCore::Image::drawPattern):
+
 2011-04-19  Simon Fraser  <simon.fraser@apple.com>
 
         Fix 32-bit builds.
index 11da0ab..4a6a2f5 100644 (file)
@@ -112,6 +112,8 @@ void Image::drawTiled(GraphicsContext* ctxt, const FloatRect& destRect, const Fl
         return;
     }
 
+    ASSERT(!isBitmapImage() || static_cast<BitmapImage*>(this)->notSolidColor());
+
     FloatSize intrinsicTileSize = size();
     if (hasRelativeWidth())
         intrinsicTileSize.setWidth(scaledTileSize.width());
index 635a804..24b7275 100644 (file)
@@ -268,11 +268,6 @@ void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const
         // Avoid a hang under CGContextDrawTiledImage on release builds.
         return;
 
-#if !ASSERT_DISABLED
-    if (this->isBitmapImage())
-        ASSERT(static_cast<BitmapImage*>(this)->notSolidColor());
-#endif
-
     CGContextRef context = ctxt->platformContext();
     ctxt->save();
     CGContextClipToRect(context, destRect);