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/parent_compositor_draw_constraints.h" | 8 #include "android_webview/browser/parent_compositor_draw_constraints.h" |
9 #include "base/cancelable_callback.h" | 9 #include "base/cancelable_callback.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 bool force_commit); | 42 bool force_commit); |
43 scoped_ptr<cc::CompositorFrame> PassCompositorFrame(); | 43 scoped_ptr<cc::CompositorFrame> PassCompositorFrame(); |
44 bool ForceCommit() const; | 44 bool ForceCommit() const; |
45 | 45 |
46 bool IsInsideHardwareRelease() const; | 46 bool IsInsideHardwareRelease() const; |
47 // Returns true if the draw constraints are updated. | 47 // Returns true if the draw constraints are updated. |
48 bool UpdateDrawConstraints( | 48 bool UpdateDrawConstraints( |
49 const ParentCompositorDrawConstraints& parent_draw_constraints); | 49 const ParentCompositorDrawConstraints& parent_draw_constraints); |
50 void PostExternalDrawConstraintsToChildCompositor( | 50 void PostExternalDrawConstraintsToChildCompositor( |
51 const ParentCompositorDrawConstraints& parent_draw_constraints); | 51 const ParentCompositorDrawConstraints& parent_draw_constraints); |
| 52 void DidSkipCommitFrame(); |
52 | 53 |
53 const ParentCompositorDrawConstraints ParentDrawConstraints() const; | 54 const ParentCompositorDrawConstraints ParentDrawConstraints() const; |
54 | 55 |
55 void SetForceInvalidateOnNextDrawGL( | 56 void SetForceInvalidateOnNextDrawGL( |
56 bool needs_force_invalidate_on_next_draw_gl); | 57 bool needs_force_invalidate_on_next_draw_gl); |
57 bool NeedsForceInvalidateOnNextDrawGL() const; | 58 bool NeedsForceInvalidateOnNextDrawGL() const; |
58 | 59 |
59 void InsertReturnedResources(const cc::ReturnedResourceArray& resources); | 60 void InsertReturnedResources(const cc::ReturnedResourceArray& resources); |
60 void SwapReturnedResources(cc::ReturnedResourceArray* resources); | 61 void SwapReturnedResources(cc::ReturnedResourceArray* resources); |
61 bool ReturnedResourcesEmpty() const; | 62 bool ReturnedResourcesEmpty() const; |
62 | 63 |
63 private: | 64 private: |
64 friend class InsideHardwareReleaseReset; | 65 friend class InsideHardwareReleaseReset; |
65 friend class internal::RequestDrawGLTracker; | 66 friend class internal::RequestDrawGLTracker; |
66 | 67 |
67 void ResetRequestDrawGLCallback(); | 68 void ResetRequestDrawGLCallback(); |
68 void ClientRequestDrawGLOnUIThread(); | 69 void ClientRequestDrawGLOnUIThread(); |
69 void UpdateParentDrawConstraintsOnUIThread(); | 70 void UpdateParentDrawConstraintsOnUIThread(); |
| 71 void DidSkipCommitFrameOnUIThread(); |
70 void SetInsideHardwareRelease(bool inside); | 72 void SetInsideHardwareRelease(bool inside); |
71 | 73 |
72 scoped_refptr<base::MessageLoopProxy> ui_loop_; | 74 scoped_refptr<base::MessageLoopProxy> ui_loop_; |
73 BrowserViewRendererClient* client_on_ui_; | 75 BrowserViewRendererClient* client_on_ui_; |
74 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; | 76 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; |
75 base::CancelableClosure request_draw_gl_cancelable_closure_; | 77 base::CancelableClosure request_draw_gl_cancelable_closure_; |
76 | 78 |
77 // Accessed by both UI and RT thread. | 79 // Accessed by both UI and RT thread. |
78 mutable base::Lock lock_; | 80 mutable base::Lock lock_; |
79 gfx::Vector2d scroll_offset_; | 81 gfx::Vector2d scroll_offset_; |
(...skipping 18 matching lines...) Expand all Loading... |
98 | 100 |
99 private: | 101 private: |
100 SharedRendererState* shared_renderer_state_; | 102 SharedRendererState* shared_renderer_state_; |
101 | 103 |
102 DISALLOW_COPY_AND_ASSIGN(InsideHardwareReleaseReset); | 104 DISALLOW_COPY_AND_ASSIGN(InsideHardwareReleaseReset); |
103 }; | 105 }; |
104 | 106 |
105 } // namespace android_webview | 107 } // namespace android_webview |
106 | 108 |
107 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ | 109 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ |
OLD | NEW |