Title: [132438] trunk/Source/WebCore
Revision
132438
Author
[email protected]
Date
2012-10-24 18:26:03 -0700 (Wed, 24 Oct 2012)

Log Message

[cairo] unneeded FloatRect object creation in BitmapImage::draw
https://bugs.webkit.org/show_bug.cgi?id=100298

Patch by Arnaud Renevier <[email protected]> on 2012-10-24
Reviewed by Martin Robinson.

Do not copy FloatRect arguments src and dst to local variables.
Instead, use src and dst directly.

No new tests. No change in behavior.

* platform/graphics/cairo/BitmapImageCairo.cpp:
(WebCore::BitmapImage::draw):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (132437 => 132438)


--- trunk/Source/WebCore/ChangeLog	2012-10-25 01:02:20 UTC (rev 132437)
+++ trunk/Source/WebCore/ChangeLog	2012-10-25 01:26:03 UTC (rev 132438)
@@ -1,3 +1,18 @@
+2012-10-24  Arnaud Renevier  <[email protected]>
+
+        [cairo] unneeded FloatRect object creation in BitmapImage::draw
+        https://bugs.webkit.org/show_bug.cgi?id=100298
+
+        Reviewed by Martin Robinson.
+
+        Do not copy FloatRect arguments src and dst to local variables.
+        Instead, use src and dst directly.
+
+        No new tests. No change in behavior.
+
+        * platform/graphics/cairo/BitmapImageCairo.cpp:
+        (WebCore::BitmapImage::draw):
+
 2012-10-24  Seokju Kwon  <[email protected]>
 
         [SOUP] Provide logging for SocketStreamHandleSoup

Modified: trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp (132437 => 132438)


--- trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp	2012-10-25 01:02:20 UTC (rev 132437)
+++ trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp	2012-10-25 01:26:03 UTC (rev 132438)
@@ -73,10 +73,7 @@
 
 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op)
 {
-    FloatRect srcRect(src);
-    FloatRect dstRect(dst);
-
-    if (!dstRect.width() || !dstRect.height() || !srcRect.width() || !srcRect.height())
+    if (!dst.width() || !dst.height() || !src.width() || !src.height())
         return;
 
     startAnimation();
@@ -86,7 +83,7 @@
         return;
 
     if (mayFillWithSolidColor()) {
-        fillWithSolidColor(context, dstRect, solidColor(), styleColorSpace, op);
+        fillWithSolidColor(context, dst, solidColor(), styleColorSpace, op);
         return;
     }
 
@@ -101,12 +98,12 @@
 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)
     cairo_surface_t* surface = nativeImage->surface();
     IntSize scaledSize(cairo_image_surface_get_width(surface), cairo_image_surface_get_height(surface));
-    FloatRect adjustedSrcRect = adjustSourceRectForDownSampling(srcRect, scaledSize);
+    FloatRect adjustedSrcRect = adjustSourceRectForDownSampling(src, scaledSize);
 #else
-    FloatRect adjustedSrcRect(srcRect);
+    FloatRect adjustedSrcRect(src);
 #endif
 
-    context->platformContext()->drawSurfaceToContext(nativeImage->surface(), dstRect, adjustedSrcRect, context);
+    context->platformContext()->drawSurfaceToContext(nativeImage->surface(), dst, adjustedSrcRect, context);
 
     context->restore();
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to