Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: Source/platform/graphics/RecordingImageBufferSurface.cpp

Issue 1068413002: Fix memory leak in display list canvas overdraw optimization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use RefPtr to unref Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "platform/graphics/RecordingImageBufferSurface.h" 7 #include "platform/graphics/RecordingImageBufferSurface.h"
8 8
9 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" 9 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h"
10 #include "platform/graphics/GraphicsContext.h" 10 #include "platform/graphics/GraphicsContext.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 void RecordingImageBufferSurface::willOverwriteCanvas() 142 void RecordingImageBufferSurface::willOverwriteCanvas()
143 { 143 {
144 m_frameWasCleared = true; 144 m_frameWasCleared = true;
145 m_previousFrame.clear(); 145 m_previousFrame.clear();
146 m_previousFrameHasExpensiveOp = false; 146 m_previousFrameHasExpensiveOp = false;
147 m_previousFramePixelCount = 0; 147 m_previousFramePixelCount = 0;
148 if (m_didRecordDrawCommandsInCurrentFrame) { 148 if (m_didRecordDrawCommandsInCurrentFrame) {
149 // Discard previous draw commands 149 // Discard previous draw commands
150 m_currentFrame->endRecording(); 150 adoptRef(m_currentFrame->endRecording());
151 initializeCurrentFrame(); 151 initializeCurrentFrame();
152 } 152 }
153 } 153 }
154 154
155 void RecordingImageBufferSurface::didDraw(const FloatRect& rect) 155 void RecordingImageBufferSurface::didDraw(const FloatRect& rect)
156 { 156 {
157 m_didRecordDrawCommandsInCurrentFrame = true; 157 m_didRecordDrawCommandsInCurrentFrame = true;
158 IntRect pixelBounds = enclosingIntRect(rect); 158 IntRect pixelBounds = enclosingIntRect(rect);
159 m_currentFramePixelCount += pixelBounds.width() * pixelBounds.height(); 159 m_currentFramePixelCount += pixelBounds.width() * pixelBounds.height();
160 } 160 }
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 306
307 void RecordingImageBufferSurface::setIsHidden(bool hidden) 307 void RecordingImageBufferSurface::setIsHidden(bool hidden)
308 { 308 {
309 if (m_fallbackSurface) 309 if (m_fallbackSurface)
310 m_fallbackSurface->setIsHidden(hidden); 310 m_fallbackSurface->setIsHidden(hidden);
311 else 311 else
312 ImageBufferSurface::setIsHidden(hidden); 312 ImageBufferSurface::setIsHidden(hidden);
313 } 313 }
314 314
315 } // namespace blink 315 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698