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

Side by Side Diff: content/browser/android/synchronous_compositor_host.h

Issue 1541203003: IPC-based sync compositor software draw optimization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove CHECK 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
« no previous file with comments | « no previous file | content/browser/android/synchronous_compositor_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ 5 #ifndef CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_
6 #define CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ 6 #define CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 void OnComputeScroll(base::TimeTicks animation_time) override; 49 void OnComputeScroll(base::TimeTicks animation_time) override;
50 50
51 // SynchronousCompositorBase overrides. 51 // SynchronousCompositorBase overrides.
52 InputEventAckState HandleInputEvent( 52 InputEventAckState HandleInputEvent(
53 const blink::WebInputEvent& input_event) override; 53 const blink::WebInputEvent& input_event) override;
54 void BeginFrame(const cc::BeginFrameArgs& args) override; 54 void BeginFrame(const cc::BeginFrameArgs& args) override;
55 bool OnMessageReceived(const IPC::Message& message) override; 55 bool OnMessageReceived(const IPC::Message& message) override;
56 void DidBecomeCurrent() override; 56 void DidBecomeCurrent() override;
57 57
58 private: 58 private:
59 class ScopedSendZeroMemory;
60 struct SharedMemoryWithSize;
61 friend class ScopedSetZeroMemory;
59 friend class SynchronousCompositorBase; 62 friend class SynchronousCompositorBase;
63
60 SynchronousCompositorHost(RenderWidgetHostViewAndroid* rwhva, 64 SynchronousCompositorHost(RenderWidgetHostViewAndroid* rwhva,
61 SynchronousCompositorClient* client); 65 SynchronousCompositorClient* client);
62 void PopulateCommonParams(SyncCompositorCommonBrowserParams* params); 66 void PopulateCommonParams(SyncCompositorCommonBrowserParams* params);
63 void ProcessCommonParams(const SyncCompositorCommonRendererParams& params); 67 void ProcessCommonParams(const SyncCompositorCommonRendererParams& params);
64 void UpdateNeedsBeginFrames(); 68 void UpdateNeedsBeginFrames();
65 void UpdateFrameMetaData(const cc::CompositorFrameMetadata& frame_metadata); 69 void UpdateFrameMetaData(const cc::CompositorFrameMetadata& frame_metadata);
66 void OnOverScroll(const SyncCompositorCommonRendererParams& params, 70 void OnOverScroll(const SyncCompositorCommonRendererParams& params,
67 const DidOverscrollParams& over_scroll_params); 71 const DidOverscrollParams& over_scroll_params);
68 void SendAsyncCompositorStateIfNeeded(); 72 void SendAsyncCompositorStateIfNeeded();
69 void UpdateStateTask(); 73 void UpdateStateTask();
74 void SetSoftwareDrawSharedMemoryIfNeeded(size_t stride, size_t buffer_size);
75 void SendZeroMemory();
70 76
71 RenderWidgetHostViewAndroid* const rwhva_; 77 RenderWidgetHostViewAndroid* const rwhva_;
72 SynchronousCompositorClient* const client_; 78 SynchronousCompositorClient* const client_;
73 const scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; 79 const scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
74 const int routing_id_; 80 const int routing_id_;
75 IPC::Sender* const sender_; 81 IPC::Sender* const sender_;
76 82
77 bool is_active_; 83 bool is_active_;
78 size_t bytes_limit_; 84 size_t bytes_limit_;
79 cc::ReturnedResourceArray returned_resources_; 85 cc::ReturnedResourceArray returned_resources_;
86 scoped_ptr<SharedMemoryWithSize> software_draw_shm_;
80 87
81 // Updated by both renderer and browser. 88 // Updated by both renderer and browser.
82 gfx::ScrollOffset root_scroll_offset_; 89 gfx::ScrollOffset root_scroll_offset_;
83 bool root_scroll_offset_updated_by_browser_; 90 bool root_scroll_offset_updated_by_browser_;
84 91
85 // From renderer. 92 // From renderer.
86 uint32_t renderer_param_version_; 93 uint32_t renderer_param_version_;
87 bool need_animate_scroll_; 94 bool need_animate_scroll_;
88 bool need_invalidate_; 95 bool need_invalidate_;
89 bool need_begin_frame_; 96 bool need_begin_frame_;
90 bool did_activate_pending_tree_; 97 bool did_activate_pending_tree_;
91 98
92 base::WeakPtrFactory<SynchronousCompositorHost> weak_ptr_factory_; 99 base::WeakPtrFactory<SynchronousCompositorHost> weak_ptr_factory_;
93 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorHost); 100 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorHost);
94 }; 101 };
95 102
96 } // namespace content 103 } // namespace content
97 104
98 #endif // CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_ 105 #endif // CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/android/synchronous_compositor_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698