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

Side by Side Diff: android_webview/browser/surfaces_instance.h

Issue 2647583002: Switching to CompositorFrameSinkSupport in android_webview::SurfacesInstance (Closed)
Patch Set: c Created 3 years, 11 months 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 ANDROID_WEBVIEW_BROWSER_SURFACES_INSTANCE_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_SURFACES_INSTANCE_H_
6 #define ANDROID_WEBVIEW_BROWSER_SURFACES_INSTANCE_H_ 6 #define ANDROID_WEBVIEW_BROWSER_SURFACES_INSTANCE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "cc/surfaces/display_client.h" 12 #include "cc/surfaces/display_client.h"
13 #include "cc/surfaces/frame_sink_id.h" 13 #include "cc/surfaces/frame_sink_id.h"
14 #include "cc/surfaces/surface_factory_client.h" 14 #include "cc/surfaces/surface_factory_client.h"
15 #include "cc/surfaces/surface_id.h" 15 #include "cc/surfaces/surface_id.h"
16 16
17 namespace cc { 17 namespace cc {
18 class Display; 18 class CompositorFrameSinkSupport;
19 class CompositorFrameSinkSupportClient;
boliu 2017/01/24 16:16:52 need to include this class in order to inherit fro
Saman Sami 2017/01/24 16:51:28 Done.
19 class SurfaceIdAllocator; 20 class SurfaceIdAllocator;
20 class SurfaceFactory;
21 class SurfaceManager; 21 class SurfaceManager;
22 } 22 }
23 23
24 namespace gfx { 24 namespace gfx {
25 class Rect; 25 class Rect;
26 class Size; 26 class Size;
27 class Transform; 27 class Transform;
28 } 28 }
29 29
30 namespace android_webview { 30 namespace android_webview {
31 31
32 class ParentOutputSurface; 32 class ParentOutputSurface;
33 33
34 class SurfacesInstance : public base::RefCounted<SurfacesInstance>, 34 class SurfacesInstance : public base::RefCounted<SurfacesInstance>,
35 public cc::DisplayClient, 35 public cc::CompositorFrameSinkSupportClient {
36 public cc::SurfaceFactoryClient {
37 public: 36 public:
38 static scoped_refptr<SurfacesInstance> GetOrCreateInstance(); 37 static scoped_refptr<SurfacesInstance> GetOrCreateInstance();
39 38
40 cc::FrameSinkId AllocateFrameSinkId(); 39 cc::FrameSinkId AllocateFrameSinkId();
41 cc::SurfaceManager* GetSurfaceManager(); 40 cc::SurfaceManager* GetSurfaceManager();
42 41
43 void DrawAndSwap(const gfx::Size& viewport, 42 void DrawAndSwap(const gfx::Size& viewport,
44 const gfx::Rect& clip, 43 const gfx::Rect& clip,
45 const gfx::Transform& transform, 44 const gfx::Transform& transform,
46 const gfx::Size& frame_size, 45 const gfx::Size& frame_size,
47 const cc::SurfaceId& child_id); 46 const cc::SurfaceId& child_id);
48 47
49 void AddChildId(const cc::SurfaceId& child_id); 48 void AddChildId(const cc::SurfaceId& child_id);
50 void RemoveChildId(const cc::SurfaceId& child_id); 49 void RemoveChildId(const cc::SurfaceId& child_id);
51 50
52 private: 51 private:
53 friend class base::RefCounted<SurfacesInstance>; 52 friend class base::RefCounted<SurfacesInstance>;
54 53
55 SurfacesInstance(); 54 SurfacesInstance();
56 ~SurfacesInstance() override; 55 ~SurfacesInstance();
boliu 2017/01/24 16:16:52 still need override for CompositorFrameSinkSupport
Saman Sami 2017/01/24 16:51:28 Done.
57
58 // cc::DisplayClient overrides.
59 void DisplayOutputSurfaceLost() override;
60 void DisplayWillDrawAndSwap(
61 bool will_draw_and_swap,
62 const cc::RenderPassList& render_passes) override {}
63 void DisplayDidDrawAndSwap() override {}
64
65 // cc::SurfaceFactoryClient implementation.
66 void ReturnResources(const cc::ReturnedResourceArray& resources) override;
67 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override;
68 56
69 void SetEmptyRootFrame(); 57 void SetEmptyRootFrame();
70 58
59 // cc::CompositorFrameSinkSupport implementation.
60 void DisplayOutputSurfaceLost() override;
61
71 uint32_t next_client_id_; 62 uint32_t next_client_id_;
72 63
73 cc::FrameSinkId frame_sink_id_; 64 cc::FrameSinkId frame_sink_id_;
74 65
75 std::unique_ptr<cc::SurfaceManager> surface_manager_; 66 std::unique_ptr<cc::SurfaceManager> surface_manager_;
76 std::unique_ptr<cc::BeginFrameSource> begin_frame_source_;
77 std::unique_ptr<cc::Display> display_;
78 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; 67 std::unique_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
79 std::unique_ptr<cc::SurfaceFactory> surface_factory_; 68 std::unique_ptr<cc::CompositorFrameSinkSupport> support_;
80 69
81 cc::LocalFrameId root_id_; 70 cc::LocalFrameId root_id_;
82 std::vector<cc::SurfaceId> child_ids_; 71 std::vector<cc::SurfaceId> child_ids_;
83 72
84 // This is owned by |display_|. 73 // This is owned by |display_|.
85 ParentOutputSurface* output_surface_; 74 ParentOutputSurface* output_surface_;
86 75
87 DISALLOW_COPY_AND_ASSIGN(SurfacesInstance); 76 DISALLOW_COPY_AND_ASSIGN(SurfacesInstance);
88 }; 77 };
89 78
90 } // namespace android_webview 79 } // namespace android_webview
91 80
92 #endif // ANDROID_WEBVIEW_BROWSER_SURFACES_INSTANCE_H_ 81 #endif // ANDROID_WEBVIEW_BROWSER_SURFACES_INSTANCE_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/browser/surfaces_instance.cc » ('j') | android_webview/browser/surfaces_instance.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698