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

Side by Side Diff: mojo/ui/gl_view.h

Issue 1679023006: Reify view ownership as a message pipe. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 | « mojo/ui/ganesh_view.cc ('k') | mojo/ui/gl_view.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MOJO_UI_GL_VIEW_H_ 5 #ifndef MOJO_UI_GL_VIEW_H_
6 #define MOJO_UI_GL_VIEW_H_ 6 #define MOJO_UI_GL_VIEW_H_
7 7
8 #include "mojo/gpu/gl_context.h" 8 #include "mojo/gpu/gl_context.h"
9 #include "mojo/gpu/gl_context_owner.h" 9 #include "mojo/gpu/gl_context_owner.h"
10 #include "mojo/ui/base_view.h" 10 #include "mojo/ui/base_view.h"
11 #include "mojo/ui/gl_renderer.h" 11 #include "mojo/ui/gl_renderer.h"
12 12
13 namespace mojo { 13 namespace mojo {
14 namespace ui { 14 namespace ui {
15 15
16 // Abstract base implementation of the View interface for simple applications 16 // Abstract base implementation of the View interface for simple applications
17 // which use GL for rendering. Subclasses must handle layout and provide 17 // which use GL for rendering. Subclasses must handle layout and provide
18 // content for the scene. 18 // content for the scene.
19 class GLView : public BaseView { 19 class GLView : public BaseView {
20 public: 20 public:
21 GLView( 21 GLView(mojo::ApplicationImpl* app_impl,
22 mojo::ApplicationImpl* app_impl, 22 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
23 const std::string& label, 23 const std::string& label);
24 const mojo::ui::ViewProvider::CreateViewCallback& create_view_callback);
25 24
26 ~GLView() override; 25 ~GLView() override;
27 26
28 // Gets the GL context, or null if none. 27 // Gets the GL context, or null if none.
29 const base::WeakPtr<mojo::GLContext>& gl_context() const { 28 const base::WeakPtr<mojo::GLContext>& gl_context() const {
30 return gl_context_owner_.context(); 29 return gl_context_owner_.context();
31 } 30 }
32 31
33 // Gets the GL renderer. 32 // Gets the GL renderer.
34 mojo::ui::GLRenderer* gl_renderer() { return &gl_renderer_; } 33 mojo::ui::GLRenderer* gl_renderer() { return &gl_renderer_; }
35 34
36 private: 35 private:
37 mojo::GLContextOwner gl_context_owner_; 36 mojo::GLContextOwner gl_context_owner_;
38 mojo::ui::GLRenderer gl_renderer_; 37 mojo::ui::GLRenderer gl_renderer_;
39 38
40 MOJO_DISALLOW_COPY_AND_ASSIGN(GLView); 39 MOJO_DISALLOW_COPY_AND_ASSIGN(GLView);
41 }; 40 };
42 41
43 } // namespace ui 42 } // namespace ui
44 } // namespace mojo 43 } // namespace mojo
45 44
46 #endif // MOJO_UI_GL_VIEW_H_ 45 #endif // MOJO_UI_GL_VIEW_H_
OLDNEW
« no previous file with comments | « mojo/ui/ganesh_view.cc ('k') | mojo/ui/gl_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698