| OLD | NEW |
| 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 Loading... |
| 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.get(); |
| 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 Loading... |
| 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 |
| OLD | NEW |