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

Side by Side Diff: content/renderer/android/synchronous_compositor_proxy.h

Issue 1546383002: sync compositor: Send ipc reply in swap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + no swap fix Created 4 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 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 CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ 5 #ifndef CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_
6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ 6 #define CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 const gfx::SizeF& scrollable_size, 60 const gfx::SizeF& scrollable_size,
61 float page_scale_factor, 61 float page_scale_factor,
62 float min_page_scale_factor, 62 float min_page_scale_factor,
63 float max_page_scale_factor) override; 63 float max_page_scale_factor) override;
64 64
65 // SynchronousCompositorExternalBeginFrameSourceClient overrides. 65 // SynchronousCompositorExternalBeginFrameSourceClient overrides.
66 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; 66 void OnNeedsBeginFramesChange(bool needs_begin_frames) override;
67 67
68 // SynchronousCompositorOutputSurfaceClient overrides. 68 // SynchronousCompositorOutputSurfaceClient overrides.
69 void Invalidate() override; 69 void Invalidate() override;
70 void SwapBuffers(cc::CompositorFrame* frame) override;
70 71
71 void OnMessageReceived(const IPC::Message& message); 72 void OnMessageReceived(const IPC::Message& message);
72 bool Send(IPC::Message* message); 73 bool Send(IPC::Message* message);
73 void DidOverscroll(const DidOverscrollParams& did_overscroll_params); 74 void DidOverscroll(const DidOverscrollParams& did_overscroll_params);
74 75
75 private: 76 private:
76 struct SharedMemoryWithSize; 77 struct SharedMemoryWithSize;
77 78
78 void ProcessCommonParams( 79 void ProcessCommonParams(
79 const SyncCompositorCommonBrowserParams& common_params); 80 const SyncCompositorCommonBrowserParams& common_params);
80 void PopulateCommonParams(SyncCompositorCommonRendererParams* params); 81 void PopulateCommonParams(SyncCompositorCommonRendererParams* params);
81 82
82 // IPC handlers. 83 // IPC handlers.
83 void HandleInputEvent( 84 void HandleInputEvent(
84 const SyncCompositorCommonBrowserParams& common_params, 85 const SyncCompositorCommonBrowserParams& common_params,
85 const blink::WebInputEvent* event, 86 const blink::WebInputEvent* event,
86 SyncCompositorCommonRendererParams* common_renderer_params, 87 SyncCompositorCommonRendererParams* common_renderer_params,
87 InputEventAckState* ack); 88 InputEventAckState* ack);
88 void BeginFrame(const SyncCompositorCommonBrowserParams& common_params, 89 void BeginFrame(const SyncCompositorCommonBrowserParams& common_params,
89 const cc::BeginFrameArgs& args, 90 const cc::BeginFrameArgs& args,
90 SyncCompositorCommonRendererParams* common_renderer_params); 91 SyncCompositorCommonRendererParams* common_renderer_params);
91 void OnComputeScroll( 92 void OnComputeScroll(
92 const SyncCompositorCommonBrowserParams& common_params, 93 const SyncCompositorCommonBrowserParams& common_params,
93 base::TimeTicks animation_time, 94 base::TimeTicks animation_time,
94 SyncCompositorCommonRendererParams* common_renderer_params); 95 SyncCompositorCommonRendererParams* common_renderer_params);
95 void DemandDrawHw(const SyncCompositorCommonBrowserParams& common_params, 96 void DemandDrawHw(const SyncCompositorCommonBrowserParams& common_params,
96 const SyncCompositorDemandDrawHwParams& params, 97 const SyncCompositorDemandDrawHwParams& params,
97 SyncCompositorCommonRendererParams* common_renderer_params, 98 IPC::Message* reply_message);
98 cc::CompositorFrame* frame);
99 void SetSharedMemory( 99 void SetSharedMemory(
100 const SyncCompositorCommonBrowserParams& common_params, 100 const SyncCompositorCommonBrowserParams& common_params,
101 const SyncCompositorSetSharedMemoryParams& params, 101 const SyncCompositorSetSharedMemoryParams& params,
102 bool* success, 102 bool* success,
103 SyncCompositorCommonRendererParams* common_renderer_params); 103 SyncCompositorCommonRendererParams* common_renderer_params);
104 void ZeroSharedMemory(); 104 void ZeroSharedMemory();
105 void DemandDrawSw(const SyncCompositorCommonBrowserParams& common_params, 105 void DemandDrawSw(const SyncCompositorCommonBrowserParams& common_params,
106 const SyncCompositorDemandDrawSwParams& params, 106 const SyncCompositorDemandDrawSwParams& params,
107 bool* result, 107 bool* result,
108 SyncCompositorCommonRendererParams* common_renderer_params, 108 SyncCompositorCommonRendererParams* common_renderer_params,
109 cc::CompositorFrame* frame); 109 cc::CompositorFrame* frame);
110 110
111 void SwapBuffersHw(cc::CompositorFrame* frame);
112 void SendDemandDrawHwReply(cc::CompositorFrame* frame,
113 IPC::Message* reply_message);
111 void DidActivatePendingTree(); 114 void DidActivatePendingTree();
112 void DeliverMessages(); 115 void DeliverMessages();
113 void SendAsyncRendererStateIfNeeded(); 116 void SendAsyncRendererStateIfNeeded();
114 117
115 const int routing_id_; 118 const int routing_id_;
116 IPC::Sender* const sender_; 119 IPC::Sender* const sender_;
117 SynchronousCompositorOutputSurface* const output_surface_; 120 SynchronousCompositorOutputSurface* const output_surface_;
118 SynchronousCompositorExternalBeginFrameSource* const begin_frame_source_; 121 SynchronousCompositorExternalBeginFrameSource* const begin_frame_source_;
119 ui::SynchronousInputHandlerProxy* const input_handler_proxy_; 122 ui::SynchronousInputHandlerProxy* const input_handler_proxy_;
120 InputHandlerManagerClient::Handler* const input_handler_; 123 InputHandlerManagerClient::Handler* const input_handler_;
121 bool inside_receive_; 124 bool inside_receive_;
125 IPC::Message* hardware_draw_reply_;
126 scoped_ptr<cc::CompositorFrame> software_frame_holder_;
122 127
123 // From browser. 128 // From browser.
124 size_t bytes_limit_; 129 size_t bytes_limit_;
125 scoped_ptr<SharedMemoryWithSize> software_draw_shm_; 130 scoped_ptr<SharedMemoryWithSize> software_draw_shm_;
126 131
127 // To browser. 132 // To browser.
128 uint32_t version_; 133 uint32_t version_;
129 gfx::ScrollOffset total_scroll_offset_; // Modified by both. 134 gfx::ScrollOffset total_scroll_offset_; // Modified by both.
130 gfx::ScrollOffset max_scroll_offset_; 135 gfx::ScrollOffset max_scroll_offset_;
131 gfx::SizeF scrollable_size_; 136 gfx::SizeF scrollable_size_;
132 float page_scale_factor_; 137 float page_scale_factor_;
133 float min_page_scale_factor_; 138 float min_page_scale_factor_;
134 float max_page_scale_factor_; 139 float max_page_scale_factor_;
135 bool need_animate_scroll_; 140 bool need_animate_scroll_;
136 bool need_invalidate_; 141 bool need_invalidate_;
137 bool need_begin_frame_; 142 bool need_begin_frame_;
138 bool did_activate_pending_tree_; 143 bool did_activate_pending_tree_;
139 144
140 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorProxy); 145 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorProxy);
141 }; 146 };
142 147
143 } // namespace content 148 } // namespace content
144 149
145 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ 150 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698