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

Unified Diff: gpu/ipc/client/command_buffer_proxy_impl.h

Issue 2041043002: CommandBufferProxyImpl holds on to GpuMemoryBuffers while they are in use. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use default move constructor and move operator=. Created 4 years, 6 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
« no previous file with comments | « no previous file | gpu/ipc/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/client/command_buffer_proxy_impl.h
diff --git a/gpu/ipc/client/command_buffer_proxy_impl.h b/gpu/ipc/client/command_buffer_proxy_impl.h
index aa47fe30122cd868f30da7916e2b74f374fd7add..78a48ff601c27842e05cb7be0cece22865212903 100644
--- a/gpu/ipc/client/command_buffer_proxy_impl.h
+++ b/gpu/ipc/client/command_buffer_proxy_impl.h
@@ -296,8 +296,19 @@ class GPU_EXPORT CommandBufferProxyImpl
SwapBuffersCompletionCallback swap_buffers_completion_callback_;
UpdateVSyncParametersCallback update_vsync_parameters_completion_callback_;
- // A map from image id to GpuMemoryBuffer id.
- std::map<int32_t, int32_t> image_gmb_ids_map_;
+ // |gpu_memory_buffer_id| will always contain a valid (not -1) id.
+ // If the GpuMemoryBuffer was created through this class, then
+ // |owned_gpu_memory_buffer| will also be not null.
+ struct ImageInfo {
+ ImageInfo();
+ ~ImageInfo();
+ ImageInfo(ImageInfo&& other);
+ ImageInfo& operator=(ImageInfo&& other);
+ int32_t gpu_memory_buffer_id = -1;
+ std::unique_ptr<gfx::GpuMemoryBuffer> owned_gpu_memory_buffer;
+ };
+ // A map from image id to ImageInfo.
+ std::map<int32_t, ImageInfo> image_gmb_map_;
base::WeakPtr<CommandBufferProxyImpl> weak_this_;
scoped_refptr<base::SequencedTaskRunner> callback_thread_;
« no previous file with comments | « no previous file | gpu/ipc/client/command_buffer_proxy_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698