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> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const gfx::RectF& contents_rect, | 59 const gfx::RectF& contents_rect, |
60 float opacity, | 60 float opacity, |
61 unsigned background_color, | 61 unsigned background_color, |
62 unsigned edge_aa_mask, | 62 unsigned edge_aa_mask, |
63 const gfx::RectF& rect, | 63 const gfx::RectF& rect, |
64 bool is_clipped, | 64 bool is_clipped, |
65 const gfx::RectF& clip_rect, | 65 const gfx::RectF& clip_rect, |
66 const gfx::Transform& transform, | 66 const gfx::Transform& transform, |
67 int sorting_context_id, | 67 int sorting_context_id, |
68 unsigned filter) override; | 68 unsigned filter) override; |
| 69 void ScheduleCALayerInUseQuery( |
| 70 std::vector<CALayerInUseQuery> queries) override; |
69 bool IsSurfaceless() const override; | 71 bool IsSurfaceless() const override; |
70 | 72 |
71 // ui::GpuSwitchingObserver implementation. | 73 // ui::GpuSwitchingObserver implementation. |
72 void OnGpuSwitched() override; | 74 void OnGpuSwitched() override; |
73 | 75 |
74 private: | 76 private: |
75 ~ImageTransportSurfaceOverlayMac() override; | 77 ~ImageTransportSurfaceOverlayMac() override; |
76 | 78 |
77 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); | 79 void SetLatencyInfo(const std::vector<ui::LatencyInfo>& latency_info); |
78 void SendAcceleratedSurfaceBuffersSwapped( | 80 void SendAcceleratedSurfaceBuffersSwapped( |
(...skipping 12 matching lines...) Expand all Loading... |
91 std::vector<ui::LatencyInfo> latency_info_; | 93 std::vector<ui::LatencyInfo> latency_info_; |
92 | 94 |
93 bool use_remote_layer_api_; | 95 bool use_remote_layer_api_; |
94 base::scoped_nsobject<CAContext> ca_context_; | 96 base::scoped_nsobject<CAContext> ca_context_; |
95 base::scoped_nsobject<CAContext> fullscreen_low_power_ca_context_; | 97 base::scoped_nsobject<CAContext> fullscreen_low_power_ca_context_; |
96 std::unique_ptr<ui::CALayerTreeCoordinator> ca_layer_tree_coordinator_; | 98 std::unique_ptr<ui::CALayerTreeCoordinator> ca_layer_tree_coordinator_; |
97 | 99 |
98 gfx::Size pixel_size_; | 100 gfx::Size pixel_size_; |
99 float scale_factor_; | 101 float scale_factor_; |
100 | 102 |
| 103 struct IOSurfaceInUseQuery { |
| 104 IOSurfaceInUseQuery(); |
| 105 explicit IOSurfaceInUseQuery(const IOSurfaceInUseQuery&); |
| 106 explicit IOSurfaceInUseQuery(IOSurfaceInUseQuery&&); |
| 107 ~IOSurfaceInUseQuery(); |
| 108 |
| 109 // It's possible that the client will have destroyed the texture before |
| 110 // SwapBuffersInternal is called. It's important that |texture| is only used |
| 111 // as an opaque identifier, since it may no longer point to the same |
| 112 // texture. |
| 113 unsigned texture = 0; |
| 114 base::ScopedCFTypeRef<IOSurfaceRef> io_surface; |
| 115 }; |
| 116 std::vector<IOSurfaceInUseQuery> io_surface_in_use_queries_; |
| 117 |
101 // A GLFence marking the end of the previous frame. Must only be accessed | 118 // A GLFence marking the end of the previous frame. Must only be accessed |
102 // while in a ScopedSetGLToRealGLApi, and while the associated | 119 // while in a ScopedSetGLToRealGLApi, and while the associated |
103 // |previous_frame_context_| is bound. | 120 // |previous_frame_context_| is bound. |
104 std::unique_ptr<gl::GLFence> previous_frame_fence_; | 121 std::unique_ptr<gl::GLFence> previous_frame_fence_; |
105 base::ScopedTypeRef<CGLContextObj> fence_context_obj_; | 122 base::ScopedTypeRef<CGLContextObj> fence_context_obj_; |
106 | 123 |
107 // The renderer ID that all contexts made current to this surface should be | 124 // The renderer ID that all contexts made current to this surface should be |
108 // targeting. | 125 // targeting. |
109 GLint gl_renderer_id_; | 126 GLint gl_renderer_id_; |
110 }; | 127 }; |
111 | 128 |
112 } // namespace gpu | 129 } // namespace gpu |
113 | 130 |
114 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ | 131 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ |
OLD | NEW |