Chromium Code Reviews| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 | 100 |
| 101 // Set the root layer scroll offset to |new_value|. | 101 // Set the root layer scroll offset to |new_value|. |
| 102 void ScrollTo(gfx::Vector2d new_value); | 102 void ScrollTo(gfx::Vector2d new_value); |
| 103 | 103 |
| 104 // Android views hierarchy gluing. | 104 // Android views hierarchy gluing. |
| 105 bool IsVisible() const; | 105 bool IsVisible() const; |
| 106 gfx::Rect GetScreenRect() const; | 106 gfx::Rect GetScreenRect() const; |
| 107 bool attached_to_window() const { return attached_to_window_; } | 107 bool attached_to_window() const { return attached_to_window_; } |
| 108 bool hardware_enabled() const { return hardware_enabled_; } | 108 bool hardware_enabled() const { return hardware_enabled_; } |
| 109 void ReleaseHardware(); | 109 void ReleaseHardware(); |
| 110 void InvalidateOnFunctorDestroy(); | |
|
boliu
2014/10/28 19:49:43
nit: Put this next to UpdateParentDrawContraints/D
hush (inactive)
2014/10/29 19:57:04
Done.
| |
| 110 | 111 |
| 111 // Set the memory policy in shared renderer state and request the tiles from | 112 // Set the memory policy in shared renderer state and request the tiles from |
| 112 // GlobalTileManager. The actually amount of memory allowed by | 113 // GlobalTileManager. The actually amount of memory allowed by |
| 113 // GlobalTileManager may not be equal to what's requested in |policy|. | 114 // GlobalTileManager may not be equal to what's requested in |policy|. |
| 114 void RequestMemoryPolicy(content::SynchronousCompositorMemoryPolicy& policy); | 115 void RequestMemoryPolicy(content::SynchronousCompositorMemoryPolicy& policy); |
| 115 | 116 |
| 116 void TrimMemory(const int level, const bool visible); | 117 void TrimMemory(const int level, const bool visible); |
| 117 | 118 |
| 118 // SynchronousCompositorClient overrides. | 119 // SynchronousCompositorClient overrides. |
| 119 virtual void DidInitializeCompositor( | 120 virtual void DidInitializeCompositor( |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 DidSkipCompositeInDraw(); | 161 void DidSkipCompositeInDraw(); |
| 161 scoped_refptr<base::debug::ConvertableToTraceFormat> RootLayerStateAsValue( | 162 scoped_refptr<base::debug::ConvertableToTraceFormat> 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(); | 166 bool OnDrawHardware(); |
| 166 scoped_ptr<cc::CompositorFrame> CompositeHw(); | 167 scoped_ptr<cc::CompositorFrame> CompositeHw(); |
| 167 void ReturnUnusedResource(scoped_ptr<cc::CompositorFrame> frame); | |
| 168 void ReturnResourceFromParent(); | 168 void ReturnResourceFromParent(); |
| 169 | 169 |
| 170 // If we call up view invalidate and OnDraw is not called before a deadline, | 170 // If we call up view invalidate and OnDraw is not called before a deadline, |
| 171 // then we keep ticking the SynchronousCompositor so it can make progress. | 171 // then we keep ticking the SynchronousCompositor so it can make progress. |
| 172 // Do this in a two stage tick due to native MessageLoop favors delayed task, | 172 // Do this in a two stage tick due to native MessageLoop favors delayed task, |
| 173 // so ensure delayed task is inserted only after the draw task returns. | 173 // so ensure delayed task is inserted only after the draw task returns. |
| 174 void PostFallbackTick(); | 174 void PostFallbackTick(); |
| 175 void FallbackTickFired(); | 175 void FallbackTickFired(); |
| 176 | 176 |
| 177 // Force invoke the compositor to run produce a 1x1 software frame that is | 177 // Force invoke the compositor to run produce a 1x1 software frame that is |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 | 244 |
| 245 GlobalTileManager::Key tile_manager_key_; | 245 GlobalTileManager::Key tile_manager_key_; |
| 246 content::SynchronousCompositorMemoryPolicy memory_policy_; | 246 content::SynchronousCompositorMemoryPolicy memory_policy_; |
| 247 | 247 |
| 248 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); | 248 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); |
| 249 }; | 249 }; |
| 250 | 250 |
| 251 } // namespace android_webview | 251 } // namespace android_webview |
| 252 | 252 |
| 253 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ | 253 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ |
| OLD | NEW |