Chromium Code Reviews| Index: content/browser/gpu/gpu_memory_buffer_factory_host_impl.h |
| diff --git a/content/browser/gpu/gpu_memory_buffer_factory_host_impl.h b/content/browser/gpu/gpu_memory_buffer_factory_host_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0ef18eab16da20d6fb064bd5fb5fef42fde159f2 |
| --- /dev/null |
| +++ b/content/browser/gpu/gpu_memory_buffer_factory_host_impl.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ |
| +#define CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ |
| + |
| +#include <map> |
| + |
| +#include "content/common/gpu/client/gpu_memory_buffer_factory_host.h" |
| + |
| +namespace content { |
| +class GpuMemoryBufferImpl; |
| + |
| +class CONTENT_EXPORT GpuMemoryBufferFactoryHostImpl |
| + : public GpuMemoryBufferFactoryHost { |
| + public: |
| + GpuMemoryBufferFactoryHostImpl(); |
| + virtual ~GpuMemoryBufferFactoryHostImpl(); |
| + |
| + // GpuMemoryBufferFactoryHost implementation. |
|
reveman
2014/09/09 23:17:54
nit: I typically use "Overridden from GpuMemoryBuf
alexst (slow to review)
2014/09/10 01:57:49
Done.
|
| + virtual void CreateGpuMemoryBuffer( |
| + const gfx::GpuMemoryBufferHandle& handle, |
| + const gfx::Size& size, |
| + unsigned internalformat, |
| + unsigned usage, |
| + const CreateGpuMemoryBufferCallback& callback) OVERRIDE; |
| + virtual void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, |
| + int32 sync_point) OVERRIDE; |
|
reveman
2014/09/09 23:17:54
nit: please add a blank line here to separate set_
alexst (slow to review)
2014/09/10 01:57:49
Done.
|
| + void set_gpu_host_id(int gpu_host_id) { gpu_host_id_ = gpu_host_id; } |
| + |
| + private: |
| + void OnGpuMemoryBufferCreated(uint32 request_id, |
| + const gfx::GpuMemoryBufferHandle& handle); |
| + |
| + int gpu_host_id_; |
| + uint32 next_create_gpu_memory_buffer_request_id_; |
| + typedef std::map<uint32, CreateGpuMemoryBufferCallback> |
| + CreateGpuMemoryBufferCallbackMap; |
| + CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryHostImpl); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ |