Chromium Code Reviews| Index: cc/resources/resource_provider.cc |
| diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc |
| index f081f6236f87a36410537af4a9c0e570f1191510..a039818bd5f5ef7dcb2d2970e9019163a699cddf 100644 |
| --- a/cc/resources/resource_provider.cc |
| +++ b/cc/resources/resource_provider.cc |
| @@ -957,13 +957,6 @@ ResourceProvider::ScopedWriteLockGpuMemoryBuffer:: |
| GLES2Interface* gl = resource_provider_->ContextGL(); |
| DCHECK(gl); |
| -#if defined(OS_CHROMEOS) |
|
reveman
2015/06/25 14:07:51
we should just remove this. if there are still per
|
| - // TODO(reveman): GL_COMMANDS_ISSUED_CHROMIUM is used for synchronization |
| - // on ChromeOS to avoid some performance issues. This only works with |
| - // shared memory backed buffers. crbug.com/436314 |
| - DCHECK_EQ(gpu_memory_buffer_->GetHandle().type, gfx::SHARED_MEMORY_BUFFER); |
| -#endif |
| - |
| resource_->image_id = gl->CreateImageCHROMIUM( |
| gpu_memory_buffer_->AsClientBuffer(), size_.width(), size_.height(), |
| GLInternalFormat(resource_->format)); |
| @@ -1865,15 +1858,17 @@ void ResourceProvider::CopyResource(ResourceId source_id, |
| if (!source_resource->gl_read_lock_query_id) |
| gl->GenQueriesEXT(1, &source_resource->gl_read_lock_query_id); |
| #if defined(OS_CHROMEOS) |
| - // TODO(reveman): This avoids a performance problem on some ChromeOS |
| - // devices. This needs to be removed to support native GpuMemoryBuffer |
| - // implementations. crbug.com/436314 |
| - gl->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, |
| - source_resource->gl_read_lock_query_id); |
| -#else |
| + // TODO(reveman): GL_COMMANDS_ISSUED_CHROMIUM is used for synchronization |
| + // on ChromeOS to avoid some performance issues. This only works with |
| + // shared memory backed buffers. crbug.com/436314 |
| + if (source_resource->gpu_memory_buffer->GetHandle().type == |
| + gfx::SHARED_MEMORY_BUFFER) |
| + gl->BeginQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM, |
| + source_resource->gl_read_lock_query_id); |
| + else |
|
dshwang
2015/06/25 14:52:13
This quirk is for ARM ChromeOS perf issue.
After t
|
| +#endif |
| gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, |
| source_resource->gl_read_lock_query_id); |
| -#endif |
| } |
| DCHECK(!dest_resource->image_id); |
| dest_resource->allocated = true; |
| @@ -1885,10 +1880,12 @@ void ResourceProvider::CopyResource(ResourceId source_id, |
| // End query and create a read lock fence that will prevent access to |
| // source resource until CopySubTextureCHROMIUM command has completed. |
| #if defined(OS_CHROMEOS) |
| - gl->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); |
| -#else |
| - gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM); |
| + if (source_resource->gpu_memory_buffer->GetHandle().type == |
| + gfx::SHARED_MEMORY_BUFFER) |
| + gl->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM); |
| + else |
| #endif |
| + gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM); |
| source_resource->read_lock_fence = make_scoped_refptr( |
| new CopyTextureFence(gl, source_resource->gl_read_lock_query_id)); |
| } else { |