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