Clear 'm_size' of DrawingBuffer in the 'clear' function
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jan 2012 03:24:38 +0000 (03:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jan 2012 03:24:38 +0000 (03:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=76239

Patch by Yongsheng Zhu <yongsheng.zhu@intel.com> on 2012-01-17
Reviewed by Kenneth Russell.

Clear the resources of DrawingBuffer but don't clear 'm_size'. This makes
's_currentResourceUsePixels' is not calculated correctly.

* platform/graphics/gpu/DrawingBuffer.cpp:
(WebCore::DrawingBuffer::clear):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp

index 739c477..b292993 100644 (file)
@@ -1,3 +1,16 @@
+2012-01-17  Yongsheng Zhu  <yongsheng.zhu@intel.com>
+
+        Clear 'm_size' of DrawingBuffer in the 'clear' function
+        https://bugs.webkit.org/show_bug.cgi?id=76239
+
+        Reviewed by Kenneth Russell.
+        
+        Clear the resources of DrawingBuffer but don't clear 'm_size'. This makes
+        's_currentResourceUsePixels' is not calculated correctly.
+
+        * platform/graphics/gpu/DrawingBuffer.cpp:
+        (WebCore::DrawingBuffer::clear):
+
 2012-01-17  Philip Rogers  <pdr@google.com>
 
         Fix getBBox for perpendicular paths
index d1d2cf2..9dd3b9d 100644 (file)
@@ -72,8 +72,10 @@ void DrawingBuffer::clear()
         return;
 
     m_context->makeContextCurrent();
-    if (!m_size.isEmpty())
+    if (!m_size.isEmpty()) {
         s_currentResourceUsePixels -= m_size.width() * m_size.height();
+        m_size = IntSize();
+    }
 
     if (m_colorBuffer) {
         m_context->deleteTexture(m_colorBuffer);