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

Side by Side Diff: examples/ganesh_app/ganesh_view.h

Issue 1559723002: Update the UI examples. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-14
Patch Set: Created 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef EXAMPLES_GANESH_APP_GANESH_VIEW_H_
6 #define EXAMPLES_GANESH_APP_GANESH_VIEW_H_
7
8 #include "examples/ganesh_app/texture_uploader.h"
9 #include "mojo/gpu/gl_context.h"
10 #include "mojo/services/surfaces/interfaces/surface_id.mojom.h"
11 #include "mojo/services/view_manager/cpp/view_observer.h"
12 #include "mojo/skia/ganesh_context.h"
13
14 namespace mojo {
15 class Shell;
16 }
17
18 namespace examples {
19
20 class GaneshView : public TextureUploader::Client, public mojo::ViewObserver {
21 public:
22 GaneshView(mojo::Shell* shell, mojo::View* view);
23 ~GaneshView() override;
24
25 private:
26 // mojo::ViewObserver implementation.
27 void OnViewDestroyed(mojo::View* view) override;
28 void OnViewBoundsChanged(mojo::View* view,
29 const mojo::Rect& old_bounds,
30 const mojo::Rect& new_bounds) override;
31 void OnViewInputEvent(mojo::View* view, const mojo::EventPtr& event) override;
32
33 // TextureUploader::Client implementation.
34 void OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) override;
35
36 void Draw(const mojo::Size& size);
37
38 mojo::View* view_;
39 base::WeakPtr<mojo::GLContext> gl_context_;
40 scoped_ptr<mojo::GaneshContext> gr_context_;
41 TextureUploader texture_uploader_;
42
43 DISALLOW_COPY_AND_ASSIGN(GaneshView);
44 };
45
46 } // namespace examples
47
48 #endif // EXAMPLES_GANESH_APP_GANESH_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698