Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1273)

Unified Diff: content/browser/gpu/gpu_memory_buffer_factory_host_impl.h

Issue 540443002: Enable sync allocation of GpuMemoryBuffers from the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..3566ad555a0f4ba824a18ab4772fc61eff6203f4
--- /dev/null
+++ b/content/browser/gpu/gpu_memory_buffer_factory_host_impl.h
@@ -0,0 +1,48 @@
+// 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();
+
+ // Overridden from GpuMemoryBufferFactoryHost:
+ 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;
+
+ 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_
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.cc ('k') | content/browser/gpu/gpu_memory_buffer_factory_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698