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

Side by Side Diff: examples/surfaces_app/child_impl.h

Issue 1534693002: Delete the Surfaces service. (Closed) Base URL: git@github.com:domokit/mojo.git@cl-2d
Patch Set: rebase Created 5 years 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 | « examples/surfaces_app/child_gl_impl.cc ('k') | examples/surfaces_app/child_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_SURFACES_APP_CHILD_IMPL_H_
6 #define EXAMPLES_SURFACES_APP_CHILD_IMPL_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h"
11 #include "cc/surfaces/surface_id.h"
12 #include "cc/surfaces/surface_id_allocator.h"
13 #include "examples/surfaces_app/child.mojom.h"
14 #include "mojo/public/cpp/bindings/string.h"
15 #include "mojo/public/cpp/bindings/strong_binding.h"
16 #include "mojo/services/surfaces/interfaces/surface_id.mojom.h"
17 #include "mojo/services/surfaces/interfaces/surfaces.mojom.h"
18 #include "third_party/skia/include/core/SkColor.h"
19 #include "ui/gfx/size.h"
20
21 namespace cc {
22 class CompositorFrame;
23 }
24
25 namespace mojo {
26
27 class ApplicationConnection;
28
29 namespace examples {
30
31 // Simple example of a child app using surfaces.
32 class ChildImpl : public Child {
33 public:
34 class Context {
35 public:
36 virtual ApplicationConnection* ShellConnection(
37 const mojo::String& application_url) = 0;
38 };
39 ChildImpl(ApplicationConnection* surfaces_service_connection,
40 InterfaceRequest<Child> request);
41 ~ChildImpl() override;
42
43 private:
44 using ProduceCallback = mojo::Callback<void(SurfaceIdPtr id)>;
45
46 void SetIdNamespace(uint32_t id_namespace);
47
48 // Child implementation.
49 void ProduceFrame(ColorPtr color,
50 SizePtr size,
51 const ProduceCallback& callback) override;
52
53 scoped_ptr<cc::SurfaceIdAllocator> allocator_;
54 SurfacePtr surface_;
55 uint32_t id_namespace_;
56 StrongBinding<Child> binding_;
57
58 DISALLOW_COPY_AND_ASSIGN(ChildImpl);
59 };
60
61 } // namespace examples
62 } // namespace mojo
63
64 #endif // EXAMPLES_SURFACES_APP_CHILD_IMPL_H_
OLDNEW
« no previous file with comments | « examples/surfaces_app/child_gl_impl.cc ('k') | examples/surfaces_app/child_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698