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 GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ | 5 #ifndef GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ |
6 #define GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ | 6 #define GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #import "base/mac/scoped_nsobject.h" | 12 #import "base/mac/scoped_nsobject.h" |
13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
14 #include "gpu/ipc/service/gpu_command_buffer_stub.h" | 14 #include "gpu/ipc/service/gpu_command_buffer_stub.h" |
15 #include "gpu/ipc/service/image_transport_surface.h" | 15 #include "gpu/ipc/service/image_transport_surface.h" |
16 #include "ui/base/cocoa/remote_layer_api.h" | 16 #include "ui/base/cocoa/remote_layer_api.h" |
17 #include "ui/events/latency_info.h" | 17 #include "ui/events/latency_info.h" |
18 #include "ui/gl/gl_surface.h" | 18 #include "ui/gl/gl_surface.h" |
19 #include "ui/gl/gpu_switching_observer.h" | 19 #include "ui/gl/gpu_switching_observer.h" |
20 | 20 |
21 @class CAContext; | 21 @class CAContext; |
22 @class CALayer; | 22 @class CALayer; |
23 | 23 |
24 namespace gpu { | 24 namespace ui { |
25 | |
26 class CALayerTree; | 25 class CALayerTree; |
27 class CALayerPartialDamageTree; | 26 class CALayerPartialDamageTree; |
| 27 } |
| 28 |
| 29 namespace gpu { |
28 | 30 |
29 class ImageTransportSurfaceOverlayMac : public gfx::GLSurface, | 31 class ImageTransportSurfaceOverlayMac : public gfx::GLSurface, |
30 public ui::GpuSwitchingObserver { | 32 public ui::GpuSwitchingObserver { |
31 public: | 33 public: |
32 ImageTransportSurfaceOverlayMac(GpuChannelManager* manager, | 34 ImageTransportSurfaceOverlayMac(GpuChannelManager* manager, |
33 GpuCommandBufferStub* stub, | 35 GpuCommandBufferStub* stub, |
34 SurfaceHandle handle); | 36 SurfaceHandle handle); |
35 | 37 |
36 // GLSurface implementation | 38 // GLSurface implementation |
37 bool Initialize(gfx::GLSurface::Format format) override; | 39 bool Initialize(gfx::GLSurface::Format format) override; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 96 |
95 gfx::Size pixel_size_; | 97 gfx::Size pixel_size_; |
96 float scale_factor_; | 98 float scale_factor_; |
97 | 99 |
98 // The renderer ID that all contexts made current to this surface should be | 100 // The renderer ID that all contexts made current to this surface should be |
99 // targeting. | 101 // targeting. |
100 GLint gl_renderer_id_; | 102 GLint gl_renderer_id_; |
101 | 103 |
102 // Planes that have been scheduled, but have not had a subsequent SwapBuffers | 104 // Planes that have been scheduled, but have not had a subsequent SwapBuffers |
103 // call made yet. | 105 // call made yet. |
104 std::unique_ptr<CALayerPartialDamageTree> pending_partial_damage_tree_; | 106 std::unique_ptr<ui::CALayerPartialDamageTree> pending_partial_damage_tree_; |
105 std::unique_ptr<CALayerTree> pending_ca_layer_tree_; | 107 std::unique_ptr<ui::CALayerTree> pending_ca_layer_tree_; |
106 | 108 |
107 // The planes that are currently being displayed on the screen. | 109 // The planes that are currently being displayed on the screen. |
108 std::unique_ptr<CALayerPartialDamageTree> current_partial_damage_tree_; | 110 std::unique_ptr<ui::CALayerPartialDamageTree> current_partial_damage_tree_; |
109 std::unique_ptr<CALayerTree> current_ca_layer_tree_; | 111 std::unique_ptr<ui::CALayerTree> current_ca_layer_tree_; |
110 | 112 |
111 // The vsync information provided by the browser. | 113 // The vsync information provided by the browser. |
112 bool vsync_parameters_valid_; | 114 bool vsync_parameters_valid_; |
113 base::TimeTicks vsync_timebase_; | 115 base::TimeTicks vsync_timebase_; |
114 base::TimeDelta vsync_interval_; | 116 base::TimeDelta vsync_interval_; |
115 }; | 117 }; |
116 | 118 |
117 } // namespace gpu | 119 } // namespace gpu |
118 | 120 |
119 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ | 121 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ |
OLD | NEW |