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