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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.h

Issue 2612083002: DirectCompositorFrameSink Uses CompositorFrameSinkSupport (Closed)
Patch Set: addressed comments Created 3 years, 10 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <unordered_set>
11 12
12 #include "base/cancelable_callback.h" 13 #include "base/cancelable_callback.h"
13 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
16 #include "base/observer_list.h" 17 #include "base/observer_list.h"
17 #include "base/timer/timer.h" 18 #include "base/timer/timer.h"
18 #include "cc/surfaces/frame_sink_id.h" 19 #include "cc/surfaces/frame_sink_id.h"
19 #include "cc/trees/layer_tree_host_client.h" 20 #include "cc/trees/layer_tree_host_client.h"
20 #include "cc/trees/layer_tree_host_single_thread_client.h" 21 #include "cc/trees/layer_tree_host_single_thread_client.h"
(...skipping 29 matching lines...) Expand all
50 : public Compositor, 51 : public Compositor,
51 public cc::LayerTreeHostClient, 52 public cc::LayerTreeHostClient,
52 public cc::LayerTreeHostSingleThreadClient, 53 public cc::LayerTreeHostSingleThreadClient,
53 public ui::UIResourceProvider, 54 public ui::UIResourceProvider,
54 public ui::WindowAndroidCompositor { 55 public ui::WindowAndroidCompositor {
55 public: 56 public:
56 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); 57 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window);
57 ~CompositorImpl() override; 58 ~CompositorImpl() override;
58 59
59 static bool IsInitialized(); 60 static bool IsInitialized();
61 void AddChildFrameSink(cc::FrameSinkId frame_sink_id);
Fady Samuel 2017/01/29 15:43:02 const cc::FrameSinkId&
Alex Z. 2017/01/30 20:37:49 Done.
60 62
61 // ui::ResourceProvider implementation. 63 // ui::ResourceProvider implementation.
62 cc::UIResourceId CreateUIResource(cc::UIResourceClient* client) override; 64 cc::UIResourceId CreateUIResource(cc::UIResourceClient* client) override;
63 void DeleteUIResource(cc::UIResourceId resource_id) override; 65 void DeleteUIResource(cc::UIResourceId resource_id) override;
64 bool SupportsETC1NonPowerOfTwo() const override; 66 bool SupportsETC1NonPowerOfTwo() const override;
65 67
66 private: 68 private:
67 // Compositor implementation. 69 // Compositor implementation.
68 void SetRootLayer(scoped_refptr<cc::Layer> root) override; 70 void SetRootLayer(scoped_refptr<cc::Layer> root) override;
69 void SetSurface(jobject surface) override; 71 void SetSurface(jobject surface) override;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 160
159 size_t num_successive_context_creation_failures_; 161 size_t num_successive_context_creation_failures_;
160 162
161 // Whether there is an CompositorFrameSink request pending from the current 163 // Whether there is an CompositorFrameSink request pending from the current
162 // |host_|. Becomes |true| if RequestNewCompositorFrameSink is called, and 164 // |host_|. Becomes |true| if RequestNewCompositorFrameSink is called, and
163 // |false| if |host_| is deleted or we succeed in creating *and* initializing 165 // |false| if |host_| is deleted or we succeed in creating *and* initializing
164 // a CompositorFrameSink (which is essentially the contract with cc). 166 // a CompositorFrameSink (which is essentially the contract with cc).
165 bool compositor_frame_sink_request_pending_; 167 bool compositor_frame_sink_request_pending_;
166 168
167 gpu::Capabilities gpu_capabilities_; 169 gpu::Capabilities gpu_capabilities_;
170 bool has_compositor_frame_sink_ = false;
171 std::unordered_set<cc::FrameSinkId, cc::FrameSinkIdHash>
172 pending_child_frame_sink_ids_;
173
168 base::WeakPtrFactory<CompositorImpl> weak_factory_; 174 base::WeakPtrFactory<CompositorImpl> weak_factory_;
169 175
170 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 176 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
171 }; 177 };
172 178
173 } // namespace content 179 } // namespace content
174 180
175 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 181 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698