| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ | 5 #ifndef PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ |
| 6 #define PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ | 6 #define PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
| 11 #include "gpu/command_buffer/common/command_buffer.h" | 11 #include "gpu/command_buffer/common/command_buffer.h" |
| 12 #include "ppapi/proxy/ppapi_proxy_export.h" | 12 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 13 #include "ppapi/shared_impl/host_resource.h" | 13 #include "ppapi/shared_impl/host_resource.h" |
| 14 #include "gpu/ipc/command_buffer_proxy.h" |
| 14 | 15 |
| 15 namespace IPC { | 16 namespace IPC { |
| 16 class Message; | 17 class Message; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace ppapi { | 20 namespace ppapi { |
| 20 namespace proxy { | 21 namespace proxy { |
| 21 | 22 |
| 22 class ProxyChannel; | 23 class ProxyChannel; |
| 23 | 24 |
| 24 class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public gpu::CommandBuffer { | 25 class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public CommandBufferProxy { |
| 25 public: | 26 public: |
| 26 PpapiCommandBufferProxy(const HostResource& resource, | 27 PpapiCommandBufferProxy(const HostResource& resource, |
| 27 ProxyChannel* channel); | 28 ProxyChannel* channel); |
| 28 virtual ~PpapiCommandBufferProxy(); | 29 virtual ~PpapiCommandBufferProxy(); |
| 29 | 30 |
| 30 void SetChannelErrorCallback(const base::Closure& callback); | |
| 31 void ReportChannelError(); | 31 void ReportChannelError(); |
| 32 | 32 |
| 33 // CommandBufferProxy implementation: |
| 34 virtual int GetRouteID() const OVERRIDE; |
| 35 virtual bool Echo(const base::Closure& callback) OVERRIDE; |
| 36 virtual bool SetSurfaceVisible(bool visible) OVERRIDE; |
| 37 virtual bool DiscardBackbuffer() OVERRIDE; |
| 38 virtual bool EnsureBackbuffer() OVERRIDE; |
| 39 virtual void SetMemoryAllocationChangedCallback( |
| 40 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>& |
| 41 callback) OVERRIDE; |
| 42 virtual bool SetParent(CommandBufferProxy* parent_command_buffer, |
| 43 uint32 parent_texture_id) OVERRIDE; |
| 44 virtual void SetChannelErrorCallback(const base::Closure& callback) OVERRIDE; |
| 45 virtual void SetNotifyRepaintTask(const base::Closure& callback) OVERRIDE; |
| 46 virtual scoped_refptr<GpuVideoDecodeAcceleratorHost> CreateVideoDecoder( |
| 47 media::VideoCodecProfile profile, |
| 48 media::VideoDecodeAccelerator::Client* client) OVERRIDE; |
| 49 virtual void SetOnConsoleMessageCallback( |
| 50 const GpuConsoleMessageCallback& callback) OVERRIDE; |
| 51 |
| 33 // gpu::CommandBuffer implementation: | 52 // gpu::CommandBuffer implementation: |
| 34 virtual bool Initialize(); | 53 virtual bool Initialize(); |
| 35 virtual State GetState(); | 54 virtual State GetState(); |
| 36 virtual State GetLastState(); | 55 virtual State GetLastState(); |
| 37 virtual void Flush(int32 put_offset); | 56 virtual void Flush(int32 put_offset); |
| 38 virtual State FlushSync(int32 put_offset, int32 last_known_get); | 57 virtual State FlushSync(int32 put_offset, int32 last_known_get); |
| 39 virtual void SetGetBuffer(int32 transfer_buffer_id); | 58 virtual void SetGetBuffer(int32 transfer_buffer_id); |
| 40 virtual void SetGetOffset(int32 get_offset); | 59 virtual void SetGetOffset(int32 get_offset); |
| 41 virtual int32 CreateTransferBuffer(size_t size, int32 id_request); | 60 virtual int32 CreateTransferBuffer(size_t size, int32 id_request); |
| 42 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, | 61 virtual int32 RegisterTransferBuffer(base::SharedMemory* shared_memory, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 | 81 |
| 63 base::Closure channel_error_callback_; | 82 base::Closure channel_error_callback_; |
| 64 | 83 |
| 65 DISALLOW_COPY_AND_ASSIGN(PpapiCommandBufferProxy); | 84 DISALLOW_COPY_AND_ASSIGN(PpapiCommandBufferProxy); |
| 66 }; | 85 }; |
| 67 | 86 |
| 68 } // namespace proxy | 87 } // namespace proxy |
| 69 } // namespace ppapi | 88 } // namespace ppapi |
| 70 | 89 |
| 71 #endif // PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ | 90 #endif // PPAPI_PROXY_COMMAND_BUFFER_PROXY_H_ |
| OLD | NEW |