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

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

Issue 1878253003: Allow explicit conversion operators and implement WTF::OwnPtr::operator bool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 "platform/graphics/RecordingImageBufferSurface.h" 5 #include "platform/graphics/RecordingImageBufferSurface.h"
6 6
7 #include "platform/Histogram.h" 7 #include "platform/Histogram.h"
8 #include "platform/graphics/CanvasMetrics.h" 8 #include "platform/graphics/CanvasMetrics.h"
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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 ASSERT(m_currentFrame->getRecordingCanvas()); 247 ASSERT(m_currentFrame->getRecordingCanvas());
248 ASSERT(fallbackReason); 248 ASSERT(fallbackReason);
249 ASSERT(*fallbackReason == FallbackReasonUnknown); 249 ASSERT(*fallbackReason == FallbackReasonUnknown);
250 250
251 if (!m_imageBuffer->isDirty()) { 251 if (!m_imageBuffer->isDirty()) {
252 if (!m_previousFrame) { 252 if (!m_previousFrame) {
253 // Create an initial blank frame 253 // Create an initial blank frame
254 m_previousFrame = fromSkSp(m_currentFrame->finishRecordingAsPicture( )); 254 m_previousFrame = fromSkSp(m_currentFrame->finishRecordingAsPicture( ));
255 initializeCurrentFrame(); 255 initializeCurrentFrame();
256 } 256 }
257 return m_currentFrame; 257 return !!m_currentFrame;
258 } 258 }
259 259
260 if (!m_frameWasCleared) { 260 if (!m_frameWasCleared) {
261 *fallbackReason = FallbackReasonCanvasNotClearedBetweenFrames; 261 *fallbackReason = FallbackReasonCanvasNotClearedBetweenFrames;
262 return false; 262 return false;
263 } 263 }
264 264
265 if (m_currentFrame->getRecordingCanvas()->getSaveCount() > ExpensiveCanvasHe uristicParameters::ExpensiveRecordingStackDepth) { 265 if (m_currentFrame->getRecordingCanvas()->getSaveCount() > ExpensiveCanvasHe uristicParameters::ExpensiveRecordingStackDepth) {
266 *fallbackReason = FallbackReasonRunawayStateStack; 266 *fallbackReason = FallbackReasonRunawayStateStack;
267 return false; 267 return false;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 void RecordingImageBufferSurface::setIsHidden(bool hidden) 344 void RecordingImageBufferSurface::setIsHidden(bool hidden)
345 { 345 {
346 if (m_fallbackSurface) 346 if (m_fallbackSurface)
347 m_fallbackSurface->setIsHidden(hidden); 347 m_fallbackSurface->setIsHidden(hidden);
348 else 348 else
349 ImageBufferSurface::setIsHidden(hidden); 349 ImageBufferSurface::setIsHidden(hidden);
350 } 350 }
351 351
352 } // namespace blink 352 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698