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

Unified Diff: content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc

Issue 685983005: gpu: Associate all GpuMemoryBuffers with unique IDs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more ozone build fix 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc
diff --git a/content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc b/content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc
index f4d3d195c5fbc8c1371c863f725d0a8a46c931e8..91b81cbd6516ca0be9fb95ec1fd22408faa90aa9 100644
--- a/content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc
+++ b/content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc
@@ -18,9 +18,10 @@ GpuMemoryBufferFactorySurfaceTexture::~GpuMemoryBufferFactorySurfaceTexture() {
gfx::GpuMemoryBufferHandle
GpuMemoryBufferFactorySurfaceTexture::CreateGpuMemoryBuffer(
- const gfx::GpuMemoryBufferId& id,
+ gfx::GpuMemoryBufferId id,
const gfx::Size& size,
- unsigned internalformat) {
+ unsigned internalformat,
+ int client_id) {
// Note: this needs to be 0 as the surface texture implemenation will take
// ownership of the texture and call glDeleteTextures when the GPU service
// attaches the surface texture to a real texture id. glDeleteTextures
@@ -32,35 +33,36 @@ GpuMemoryBufferFactorySurfaceTexture::CreateGpuMemoryBuffer(
return gfx::GpuMemoryBufferHandle();
SurfaceTextureManager::GetInstance()->RegisterSurfaceTexture(
- id.primary_id, id.secondary_id, surface_texture.get());
+ id, client_id, surface_texture.get());
- SurfaceTextureMapKey key(id.primary_id, id.secondary_id);
+ SurfaceTextureMapKey key(id, client_id);
DCHECK(surface_textures_.find(key) == surface_textures_.end());
surface_textures_[key] = surface_texture;
gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::SURFACE_TEXTURE_BUFFER;
- handle.global_id = id;
+ handle.id = id;
return handle;
}
void GpuMemoryBufferFactorySurfaceTexture::DestroyGpuMemoryBuffer(
- const gfx::GpuMemoryBufferId& id) {
- SurfaceTextureMapKey key(id.primary_id, id.secondary_id);
+ gfx::GpuMemoryBufferId id,
+ int client_id) {
+ SurfaceTextureMapKey key(id, client_id);
SurfaceTextureMap::iterator it = surface_textures_.find(key);
if (it != surface_textures_.end())
surface_textures_.erase(it);
- SurfaceTextureManager::GetInstance()->UnregisterSurfaceTexture(
- id.primary_id, id.secondary_id);
+ SurfaceTextureManager::GetInstance()->UnregisterSurfaceTexture(id, client_id);
}
scoped_refptr<gfx::GLImage>
GpuMemoryBufferFactorySurfaceTexture::CreateImageForGpuMemoryBuffer(
- const gfx::GpuMemoryBufferId& id,
+ gfx::GpuMemoryBufferId id,
const gfx::Size& size,
- unsigned internalformat) {
- SurfaceTextureMapKey key(id.primary_id, id.secondary_id);
+ unsigned internalformat,
+ int client_id) {
+ SurfaceTextureMapKey key(id, client_id);
SurfaceTextureMap::iterator it = surface_textures_.find(key);
if (it == surface_textures_.end())
return scoped_refptr<gfx::GLImage>();
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_surface_texture.h ('k') | content/common/gpu/gpu_memory_buffer_factory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698