Title: [91228] trunk/Source/WebCore
Revision
91228
Author
[email protected]
Date
2011-07-18 17:54:38 -0700 (Mon, 18 Jul 2011)

Log Message

Remove drawsUsingCopy now that all ports handle the copying
https://bugs.webkit.org/show_bug.cgi?id=64768
        
Introduced in https://bugs.webkit.org/show_bug.cgi?id=43507, ImageBuffer::drawsUsingCopy
was used to know whether or not an ImageBuffer should be explicitly copied before being
painted into a context (as was used in HTMLCanvasElement::paint). All platforms now
handle the logic of copying or not in their ImageBuffer::draw() implementations, so
drawsUsingCopy() is no longer needed. This patch removes it.

Reviewed by Dan Bernstein.

No new tests; does not affect behavior.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::paint):
* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::isAccelerated):
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/cg/ImageBufferCG.cpp:
* platform/graphics/qt/ImageBufferQt.cpp:
* platform/graphics/skia/ImageBufferSkia.cpp:
* platform/graphics/wince/ImageBufferWinCE.cpp:
* platform/graphics/wx/ImageBufferWx.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91227 => 91228)


--- trunk/Source/WebCore/ChangeLog	2011-07-19 00:39:02 UTC (rev 91227)
+++ trunk/Source/WebCore/ChangeLog	2011-07-19 00:54:38 UTC (rev 91228)
@@ -1,3 +1,29 @@
+2011-07-18  Matthew Delaney  <[email protected]>
+
+        Remove drawsUsingCopy now that all ports handle the copying
+        https://bugs.webkit.org/show_bug.cgi?id=64768
+        
+        Introduced in https://bugs.webkit.org/show_bug.cgi?id=43507, ImageBuffer::drawsUsingCopy
+        was used to know whether or not an ImageBuffer should be explicitly copied before being
+        painted into a context (as was used in HTMLCanvasElement::paint). All platforms now
+        handle the logic of copying or not in their ImageBuffer::draw() implementations, so
+        drawsUsingCopy() is no longer needed. This patch removes it.
+
+        Reviewed by Dan Bernstein.
+
+        No new tests; does not affect behavior.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::paint):
+        * platform/graphics/ImageBuffer.h:
+        (WebCore::ImageBuffer::isAccelerated):
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        * platform/graphics/qt/ImageBufferQt.cpp:
+        * platform/graphics/skia/ImageBufferSkia.cpp:
+        * platform/graphics/wince/ImageBufferWinCE.cpp:
+        * platform/graphics/wx/ImageBufferWx.cpp:
+
 2011-07-18  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: [REGRESSION] Resource preserving fails when frameNavigated event is dispatched on NetworkPanel.

Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (91227 => 91228)


--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp	2011-07-19 00:39:02 UTC (rev 91227)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp	2011-07-19 00:54:38 UTC (rev 91228)
@@ -281,8 +281,6 @@
         if (imageBuffer) {
             if (m_presentedImage)
                 context->drawImage(m_presentedImage.get(), ColorSpaceDeviceRGB, r, CompositeSourceOver, useLowQualityScale);
-            else if (imageBuffer->drawsUsingCopy())
-                context->drawImage(copiedImage(), ColorSpaceDeviceRGB, r, CompositeSourceOver, useLowQualityScale);
             else
                 context->drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, r, CompositeSourceOver, useLowQualityScale);
         }

Modified: trunk/Source/WebCore/platform/graphics/ImageBuffer.h (91227 => 91228)


--- trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2011-07-19 00:39:02 UTC (rev 91227)
+++ trunk/Source/WebCore/platform/graphics/ImageBuffer.h	2011-07-19 00:54:38 UTC (rev 91228)
@@ -83,7 +83,6 @@
         GraphicsContext* context() const;
 
         bool isAccelerated() const { return m_accelerateRendering; }
-        bool drawsUsingCopy() const; // If the image buffer has to render using a copied image, it will return true.
         PassRefPtr<Image> copyImage() const; // Return a new image that is a copy of the buffer.
 
         PassRefPtr<ByteArray> getUnmultipliedImageData(const IntRect&) const;

Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (91227 => 91228)


--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2011-07-19 00:39:02 UTC (rev 91227)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp	2011-07-19 00:54:38 UTC (rev 91228)
@@ -86,11 +86,6 @@
     return m_context.get();
 }
 
-bool ImageBuffer::drawsUsingCopy() const
-{
-    return false;
-}
-
 PassRefPtr<Image> ImageBuffer::copyImage() const
 {
     // BitmapImage will release the passed in surface on destruction

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (91227 => 91228)


--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2011-07-19 00:39:02 UTC (rev 91227)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2011-07-19 00:54:38 UTC (rev 91228)
@@ -177,11 +177,6 @@
     return m_context.get();
 }
 
-bool ImageBuffer::drawsUsingCopy() const
-{
-    return false;
-}
-
 PassRefPtr<Image> ImageBuffer::copyImage() const
 {
     // BitmapImage will release the passed in CGImage on destruction

Modified: trunk/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp (91227 => 91228)


--- trunk/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp	2011-07-19 00:39:02 UTC (rev 91227)
+++ trunk/Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp	2011-07-19 00:54:38 UTC (rev 91228)
@@ -121,11 +121,6 @@
     return m_context.get();
 }
 
-bool ImageBuffer::drawsUsingCopy() const
-{
-    return false;
-}
-
 PassRefPtr<Image> ImageBuffer::copyImage() const
 {
     return StillImage::create(m_data.m_pixmap);

Modified: trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp (91227 => 91228)


--- trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp	2011-07-19 00:39:02 UTC (rev 91227)
+++ trunk/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp	2011-07-19 00:54:38 UTC (rev 91228)
@@ -97,11 +97,6 @@
     return m_size.width() * m_size.height() * 4;
 }
 
-bool ImageBuffer::drawsUsingCopy() const
-{
-    return false;
-}
-
 PassRefPtr<Image> ImageBuffer::copyImage() const
 {
     m_context->platformContext()->makeGrContextCurrent();

Modified: trunk/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp (91227 => 91228)


--- trunk/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp	2011-07-19 00:39:02 UTC (rev 91227)
+++ trunk/Source/WebCore/platform/graphics/wince/ImageBufferWinCE.cpp	2011-07-19 00:54:38 UTC (rev 91228)
@@ -98,11 +98,6 @@
     return m_context.get();
 }
 
-bool ImageBuffer::drawsUsingCopy() const
-{
-    return true;
-}
-
 PassRefPtr<Image> ImageBuffer::copyImage() const
 {
     return adoptRef(new BufferedImage(&m_data));

Modified: trunk/Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp (91227 => 91228)


--- trunk/Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp	2011-07-19 00:39:02 UTC (rev 91227)
+++ trunk/Source/WebCore/platform/graphics/wx/ImageBufferWx.cpp	2011-07-19 00:54:38 UTC (rev 91228)
@@ -88,11 +88,6 @@
     return String();
 }
 
-bool ImageBuffer::drawsUsingCopy() const
-{
-    return true;
-}
-
 PassRefPtr<Image> ImageBuffer::copyImage() const
 {
     notImplemented();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to