Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SHARED_RENDERER_STATE_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ |
| 7 | 7 |
| 8 #include "android_webview/browser/gl_view_renderer_manager.h" | 8 #include "android_webview/browser/gl_view_renderer_manager.h" |
| 9 #include "android_webview/browser/parent_compositor_draw_constraints.h" | 9 #include "android_webview/browser/parent_compositor_draw_constraints.h" |
| 10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 void UpdateParentDrawConstraintsOnUI(); | 88 void UpdateParentDrawConstraintsOnUI(); |
| 89 void DidSkipCommitFrameOnUI(); | 89 void DidSkipCommitFrameOnUI(); |
| 90 bool IsInsideHardwareRelease() const; | 90 bool IsInsideHardwareRelease() const; |
| 91 void SetInsideHardwareRelease(bool inside); | 91 void SetInsideHardwareRelease(bool inside); |
| 92 | 92 |
| 93 // Accessed by UI thread. | 93 // Accessed by UI thread. |
| 94 scoped_refptr<base::SingleThreadTaskRunner> ui_loop_; | 94 scoped_refptr<base::SingleThreadTaskRunner> ui_loop_; |
| 95 BrowserViewRenderer* browser_view_renderer_; | 95 BrowserViewRenderer* browser_view_renderer_; |
| 96 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; | 96 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; |
| 97 base::CancelableClosure request_draw_gl_cancelable_closure_; | 97 base::CancelableClosure request_draw_gl_cancelable_closure_; |
| 98 // This is true after BrowserViewRender::RequestDrawGL is called, and before | |
| 99 // the next GL mode process. False in other times. | |
| 100 bool has_queued_functor_on_ui_; | |
|
boliu
2014/12/13 01:03:15
This state should be tracked in RequestDrawGLTrack
hush (inactive)
2014/12/13 01:17:23
Right. Good point!
| |
| 98 | 101 |
| 99 // Accessed by RT thread. | 102 // Accessed by RT thread. |
| 100 scoped_ptr<HardwareRenderer> hardware_renderer_; | 103 scoped_ptr<HardwareRenderer> hardware_renderer_; |
| 101 | 104 |
| 102 // This is accessed by both UI and RT now. TODO(hush): move to RT only. | 105 // This is accessed by both UI and RT now. TODO(hush): move to RT only. |
| 103 GLViewRendererManager::Key renderer_manager_key_; | 106 GLViewRendererManager::Key renderer_manager_key_; |
| 104 | 107 |
| 105 // Accessed by both UI and RT thread. | 108 // Accessed by both UI and RT thread. |
| 106 mutable base::Lock lock_; | 109 mutable base::Lock lock_; |
| 107 gfx::Vector2d scroll_offset_; | 110 gfx::Vector2d scroll_offset_; |
| 108 scoped_ptr<cc::CompositorFrame> compositor_frame_; | 111 scoped_ptr<cc::CompositorFrame> compositor_frame_; |
| 109 bool force_commit_; | 112 bool force_commit_; |
| 110 bool inside_hardware_release_; | 113 bool inside_hardware_release_; |
| 111 bool needs_force_invalidate_on_next_draw_gl_; | 114 bool needs_force_invalidate_on_next_draw_gl_; |
| 112 ParentCompositorDrawConstraints parent_draw_constraints_; | 115 ParentCompositorDrawConstraints parent_draw_constraints_; |
| 113 cc::ReturnedResourceArray returned_resources_; | 116 cc::ReturnedResourceArray returned_resources_; |
| 114 base::Closure request_draw_gl_closure_; | 117 base::Closure request_draw_gl_closure_; |
| 115 | 118 |
| 116 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; | 119 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; |
| 117 | 120 |
| 118 DISALLOW_COPY_AND_ASSIGN(SharedRendererState); | 121 DISALLOW_COPY_AND_ASSIGN(SharedRendererState); |
| 119 }; | 122 }; |
| 120 | 123 |
| 121 } // namespace android_webview | 124 } // namespace android_webview |
| 122 | 125 |
| 123 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ | 126 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ |
| OLD | NEW |