| 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 ui { | 24 namespace ui { |
| 25 class CALayerTree; | 25 class CALayerTreeCoordinator; |
| 26 class CALayerPartialDamageTree; | |
| 27 } | 26 } |
| 28 | 27 |
| 29 namespace gpu { | 28 namespace gpu { |
| 30 | 29 |
| 31 class ImageTransportSurfaceOverlayMac : public gfx::GLSurface, | 30 class ImageTransportSurfaceOverlayMac : public gfx::GLSurface, |
| 32 public ui::GpuSwitchingObserver { | 31 public ui::GpuSwitchingObserver { |
| 33 public: | 32 public: |
| 34 ImageTransportSurfaceOverlayMac(GpuChannelManager* manager, | 33 ImageTransportSurfaceOverlayMac(GpuChannelManager* manager, |
| 35 GpuCommandBufferStub* stub, | 34 GpuCommandBufferStub* stub, |
| 36 SurfaceHandle handle); | 35 SurfaceHandle handle); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 std::vector<ui::LatencyInfo> latency_info); | 84 std::vector<ui::LatencyInfo> latency_info); |
| 86 gfx::SwapResult SwapBuffersInternal(const gfx::Rect& pixel_damage_rect); | 85 gfx::SwapResult SwapBuffersInternal(const gfx::Rect& pixel_damage_rect); |
| 87 | 86 |
| 88 GpuChannelManager* manager_; | 87 GpuChannelManager* manager_; |
| 89 base::WeakPtr<GpuCommandBufferStub> stub_; | 88 base::WeakPtr<GpuCommandBufferStub> stub_; |
| 90 SurfaceHandle handle_; | 89 SurfaceHandle handle_; |
| 91 std::vector<ui::LatencyInfo> latency_info_; | 90 std::vector<ui::LatencyInfo> latency_info_; |
| 92 | 91 |
| 93 bool use_remote_layer_api_; | 92 bool use_remote_layer_api_; |
| 94 base::scoped_nsobject<CAContext> ca_context_; | 93 base::scoped_nsobject<CAContext> ca_context_; |
| 95 base::scoped_nsobject<CALayer> ca_root_layer_; | 94 std::unique_ptr<ui::CALayerTreeCoordinator> ca_layer_tree_coordinator_; |
| 96 | 95 |
| 97 gfx::Size pixel_size_; | 96 gfx::Size pixel_size_; |
| 98 float scale_factor_; | 97 float scale_factor_; |
| 99 | 98 |
| 100 // The renderer ID that all contexts made current to this surface should be | 99 // The renderer ID that all contexts made current to this surface should be |
| 101 // targeting. | 100 // targeting. |
| 102 GLint gl_renderer_id_; | 101 GLint gl_renderer_id_; |
| 103 | 102 |
| 104 // Planes that have been scheduled, but have not had a subsequent SwapBuffers | |
| 105 // call made yet. | |
| 106 std::unique_ptr<ui::CALayerPartialDamageTree> pending_partial_damage_tree_; | |
| 107 std::unique_ptr<ui::CALayerTree> pending_ca_layer_tree_; | |
| 108 | |
| 109 // The planes that are currently being displayed on the screen. | |
| 110 std::unique_ptr<ui::CALayerPartialDamageTree> current_partial_damage_tree_; | |
| 111 std::unique_ptr<ui::CALayerTree> current_ca_layer_tree_; | |
| 112 | |
| 113 // The vsync information provided by the browser. | 103 // The vsync information provided by the browser. |
| 114 bool vsync_parameters_valid_; | 104 bool vsync_parameters_valid_; |
| 115 base::TimeTicks vsync_timebase_; | 105 base::TimeTicks vsync_timebase_; |
| 116 base::TimeDelta vsync_interval_; | 106 base::TimeDelta vsync_interval_; |
| 117 }; | 107 }; |
| 118 | 108 |
| 119 } // namespace gpu | 109 } // namespace gpu |
| 120 | 110 |
| 121 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ | 111 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ |
| OLD | NEW |