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 #ifndef CanvasDrawListener_h | 5 #ifndef CanvasDrawListener_h |
6 #define CanvasDrawListener_h | 6 #define CanvasDrawListener_h |
7 | 7 |
| 8 #include <memory> |
8 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
9 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
10 #include "public/platform/WebCanvasCaptureHandler.h" | 11 #include "public/platform/WebCanvasCaptureHandler.h" |
11 #include "third_party/skia/include/core/SkRefCnt.h" | 12 #include "third_party/skia/include/core/SkRefCnt.h" |
12 #include <memory> | |
13 | 13 |
14 class SkImage; | 14 class SkImage; |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 class CORE_EXPORT CanvasDrawListener : public GarbageCollectedMixin { | 18 class CORE_EXPORT CanvasDrawListener : public GarbageCollectedMixin { |
19 public: | 19 public: |
20 virtual ~CanvasDrawListener(); | 20 virtual ~CanvasDrawListener(); |
21 virtual void SendNewFrame(sk_sp<SkImage>); | 21 virtual void SendNewFrame(sk_sp<SkImage>); |
22 bool NeedsNewFrame() const; | 22 bool NeedsNewFrame() const; |
23 void RequestFrame(); | 23 void RequestFrame(); |
24 | 24 |
25 protected: | 25 protected: |
26 explicit CanvasDrawListener(std::unique_ptr<WebCanvasCaptureHandler>); | 26 explicit CanvasDrawListener(std::unique_ptr<WebCanvasCaptureHandler>); |
27 | 27 |
28 bool frame_capture_requested_; | 28 bool frame_capture_requested_; |
29 std::unique_ptr<WebCanvasCaptureHandler> handler_; | 29 std::unique_ptr<WebCanvasCaptureHandler> handler_; |
30 }; | 30 }; |
31 | 31 |
32 } // namespace blink | 32 } // namespace blink |
33 | 33 |
34 #endif | 34 #endif |
OLD | NEW |