| 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 CALayerTreeCoordinator; | 25 class CALayerTreeCoordinator; |
| 26 struct CARendererLayerParams; | |
| 27 } | 26 } |
| 28 | 27 |
| 29 namespace gl { | 28 namespace gl { |
| 30 class GLFence; | 29 class GLFence; |
| 31 } | 30 } |
| 32 | 31 |
| 33 namespace gpu { | 32 namespace gpu { |
| 34 | 33 |
| 35 class ImageTransportSurfaceOverlayMac : public gl::GLSurface, | 34 class ImageTransportSurfaceOverlayMac : public gl::GLSurface, |
| 36 public ui::GpuSwitchingObserver { | 35 public ui::GpuSwitchingObserver { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 49 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; | 48 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; |
| 50 bool SupportsPostSubBuffer() override; | 49 bool SupportsPostSubBuffer() override; |
| 51 gfx::Size GetSize() override; | 50 gfx::Size GetSize() override; |
| 52 void* GetHandle() override; | 51 void* GetHandle() override; |
| 53 bool OnMakeCurrent(gl::GLContext* context) override; | 52 bool OnMakeCurrent(gl::GLContext* context) override; |
| 54 bool ScheduleOverlayPlane(int z_order, | 53 bool ScheduleOverlayPlane(int z_order, |
| 55 gfx::OverlayTransform transform, | 54 gfx::OverlayTransform transform, |
| 56 gl::GLImage* image, | 55 gl::GLImage* image, |
| 57 const gfx::Rect& bounds_rect, | 56 const gfx::Rect& bounds_rect, |
| 58 const gfx::RectF& crop_rect) override; | 57 const gfx::RectF& crop_rect) override; |
| 59 bool ScheduleCALayer(const ui::CARendererLayerParams& params) override; | 58 bool ScheduleCALayer(gl::GLImage* contents_image, |
| 59 const gfx::RectF& contents_rect, |
| 60 float opacity, |
| 61 unsigned background_color, |
| 62 unsigned edge_aa_mask, |
| 63 const gfx::RectF& rect, |
| 64 bool is_clipped, |
| 65 const gfx::RectF& clip_rect, |
| 66 const gfx::Transform& transform, |
| 67 int sorting_context_id, |
| 68 unsigned filter) override; |
| 60 void ScheduleCALayerInUseQuery( | 69 void ScheduleCALayerInUseQuery( |
| 61 std::vector<CALayerInUseQuery> queries) override; | 70 std::vector<CALayerInUseQuery> queries) override; |
| 62 bool IsSurfaceless() const override; | 71 bool IsSurfaceless() const override; |
| 63 | 72 |
| 64 // ui::GpuSwitchingObserver implementation. | 73 // ui::GpuSwitchingObserver implementation. |
| 65 void OnGpuSwitched() override; | 74 void OnGpuSwitched() override; |
| 66 | 75 |
| 67 private: | 76 private: |
| 68 ~ImageTransportSurfaceOverlayMac() override; | 77 ~ImageTransportSurfaceOverlayMac() override; |
| 69 | 78 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 100 base::ScopedTypeRef<CGLContextObj> fence_context_obj_; | 109 base::ScopedTypeRef<CGLContextObj> fence_context_obj_; |
| 101 | 110 |
| 102 // The renderer ID that all contexts made current to this surface should be | 111 // The renderer ID that all contexts made current to this surface should be |
| 103 // targeting. | 112 // targeting. |
| 104 GLint gl_renderer_id_; | 113 GLint gl_renderer_id_; |
| 105 }; | 114 }; |
| 106 | 115 |
| 107 } // namespace gpu | 116 } // namespace gpu |
| 108 | 117 |
| 109 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ | 118 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ |
| OLD | NEW |