Title: [169484] trunk/Source/WebCore
Revision
169484
Author
za...@apple.com
Date
2014-05-30 07:16:54 -0700 (Fri, 30 May 2014)

Log Message

Remove redundant GraphicsContext::drawImage() function.
https://bugs.webkit.org/show_bug.cgi?id=133347

Reviewed by Simon Fraser.

There are 2 GraphicsContext::drawImage functions with very similar parameter list. This looks
to be a source of confusion and results in passing unneeded parameters.

No change in functionality.

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawImage):
(WebCore::drawImageToContext):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
* platform/graphics/GraphicsContext.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
* platform/graphics/texmap/TextureMapperImageBuffer.cpp:
(WebCore::BitmapTextureImageBuffer::updateContents):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintNinePieceImage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169483 => 169484)


--- trunk/Source/WebCore/ChangeLog	2014-05-30 10:58:36 UTC (rev 169483)
+++ trunk/Source/WebCore/ChangeLog	2014-05-30 14:16:54 UTC (rev 169484)
@@ -1,3 +1,28 @@
+2014-05-30  Zalan Bujtas  <za...@apple.com>
+
+        Remove redundant GraphicsContext::drawImage() function.
+        https://bugs.webkit.org/show_bug.cgi?id=133347
+
+        Reviewed by Simon Fraser.
+
+        There are 2 GraphicsContext::drawImage functions with very similar parameter list. This looks
+        to be a source of confusion and results in passing unneeded parameters.
+
+        No change in functionality.
+
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::drawImage):
+        (WebCore::drawImageToContext):
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::drawImage):
+        * platform/graphics/GraphicsContext.h:
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::paint):
+        * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
+        (WebCore::BitmapTextureImageBuffer::updateContents):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintNinePieceImage):
+
 2014-05-29  Alex Christensen  <achristen...@webkit.org>
 
         Prepare css jit for arm64 and other architectures.

Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (169483 => 169484)


--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2014-05-30 10:58:36 UTC (rev 169483)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2014-05-30 14:16:54 UTC (rev 169484)
@@ -1378,17 +1378,17 @@
     checkOrigin(image);
 
     if (rectContainsCanvas(normalizedDstRect)) {
-        c->drawImage(cachedImage->imageForRenderer(image->renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op, blendMode, ImageOrientationDescription());
+        c->drawImage(cachedImage->imageForRenderer(image->renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op, blendMode);
         didDrawEntireCanvas();
     } else if (isFullCanvasCompositeMode(op)) {
         fullCanvasCompositedDrawImage(cachedImage->imageForRenderer(image->renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op);
         didDrawEntireCanvas();
     } else if (op == CompositeCopy) {
         clearCanvas();
-        c->drawImage(cachedImage->imageForRenderer(image->renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op, blendMode, ImageOrientationDescription());
+        c->drawImage(cachedImage->imageForRenderer(image->renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op, blendMode);
         didDrawEntireCanvas();
     } else {
-        c->drawImage(cachedImage->imageForRenderer(image->renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op, blendMode, ImageOrientationDescription());
+        c->drawImage(cachedImage->imageForRenderer(image->renderer()), ColorSpaceDeviceRGB, normalizedDstRect, normalizedSrcRect, op, blendMode);
         didDraw(normalizedDstRect);
     }
 }
@@ -1659,7 +1659,7 @@
 
 static void drawImageToContext(Image* image, GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
 {
-    context->drawImage(image, styleColorSpace, dest, src, op, ImageOrientationDescription());
+    context->drawImage(image, styleColorSpace, dest, src, op);
 }
 
 static void drawImageToContext(ImageBuffer* imageBuffer, GraphicsContext* context, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op)

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (169483 => 169484)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp	2014-05-30 10:58:36 UTC (rev 169483)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp	2014-05-30 14:16:54 UTC (rev 169484)
@@ -551,26 +551,21 @@
 {
     if (!image)
         return;
-    drawImage(image, styleColorSpace, FloatRect(p, image->size()), FloatRect(FloatPoint(), image->size()), op, description);
+    drawImage(image, styleColorSpace, FloatRect(p, image->size()), FloatRect(FloatPoint(), image->size()), op, BlendModeNormal, description);
 }
 
 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& r, CompositeOperator op, ImageOrientationDescription description, bool useLowQualityScale)
 {
     if (!image)
         return;
-    drawImage(image, styleColorSpace, r, FloatRect(FloatPoint(), image->size()), op, description, useLowQualityScale);
+    drawImage(image, styleColorSpace, r, FloatRect(FloatPoint(), image->size()), op, BlendModeNormal, description, useLowQualityScale);
 }
 
 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatPoint& dest, const FloatRect& srcRect, CompositeOperator op, ImageOrientationDescription description)
 {
-    drawImage(image, styleColorSpace, FloatRect(dest, srcRect.size()), srcRect, op, description);
+    drawImage(image, styleColorSpace, FloatRect(dest, srcRect.size()), srcRect, op, BlendModeNormal, description);
 }
 
-void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, ImageOrientationDescription description, bool useLowQualityScale)
-{
-    drawImage(image, styleColorSpace, dest, src, op, BlendModeNormal, description, useLowQualityScale);
-}
-
 void GraphicsContext::drawImage(Image* image, ColorSpace styleColorSpace, const FloatRect& dest, const FloatRect& src, CompositeOperator op, BlendMode blendMode, ImageOrientationDescription description, bool useLowQualityScale)
 {    if (paintingDisabled() || !image)
         return;

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (169483 => 169484)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2014-05-30 10:58:36 UTC (rev 169483)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h	2014-05-30 14:16:54 UTC (rev 169484)
@@ -305,8 +305,7 @@
         void drawImage(Image*, ColorSpace styleColorSpace, const FloatPoint&, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription());
         void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect&, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription(), bool useLowQualityScale = false);
         void drawImage(Image*, ColorSpace styleColorSpace, const FloatPoint& destPoint, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription());
-        void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, ImageOrientationDescription = ImageOrientationDescription(), bool useLowQualityScale = false);
-        void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, BlendMode, ImageOrientationDescription = ImageOrientationDescription(), bool useLowQualityScale = false);
+        void drawImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, BlendMode = BlendModeNormal, ImageOrientationDescription = ImageOrientationDescription(), bool useLowQualityScale = false);
         
         void drawTiledImage(Image*, ColorSpace styleColorSpace, const FloatRect& destRect, const FloatPoint& srcPoint, const FloatSize& tileSize,
             CompositeOperator = CompositeSourceOver, bool useLowQualityScale = false, BlendMode = BlendModeNormal);

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (169483 => 169484)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2014-05-30 10:58:36 UTC (rev 169483)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp	2014-05-30 14:16:54 UTC (rev 169484)
@@ -364,7 +364,7 @@
         return;
 
     context->drawImage(reinterpret_cast<Image*>(gstImage->image().get()), ColorSpaceSRGB,
-        rect, gstImage->rect(), CompositeCopy, ImageOrientationDescription(), false);
+        rect, gstImage->rect(), CompositeCopy);
 }
 
 #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp (169483 => 169484)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp	2014-05-30 10:58:36 UTC (rev 169483)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp	2014-05-30 14:16:54 UTC (rev 169484)
@@ -67,7 +67,7 @@
 
 void BitmapTextureImageBuffer::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag)
 {
-    m_image->context()->drawImage(image, ColorSpaceDeviceRGB, targetRect, IntRect(offset, targetRect.size()), CompositeCopy, ImageOrientationDescription());
+    m_image->context()->drawImage(image, ColorSpaceDeviceRGB, targetRect, IntRect(offset, targetRect.size()), CompositeCopy);
 }
 
 IntSize TextureMapperImageBuffer::maxTextureSize() const

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (169483 => 169484)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2014-05-30 10:58:36 UTC (rev 169483)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2014-05-30 14:16:54 UTC (rev 169484)
@@ -1328,13 +1328,13 @@
         // The rect to use from within the image is obtained from our slice, and is (0, 0, leftSlice, topSlice)
         if (drawTop)
             graphicsContext->drawImage(image.get(), colorSpace, pixelSnappedForPainting(x, y, leftWidth, topWidth, deviceScaleFactor),
-                pixelSnappedForPainting(0, 0, leftSlice, topSlice, deviceScaleFactor), op, ImageOrientationDescription());
+                pixelSnappedForPainting(0, 0, leftSlice, topSlice, deviceScaleFactor), op);
 
         // The bottom left corner rect is (tx, ty + h - bottomWidth, leftWidth, bottomWidth)
         // The rect to use from within the image is (0, imageHeight - bottomSlice, leftSlice, botomSlice)
         if (drawBottom)
             graphicsContext->drawImage(image.get(), colorSpace, pixelSnappedForPainting(x, borderImageRect.maxY() - bottomWidth, leftWidth, bottomWidth, deviceScaleFactor),
-                pixelSnappedForPainting(0, imageHeight - bottomSlice, leftSlice, bottomSlice, deviceScaleFactor), op, ImageOrientationDescription());
+                pixelSnappedForPainting(0, imageHeight - bottomSlice, leftSlice, bottomSlice, deviceScaleFactor), op);
 
         // Paint the left edge.
         // Have to scale and tile into the border rect.
@@ -1349,14 +1349,14 @@
         // The rect to use from within the image is obtained from our slice, and is (imageWidth - rightSlice, 0, rightSlice, topSlice)
         if (drawTop)
             graphicsContext->drawImage(image.get(), colorSpace, pixelSnappedForPainting(borderImageRect.maxX() - rightWidth, y, rightWidth, topWidth, deviceScaleFactor),
-                pixelSnappedForPainting(imageWidth - rightSlice, 0, rightSlice, topSlice, deviceScaleFactor), op, ImageOrientationDescription());
+                pixelSnappedForPainting(imageWidth - rightSlice, 0, rightSlice, topSlice, deviceScaleFactor), op);
 
         // The bottom right corner rect is (tx + w - rightWidth, ty + h - bottomWidth, rightWidth, bottomWidth)
         // The rect to use from within the image is (imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice)
         if (drawBottom)
             graphicsContext->drawImage(image.get(), colorSpace, pixelSnappedForPainting(borderImageRect.maxX() - rightWidth, borderImageRect.maxY() - bottomWidth,
                 rightWidth, bottomWidth, deviceScaleFactor), pixelSnappedForPainting(imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice, deviceScaleFactor),
-                op, ImageOrientationDescription());
+                op);
 
         // Paint the right edge.
         if (sourceHeight > 0)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to