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 27 matching lines...) Expand all Loading... |
38 gfx::Size size, float scale_factor) = 0; | 38 gfx::Size size, float scale_factor) = 0; |
39 | 39 |
40 // Free the storage allocated in the AllocateColorBufferStorage call. The | 40 // Free the storage allocated in the AllocateColorBufferStorage call. The |
41 // GL texture that was bound has already been deleted by the caller. | 41 // GL texture that was bound has already been deleted by the caller. |
42 virtual void FreeColorBufferStorage() = 0; | 42 virtual void FreeColorBufferStorage() = 0; |
43 | 43 |
44 // Retrieve the handle for the surface to send to the browser process to | 44 // Retrieve the handle for the surface to send to the browser process to |
45 // display. | 45 // display. |
46 virtual uint64 GetSurfaceHandle() const = 0; | 46 virtual uint64 GetSurfaceHandle() const = 0; |
47 | 47 |
48 // Called when a frame is about to be sent to the browser process. | 48 // Called when a new frame has been rendered into the texture, and the |
| 49 // browser is about to be sent the surface to display. |
49 virtual void WillSwapBuffers() = 0; | 50 virtual void WillSwapBuffers() = 0; |
| 51 |
| 52 // Called once for every WillSwapBuffers call when the buffer that was sent |
| 53 // to the browser may be released by the GPU process (this may be because |
| 54 // the browser is holding a reference, in which case this will come |
| 55 // quickly, or it may be because the browser is done with the surface, in |
| 56 // which case it will come much later). |
| 57 virtual void CanFreeSwappedBuffer() = 0; |
50 }; | 58 }; |
51 | 59 |
52 ImageTransportSurfaceFBO(StorageProvider* storage_provider, | 60 ImageTransportSurfaceFBO(GpuChannelManager* manager, |
53 GpuChannelManager* manager, | |
54 GpuCommandBufferStub* stub, | 61 GpuCommandBufferStub* stub, |
55 gfx::PluginWindowHandle handle); | 62 gfx::PluginWindowHandle handle); |
56 | 63 |
57 // GLSurface implementation | 64 // GLSurface implementation |
58 virtual bool Initialize() OVERRIDE; | 65 virtual bool Initialize() OVERRIDE; |
59 virtual void Destroy() OVERRIDE; | 66 virtual void Destroy() OVERRIDE; |
60 virtual bool DeferDraws() OVERRIDE; | 67 virtual bool DeferDraws() OVERRIDE; |
61 virtual bool IsOffscreen() OVERRIDE; | 68 virtual bool IsOffscreen() OVERRIDE; |
62 virtual bool SwapBuffers() OVERRIDE; | 69 virtual bool SwapBuffers() OVERRIDE; |
63 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 70 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
64 virtual bool SupportsPostSubBuffer() OVERRIDE; | 71 virtual bool SupportsPostSubBuffer() OVERRIDE; |
65 virtual gfx::Size GetSize() OVERRIDE; | 72 virtual gfx::Size GetSize() OVERRIDE; |
66 virtual void* GetHandle() OVERRIDE; | 73 virtual void* GetHandle() OVERRIDE; |
67 virtual void* GetDisplay() OVERRIDE; | 74 virtual void* GetDisplay() OVERRIDE; |
68 virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE; | 75 virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE; |
69 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; | 76 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; |
70 virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE; | 77 virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE; |
71 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; | 78 virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; |
72 | 79 |
| 80 // Called when the context may continue to make forward progress after a swap. |
| 81 void UnblockContextAfterPendingSwap(); |
| 82 |
73 protected: | 83 protected: |
74 // ImageTransportSurface implementation | 84 // ImageTransportSurface implementation |
75 virtual void OnBufferPresented( | 85 virtual void OnBufferPresented( |
76 const AcceleratedSurfaceMsg_BufferPresented_Params& params) OVERRIDE; | 86 const AcceleratedSurfaceMsg_BufferPresented_Params& params) OVERRIDE; |
77 virtual void OnResize(gfx::Size size, float scale_factor) OVERRIDE; | 87 virtual void OnResize(gfx::Size size, float scale_factor) OVERRIDE; |
78 virtual void SetLatencyInfo( | 88 virtual void SetLatencyInfo( |
79 const std::vector<ui::LatencyInfo>&) OVERRIDE; | 89 const std::vector<ui::LatencyInfo>&) OVERRIDE; |
80 virtual void WakeUpGpu() OVERRIDE; | 90 virtual void WakeUpGpu() OVERRIDE; |
81 | 91 |
82 // GpuCommandBufferStub::DestructionObserver implementation. | 92 // GpuCommandBufferStub::DestructionObserver implementation. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 std::vector<ui::LatencyInfo> latency_info_; | 129 std::vector<ui::LatencyInfo> latency_info_; |
120 | 130 |
121 scoped_ptr<ImageTransportHelper> helper_; | 131 scoped_ptr<ImageTransportHelper> helper_; |
122 | 132 |
123 DISALLOW_COPY_AND_ASSIGN(ImageTransportSurfaceFBO); | 133 DISALLOW_COPY_AND_ASSIGN(ImageTransportSurfaceFBO); |
124 }; | 134 }; |
125 | 135 |
126 } // namespace content | 136 } // namespace content |
127 | 137 |
128 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_ | 138 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_ |
OLD | NEW |