| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/html/canvas/CanvasDrawListener.h" | 5 #include "core/html/canvas/CanvasDrawListener.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "third_party/skia/include/core/SkImage.h" | 8 #include "third_party/skia/include/core/SkImage.h" |
| 8 #include <memory> | |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 CanvasDrawListener::~CanvasDrawListener() {} | 12 CanvasDrawListener::~CanvasDrawListener() {} |
| 13 | 13 |
| 14 void CanvasDrawListener::sendNewFrame(sk_sp<SkImage> image) { | 14 void CanvasDrawListener::sendNewFrame(sk_sp<SkImage> image) { |
| 15 m_handler->sendNewFrame(image.get()); | 15 m_handler->sendNewFrame(image.get()); |
| 16 } | 16 } |
| 17 | 17 |
| 18 bool CanvasDrawListener::needsNewFrame() const { | 18 bool CanvasDrawListener::needsNewFrame() const { |
| 19 return m_frameCaptureRequested && m_handler->needsNewFrame(); | 19 return m_frameCaptureRequested && m_handler->needsNewFrame(); |
| 20 } | 20 } |
| 21 | 21 |
| 22 void CanvasDrawListener::requestFrame() { | 22 void CanvasDrawListener::requestFrame() { |
| 23 m_frameCaptureRequested = true; | 23 m_frameCaptureRequested = true; |
| 24 } | 24 } |
| 25 | 25 |
| 26 CanvasDrawListener::CanvasDrawListener( | 26 CanvasDrawListener::CanvasDrawListener( |
| 27 std::unique_ptr<WebCanvasCaptureHandler> handler) | 27 std::unique_ptr<WebCanvasCaptureHandler> handler) |
| 28 : m_frameCaptureRequested(true), m_handler(std::move(handler)) {} | 28 : m_frameCaptureRequested(true), m_handler(std::move(handler)) {} |
| 29 | 29 |
| 30 } // namespace blink | 30 } // namespace blink |
| OLD | NEW |