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

Side by Side Diff: examples/surfaces_app/child_impl.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_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
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_CHILD_IMPL_H_ 5 #ifndef EXAMPLES_SURFACES_APP_CHILD_IMPL_H_
6 #define EXAMPLES_SURFACES_APP_CHILD_IMPL_H_ 6 #define EXAMPLES_SURFACES_APP_CHILD_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 22 matching lines...) Expand all
33 public: 33 public:
34 class Context { 34 class Context {
35 public: 35 public:
36 virtual ApplicationConnection* ShellConnection( 36 virtual ApplicationConnection* ShellConnection(
37 const mojo::String& application_url) = 0; 37 const mojo::String& application_url) = 0;
38 }; 38 };
39 explicit ChildImpl(ApplicationConnection* surfaces_service_connection); 39 explicit ChildImpl(ApplicationConnection* surfaces_service_connection);
40 ~ChildImpl() override; 40 ~ChildImpl() override;
41 41
42 private: 42 private:
43 using ProduceCallback = mojo::Callback<void(SurfaceIdPtr id)>;
44
43 // SurfaceClient implementation 45 // SurfaceClient implementation
44 void SetIdNamespace(uint32_t id_namespace) override; 46 void SetIdNamespace(uint32_t id_namespace) override;
45 void ReturnResources(Array<ReturnedResourcePtr> resources) override; 47 void ReturnResources(Array<ReturnedResourcePtr> resources) override;
46 48
47 // Child implementation. 49 // Child implementation.
48 void ProduceFrame( 50 void ProduceFrame(ColorPtr color,
49 ColorPtr color, 51 SizePtr size,
50 SizePtr size, 52 const ProduceCallback& callback) override;
51 const mojo::Callback<void(SurfaceIdPtr id)>& callback) override;
52 53
53 scoped_ptr<cc::SurfaceIdAllocator> allocator_; 54 scoped_ptr<cc::SurfaceIdAllocator> allocator_;
54 SurfacePtr surface_; 55 SurfacePtr surface_;
55 cc::SurfaceId id_; 56 uint32_t id_namespace_;
56 57
57 DISALLOW_COPY_AND_ASSIGN(ChildImpl); 58 DISALLOW_COPY_AND_ASSIGN(ChildImpl);
58 }; 59 };
59 60
60 } // namespace examples 61 } // namespace examples
61 } // namespace mojo 62 } // namespace mojo
62 63
63 #endif // EXAMPLES_SURFACES_APP_CHILD_IMPL_H_ 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