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

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory_surface_texture.cc

Issue 1131463004: content: Cleanup IOSurface/SurfaceTexture destruction code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_io_surface.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h" 5 #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h"
6 6
7 #include "content/common/android/surface_texture_manager.h" 7 #include "content/common/android/surface_texture_manager.h"
8 #include "ui/gl/android/surface_texture.h" 8 #include "ui/gl/android/surface_texture.h"
9 #include "ui/gl/gl_image_surface_texture.h" 9 #include "ui/gl/gl_image_surface_texture.h"
10 10
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return handle; 78 return handle;
79 } 79 }
80 80
81 void GpuMemoryBufferFactorySurfaceTexture::DestroyGpuMemoryBuffer( 81 void GpuMemoryBufferFactorySurfaceTexture::DestroyGpuMemoryBuffer(
82 gfx::GpuMemoryBufferId id, 82 gfx::GpuMemoryBufferId id,
83 int client_id) { 83 int client_id) {
84 { 84 {
85 base::AutoLock lock(surface_textures_lock_); 85 base::AutoLock lock(surface_textures_lock_);
86 86
87 SurfaceTextureMapKey key(id, client_id); 87 SurfaceTextureMapKey key(id, client_id);
88 SurfaceTextureMap::iterator it = surface_textures_.find(key); 88 DCHECK(surface_textures_.find(key) != surface_textures_.end());
89 if (it != surface_textures_.end()) 89 surface_textures_.erase(key);
90 surface_textures_.erase(it);
91 } 90 }
92 91
93 SurfaceTextureManager::GetInstance()->UnregisterSurfaceTexture(id, client_id); 92 SurfaceTextureManager::GetInstance()->UnregisterSurfaceTexture(id, client_id);
94 } 93 }
95 94
96 gpu::ImageFactory* GpuMemoryBufferFactorySurfaceTexture::AsImageFactory() { 95 gpu::ImageFactory* GpuMemoryBufferFactorySurfaceTexture::AsImageFactory() {
97 return this; 96 return this;
98 } 97 }
99 98
100 scoped_refptr<gfx::GLImage> 99 scoped_refptr<gfx::GLImage>
(...skipping 14 matching lines...) Expand all
115 114
116 scoped_refptr<gfx::GLImageSurfaceTexture> image( 115 scoped_refptr<gfx::GLImageSurfaceTexture> image(
117 new gfx::GLImageSurfaceTexture(size)); 116 new gfx::GLImageSurfaceTexture(size));
118 if (!image->Initialize(it->second.get())) 117 if (!image->Initialize(it->second.get()))
119 return scoped_refptr<gfx::GLImage>(); 118 return scoped_refptr<gfx::GLImage>();
120 119
121 return image; 120 return image;
122 } 121 }
123 122
124 } // namespace content 123 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_memory_buffer_factory_io_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698