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

Side by Side Diff: remoting/client/display/gl_renderer.h

Issue 2623413004: [Remoting Android] Fix thread issue with OpenGL drawable (Closed)
Patch Set: Reviewer's Feedback Created 3 years, 11 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
« no previous file with comments | « no previous file | remoting/client/jni/jni_gl_display_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 REMOTING_CLIENT_DISPLAY_GL_RENDERER_H_ 5 #ifndef REMOTING_CLIENT_DISPLAY_GL_RENDERER_H_
6 #define REMOTING_CLIENT_DISPLAY_GL_RENDERER_H_ 6 #define REMOTING_CLIENT_DISPLAY_GL_RENDERER_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 // Called when the surface is destroyed. 92 // Called when the surface is destroyed.
93 void OnSurfaceDestroyed(); 93 void OnSurfaceDestroyed();
94 94
95 void AddDrawable(base::WeakPtr<Drawable> drawable); 95 void AddDrawable(base::WeakPtr<Drawable> drawable);
96 96
97 // Returns the weak pointer to be used on the display thread. 97 // Returns the weak pointer to be used on the display thread.
98 base::WeakPtr<GlRenderer> GetWeakPtr(); 98 base::WeakPtr<GlRenderer> GetWeakPtr();
99 99
100 // Convenience method to create a Renderer with standard desktop components. 100 // Convenience method to create a Renderer with standard desktop components.
101 // This function must be called on the display thread, or whatever thread that
102 // will be used after the renderer is created.
101 static std::unique_ptr<GlRenderer> CreateGlRendererWithDesktop(); 103 static std::unique_ptr<GlRenderer> CreateGlRendererWithDesktop();
102 104
103 private: 105 private:
104 friend class GlRendererTest; 106 friend class GlRendererTest;
105 107
106 // Post a rendering task to the task runner of current thread. 108 // Post a rendering task to the task runner of current thread.
107 // Do nothing if render_callback_ is not set yet or an existing rendering task 109 // Do nothing if render_callback_ is not set yet or an existing rendering task
108 // in the queue will cover changes before this function is called. 110 // in the queue will cover changes before this function is called.
109 void RequestRender(); 111 void RequestRender();
110 112
(...skipping 25 matching lines...) Expand all
136 base::ThreadChecker thread_checker_; 138 base::ThreadChecker thread_checker_;
137 base::WeakPtr<GlRenderer> weak_ptr_; 139 base::WeakPtr<GlRenderer> weak_ptr_;
138 base::WeakPtrFactory<GlRenderer> weak_factory_; 140 base::WeakPtrFactory<GlRenderer> weak_factory_;
139 141
140 DISALLOW_COPY_AND_ASSIGN(GlRenderer); 142 DISALLOW_COPY_AND_ASSIGN(GlRenderer);
141 }; 143 };
142 144
143 } // namespace remoting 145 } // namespace remoting
144 146
145 #endif // REMOTING_CLIENT_DISPLAY_GL_RENDERER_H_ 147 #endif // REMOTING_CLIENT_DISPLAY_GL_RENDERER_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/client/jni/jni_gl_display_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698