OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ | 5 #ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ |
6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ | 6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ |
7 | 7 |
8 #include "base/mac/scoped_cftyperef.h" | 8 #include "base/mac/scoped_cftyperef.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/common/gpu/gpu_command_buffer_stub.h" | 10 #include "content/common/gpu/gpu_command_buffer_stub.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 class StorageProvider { | 27 class StorageProvider { |
28 public: | 28 public: |
29 virtual ~StorageProvider() {} | 29 virtual ~StorageProvider() {} |
30 // IOSurfaces cause too much address space fragmentation if they are | 30 // IOSurfaces cause too much address space fragmentation if they are |
31 // allocated on every resize. This gets a rounded size for allocation. | 31 // allocated on every resize. This gets a rounded size for allocation. |
32 virtual gfx::Size GetRoundedSize(gfx::Size size) = 0; | 32 virtual gfx::Size GetRoundedSize(gfx::Size size) = 0; |
33 | 33 |
34 // Allocate the storage for the color buffer. The specified context is | 34 // Allocate the storage for the color buffer. The specified context is |
35 // current, and there is a texture bound to GL_TEXTURE_RECTANGLE_ARB. | 35 // current, and there is a texture bound to GL_TEXTURE_RECTANGLE_ARB. |
36 virtual bool AllocateColorBufferStorage( | 36 virtual bool AllocateColorBufferStorage( |
37 CGLContextObj context, gfx::Size size) = 0; | 37 CGLContextObj context, gfx::Size size, float scale_factor) = 0; |
38 | 38 |
39 // Free the storage allocated in the AllocateColorBufferStorage call. The | 39 // Free the storage allocated in the AllocateColorBufferStorage call. The |
40 // GL texture that was bound has already been deleted by the caller. | 40 // GL texture that was bound has already been deleted by the caller. |
41 virtual void FreeColorBufferStorage() = 0; | 41 virtual void FreeColorBufferStorage() = 0; |
42 | 42 |
43 // Retrieve the handle for the surface to send to the browser process to | 43 // Retrieve the handle for the surface to send to the browser process to |
44 // display. | 44 // display. |
45 virtual uint64 GetSurfaceHandle() const = 0; | 45 virtual uint64 GetSurfaceHandle() const = 0; |
| 46 |
| 47 // Called when a frame is about to be sent to the browser process. |
| 48 virtual void WillSwapBuffers() = 0; |
46 }; | 49 }; |
47 | 50 |
48 ImageTransportSurfaceFBO(StorageProvider* storage_provider, | 51 ImageTransportSurfaceFBO(StorageProvider* storage_provider, |
49 GpuChannelManager* manager, | 52 GpuChannelManager* manager, |
50 GpuCommandBufferStub* stub, | 53 GpuCommandBufferStub* stub, |
51 gfx::PluginWindowHandle handle); | 54 gfx::PluginWindowHandle handle); |
52 | 55 |
53 // GLSurface implementation | 56 // GLSurface implementation |
54 virtual bool Initialize() OVERRIDE; | 57 virtual bool Initialize() OVERRIDE; |
55 virtual void Destroy() OVERRIDE; | 58 virtual void Destroy() OVERRIDE; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 std::vector<ui::LatencyInfo> latency_info_; | 118 std::vector<ui::LatencyInfo> latency_info_; |
116 | 119 |
117 scoped_ptr<ImageTransportHelper> helper_; | 120 scoped_ptr<ImageTransportHelper> helper_; |
118 | 121 |
119 DISALLOW_COPY_AND_ASSIGN(ImageTransportSurfaceFBO); | 122 DISALLOW_COPY_AND_ASSIGN(ImageTransportSurfaceFBO); |
120 }; | 123 }; |
121 | 124 |
122 } // namespace content | 125 } // namespace content |
123 | 126 |
124 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_ | 127 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_ |
OLD | NEW |