| Index: cc/resources/resource_provider.cc
|
| diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc
|
| index 115238f73cb5e74f32e666db16abc4ff276bf244..25f6597c9e4ec576e1931dc1ea832af1c4e31b50 100644
|
| --- a/cc/resources/resource_provider.cc
|
| +++ b/cc/resources/resource_provider.cc
|
| @@ -898,11 +898,9 @@ const ResourceProvider::Resource* ResourceProvider::LockForRead(ResourceId id) {
|
|
|
| GLES2Interface* gl = ContextGL();
|
| DCHECK(gl);
|
| - resource->gl_id = texture_id_allocator_->NextId();
|
| - GLC(gl, gl->BindTexture(resource->target, resource->gl_id));
|
| - GLC(gl,
|
| - gl->ConsumeTextureCHROMIUM(resource->mailbox.target(),
|
| - resource->mailbox.name()));
|
| + resource->gl_id =
|
| + GLC(gl, gl->CreateAndConsumeTextureCHROMIUM(resource->mailbox.target(),
|
| + resource->mailbox.name()));
|
| }
|
|
|
| if (!resource->pixels && resource->has_shared_bitmap_id &&
|
| @@ -1595,9 +1593,6 @@ void ResourceProvider::TransferResource(GLES2Interface* gl,
|
| LazyCreate(source);
|
| DCHECK(source->gl_id);
|
| DCHECK(source->origin == Resource::INTERNAL);
|
| - GLC(gl,
|
| - gl->BindTexture(resource->mailbox_holder.texture_target,
|
| - source->gl_id));
|
| if (source->image_id) {
|
| DCHECK(source->dirty_image);
|
| BindImageForSampling(source);
|
| @@ -1605,9 +1600,10 @@ void ResourceProvider::TransferResource(GLES2Interface* gl,
|
| // This is a resource allocated by the compositor, we need to produce it.
|
| // Don't set a sync point, the caller will do it.
|
| GLC(gl, gl->GenMailboxCHROMIUM(resource->mailbox_holder.mailbox.name));
|
| - GLC(gl,
|
| - gl->ProduceTextureCHROMIUM(resource->mailbox_holder.texture_target,
|
| - resource->mailbox_holder.mailbox.name));
|
| + GLC(gl, gl->ProduceTextureDirectCHROMIUM(
|
| + source->gl_id, resource->mailbox_holder.texture_target,
|
| + resource->mailbox_holder.mailbox.name));
|
| +
|
| source->mailbox = TextureMailbox(resource->mailbox_holder);
|
| } else {
|
| DCHECK(source->mailbox.IsTexture());
|
| @@ -2107,15 +2103,11 @@ void ResourceProvider::CopyResource(ResourceId source_id, ResourceId dest_id) {
|
| }
|
| DCHECK(!dest_resource->image_id);
|
| dest_resource->allocated = true;
|
| - gl->CopyTextureCHROMIUM(dest_resource->target,
|
| - source_resource->gl_id,
|
| - dest_resource->gl_id,
|
| - 0,
|
| - GLInternalFormat(dest_resource->format),
|
| - GLDataType(dest_resource->format));
|
| + gl->CopySubTextureCHROMIUM(dest_resource->target, source_resource->gl_id,
|
| + dest_resource->gl_id, 0, 0);
|
| if (source_resource->gl_read_lock_query_id) {
|
| // End query and create a read lock fence that will prevent access to
|
| - // source resource until CopyTextureCHROMIUM command has completed.
|
| +// source resource until CopySubTextureCHROMIUM command has completed.
|
| #if defined(OS_CHROMEOS)
|
| gl->EndQueryEXT(GL_COMMANDS_ISSUED_CHROMIUM);
|
| #else
|
|
|