| Index: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
|
| diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
|
| index 38667e51e180f2d306fc50ec87e8994da9d88e1f..b265c9176c9679f6176306c4898e57dd1b1065e5 100644
|
| --- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
|
| +++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
|
| @@ -138,6 +138,7 @@ bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer(
|
| gfx::GpuMemoryBuffer::Usage usage,
|
| int client_id,
|
| gfx::PluginWindowHandle surface_handle) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| scoped_refptr<NativePixmap> pixmap =
|
| SurfaceFactoryOzone::GetInstance()->CreateNativePixmap(
|
| surface_handle, size, GetOzoneFormatFor(format),
|
| @@ -147,7 +148,6 @@ bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer(
|
| << size.height() << " format " << format << ", usage " << usage;
|
| return false;
|
| }
|
| - base::AutoLock lock(native_pixmap_map_lock_);
|
| native_pixmap_map_[GetIndex(id, client_id)] = pixmap;
|
| return true;
|
| }
|
| @@ -155,7 +155,7 @@ bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer(
|
| void GpuMemoryBufferFactoryOzoneNativeBuffer::DestroyGpuMemoryBuffer(
|
| gfx::GpuMemoryBufferId id,
|
| int client_id) {
|
| - base::AutoLock lock(native_pixmap_map_lock_);
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| native_pixmap_map_.erase(GetIndex(id, client_id));
|
| }
|
|
|
| @@ -166,16 +166,13 @@ GpuMemoryBufferFactoryOzoneNativeBuffer::CreateImageForGpuMemoryBuffer(
|
| gfx::GpuMemoryBuffer::Format format,
|
| unsigned internalformat,
|
| int client_id) {
|
| - NativePixmap* pixmap = nullptr;
|
| - {
|
| - base::AutoLock lock(native_pixmap_map_lock_);
|
| - BufferToPixmapMap::iterator it =
|
| - native_pixmap_map_.find(GetIndex(id, client_id));
|
| - if (it == native_pixmap_map_.end()) {
|
| - return scoped_refptr<gfx::GLImage>();
|
| - }
|
| - pixmap = it->second.get();
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + BufferToPixmapMap::iterator it =
|
| + native_pixmap_map_.find(GetIndex(id, client_id));
|
| + if (it == native_pixmap_map_.end()) {
|
| + return scoped_refptr<gfx::GLImage>();
|
| }
|
| + NativePixmap* pixmap = it->second.get();
|
| return CreateImageForPixmap(pixmap, size, format, internalformat);
|
| }
|
|
|
|
|