OLD | NEW |
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 SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ |
6 #define SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.h" |
10 #include "cc/surfaces/surface_id.h" | 10 #include "cc/surfaces/surface_id.h" |
11 #include "mojo/public/cpp/bindings/binding.h" | 11 #include "mojo/public/cpp/bindings/binding.h" |
| 12 #include "services/ui/public/cpp/ui_export.h" |
12 #include "services/ui/public/cpp/window_surface.h" | 13 #include "services/ui/public/cpp/window_surface.h" |
13 #include "services/ui/public/cpp/window_surface_client.h" | 14 #include "services/ui/public/cpp/window_surface_client.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 | 17 |
17 class OutputSurface : public cc::OutputSurface, public WindowSurfaceClient { | 18 class UI_EXPORT OutputSurface : public cc::OutputSurface, |
| 19 public WindowSurfaceClient { |
18 public: | 20 public: |
19 OutputSurface(const scoped_refptr<cc::ContextProvider>& context_provider, | 21 OutputSurface(const scoped_refptr<cc::ContextProvider>& context_provider, |
20 std::unique_ptr<WindowSurface> surface); | 22 std::unique_ptr<WindowSurface> surface); |
21 ~OutputSurface() override; | 23 ~OutputSurface() override; |
22 | 24 |
23 // cc::OutputSurface implementation. | 25 // cc::OutputSurface implementation. |
24 void SwapBuffers(cc::CompositorFrame frame) override; | 26 void SwapBuffers(cc::CompositorFrame frame) override; |
25 bool BindToClient(cc::OutputSurfaceClient* client) override; | 27 bool BindToClient(cc::OutputSurfaceClient* client) override; |
26 void DetachFromClient() override; | 28 void DetachFromClient() override; |
27 void BindFramebuffer() override; | 29 void BindFramebuffer() override; |
28 uint32_t GetFramebufferCopyTextureFormat() override; | 30 uint32_t GetFramebufferCopyTextureFormat() override; |
29 | 31 |
30 private: | 32 private: |
31 // WindowSurfaceClient implementation: | 33 // WindowSurfaceClient implementation: |
32 void OnResourcesReturned( | 34 void OnResourcesReturned( |
33 WindowSurface* surface, | 35 WindowSurface* surface, |
34 mojo::Array<cc::ReturnedResource> resources) override; | 36 mojo::Array<cc::ReturnedResource> resources) override; |
35 | 37 |
36 void SwapBuffersComplete(); | 38 void SwapBuffersComplete(); |
37 | 39 |
38 std::unique_ptr<WindowSurface> surface_; | 40 std::unique_ptr<WindowSurface> surface_; |
39 | 41 |
40 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 42 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
41 }; | 43 }; |
42 | 44 |
43 } // namespace ui | 45 } // namespace ui |
44 | 46 |
45 #endif // SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ | 47 #endif // SERVICES_UI_PUBLIC_CPP_OUTPUT_SURFACE_H_ |
OLD | NEW |