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 CONTENT_BROWSER_COMPOSITOR_SURFACE_DISPLAY_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_SURFACE_DISPLAY_OUTPUT_SURFACE_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_SURFACE_DISPLAY_OUTPUT_SURFACE_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_SURFACE_DISPLAY_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include "cc/output/output_surface.h" | 8 #include "cc/output/output_surface.h" |
9 #include "cc/surfaces/surface_factory.h" | 9 #include "cc/surfaces/surface_factory.h" |
10 #include "cc/surfaces/surface_factory_client.h" | 10 #include "cc/surfaces/surface_factory_client.h" |
11 #include "cc/surfaces/surface_id_allocator.h" | 11 #include "cc/surfaces/surface_id_allocator.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 class Display; | 14 class Display; |
15 class SurfaceManager; | 15 class SurfaceManager; |
16 } | 16 } |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 // This class is maps a compositor OutputSurface to the surface system's Display | 20 // This class is maps a compositor OutputSurface to the surface system's Display |
21 // concept, allowing a compositor client to submit frames for a native root | 21 // concept, allowing a compositor client to submit frames for a native root |
22 // window or physical display. | 22 // window or physical display. |
23 class SurfaceDisplayOutputSurface : public cc::OutputSurface, | 23 class SurfaceDisplayOutputSurface : public cc::OutputSurface, |
24 public cc::SurfaceFactoryClient { | 24 public cc::SurfaceFactoryClient { |
25 public: | 25 public: |
26 // The underlying cc::Display and cc::SurfaceManager must outlive this class. | 26 // The underlying cc::Display and cc::SurfaceManager must outlive this class. |
27 SurfaceDisplayOutputSurface( | 27 SurfaceDisplayOutputSurface( |
28 cc::SurfaceManager* surface_manager, | 28 cc::SurfaceManager* surface_manager, |
29 uint32_t surface_id_namespace, | 29 cc::SurfaceIdAllocator* allocator, |
30 const scoped_refptr<cc::ContextProvider>& context_provider); | 30 const scoped_refptr<cc::ContextProvider>& context_provider); |
31 virtual ~SurfaceDisplayOutputSurface(); | 31 virtual ~SurfaceDisplayOutputSurface(); |
32 | 32 |
33 void set_display(cc::Display* display) { display_ = display; } | 33 void set_display(cc::Display* display) { display_ = display; } |
34 cc::SurfaceFactory* factory() { return &factory_; } | 34 cc::SurfaceFactory* factory() { return &factory_; } |
35 void ReceivedVSyncParameters(base::TimeTicks timebase, | 35 void ReceivedVSyncParameters(base::TimeTicks timebase, |
36 base::TimeDelta interval); | 36 base::TimeDelta interval); |
37 | 37 |
38 // cc::OutputSurface implementation. | 38 // cc::OutputSurface implementation. |
39 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; | 39 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE; |
40 | 40 |
41 // cc::SurfaceFactoryClient implementation. | 41 // cc::SurfaceFactoryClient implementation. |
42 virtual void ReturnResources( | 42 virtual void ReturnResources( |
43 const cc::ReturnedResourceArray& resources) OVERRIDE; | 43 const cc::ReturnedResourceArray& resources) OVERRIDE; |
44 | 44 |
45 private: | 45 private: |
46 void SwapBuffersComplete(); | 46 void SwapBuffersComplete(); |
47 | 47 |
48 cc::Display* display_; | 48 cc::Display* display_; |
49 cc::SurfaceManager* surface_manager_; | 49 cc::SurfaceManager* surface_manager_; |
50 cc::SurfaceFactory factory_; | 50 cc::SurfaceFactory factory_; |
51 gfx::Size display_size_; | 51 gfx::Size display_size_; |
52 cc::SurfaceId surface_id_; | 52 cc::SurfaceId surface_id_; |
53 cc::SurfaceIdAllocator allocator_; | 53 cc::SurfaceIdAllocator* allocator_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(SurfaceDisplayOutputSurface); | 55 DISALLOW_COPY_AND_ASSIGN(SurfaceDisplayOutputSurface); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace content | 58 } // namespace content |
59 | 59 |
60 #endif // CONTENT_BROWSER_COMPOSITOR_SURFACE_DISPLAY_OUTPUT_SURFACE_H_ | 60 #endif // CONTENT_BROWSER_COMPOSITOR_SURFACE_DISPLAY_OUTPUT_SURFACE_H_ |
OLD | NEW |