| 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 21 matching lines...) Expand all Loading... |
| 32 m_currentFrameHasExpensiveOp(false), | 32 m_currentFrameHasExpensiveOp(false), |
| 33 m_previousFrameHasExpensiveOp(false), | 33 m_previousFrameHasExpensiveOp(false), |
| 34 m_fallbackFactory(std::move(fallbackFactory)) { | 34 m_fallbackFactory(std::move(fallbackFactory)) { |
| 35 initializeCurrentFrame(); | 35 initializeCurrentFrame(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 RecordingImageBufferSurface::~RecordingImageBufferSurface() {} | 38 RecordingImageBufferSurface::~RecordingImageBufferSurface() {} |
| 39 | 39 |
| 40 void RecordingImageBufferSurface::initializeCurrentFrame() { | 40 void RecordingImageBufferSurface::initializeCurrentFrame() { |
| 41 static SkRTreeFactory rTreeFactory; | 41 static SkRTreeFactory rTreeFactory; |
| 42 m_currentFrame = wrapUnique(new SkPictureRecorder); | 42 m_currentFrame = WTF::wrapUnique(new SkPictureRecorder); |
| 43 SkCanvas* canvas = m_currentFrame->beginRecording( | 43 SkCanvas* canvas = m_currentFrame->beginRecording( |
| 44 size().width(), size().height(), &rTreeFactory); | 44 size().width(), size().height(), &rTreeFactory); |
| 45 // Always save an initial frame, to support resetting the top level matrix | 45 // Always save an initial frame, to support resetting the top level matrix |
| 46 // and clip. | 46 // and clip. |
| 47 canvas->save(); | 47 canvas->save(); |
| 48 | 48 |
| 49 if (m_imageBuffer) { | 49 if (m_imageBuffer) { |
| 50 m_imageBuffer->resetCanvas(canvas); | 50 m_imageBuffer->resetCanvas(canvas); |
| 51 } | 51 } |
| 52 m_didRecordDrawCommandsInCurrentFrame = false; | 52 m_didRecordDrawCommandsInCurrentFrame = false; |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 386 } |
| 387 | 387 |
| 388 void RecordingImageBufferSurface::setIsHidden(bool hidden) { | 388 void RecordingImageBufferSurface::setIsHidden(bool hidden) { |
| 389 if (m_fallbackSurface) | 389 if (m_fallbackSurface) |
| 390 m_fallbackSurface->setIsHidden(hidden); | 390 m_fallbackSurface->setIsHidden(hidden); |
| 391 else | 391 else |
| 392 ImageBufferSurface::setIsHidden(hidden); | 392 ImageBufferSurface::setIsHidden(hidden); |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace blink | 395 } // namespace blink |
| OLD | NEW |