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

Side by Side Diff: content/renderer/gpu/renderer_compositor_frame_sink.h

Issue 2728183002: RendererCompositorFrameSink should handle local surface id allocation (Closed)
Patch Set: rebase Created 3 years, 9 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_RENDERER_GPU_RENDERER_COMPOSITOR_FRAME_SINK_H_ 5 #ifndef CONTENT_RENDERER_GPU_RENDERER_COMPOSITOR_FRAME_SINK_H_
6 #define CONTENT_RENDERER_GPU_RENDERER_COMPOSITOR_FRAME_SINK_H_ 6 #define CONTENT_RENDERER_GPU_RENDERER_COMPOSITOR_FRAME_SINK_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/threading/non_thread_safe.h" 16 #include "base/threading/non_thread_safe.h"
17 #include "base/threading/platform_thread.h" 17 #include "base/threading/platform_thread.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 #include "build/build_config.h" 19 #include "build/build_config.h"
20 #include "cc/input/selection.h"
20 #include "cc/output/begin_frame_args.h" 21 #include "cc/output/begin_frame_args.h"
21 #include "cc/output/compositor_frame_sink.h" 22 #include "cc/output/compositor_frame_sink.h"
22 #include "cc/scheduler/begin_frame_source.h" 23 #include "cc/scheduler/begin_frame_source.h"
24 #include "cc/surfaces/local_surface_id.h"
25 #include "cc/surfaces/local_surface_id_allocator.h"
23 #include "content/renderer/gpu/compositor_forwarding_message_filter.h" 26 #include "content/renderer/gpu/compositor_forwarding_message_filter.h"
24 #include "ipc/ipc_sync_message_filter.h" 27 #include "ipc/ipc_sync_message_filter.h"
28 #include "ui/gfx/selection_bound.h"
25 29
26 namespace IPC { 30 namespace IPC {
27 class Message; 31 class Message;
28 } 32 }
29 33
30 namespace cc { 34 namespace cc {
31 class BeginFrameSource; 35 class BeginFrameSource;
32 class CompositorFrame; 36 class CompositorFrame;
33 class ContextProvider; 37 class ContextProvider;
34 } 38 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 91
88 DISALLOW_COPY_AND_ASSIGN(RendererCompositorFrameSinkProxy); 92 DISALLOW_COPY_AND_ASSIGN(RendererCompositorFrameSinkProxy);
89 }; 93 };
90 94
91 void OnMessageReceived(const IPC::Message& message); 95 void OnMessageReceived(const IPC::Message& message);
92 void OnReclaimCompositorResources(uint32_t compositor_frame_sink_id, 96 void OnReclaimCompositorResources(uint32_t compositor_frame_sink_id,
93 bool is_swap_ack, 97 bool is_swap_ack,
94 const cc::ReturnedResourceArray& resources); 98 const cc::ReturnedResourceArray& resources);
95 bool Send(IPC::Message* message); 99 bool Send(IPC::Message* message);
96 100
101 bool ShouldAllocateNewLocalSurfaceId(const cc::CompositorFrame& frame);
102 void UpdateFrameData(const cc::CompositorFrame& frame);
103
97 scoped_refptr<CompositorForwardingMessageFilter> 104 scoped_refptr<CompositorForwardingMessageFilter>
98 compositor_frame_sink_filter_; 105 compositor_frame_sink_filter_;
99 CompositorForwardingMessageFilter::Handler 106 CompositorForwardingMessageFilter::Handler
100 compositor_frame_sink_filter_handler_; 107 compositor_frame_sink_filter_handler_;
101 scoped_refptr<RendererCompositorFrameSinkProxy> compositor_frame_sink_proxy_; 108 scoped_refptr<RendererCompositorFrameSinkProxy> compositor_frame_sink_proxy_;
102 scoped_refptr<IPC::SyncMessageFilter> message_sender_; 109 scoped_refptr<IPC::SyncMessageFilter> message_sender_;
103 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_; 110 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue_;
104 std::unique_ptr<cc::BeginFrameSource> begin_frame_source_; 111 std::unique_ptr<cc::BeginFrameSource> begin_frame_source_;
105 int routing_id_; 112 int routing_id_;
113
114 cc::LocalSurfaceId local_surface_id_;
115 cc::LocalSurfaceIdAllocator id_allocator_;
116 struct {
117 gfx::Size frame_size;
118 float device_scale_factor;
119 #ifdef OS_ANDROID
120 float top_controls_height;
121 float top_controls_shown_ratio;
122 float bottom_controls_height;
123 float bottom_controls_shown_ratio;
124 cc::Selection<gfx::SelectionBound> viewport_selection;
125 bool has_transparent_background;
126 #endif
127 } current_frame_data_;
128
106 base::ThreadChecker thread_checker_; 129 base::ThreadChecker thread_checker_;
107 bool bound_ = false; 130 bool bound_ = false;
108 }; 131 };
109 132
110 } // namespace content 133 } // namespace content
111 134
112 #endif // CONTENT_RENDERER_GPU_RENDERER_COMPOSITOR_FRAME_SINK_H_ 135 #endif // CONTENT_RENDERER_GPU_RENDERER_COMPOSITOR_FRAME_SINK_H_
OLDNEW
« no previous file with comments | « content/public/test/browser_test_utils.cc ('k') | content/renderer/gpu/renderer_compositor_frame_sink.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698