| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 m_fallbackSurface = m_fallbackFactory->createSurface(size(), getOpacityMode(
)); | 83 m_fallbackSurface = m_fallbackFactory->createSurface(size(), getOpacityMode(
)); |
| 84 m_fallbackSurface->setImageBuffer(m_imageBuffer); | 84 m_fallbackSurface->setImageBuffer(m_imageBuffer); |
| 85 | 85 |
| 86 if (m_previousFrame) { | 86 if (m_previousFrame) { |
| 87 m_previousFrame->playback(m_fallbackSurface->canvas()); | 87 m_previousFrame->playback(m_fallbackSurface->canvas()); |
| 88 m_previousFrame.clear(); | 88 m_previousFrame.clear(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 if (m_currentFrame) { | 91 if (m_currentFrame) { |
| 92 m_currentFrame->finishRecordingAsPicture()->playback(m_fallbackSurface->
canvas()); | 92 m_currentFrame->finishRecordingAsPicture()->playback(m_fallbackSurface->
canvas()); |
| 93 m_currentFrame.clear(); | 93 m_currentFrame.reset(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 if (m_imageBuffer) { | 96 if (m_imageBuffer) { |
| 97 m_imageBuffer->resetCanvas(m_fallbackSurface->canvas()); | 97 m_imageBuffer->resetCanvas(m_fallbackSurface->canvas()); |
| 98 } | 98 } |
| 99 | 99 |
| 100 CanvasMetrics::countCanvasContextUsage(CanvasMetrics::DisplayList2DCanvasFal
lbackToRaster); | 100 CanvasMetrics::countCanvasContextUsage(CanvasMetrics::DisplayList2DCanvasFal
lbackToRaster); |
| 101 } | 101 } |
| 102 | 102 |
| 103 static RecordingImageBufferSurface::FallbackReason snapshotReasonToFallbackReaso
n(SnapshotReason reason) | 103 static RecordingImageBufferSurface::FallbackReason snapshotReasonToFallbackReaso
n(SnapshotReason reason) |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 | 347 |
| 348 void RecordingImageBufferSurface::setIsHidden(bool hidden) | 348 void RecordingImageBufferSurface::setIsHidden(bool hidden) |
| 349 { | 349 { |
| 350 if (m_fallbackSurface) | 350 if (m_fallbackSurface) |
| 351 m_fallbackSurface->setIsHidden(hidden); | 351 m_fallbackSurface->setIsHidden(hidden); |
| 352 else | 352 else |
| 353 ImageBufferSurface::setIsHidden(hidden); | 353 ImageBufferSurface::setIsHidden(hidden); |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace blink | 356 } // namespace blink |
| OLD | NEW |