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

Side by Side Diff: components/mus/public/cpp/view_surface.h

Issue 1344573002: Mandoline: Rename components/view_manager to components/mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 3 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_SURFACE_H_ 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_VIEW_SURFACE_H_
6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_SURFACE_H_ 6 #define COMPONENTS_MUS_PUBLIC_CPP_VIEW_SURFACE_H_
7 7
8 #include "base/observer_list.h" 8 #include "base/observer_list.h"
9 #include "components/view_manager/public/interfaces/compositor_frame.mojom.h" 9 #include "components/mus/public/interfaces/compositor_frame.mojom.h"
10 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" 10 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
11 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr_info.h" 11 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr_info.h"
12 12
13 namespace mojo { 13 namespace mojo {
14 14
15 class ViewSurfaceClient; 15 class ViewSurfaceClient;
16 class View; 16 class View;
17 17
18 // A ViewSurface is wrapper to simplify submitting CompositorFrames to Views, 18 // A ViewSurface is wrapper to simplify submitting CompositorFrames to Views,
19 // and receiving ReturnedResources. 19 // and receiving ReturnedResources.
20 class ViewSurface : public mojo::SurfaceClient { 20 class ViewSurface : public mojo::SurfaceClient {
21 public: 21 public:
22 ~ViewSurface() override; 22 ~ViewSurface() override;
23 23
24 // Called to indicate that the current thread has assumed control of this 24 // Called to indicate that the current thread has assumed control of this
25 // object. 25 // object.
26 void BindToThread(); 26 void BindToThread();
27 27
28
29 // TODO(fsamuel): Add a callback. 28 // TODO(fsamuel): Add a callback.
30 void SubmitCompositorFrame(mojo::CompositorFramePtr frame); 29 void SubmitCompositorFrame(mojo::CompositorFramePtr frame);
31 30
32 void set_client(mojo::ViewSurfaceClient* client) { client_ = client; } 31 void set_client(mojo::ViewSurfaceClient* client) { client_ = client; }
33 32
34 private: 33 private:
35 friend class mojo::View; 34 friend class mojo::View;
36 35
37 ViewSurface(mojo::InterfacePtrInfo<mojo::Surface> surface_info, 36 ViewSurface(mojo::InterfacePtrInfo<mojo::Surface> surface_info,
38 mojo::InterfaceRequest<mojo::SurfaceClient> client_request); 37 mojo::InterfaceRequest<mojo::SurfaceClient> client_request);
39 38
40 // SurfaceClient implementation: 39 // SurfaceClient implementation:
41 void ReturnResources( 40 void ReturnResources(
42 mojo::Array<mojo::ReturnedResourcePtr> resources) override; 41 mojo::Array<mojo::ReturnedResourcePtr> resources) override;
43 42
44 mojo::ViewSurfaceClient* client_; 43 mojo::ViewSurfaceClient* client_;
45 mojo::InterfacePtrInfo<mojo::Surface> surface_info_; 44 mojo::InterfacePtrInfo<mojo::Surface> surface_info_;
46 mojo::InterfaceRequest<mojo::SurfaceClient> client_request_; 45 mojo::InterfaceRequest<mojo::SurfaceClient> client_request_;
47 mojo::SurfacePtr surface_; 46 mojo::SurfacePtr surface_;
48 mojo::Binding<mojo::SurfaceClient> client_binding_; 47 mojo::Binding<mojo::SurfaceClient> client_binding_;
49 bool bound_to_thread_; 48 bool bound_to_thread_;
50 }; 49 };
51 50
52 } // namespace mojo 51 } // namespace mojo
53 52
54 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_VIEW_SURFACE_H_ 53 #endif // COMPONENTS_MUS_PUBLIC_CPP_VIEW_SURFACE_H_
OLDNEW
« no previous file with comments | « components/mus/public/cpp/view_property.h ('k') | components/mus/public/cpp/view_surface_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698