| 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 19 matching lines...) Expand all Loading... |
| 30 // Client side proxy that forwards messages synchronously to a | 30 // Client side proxy that forwards messages synchronously to a |
| 31 // CommandBufferStub. | 31 // CommandBufferStub. |
| 32 class CommandBufferProxy : public gpu::CommandBuffer, | 32 class CommandBufferProxy : public gpu::CommandBuffer, |
| 33 public IPC::Channel::Listener, | 33 public IPC::Channel::Listener, |
| 34 public base::SupportsWeakPtr<CommandBufferProxy> { | 34 public base::SupportsWeakPtr<CommandBufferProxy> { |
| 35 public: | 35 public: |
| 36 CommandBufferProxy(GpuChannelHost* channel, int route_id); | 36 CommandBufferProxy(GpuChannelHost* channel, int route_id); |
| 37 virtual ~CommandBufferProxy(); | 37 virtual ~CommandBufferProxy(); |
| 38 | 38 |
| 39 // IPC::Channel::Listener implementation: | 39 // IPC::Channel::Listener implementation: |
| 40 virtual bool OnMessageReceived(const IPC::Message& message); | 40 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 41 virtual void OnChannelError(); | 41 virtual void OnChannelError() OVERRIDE; |
| 42 | 42 |
| 43 int route_id() const { return route_id_; } | 43 int route_id() const { return route_id_; } |
| 44 | 44 |
| 45 // CommandBuffer implementation: | 45 // CommandBuffer implementation: |
| 46 virtual bool Initialize(int32 size); | 46 virtual bool Initialize(int32 size) OVERRIDE; |
| 47 virtual bool Initialize(base::SharedMemory* buffer, int32 size); | 47 virtual bool Initialize(base::SharedMemory* buffer, int32 size) OVERRIDE; |
| 48 virtual gpu::Buffer GetRingBuffer(); | 48 virtual gpu::Buffer GetRingBuffer() OVERRIDE; |
| 49 virtual State GetState(); | 49 virtual State GetState() OVERRIDE; |
| 50 virtual State GetLastState(); | 50 virtual State GetLastState() OVERRIDE; |
| 51 virtual void Flush(int32 put_offset); | 51 virtual void Flush(int32 put_offset) OVERRIDE; |
| 52 virtual State FlushSync(int32 put_offset, int32 last_known_get); | 52 virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE; |
| 53 virtual void SetGetOffset(int32 get_offset); | 53 virtual void SetGetOffset(int32 get_offset) OVERRIDE; |
| 54 virtual int32 CreateTransferBuffer(size_t size, int32 id_request); | 54 virtual int32 CreateTransferBuffer(size_t size, int32 id_request) OVERRIDE; |
| 55 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, | 55 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, |
| 56 size_t size, | 56 size_t size, |
| 57 int32 id_request); | 57 int32 id_request) OVERRIDE; |
| 58 virtual void DestroyTransferBuffer(int32 id); | 58 virtual void DestroyTransferBuffer(int32 id) OVERRIDE; |
| 59 virtual gpu::Buffer GetTransferBuffer(int32 handle); | 59 virtual gpu::Buffer GetTransferBuffer(int32 handle) OVERRIDE; |
| 60 virtual void SetToken(int32 token); | 60 virtual void SetToken(int32 token) OVERRIDE; |
| 61 virtual void SetParseError(gpu::error::Error error); | 61 virtual void SetParseError(gpu::error::Error error) OVERRIDE; |
| 62 virtual void SetContextLostReason(gpu::error::ContextLostReason reason); | 62 virtual void SetContextLostReason( |
| 63 gpu::error::ContextLostReason reason) OVERRIDE; |
| 63 | 64 |
| 64 // Invoke the task when the channel has been flushed. Takes care of deleting | 65 // Invoke the task when the channel has been flushed. Takes care of deleting |
| 65 // the task whether the echo succeeds or not. | 66 // the task whether the echo succeeds or not. |
| 66 bool Echo(const base::Closure& callback); | 67 bool Echo(const base::Closure& callback); |
| 67 | 68 |
| 68 // Sends an IPC message with the new state of surface visibility | 69 // Sends an IPC message with the new state of surface visibility |
| 69 bool SetSurfaceVisible(bool visible); | 70 bool SetSurfaceVisible(bool visible); |
| 70 | 71 |
| 71 // Reparent a command buffer. TODO(apatrick): going forward, the notion of | 72 // Reparent a command buffer. TODO(apatrick): going forward, the notion of |
| 72 // the parent / child relationship between command buffers is going away in | 73 // the parent / child relationship between command buffers is going away in |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 base::Closure notify_repaint_task_; | 132 base::Closure notify_repaint_task_; |
| 132 | 133 |
| 133 base::Closure channel_error_callback_; | 134 base::Closure channel_error_callback_; |
| 134 | 135 |
| 135 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); | 136 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 #endif // ENABLE_GPU | 139 #endif // ENABLE_GPU |
| 139 | 140 |
| 140 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 141 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
| OLD | NEW |