| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 void RecordingImageBufferSurface::setImageBuffer(ImageBuffer* imageBuffer) | 43 void RecordingImageBufferSurface::setImageBuffer(ImageBuffer* imageBuffer) |
| 44 { | 44 { |
| 45 m_imageBuffer = imageBuffer; | 45 m_imageBuffer = imageBuffer; |
| 46 if (m_currentFrame && m_imageBuffer) { | 46 if (m_currentFrame && m_imageBuffer) { |
| 47 m_imageBuffer->context()->setRegionTrackingMode(GraphicsContext::RegionT
rackingOverwrite); | 47 m_imageBuffer->context()->setRegionTrackingMode(GraphicsContext::RegionT
rackingOverwrite); |
| 48 m_imageBuffer->context()->resetCanvas(m_currentFrame->getRecordingCanvas
()); | 48 m_imageBuffer->context()->resetCanvas(m_currentFrame->getRecordingCanvas
()); |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 void RecordingImageBufferSurface::willReadback() | 52 void RecordingImageBufferSurface::willAccessPixels() |
| 53 { | 53 { |
| 54 fallBackToRasterCanvas(); | 54 fallBackToRasterCanvas(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void RecordingImageBufferSurface::fallBackToRasterCanvas() | 57 void RecordingImageBufferSurface::fallBackToRasterCanvas() |
| 58 { | 58 { |
| 59 if (m_rasterCanvas) { | 59 if (m_rasterCanvas) { |
| 60 ASSERT(!m_currentFrame); | 60 ASSERT(!m_currentFrame); |
| 61 return; | 61 return; |
| 62 } | 62 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 SkCanvas* newCanvas = m_currentFrame->getRecordingCanvas(); | 153 SkCanvas* newCanvas = m_currentFrame->getRecordingCanvas(); |
| 154 newCanvas->concat(ctm); | 154 newCanvas->concat(ctm); |
| 155 newCanvas->clipRect(clip); | 155 newCanvas->clipRect(clip); |
| 156 | 156 |
| 157 m_frameWasCleared = false; | 157 m_frameWasCleared = false; |
| 158 return true; | 158 return true; |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace blink | 161 } // namespace blink |
| OLD | NEW |