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

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

Issue 1991853003: Make BaseView et al. take an ApplicationConnector instead of an ApplicationImpl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh Created 4 years, 7 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/base_view.cc ('k') | mojo/ui/ganesh_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 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 MOJO_UI_GANESH_VIEW_H_ 5 #ifndef MOJO_UI_GANESH_VIEW_H_
6 #define MOJO_UI_GANESH_VIEW_H_ 6 #define MOJO_UI_GANESH_VIEW_H_
7 7
8 #include "mojo/gpu/gl_context.h" 8 #include "mojo/gpu/gl_context.h"
9 #include "mojo/public/cpp/bindings/interface_handle.h"
9 #include "mojo/skia/ganesh_context.h" 10 #include "mojo/skia/ganesh_context.h"
10 #include "mojo/ui/base_view.h" 11 #include "mojo/ui/base_view.h"
11 #include "mojo/ui/ganesh_renderer.h" 12 #include "mojo/ui/ganesh_renderer.h"
12 13
13 class SkSurface; 14 class SkSurface;
14 15
15 namespace mojo { 16 namespace mojo {
16 namespace ui { 17 namespace ui {
17 18
18 // Abstract base implementation of the View interface for simple applications 19 // Abstract base implementation of the View interface for simple applications
19 // which use Ganesh for rendering. Subclasses must handle layout and provide 20 // which use Ganesh for rendering. Subclasses must handle layout and provide
20 // content for the scene. 21 // content for the scene.
21 class GaneshView : public BaseView { 22 class GaneshView : public BaseView {
22 public: 23 public:
23 GaneshView(mojo::ApplicationImpl* app_impl, 24 GaneshView(InterfaceHandle<ApplicationConnector> app_connector,
24 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, 25 InterfaceRequest<ViewOwner> view_owner_request,
25 const std::string& label); 26 const std::string& label);
26 27
27 ~GaneshView() override; 28 ~GaneshView() override;
28 29
29 // Gets the GL context, never null. 30 // Gets the GL context, never null.
30 const scoped_refptr<mojo::GLContext>& gl_context() const { 31 const scoped_refptr<GLContext>& gl_context() const {
31 return ganesh_renderer_.gl_context(); 32 return ganesh_renderer_.gl_context();
32 } 33 }
33 34
34 // Gets the Ganesh context, never null. 35 // Gets the Ganesh context, never null.
35 const scoped_refptr<mojo::skia::GaneshContext>& ganesh_context() const { 36 const scoped_refptr<skia::GaneshContext>& ganesh_context() const {
36 return ganesh_renderer_.ganesh_context(); 37 return ganesh_renderer_.ganesh_context();
37 } 38 }
38 39
39 // Gets the Ganesh renderer, never null. 40 // Gets the Ganesh renderer, never null.
40 mojo::ui::GaneshRenderer* ganesh_renderer() { return &ganesh_renderer_; } 41 GaneshRenderer* ganesh_renderer() { return &ganesh_renderer_; }
41 42
42 private: 43 private:
43 mojo::ui::GaneshRenderer ganesh_renderer_; 44 GaneshRenderer ganesh_renderer_;
44 45
45 DISALLOW_COPY_AND_ASSIGN(GaneshView); 46 DISALLOW_COPY_AND_ASSIGN(GaneshView);
46 }; 47 };
47 48
48 } // namespace ui 49 } // namespace ui
49 } // namespace mojo 50 } // namespace mojo
50 51
51 #endif // MOJO_UI_GANESH_VIEW_H_ 52 #endif // MOJO_UI_GANESH_VIEW_H_
OLDNEW
« no previous file with comments | « mojo/ui/base_view.cc ('k') | mojo/ui/ganesh_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698