From b1c64db80cd348d660f8966be37cae8b85293e98 Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Wed, 18 Jan 2012 03:24:38 +0000 Subject: [PATCH] Clear 'm_size' of DrawingBuffer in the 'clear' function https://bugs.webkit.org/show_bug.cgi?id=76239 Patch by Yongsheng Zhu 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 | 13 +++++++++++++ Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 739c477..b292993 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,16 @@ +2012-01-17 Yongsheng Zhu + + 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 Fix getBBox for perpendicular paths diff --git a/Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp b/Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp index d1d2cf2..9dd3b9d 100644 --- a/Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp +++ b/Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp @@ -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); -- 2.7.4