| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
| 6 #define CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 6 #define CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #if defined(ENABLE_GPU) | 9 #if defined(ENABLE_GPU) |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void SetChannelErrorCallback(Callback0::Type* callback); | 76 void SetChannelErrorCallback(Callback0::Type* callback); |
| 77 | 77 |
| 78 // Asynchronously resizes an offscreen frame buffer. | 78 // Asynchronously resizes an offscreen frame buffer. |
| 79 void ResizeOffscreenFrameBuffer(const gfx::Size& size); | 79 void ResizeOffscreenFrameBuffer(const gfx::Size& size); |
| 80 | 80 |
| 81 // Set a task that will be invoked the next time the window becomes invalid | 81 // Set a task that will be invoked the next time the window becomes invalid |
| 82 // and needs to be repainted. Takes ownership of task. | 82 // and needs to be repainted. Takes ownership of task. |
| 83 void SetNotifyRepaintTask(Task* task); | 83 void SetNotifyRepaintTask(Task* task); |
| 84 | 84 |
| 85 // Sends an IPC message to create a GpuVideoDecodeAccelerator. Creates and | 85 // Sends an IPC message to create a GpuVideoDecodeAccelerator. Creates and |
| 86 // returns a pointer to a GpuVideoDecodeAcceleratorHost. CommandBufferProxy | 86 // returns a pointer to a GpuVideoDecodeAcceleratorHost. |
| 87 // owns the GpuVideoDecodeAcceleratorHost and does not transfer ownership to | |
| 88 // the caller of this method. | |
| 89 // Returns NULL on failure to create the GpuVideoDecodeAcceleratorHost. | 87 // Returns NULL on failure to create the GpuVideoDecodeAcceleratorHost. |
| 90 // Note that the GpuVideoDecodeAccelerator may still fail to be created in | 88 // Note that the GpuVideoDecodeAccelerator may still fail to be created in |
| 91 // the GPU process, even if this returns non-NULL. In this case the client is | 89 // the GPU process, even if this returns non-NULL. In this case the client is |
| 92 // notified of an error later. | 90 // notified of an error later. |
| 93 GpuVideoDecodeAcceleratorHost* CreateVideoDecoder( | 91 scoped_refptr<GpuVideoDecodeAcceleratorHost> CreateVideoDecoder( |
| 94 const std::vector<uint32>& configs, | 92 const std::vector<uint32>& configs, |
| 95 gpu::CommandBufferHelper* cmd_buffer_helper, | 93 gpu::CommandBufferHelper* cmd_buffer_helper, |
| 96 media::VideoDecodeAccelerator::Client* client); | 94 media::VideoDecodeAccelerator::Client* client); |
| 97 | 95 |
| 98 #if defined(OS_MACOSX) | 96 #if defined(OS_MACOSX) |
| 99 virtual void SetWindowSize(const gfx::Size& size); | 97 virtual void SetWindowSize(const gfx::Size& size); |
| 100 #endif | 98 #endif |
| 101 | 99 |
| 102 // Get the last state received from the service without synchronizing. | 100 // Get the last state received from the service without synchronizing. |
| 103 State GetLastState() { | 101 State GetLastState() { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 119 // As with the service, the client takes ownership of the ring buffer. | 117 // As with the service, the client takes ownership of the ring buffer. |
| 120 int32 num_entries_; | 118 int32 num_entries_; |
| 121 scoped_ptr<base::SharedMemory> ring_buffer_; | 119 scoped_ptr<base::SharedMemory> ring_buffer_; |
| 122 | 120 |
| 123 // Local cache of id to transfer buffer mapping. | 121 // Local cache of id to transfer buffer mapping. |
| 124 typedef std::map<int32, gpu::Buffer> TransferBufferMap; | 122 typedef std::map<int32, gpu::Buffer> TransferBufferMap; |
| 125 TransferBufferMap transfer_buffers_; | 123 TransferBufferMap transfer_buffers_; |
| 126 | 124 |
| 127 // The video decoder host corresponding to the stub's video decoder in the GPU | 125 // The video decoder host corresponding to the stub's video decoder in the GPU |
| 128 // process, if one exists. | 126 // process, if one exists. |
| 129 scoped_ptr<GpuVideoDecodeAcceleratorHost> video_decoder_host_; | 127 scoped_refptr<GpuVideoDecodeAcceleratorHost> video_decoder_host_; |
| 130 | 128 |
| 131 // The last cached state received from the service. | 129 // The last cached state received from the service. |
| 132 State last_state_; | 130 State last_state_; |
| 133 | 131 |
| 134 IPC::Channel::Sender* channel_; | 132 IPC::Channel::Sender* channel_; |
| 135 int route_id_; | 133 int route_id_; |
| 136 unsigned int flush_count_; | 134 unsigned int flush_count_; |
| 137 | 135 |
| 138 scoped_ptr<Task> notify_repaint_task_; | 136 scoped_ptr<Task> notify_repaint_task_; |
| 139 | 137 |
| 140 scoped_ptr<Callback0::Type> swap_buffers_callback_; | 138 scoped_ptr<Callback0::Type> swap_buffers_callback_; |
| 141 scoped_ptr<Callback0::Type> channel_error_callback_; | 139 scoped_ptr<Callback0::Type> channel_error_callback_; |
| 142 | 140 |
| 143 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); | 141 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); |
| 144 }; | 142 }; |
| 145 | 143 |
| 146 #endif // ENABLE_GPU | 144 #endif // ENABLE_GPU |
| 147 | 145 |
| 148 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 146 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
| OLD | NEW |