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

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

Issue 2174203002: OnDrawHardware() implementation with async messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added flag to branch old and new implementation Created 4 years, 4 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void SetOutputSurface(SynchronousCompositorOutputSurface* output_surface); 66 void SetOutputSurface(SynchronousCompositorOutputSurface* output_surface);
67 void OnMessageReceived(const IPC::Message& message); 67 void OnMessageReceived(const IPC::Message& message);
68 bool Send(IPC::Message* message); 68 bool Send(IPC::Message* message);
69 void PopulateCommonParams(SyncCompositorCommonRendererParams* params) const; 69 void PopulateCommonParams(SyncCompositorCommonRendererParams* params) const;
70 70
71 private: 71 private:
72 struct SharedMemoryWithSize; 72 struct SharedMemoryWithSize;
73 73
74 // IPC handlers. 74 // IPC handlers.
75 void OnComputeScroll(base::TimeTicks animation_time); 75 void OnComputeScroll(base::TimeTicks animation_time);
76 void DemandDrawHw_Async(const SyncCompositorDemandDrawHwParams& params);
boliu 2016/08/11 19:23:40 drop the underscore on all these new methods
ojars 2016/08/23 02:15:42 Done.
76 void DemandDrawHw(const SyncCompositorDemandDrawHwParams& params, 77 void DemandDrawHw(const SyncCompositorDemandDrawHwParams& params,
77 IPC::Message* reply_message); 78 IPC::Message* reply_message);
78 void SetSharedMemory( 79 void SetSharedMemory(
79 const SyncCompositorSetSharedMemoryParams& params, 80 const SyncCompositorSetSharedMemoryParams& params,
80 bool* success, 81 bool* success,
81 SyncCompositorCommonRendererParams* common_renderer_params); 82 SyncCompositorCommonRendererParams* common_renderer_params);
82 void ZeroSharedMemory(); 83 void ZeroSharedMemory();
83 void DemandDrawSw(const SyncCompositorDemandDrawSwParams& params, 84 void DemandDrawSw(const SyncCompositorDemandDrawSwParams& params,
84 IPC::Message* reply_message); 85 IPC::Message* reply_message);
85 void SynchronouslyZoomBy( 86 void SynchronouslyZoomBy(
86 float zoom_delta, 87 float zoom_delta,
87 const gfx::Point& anchor, 88 const gfx::Point& anchor,
88 SyncCompositorCommonRendererParams* common_renderer_params); 89 SyncCompositorCommonRendererParams* common_renderer_params);
89 void SetScroll(const gfx::ScrollOffset& total_scroll_offset); 90 void SetScroll(const gfx::ScrollOffset& total_scroll_offset);
90 91
92 void SwapBuffersHw_Async(uint32_t output_surface_id,
93 cc::CompositorFrame frame);
91 void SwapBuffersHw(uint32_t output_surface_id, cc::CompositorFrame frame); 94 void SwapBuffersHw(uint32_t output_surface_id, cc::CompositorFrame frame);
92 void SendDemandDrawHwReply(cc::CompositorFrame frame, 95 void SendDemandDrawHwReply(cc::CompositorFrame frame,
93 uint32_t output_surface_id, 96 uint32_t output_surface_id,
94 IPC::Message* reply_message); 97 IPC::Message* reply_message);
98 void SendDemandDrawHwReply_Async(cc::CompositorFrame frame,
99 uint32_t output_surface_id);
95 void DoDemandDrawSw(const SyncCompositorDemandDrawSwParams& params); 100 void DoDemandDrawSw(const SyncCompositorDemandDrawSwParams& params);
96 void SwapBuffersSw(cc::CompositorFrame frame); 101 void SwapBuffersSw(cc::CompositorFrame frame);
97 void SendDemandDrawSwReply(bool success, 102 void SendDemandDrawSwReply(bool success,
98 cc::CompositorFrame frame, 103 cc::CompositorFrame frame,
99 IPC::Message* reply_message); 104 IPC::Message* reply_message);
100 void SendAsyncRendererStateIfNeeded(); 105 void SendAsyncRendererStateIfNeeded();
101 106
102 const int routing_id_; 107 const int routing_id_;
103 IPC::Sender* const sender_; 108 IPC::Sender* const sender_;
104 ui::SynchronousInputHandlerProxy* const input_handler_proxy_; 109 ui::SynchronousInputHandlerProxy* const input_handler_proxy_;
105 const bool use_in_process_zero_copy_software_draw_; 110 const bool use_in_process_zero_copy_software_draw_;
106 SynchronousCompositorOutputSurface* output_surface_; 111 SynchronousCompositorOutputSurface* output_surface_;
107 bool inside_receive_; 112 bool inside_receive_;
108 IPC::Message* hardware_draw_reply_; 113 IPC::Message* hardware_draw_reply_;
109 IPC::Message* software_draw_reply_; 114 IPC::Message* software_draw_reply_;
115 bool hardware_draw_reply_async_;
110 116
111 // From browser. 117 // From browser.
112 std::unique_ptr<SharedMemoryWithSize> software_draw_shm_; 118 std::unique_ptr<SharedMemoryWithSize> software_draw_shm_;
113 119
114 // To browser. 120 // To browser.
115 mutable uint32_t version_; // Mustable so PopulateCommonParams can be const. 121 mutable uint32_t version_; // Mustable so PopulateCommonParams can be const.
116 gfx::ScrollOffset total_scroll_offset_; // Modified by both. 122 gfx::ScrollOffset total_scroll_offset_; // Modified by both.
117 gfx::ScrollOffset max_scroll_offset_; 123 gfx::ScrollOffset max_scroll_offset_;
118 gfx::SizeF scrollable_size_; 124 gfx::SizeF scrollable_size_;
119 float page_scale_factor_; 125 float page_scale_factor_;
120 float min_page_scale_factor_; 126 float min_page_scale_factor_;
121 float max_page_scale_factor_; 127 float max_page_scale_factor_;
122 bool need_animate_scroll_; 128 bool need_animate_scroll_;
123 uint32_t need_invalidate_count_; 129 uint32_t need_invalidate_count_;
124 uint32_t did_activate_pending_tree_count_; 130 uint32_t did_activate_pending_tree_count_;
125 131
126 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorProxy); 132 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorProxy);
127 }; 133 };
128 134
129 } // namespace content 135 } // namespace content
130 136
131 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_ 137 #endif // CONTENT_RENDERER_ANDROID_SYNCHRONOUS_COMPOSITOR_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698