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 } | 26 } |
27 | 27 |
28 namespace gpu { | 28 namespace gpu { |
29 | 29 |
30 class ImageTransportSurfaceOverlayMac : public gfx::GLSurface, | 30 class ImageTransportSurfaceOverlayMac : public gl::GLSurface, |
31 public ui::GpuSwitchingObserver { | 31 public ui::GpuSwitchingObserver { |
32 public: | 32 public: |
33 ImageTransportSurfaceOverlayMac(GpuCommandBufferStub* stub, | 33 ImageTransportSurfaceOverlayMac(GpuCommandBufferStub* stub, |
34 SurfaceHandle handle); | 34 SurfaceHandle handle); |
35 | 35 |
36 // GLSurface implementation | 36 // GLSurface implementation |
37 bool Initialize(gfx::GLSurface::Format format) override; | 37 bool Initialize(gl::GLSurface::Format format) override; |
38 void Destroy() override; | 38 void Destroy() override; |
39 bool Resize(const gfx::Size& size, | 39 bool Resize(const gfx::Size& size, |
40 float scale_factor, | 40 float scale_factor, |
41 bool has_alpha) override; | 41 bool has_alpha) override; |
42 bool IsOffscreen() override; | 42 bool IsOffscreen() override; |
43 gfx::SwapResult SwapBuffers() override; | 43 gfx::SwapResult SwapBuffers() override; |
44 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; | 44 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; |
45 bool SupportsPostSubBuffer() override; | 45 bool SupportsPostSubBuffer() override; |
46 gfx::Size GetSize() override; | 46 gfx::Size GetSize() override; |
47 void* GetHandle() override; | 47 void* GetHandle() override; |
48 bool OnMakeCurrent(gfx::GLContext* context) override; | 48 bool OnMakeCurrent(gl::GLContext* context) override; |
49 bool ScheduleOverlayPlane(int z_order, | 49 bool ScheduleOverlayPlane(int z_order, |
50 gfx::OverlayTransform transform, | 50 gfx::OverlayTransform transform, |
51 gl::GLImage* image, | 51 gl::GLImage* image, |
52 const gfx::Rect& bounds_rect, | 52 const gfx::Rect& bounds_rect, |
53 const gfx::RectF& crop_rect) override; | 53 const gfx::RectF& crop_rect) override; |
54 bool ScheduleCALayer(gl::GLImage* contents_image, | 54 bool ScheduleCALayer(gl::GLImage* contents_image, |
55 const gfx::RectF& contents_rect, | 55 const gfx::RectF& contents_rect, |
56 float opacity, | 56 float opacity, |
57 unsigned background_color, | 57 unsigned background_color, |
58 unsigned edge_aa_mask, | 58 unsigned edge_aa_mask, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 float scale_factor_; | 95 float scale_factor_; |
96 | 96 |
97 // The renderer ID that all contexts made current to this surface should be | 97 // The renderer ID that all contexts made current to this surface should be |
98 // targeting. | 98 // targeting. |
99 GLint gl_renderer_id_; | 99 GLint gl_renderer_id_; |
100 }; | 100 }; |
101 | 101 |
102 } // namespace gpu | 102 } // namespace gpu |
103 | 103 |
104 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ | 104 #endif // GPU_IPC_SERVICE_IMAGE_TRANSPORT_SURFACE_OVERLAY_MAC_H_ |
OLD | NEW |