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

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

Issue 826423008: Use local ids for Surfaces APIs that can only apply to local surfaces (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 | « examples/surfaces_app/child_impl.cc ('k') | examples/surfaces_app/embedder.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 EXAMPLES_SURFACES_APP_EMBEDDER_H_ 5 #ifndef EXAMPLES_SURFACES_APP_EMBEDDER_H_
6 #define EXAMPLES_SURFACES_APP_EMBEDDER_H_ 6 #define EXAMPLES_SURFACES_APP_EMBEDDER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/surfaces/surface_id.h" 9 #include "cc/surfaces/surface_id.h"
10 #include "mojo/services/surfaces/public/interfaces/surfaces.mojom.h" 10 #include "mojo/services/surfaces/public/interfaces/surfaces.mojom.h"
11 #include "ui/gfx/size.h" 11 #include "ui/gfx/size.h"
12 12
13 namespace cc { 13 namespace cc {
14 class CompositorFrame; 14 class CompositorFrame;
15 } 15 }
16 16
17 namespace mojo { 17 namespace mojo {
18 18
19 class ApplicationConnection; 19 class ApplicationConnection;
20 20
21 namespace examples { 21 namespace examples {
22 22
23 // Simple example of a surface embedder that embeds two other surfaces. 23 // Simple example of a surface embedder that embeds two other surfaces.
24 class Embedder { 24 class Embedder {
25 public: 25 public:
26 Embedder(); 26 Embedder(uint32_t local_id, Surface* surface);
27 ~Embedder(); 27 ~Embedder();
28 28
29 void set_surface(Surface* surface) { surface_ = surface; }
30 void set_surface_id(SurfaceIdPtr id) { id_ = id.Clone(); }
31
32 void ProduceFrame(cc::SurfaceId child_one, 29 void ProduceFrame(cc::SurfaceId child_one,
33 cc::SurfaceId child_two, 30 cc::SurfaceId child_two,
34 const gfx::Size& child_size, 31 const gfx::Size& child_size,
35 const gfx::Size& size, 32 const gfx::Size& size,
36 int offset); 33 int offset);
37 34
38 private: 35 private:
39 SurfaceIdPtr id_; 36 uint32_t local_id_;
40 Surface* surface_; 37 Surface* surface_;
41 38
42 DISALLOW_COPY_AND_ASSIGN(Embedder); 39 DISALLOW_COPY_AND_ASSIGN(Embedder);
43 }; 40 };
44 41
45 } // namespace examples 42 } // namespace examples
46 } // namespace mojo 43 } // namespace mojo
47 44
48 #endif // EXAMPLES_SURFACES_APP_EMBEDDER_H_ 45 #endif // EXAMPLES_SURFACES_APP_EMBEDDER_H_
OLDNEW
« no previous file with comments | « examples/surfaces_app/child_impl.cc ('k') | examples/surfaces_app/embedder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698