Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: android_webview/browser/shared_renderer_state.h

Issue 603633003: Android WebView: fix missing an invalidate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ~SharedRendererState(); 51 ~SharedRendererState();
52 52
53 void ClientRequestDrawGL(); 53 void ClientRequestDrawGL();
54 void DidDrawGLProcess(); 54 void DidDrawGLProcess();
55 55
56 bool HasDrawGLInput() const; 56 bool HasDrawGLInput() const;
57 void SetDrawGLInput(scoped_ptr<DrawGLInput> input); 57 void SetDrawGLInput(scoped_ptr<DrawGLInput> input);
58 scoped_ptr<DrawGLInput> PassDrawGLInput(); 58 scoped_ptr<DrawGLInput> PassDrawGLInput();
59 59
60 bool IsInsideHardwareRelease() const; 60 bool IsInsideHardwareRelease() const;
61 void UpdateDrawConstraints( 61 // Returns true if the draw constraints are updated.
62 bool UpdateDrawConstraints(
62 const ParentCompositorDrawConstraints& parent_draw_constraints); 63 const ParentCompositorDrawConstraints& parent_draw_constraints);
63 void PostExternalDrawConstraintsToChildCompositor( 64 void PostExternalDrawConstraintsToChildCompositor(
64 const ParentCompositorDrawConstraints& parent_draw_constraints); 65 const ParentCompositorDrawConstraints& parent_draw_constraints);
65 66
66 const ParentCompositorDrawConstraints ParentDrawConstraints() const; 67 const ParentCompositorDrawConstraints ParentDrawConstraints() const;
67 68
69 void SetForceInvalidateOnNextDrawGL(
70 bool needs_force_invalidate_on_next_draw_gl);
71 bool NeedsForceInvalidateOnNextDrawGL() const;
72
68 void InsertReturnedResources(const cc::ReturnedResourceArray& resources); 73 void InsertReturnedResources(const cc::ReturnedResourceArray& resources);
69 void SwapReturnedResources(cc::ReturnedResourceArray* resources); 74 void SwapReturnedResources(cc::ReturnedResourceArray* resources);
70 bool ReturnedResourcesEmpty() const; 75 bool ReturnedResourcesEmpty() const;
71 76
72 private: 77 private:
73 friend class InsideHardwareReleaseReset; 78 friend class InsideHardwareReleaseReset;
74 friend class internal::RequestDrawGLTracker; 79 friend class internal::RequestDrawGLTracker;
75 80
76 void ResetRequestDrawGLCallback(); 81 void ResetRequestDrawGLCallback();
77 void ClientRequestDrawGLOnUIThread(); 82 void ClientRequestDrawGLOnUIThread();
78 void UpdateParentDrawConstraintsOnUIThread(); 83 void UpdateParentDrawConstraintsOnUIThread();
79 void SetInsideHardwareRelease(bool inside); 84 void SetInsideHardwareRelease(bool inside);
80 85
81 scoped_refptr<base::MessageLoopProxy> ui_loop_; 86 scoped_refptr<base::MessageLoopProxy> ui_loop_;
82 BrowserViewRendererClient* client_on_ui_; 87 BrowserViewRendererClient* client_on_ui_;
83 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_; 88 base::WeakPtr<SharedRendererState> ui_thread_weak_ptr_;
84 base::CancelableClosure request_draw_gl_cancelable_closure_; 89 base::CancelableClosure request_draw_gl_cancelable_closure_;
85 90
86 // Accessed by both UI and RT thread. 91 // Accessed by both UI and RT thread.
87 mutable base::Lock lock_; 92 mutable base::Lock lock_;
88 scoped_ptr<DrawGLInput> draw_gl_input_; 93 scoped_ptr<DrawGLInput> draw_gl_input_;
89 bool inside_hardware_release_; 94 bool inside_hardware_release_;
95 bool needs_force_invalidate_on_next_draw_gl_;
90 ParentCompositorDrawConstraints parent_draw_constraints_; 96 ParentCompositorDrawConstraints parent_draw_constraints_;
91 cc::ReturnedResourceArray returned_resources_; 97 cc::ReturnedResourceArray returned_resources_;
92 base::Closure request_draw_gl_closure_; 98 base::Closure request_draw_gl_closure_;
93 99
94 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_; 100 base::WeakPtrFactory<SharedRendererState> weak_factory_on_ui_thread_;
95 101
96 DISALLOW_COPY_AND_ASSIGN(SharedRendererState); 102 DISALLOW_COPY_AND_ASSIGN(SharedRendererState);
97 }; 103 };
98 104
99 class InsideHardwareReleaseReset { 105 class InsideHardwareReleaseReset {
100 public: 106 public:
101 explicit InsideHardwareReleaseReset( 107 explicit InsideHardwareReleaseReset(
102 SharedRendererState* shared_renderer_state); 108 SharedRendererState* shared_renderer_state);
103 ~InsideHardwareReleaseReset(); 109 ~InsideHardwareReleaseReset();
104 110
105 private: 111 private:
106 SharedRendererState* shared_renderer_state_; 112 SharedRendererState* shared_renderer_state_;
107 113
108 DISALLOW_COPY_AND_ASSIGN(InsideHardwareReleaseReset); 114 DISALLOW_COPY_AND_ASSIGN(InsideHardwareReleaseReset);
109 }; 115 };
110 116
111 } // namespace android_webview 117 } // namespace android_webview
112 118
113 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_ 119 #endif // ANDROID_WEBVIEW_BROWSER_SHARED_RENDERER_STATE_H_
OLDNEW
« no previous file with comments | « android_webview/browser/hardware_renderer.cc ('k') | android_webview/browser/shared_renderer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698