| 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 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // UI thread methods. | 42 // UI thread methods. |
| 43 void SetScrollOffsetOnUI(gfx::Vector2d scroll_offset); | 43 void SetScrollOffsetOnUI(gfx::Vector2d scroll_offset); |
| 44 void SetCompositorFrameOnUI(scoped_ptr<ChildFrame> frame); | 44 void SetCompositorFrameOnUI(scoped_ptr<ChildFrame> frame); |
| 45 void InitializeHardwareDrawIfNeededOnUI(); | 45 void InitializeHardwareDrawIfNeededOnUI(); |
| 46 void ReleaseHardwareDrawIfNeededOnUI(); | 46 void ReleaseHardwareDrawIfNeededOnUI(); |
| 47 ParentCompositorDrawConstraints GetParentDrawConstraintsOnUI() const; | 47 ParentCompositorDrawConstraints GetParentDrawConstraintsOnUI() const; |
| 48 void SwapReturnedResourcesOnUI(cc::ReturnedResourceArray* resources); | 48 void SwapReturnedResourcesOnUI(cc::ReturnedResourceArray* resources); |
| 49 bool ReturnedResourcesEmptyOnUI() const; | 49 bool ReturnedResourcesEmptyOnUI() const; |
| 50 scoped_ptr<ChildFrame> PassUncommittedFrameOnUI(); | 50 scoped_ptr<ChildFrame> PassUncommittedFrameOnUI(); |
| 51 void DeleteHardwareRendererOnUI(); |
| 51 | 52 |
| 52 // RT thread methods. | 53 // RT thread methods. |
| 53 gfx::Vector2d GetScrollOffsetOnRT(); | 54 gfx::Vector2d GetScrollOffsetOnRT(); |
| 54 scoped_ptr<ChildFrame> PassCompositorFrameOnRT(); | 55 scoped_ptr<ChildFrame> PassCompositorFrameOnRT(); |
| 55 void DrawGL(AwDrawGLInfo* draw_info); | 56 void DrawGL(AwDrawGLInfo* draw_info); |
| 56 void PostExternalDrawConstraintsToChildCompositorOnRT( | 57 void PostExternalDrawConstraintsToChildCompositorOnRT( |
| 57 const ParentCompositorDrawConstraints& parent_draw_constraints); | 58 const ParentCompositorDrawConstraints& parent_draw_constraints); |
| 58 void InsertReturnedResourcesOnRT(const cc::ReturnedResourceArray& resources); | 59 void InsertReturnedResourcesOnRT(const cc::ReturnedResourceArray& resources); |
| 59 | 60 |
| 60 private: | 61 private: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 71 | 72 |
| 72 // RT thread method. | 73 // RT thread method. |
| 73 void DidDrawGLProcess(); | 74 void DidDrawGLProcess(); |
| 74 | 75 |
| 75 // UI thread methods. | 76 // UI thread methods. |
| 76 void ResetRequestDrawGLCallback(); | 77 void ResetRequestDrawGLCallback(); |
| 77 void ClientRequestDrawGLOnUI(); | 78 void ClientRequestDrawGLOnUI(); |
| 78 void UpdateParentDrawConstraintsOnUI(); | 79 void UpdateParentDrawConstraintsOnUI(); |
| 79 bool IsInsideHardwareRelease() const; | 80 bool IsInsideHardwareRelease() const; |
| 80 void SetInsideHardwareRelease(bool inside); | 81 void SetInsideHardwareRelease(bool inside); |
| 82 void ReleaseCompositorResourcesIfNeededOnUI(bool release_hardware_draw); |
| 81 | 83 |
| 82 // Accessed by UI thread. | 84 // Accessed by UI thread. |
| 83 scoped_refptr<base::SingleThreadTaskRunner> ui_loop_; | 85 scoped_refptr<base::SingleThreadTaskRunner> ui_loop_; |
| 84 BrowserViewRenderer* browser_view_renderer_; | 86 BrowserViewRenderer* browser_view_renderer_; |
| 85 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; | 87 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; |
| 86 base::CancelableClosure request_draw_gl_cancelable_closure_; | 88 base::CancelableClosure request_draw_gl_cancelable_closure_; |
| 87 | 89 |
| 88 // Accessed by RT thread. | 90 // Accessed by RT thread. |
| 89 scoped_ptr<HardwareRenderer> hardware_renderer_; | 91 scoped_ptr<HardwareRenderer> hardware_renderer_; |
| 90 | 92 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 101 base::Closure request_draw_gl_closure_; | 103 base::Closure request_draw_gl_closure_; |
| 102 | 104 |
| 103 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; | 105 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; |
| 104 | 106 |
| 105 DISALLOW_COPY_AND_ASSIGN(SharedRendererState); | 107 DISALLOW_COPY_AND_ASSIGN(SharedRendererState); |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 } // namespace android_webview | 110 } // namespace android_webview |
| 109 | 111 |
| 110 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ | 112 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ |
| OLD | NEW |