Chromium Code Reviews| 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(IOSurfaceInUseQuery&); | |
|
piman
2016/06/14 00:58:56
Did you mean IOSurfaceInUseQuery(const IOSurfaceIn
erikchen
2016/06/14 01:47:51
yes, done.
| |
| 106 explicit IOSurfaceInUseQuery(IOSurfaceInUseQuery&&); | |
| 107 ~IOSurfaceInUseQuery(); | |
| 108 unsigned texture; | |
|
piman
2016/06/14 00:58:56
= 0;
erikchen
2016/06/14 01:47:51
Done.
| |
| 109 base::ScopedCFTypeRef<IOSurfaceRef> io_surface; | |
| 110 }; | |
| 111 std::vector<IOSurfaceInUseQuery> io_surface_in_use_queries_; | |
| 112 | |
| 101 // A GLFence marking the end of the previous frame. Must only be accessed | 113 // A GLFence marking the end of the previous frame. Must only be accessed |
| 102 // while in a ScopedSetGLToRealGLApi, and while the associated | 114 // while in a ScopedSetGLToRealGLApi, and while the associated |
| 103 // |previous_frame_context_| is bound. | 115 // |previous_frame_context_| is bound. |
| 104 std::unique_ptr<gl::GLFence> previous_frame_fence_; | 116 std::unique_ptr<gl::GLFence> previous_frame_fence_; |
| 105 base::ScopedTypeRef<CGLContextObj> fence_context_obj_; | 117 base::ScopedTypeRef<CGLContextObj> fence_context_obj_; |
| 106 | 118 |
| 107 // The renderer ID that all contexts made current to this surface should be | 119 // The renderer ID that all contexts made current to this surface should be |
| 108 // targeting. | 120 // targeting. |
| 109 GLint gl_renderer_id_; | 121 GLint gl_renderer_id_; |
| 110 }; | 122 }; |
| 111 | 123 |
| 112 } // namespace gpu | 124 } // namespace gpu |
| 113 | 125 |
| 114 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ | 126 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ |
| OLD | NEW |