| 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 "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/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 #include "platform/graphics/ImageBuffer.h" | 10 #include "platform/graphics/ImageBuffer.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 RefPtr<SkPicture> currentPicture = adoptRef(m_currentFrame->endRecording
()); | 96 RefPtr<SkPicture> currentPicture = adoptRef(m_currentFrame->endRecording
()); |
| 97 currentPicture->draw(m_fallbackSurface->canvas()); | 97 currentPicture->draw(m_fallbackSurface->canvas()); |
| 98 m_currentFrame.clear(); | 98 m_currentFrame.clear(); |
| 99 if (savedState) | 99 if (savedState) |
| 100 setCurrentState(m_fallbackSurface->canvas(), &stateStack); | 100 setCurrentState(m_fallbackSurface->canvas(), &stateStack); |
| 101 } | 101 } |
| 102 | 102 |
| 103 if (m_imageBuffer) { | 103 if (m_imageBuffer) { |
| 104 m_imageBuffer->context()->setRegionTrackingMode(GraphicsContext::RegionT
rackingDisabled); | 104 m_imageBuffer->context()->setRegionTrackingMode(GraphicsContext::RegionT
rackingDisabled); |
| 105 m_imageBuffer->context()->resetCanvas(m_fallbackSurface->canvas()); | 105 m_imageBuffer->context()->resetCanvas(m_fallbackSurface->canvas()); |
| 106 m_imageBuffer->context()->setAccelerated(m_fallbackSurface->isAccelerate
d()); |
| 106 } | 107 } |
| 107 } | 108 } |
| 108 | 109 |
| 109 SkCanvas* RecordingImageBufferSurface::canvas() const | 110 SkCanvas* RecordingImageBufferSurface::canvas() const |
| 110 { | 111 { |
| 111 if (m_fallbackSurface) | 112 if (m_fallbackSurface) |
| 112 return m_fallbackSurface->canvas(); | 113 return m_fallbackSurface->canvas(); |
| 113 | 114 |
| 114 ASSERT(m_currentFrame->getRecordingCanvas()); | 115 ASSERT(m_currentFrame->getRecordingCanvas()); |
| 115 return m_currentFrame->getRecordingCanvas(); | 116 return m_currentFrame->getRecordingCanvas(); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 287 |
| 287 void RecordingImageBufferSurface::setIsHidden(bool hidden) | 288 void RecordingImageBufferSurface::setIsHidden(bool hidden) |
| 288 { | 289 { |
| 289 if (m_fallbackSurface) | 290 if (m_fallbackSurface) |
| 290 m_fallbackSurface->setIsHidden(hidden); | 291 m_fallbackSurface->setIsHidden(hidden); |
| 291 else | 292 else |
| 292 ImageBufferSurface::setIsHidden(hidden); | 293 ImageBufferSurface::setIsHidden(hidden); |
| 293 } | 294 } |
| 294 | 295 |
| 295 } // namespace blink | 296 } // namespace blink |
| OLD | NEW |