Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.h

Issue 2493673002: Synchronize OffscreenCanvas content with the placeholder canvas (Closed)
Patch Set: fix printing Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef OffscreenCanvasPlaceholder_h
6 #define OffscreenCanvasPlaceholder_h
7
8 #include "wtf/RefPtr.h"
9 #include "wtf/WeakPtr.h"
10 #include <memory>
11
12 namespace blink {
13
14 class Image;
15 class OffscreenCanvasFrameDispatcher;
16 class WebTaskRunner;
17
18 class OffscreenCanvasPlaceholder {
19 public:
20 ~OffscreenCanvasPlaceholder();
21
22 void setPlaceholderFrame(RefPtr<Image>,
23 WeakPtr<OffscreenCanvasFrameDispatcher>,
24 std::unique_ptr<WebTaskRunner>,
25 unsigned resourceId);
26 void releasePlaceholderFrame();
27
28 static OffscreenCanvasPlaceholder* getPlaceholderById(unsigned placeholderId);
29
30 void registerPlaceholder(unsigned placeholderId);
31 void unregisterPlaceholder();
32 const RefPtr<Image>& placeholderFrame() const { return m_placeholderFrame; }
33
34 private:
35 bool isPlaceholderRegistered() const {
36 return m_placeholderId != kNoPlaceholderId;
37 }
38
39 RefPtr<Image> m_placeholderFrame;
40 WeakPtr<OffscreenCanvasFrameDispatcher> m_frameDispatcher;
41 std::unique_ptr<WebTaskRunner> m_frameDispatcherTaskRunner;
42 unsigned m_placeholderFrameResourceId = 0;
43
44 enum {
45 kNoPlaceholderId = -1,
46 };
47 int m_placeholderId = kNoPlaceholderId;
48 };
49
50 } // blink
51
52 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698