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

Side by Side Diff: content/browser/gpu/gpu_memory_buffer_factory_host_impl.h

Issue 685983005: gpu: Associate all GpuMemoryBuffers with unique IDs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_
6 #define CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "content/common/gpu/client/gpu_memory_buffer_factory_host.h" 10 #include "content/common/gpu/client/gpu_memory_buffer_factory_host.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 class CONTENT_EXPORT GpuMemoryBufferFactoryHostImpl 14 class CONTENT_EXPORT GpuMemoryBufferFactoryHostImpl
15 : public GpuMemoryBufferFactoryHost { 15 : public GpuMemoryBufferFactoryHost {
16 public: 16 public:
17 GpuMemoryBufferFactoryHostImpl(); 17 GpuMemoryBufferFactoryHostImpl();
18 ~GpuMemoryBufferFactoryHostImpl() override; 18 ~GpuMemoryBufferFactoryHostImpl() override;
19 19
20 // Overridden from GpuMemoryBufferFactoryHost: 20 // Overridden from GpuMemoryBufferFactoryHost:
21 void CreateGpuMemoryBuffer( 21 void CreateGpuMemoryBuffer(
22 const gfx::GpuMemoryBufferHandle& handle, 22 gfx::GpuMemoryBufferType type,
23 gfx::GpuMemoryBufferId id,
23 const gfx::Size& size, 24 const gfx::Size& size,
24 gfx::GpuMemoryBuffer::Format format, 25 gfx::GpuMemoryBuffer::Format format,
25 gfx::GpuMemoryBuffer::Usage usage, 26 gfx::GpuMemoryBuffer::Usage usage,
27 int client_id,
26 const CreateGpuMemoryBufferCallback& callback) override; 28 const CreateGpuMemoryBufferCallback& callback) override;
27 void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, 29 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferType type,
30 gfx::GpuMemoryBufferId id,
31 int client_id,
28 int32 sync_point) override; 32 int32 sync_point) override;
29 33
30 void set_gpu_host_id(int gpu_host_id) { gpu_host_id_ = gpu_host_id; } 34 void set_gpu_host_id(int gpu_host_id) { gpu_host_id_ = gpu_host_id; }
31 35
32 private: 36 private:
33 void OnGpuMemoryBufferCreated(uint32 request_id, 37 void OnGpuMemoryBufferCreated(uint32 request_id,
34 const gfx::GpuMemoryBufferHandle& handle); 38 const gfx::GpuMemoryBufferHandle& handle);
35 39
36 int gpu_host_id_; 40 int gpu_host_id_;
37 uint32 next_create_gpu_memory_buffer_request_id_; 41 uint32 next_create_gpu_memory_buffer_request_id_;
38 typedef std::map<uint32, CreateGpuMemoryBufferCallback> 42 typedef std::map<uint32, CreateGpuMemoryBufferCallback>
39 CreateGpuMemoryBufferCallbackMap; 43 CreateGpuMemoryBufferCallbackMap;
40 CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_; 44 CreateGpuMemoryBufferCallbackMap create_gpu_memory_buffer_requests_;
41 45
42 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryHostImpl); 46 DISALLOW_COPY_AND_ASSIGN(GpuMemoryBufferFactoryHostImpl);
43 }; 47 };
44 48
45 } // namespace content 49 } // namespace content
46 50
47 #endif // CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_ 51 #endif // CONTENT_BROWSER_GPU_GPU_MEMORY_BUFFER_FACTORY_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698