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 20 matching lines...) Expand all Loading... | |
31 BrowserViewRendererClient* client); | 31 BrowserViewRendererClient* client); |
32 ~SharedRendererState(); | 32 ~SharedRendererState(); |
33 | 33 |
34 void ClientRequestDrawGL(); | 34 void ClientRequestDrawGL(); |
35 void DidDrawGLProcess(); | 35 void DidDrawGLProcess(); |
36 | 36 |
37 void SetScrollOffset(gfx::Vector2d scroll_offset); | 37 void SetScrollOffset(gfx::Vector2d scroll_offset); |
38 gfx::Vector2d GetScrollOffset(); | 38 gfx::Vector2d GetScrollOffset(); |
39 | 39 |
40 bool HasCompositorFrame() const; | 40 bool HasCompositorFrame() const; |
41 void SetCompositorFrame(scoped_ptr<cc::CompositorFrame> frame); | 41 void SetCompositorFrame(scoped_ptr<cc::CompositorFrame> frame, |
42 bool force_commit); | |
42 scoped_ptr<cc::CompositorFrame> PassCompositorFrame(); | 43 scoped_ptr<cc::CompositorFrame> PassCompositorFrame(); |
44 bool ForceCommit(); | |
hush (inactive)
2014/10/15 21:10:37
add a const in the end?
boliu
2014/10/16 01:20:11
Done.
| |
43 | 45 |
44 bool IsInsideHardwareRelease() const; | 46 bool IsInsideHardwareRelease() const; |
45 // Returns true if the draw constraints are updated. | 47 // Returns true if the draw constraints are updated. |
46 bool UpdateDrawConstraints( | 48 bool UpdateDrawConstraints( |
47 const ParentCompositorDrawConstraints& parent_draw_constraints); | 49 const ParentCompositorDrawConstraints& parent_draw_constraints); |
48 void PostExternalDrawConstraintsToChildCompositor( | 50 void PostExternalDrawConstraintsToChildCompositor( |
49 const ParentCompositorDrawConstraints& parent_draw_constraints); | 51 const ParentCompositorDrawConstraints& parent_draw_constraints); |
50 | 52 |
51 const ParentCompositorDrawConstraints ParentDrawConstraints() const; | 53 const ParentCompositorDrawConstraints ParentDrawConstraints() const; |
52 | 54 |
(...skipping 16 matching lines...) Expand all Loading... | |
69 | 71 |
70 scoped_refptr<base::MessageLoopProxy> ui_loop_; | 72 scoped_refptr<base::MessageLoopProxy> ui_loop_; |
71 BrowserViewRendererClient* client_on_ui_; | 73 BrowserViewRendererClient* client_on_ui_; |
72 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; | 74 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; |
73 base::CancelableClosure request_draw_gl_cancelable_closure_; | 75 base::CancelableClosure request_draw_gl_cancelable_closure_; |
74 | 76 |
75 // Accessed by both UI and RT thread. | 77 // Accessed by both UI and RT thread. |
76 mutable base::Lock lock_; | 78 mutable base::Lock lock_; |
77 gfx::Vector2d scroll_offset_; | 79 gfx::Vector2d scroll_offset_; |
78 scoped_ptr<cc::CompositorFrame> compositor_frame_; | 80 scoped_ptr<cc::CompositorFrame> compositor_frame_; |
81 bool force_commit_; | |
79 bool inside_hardware_release_; | 82 bool inside_hardware_release_; |
80 bool needs_force_invalidate_on_next_draw_gl_; | 83 bool needs_force_invalidate_on_next_draw_gl_; |
81 ParentCompositorDrawConstraints parent_draw_constraints_; | 84 ParentCompositorDrawConstraints parent_draw_constraints_; |
82 cc::ReturnedResourceArray returned_resources_; | 85 cc::ReturnedResourceArray returned_resources_; |
83 base::Closure request_draw_gl_closure_; | 86 base::Closure request_draw_gl_closure_; |
84 | 87 |
85 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; | 88 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(SharedRendererState); | 90 DISALLOW_COPY_AND_ASSIGN(SharedRendererState); |
88 }; | 91 }; |
89 | 92 |
90 class InsideHardwareReleaseReset { | 93 class InsideHardwareReleaseReset { |
91 public: | 94 public: |
92 explicit InsideHardwareReleaseReset( | 95 explicit InsideHardwareReleaseReset( |
93 SharedRendererState* shared_renderer_state); | 96 SharedRendererState* shared_renderer_state); |
94 ~InsideHardwareReleaseReset(); | 97 ~InsideHardwareReleaseReset(); |
95 | 98 |
96 private: | 99 private: |
97 SharedRendererState* shared_renderer_state_; | 100 SharedRendererState* shared_renderer_state_; |
98 | 101 |
99 DISALLOW_COPY_AND_ASSIGN(InsideHardwareReleaseReset); | 102 DISALLOW_COPY_AND_ASSIGN(InsideHardwareReleaseReset); |
100 }; | 103 }; |
101 | 104 |
102 } // namespace android_webview | 105 } // namespace android_webview |
103 | 106 |
104 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ | 107 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ |
OLD | NEW |