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

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

Issue 750643003: Android: Improve Composite-with-no-GPU-channel handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/renderer_host/compositor_impl_android.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 (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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/cancelable_callback.h" 9 #include "base/cancelable_callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 bool WillCompositeThisFrame() const { 117 bool WillCompositeThisFrame() const {
118 return current_composite_task_ && 118 return current_composite_task_ &&
119 !current_composite_task_->callback().is_null(); 119 !current_composite_task_->callback().is_null();
120 } 120 }
121 bool DidCompositeThisFrame() const { 121 bool DidCompositeThisFrame() const {
122 return current_composite_task_ && 122 return current_composite_task_ &&
123 current_composite_task_->callback().is_null(); 123 current_composite_task_->callback().is_null();
124 } 124 }
125 bool WillComposite() const { 125 bool WillComposite() const {
126 return WillCompositeThisFrame() || 126 return WillCompositeThisFrame() ||
127 composite_on_vsync_trigger_ != DO_NOT_COMPOSITE; 127 composite_on_vsync_trigger_ != DO_NOT_COMPOSITE ||
128 defer_composite_for_gpu_channel_;
128 } 129 }
129 void CancelComposite() { 130 void CancelComposite() {
130 DCHECK(WillComposite()); 131 DCHECK(WillComposite());
131 if (WillCompositeThisFrame()) 132 if (WillCompositeThisFrame())
132 current_composite_task_->Cancel(); 133 current_composite_task_->Cancel();
133 current_composite_task_.reset(); 134 current_composite_task_.reset();
134 composite_on_vsync_trigger_ = DO_NOT_COMPOSITE; 135 composite_on_vsync_trigger_ = DO_NOT_COMPOSITE;
135 will_composite_immediately_ = false; 136 will_composite_immediately_ = false;
136 } 137 }
137 void OnGpuChannelEstablished(); 138 void OnGpuChannelEstablished();
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // How we should schedule Composite during the next vsync. 179 // How we should schedule Composite during the next vsync.
179 CompositingTrigger composite_on_vsync_trigger_; 180 CompositingTrigger composite_on_vsync_trigger_;
180 181
181 // The Composite operation scheduled for the current vsync interval. 182 // The Composite operation scheduled for the current vsync interval.
182 scoped_ptr<base::CancelableClosure> current_composite_task_; 183 scoped_ptr<base::CancelableClosure> current_composite_task_;
183 184
184 // The number of SwapBuffer calls that have not returned and ACK'd from 185 // The number of SwapBuffer calls that have not returned and ACK'd from
185 // the GPU thread. 186 // the GPU thread.
186 unsigned int pending_swapbuffers_; 187 unsigned int pending_swapbuffers_;
187 188
189 // Whether we are currently deferring a requested Composite operation until
190 // the GPU channel is established (it was either lost or not yet fully
191 // established the first time we tried to composite).
192 bool defer_composite_for_gpu_channel_;
193
188 base::TimeDelta vsync_period_; 194 base::TimeDelta vsync_period_;
189 base::TimeTicks last_vsync_; 195 base::TimeTicks last_vsync_;
190 196
191 base::WeakPtrFactory<CompositorImpl> weak_factory_; 197 base::WeakPtrFactory<CompositorImpl> weak_factory_;
192 198
193 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); 199 DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
194 }; 200 };
195 201
196 } // namespace content 202 } // namespace content
197 203
198 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ 204 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698