OLD | NEW |
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_SURFACES_DISPLAY_IMPL_H_ | 5 #ifndef COMPONENTS_VIEW_MANAGER_SURFACES_DISPLAY_IMPL_H_ |
6 #define COMPONENTS_VIEW_MANAGER_SURFACES_DISPLAY_IMPL_H_ | 6 #define COMPONENTS_VIEW_MANAGER_SURFACES_DISPLAY_IMPL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/surfaces/display_client.h" | 9 #include "cc/surfaces/display_client.h" |
10 #include "cc/surfaces/surface_factory.h" | 10 #include "cc/surfaces/surface_factory.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 class TopLevelDisplayClient | 36 class TopLevelDisplayClient |
37 : public cc::DisplayClient, | 37 : public cc::DisplayClient, |
38 public cc::SurfaceFactoryClient, | 38 public cc::SurfaceFactoryClient, |
39 public surfaces::SurfacesContextProvider::Delegate { | 39 public surfaces::SurfacesContextProvider::Delegate { |
40 public: | 40 public: |
41 TopLevelDisplayClient(gfx::AcceleratedWidget widget, | 41 TopLevelDisplayClient(gfx::AcceleratedWidget widget, |
42 const scoped_refptr<gles2::GpuState>& gpu_state, | 42 const scoped_refptr<gles2::GpuState>& gpu_state, |
43 const scoped_refptr<SurfacesState>& surfaces_state); | 43 const scoped_refptr<SurfacesState>& surfaces_state); |
44 ~TopLevelDisplayClient() override; | 44 ~TopLevelDisplayClient() override; |
45 | 45 |
46 void SubmitFrame(mojo::FramePtr frame, const base::Closure& callback); | 46 void SubmitFrame(scoped_ptr<cc::CompositorFrame> frame, |
| 47 const base::Closure& callback); |
47 | 48 |
48 private: | 49 private: |
49 // DisplayClient implementation. | 50 // DisplayClient implementation. |
50 // TODO(rjkroege, fsamuel): This won't work correctly with multiple displays. | 51 // TODO(rjkroege, fsamuel): This won't work correctly with multiple displays. |
51 void CommitVSyncParameters(base::TimeTicks timebase, | 52 void CommitVSyncParameters(base::TimeTicks timebase, |
52 base::TimeDelta interval) override; | 53 base::TimeDelta interval) override; |
53 void OutputSurfaceLost() override; | 54 void OutputSurfaceLost() override; |
54 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; | 55 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; |
55 | 56 |
56 // SurfacesContextProvider::Delegate: | 57 // SurfacesContextProvider::Delegate: |
57 void OnContextCreated(); | 58 void OnContextCreated(); |
58 void OnVSyncParametersUpdated(int64_t timebase, int64_t interval) override; | 59 void OnVSyncParametersUpdated(int64_t timebase, int64_t interval) override; |
59 | 60 |
60 // SurfaceFactoryClient implementation. | 61 // SurfaceFactoryClient implementation. |
61 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 62 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
62 | 63 |
63 void Draw(); | 64 void Draw(); |
64 | 65 |
65 scoped_refptr<gles2::GpuState> gpu_state_; | 66 scoped_refptr<gles2::GpuState> gpu_state_; |
66 scoped_refptr<SurfacesState> surfaces_state_; | 67 scoped_refptr<SurfacesState> surfaces_state_; |
67 cc::SurfaceFactory factory_; | 68 cc::SurfaceFactory factory_; |
68 cc::SurfaceId cc_id_; | 69 cc::SurfaceId cc_id_; |
69 | 70 |
70 gfx::Size last_submitted_frame_size_; | 71 gfx::Size last_submitted_frame_size_; |
71 mojo::FramePtr pending_frame_; | 72 scoped_ptr<cc::CompositorFrame> pending_frame_; |
72 base::Closure pending_callback_; | 73 base::Closure pending_callback_; |
73 | 74 |
74 scoped_ptr<cc::Display> display_; | 75 scoped_ptr<cc::Display> display_; |
75 | 76 |
76 DISALLOW_COPY_AND_ASSIGN(TopLevelDisplayClient); | 77 DISALLOW_COPY_AND_ASSIGN(TopLevelDisplayClient); |
77 }; | 78 }; |
78 | 79 |
79 } // namespace surfaces | 80 } // namespace surfaces |
80 | 81 |
81 #endif // COMPONENTS_VIEW_MANAGER_SURFACES_DISPLAY_IMPL_H_ | 82 #endif // COMPONENTS_VIEW_MANAGER_SURFACES_DISPLAY_IMPL_H_ |
OLD | NEW |