Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_SURFACE_H_ | |
| 6 #define COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_SURFACE_H_ | |
| 7 | |
| 8 #include "base/observer_list.h" | |
| 9 #include "components/view_manager/public/interfaces/compositor_frame.mojom.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" | |
| 12 | |
| 13 namespace cc { | |
| 14 class CompositorFrame; | |
|
sky
2015/08/26 22:58:03
This shouldn't be needed.
Fady Samuel
2015/08/26 23:51:00
Removed.
| |
| 15 } | |
| 16 | |
| 17 namespace mojo { | |
| 18 class View; | |
| 19 } | |
| 20 | |
| 21 namespace uip { | |
|
sky
2015/08/26 22:58:03
Why is this in the namespace uip? It's in the view
Fady Samuel
2015/08/26 23:51:00
Changed to mojo for now.
| |
| 22 | |
| 23 class SurfaceClient; | |
| 24 class SurfaceObserver; | |
|
sky
2015/08/26 22:58:03
You don't seem to use this.
Fady Samuel
2015/08/26 23:51:00
Removed.
| |
| 25 | |
| 26 class Surface : public mojo::SurfaceClient { | |
|
sky
2015/08/26 22:58:03
Add description.
Fady Samuel
2015/08/26 23:51:00
Done.
| |
| 27 public: | |
| 28 ~Surface() override; | |
| 29 | |
| 30 // Called to indicate that the current thread has assumed control of this | |
| 31 // object. | |
| 32 void BindToThread(); | |
| 33 | |
| 34 // TODO(fsamuel): Add a callback. | |
| 35 void SubmitCompositorFrame(mojo::CompositorFramePtr frame); | |
| 36 | |
| 37 void set_client(uip::SurfaceClient* client) { client_ = client; } | |
| 38 | |
| 39 private: | |
| 40 friend class mojo::View; | |
| 41 | |
| 42 Surface(mojo::InterfacePtrInfo<mojo::Surface> surface_info, | |
| 43 mojo::InterfaceRequest<mojo::SurfaceClient> client_request); | |
| 44 | |
| 45 // SurfaceClient implementation: | |
| 46 void ReturnResources( | |
| 47 mojo::Array<mojo::ReturnedResourcePtr> resources) override; | |
| 48 | |
| 49 uip::SurfaceClient* client_; | |
| 50 mojo::InterfacePtrInfo<mojo::Surface> surface_info_; | |
| 51 mojo::InterfaceRequest<mojo::SurfaceClient> client_request_; | |
| 52 mojo::SurfacePtr surface_; | |
| 53 mojo::Binding<mojo::SurfaceClient> client_binding_; | |
| 54 bool bound_to_thread_; | |
| 55 }; | |
| 56 | |
| 57 } // namespace uip | |
| 58 | |
| 59 #endif // COMPONENTS_VIEW_MANAGER_PUBLIC_CPP_SURFACE_H_ | |
| OLD | NEW |