OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
7 | 7 |
8 #include "android_webview/browser/global_tile_manager.h" | 8 #include "android_webview/browser/global_tile_manager.h" |
9 #include "android_webview/browser/global_tile_manager_client.h" | 9 #include "android_webview/browser/global_tile_manager_client.h" |
10 #include "android_webview/browser/parent_compositor_draw_constraints.h" | 10 #include "android_webview/browser/parent_compositor_draw_constraints.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 gfx::Vector2dF current_fling_velocity) override; | 134 gfx::Vector2dF current_fling_velocity) override; |
135 | 135 |
136 // GlobalTileManagerClient overrides. | 136 // GlobalTileManagerClient overrides. |
137 virtual content::SynchronousCompositorMemoryPolicy GetMemoryPolicy() | 137 virtual content::SynchronousCompositorMemoryPolicy GetMemoryPolicy() |
138 const override; | 138 const override; |
139 virtual void SetMemoryPolicy( | 139 virtual void SetMemoryPolicy( |
140 content::SynchronousCompositorMemoryPolicy new_policy, | 140 content::SynchronousCompositorMemoryPolicy new_policy, |
141 bool effective_immediately) override; | 141 bool effective_immediately) override; |
142 | 142 |
143 void UpdateParentDrawConstraints(); | 143 void UpdateParentDrawConstraints(); |
| 144 void DidSkipCommitFrame(); |
144 | 145 |
145 private: | 146 private: |
146 void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value_dip); | 147 void SetTotalRootLayerScrollOffset(gfx::Vector2dF new_value_dip); |
147 // Checks the continuous invalidate and block invalidate state, and schedule | 148 // Checks the continuous invalidate and block invalidate state, and schedule |
148 // invalidates appropriately. If |force_invalidate| is true, then send a view | 149 // invalidates appropriately. If |force_invalidate| is true, then send a view |
149 // invalidate regardless of compositor expectation. If |skip_reschedule_tick| | 150 // invalidate regardless of compositor expectation. If |skip_reschedule_tick| |
150 // is true and if there is already a pending fallback tick, don't reschedule | 151 // is true and if there is already a pending fallback tick, don't reschedule |
151 // them. | 152 // them. |
152 void EnsureContinuousInvalidation(bool force_invalidate, | 153 void EnsureContinuousInvalidation(bool force_invalidate, |
153 bool skip_reschedule_tick); | 154 bool skip_reschedule_tick); |
154 bool OnDrawSoftware(jobject java_canvas); | 155 bool OnDrawSoftware(jobject java_canvas); |
155 bool CompositeSW(SkCanvas* canvas); | 156 bool CompositeSW(SkCanvas* canvas); |
156 void DidComposite(); | 157 void DidComposite(); |
157 void SkippedCompositeInDraw(); | 158 void DidSkipCompositeInDraw(); |
158 scoped_refptr<base::debug::ConvertableToTraceFormat> RootLayerStateAsValue( | 159 scoped_refptr<base::debug::ConvertableToTraceFormat> RootLayerStateAsValue( |
159 const gfx::Vector2dF& total_scroll_offset_dip, | 160 const gfx::Vector2dF& total_scroll_offset_dip, |
160 const gfx::SizeF& scrollable_size_dip); | 161 const gfx::SizeF& scrollable_size_dip); |
161 | 162 |
162 bool OnDrawHardware(jobject java_canvas); | 163 bool OnDrawHardware(jobject java_canvas); |
163 scoped_ptr<cc::CompositorFrame> CompositeHw(); | 164 scoped_ptr<cc::CompositorFrame> CompositeHw(); |
164 void ReturnUnusedResource(scoped_ptr<cc::CompositorFrame> frame); | 165 void ReturnUnusedResource(scoped_ptr<cc::CompositorFrame> frame); |
165 void ReturnResourceFromParent(); | 166 void ReturnResourceFromParent(); |
166 | 167 |
167 // If we call up view invalidate and OnDraw is not called before a deadline, | 168 // If we call up view invalidate and OnDraw is not called before a deadline, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // The draw constraints from the parent compositor. These are only used for | 210 // The draw constraints from the parent compositor. These are only used for |
210 // tiling priority. | 211 // tiling priority. |
211 ParentCompositorDrawConstraints parent_draw_constraints_; | 212 ParentCompositorDrawConstraints parent_draw_constraints_; |
212 | 213 |
213 // When true, we should continuously invalidate and keep drawing, for example | 214 // When true, we should continuously invalidate and keep drawing, for example |
214 // to drive animation. This value is set by the compositor and should always | 215 // to drive animation. This value is set by the compositor and should always |
215 // reflect the expectation of the compositor and not be reused for other | 216 // reflect the expectation of the compositor and not be reused for other |
216 // states. | 217 // states. |
217 bool compositor_needs_continuous_invalidate_; | 218 bool compositor_needs_continuous_invalidate_; |
218 | 219 |
| 220 bool invalidate_after_composite_; |
| 221 |
219 // Used to block additional invalidates while one is already pending. | 222 // Used to block additional invalidates while one is already pending. |
220 bool block_invalidates_; | 223 bool block_invalidates_; |
221 | 224 |
222 base::CancelableClosure post_fallback_tick_; | 225 base::CancelableClosure post_fallback_tick_; |
223 base::CancelableClosure fallback_tick_fired_; | 226 base::CancelableClosure fallback_tick_fired_; |
224 bool fallback_tick_pending_; | 227 bool fallback_tick_pending_; |
225 | 228 |
226 int width_; | 229 int width_; |
227 int height_; | 230 int height_; |
228 | 231 |
(...skipping 10 matching lines...) Expand all Loading... |
239 | 242 |
240 GlobalTileManager::Key tile_manager_key_; | 243 GlobalTileManager::Key tile_manager_key_; |
241 content::SynchronousCompositorMemoryPolicy memory_policy_; | 244 content::SynchronousCompositorMemoryPolicy memory_policy_; |
242 | 245 |
243 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); | 246 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); |
244 }; | 247 }; |
245 | 248 |
246 } // namespace android_webview | 249 } // namespace android_webview |
247 | 250 |
248 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 251 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
OLD | NEW |