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