Index: content/renderer/pepper/pepper_plugin_instance_impl.cc |
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc |
index 5b2757e8f5e3aa49b5675bbcf35d3f2a4006e5cb..14c337e58e93aec4aa933091c6a505cfbdd7105b 100644 |
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc |
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc |
@@ -778,12 +778,13 @@ void PepperPluginInstanceImpl::ScrollRect(int dx, |
void PepperPluginInstanceImpl::CommitTextureMailbox( |
const cc::TextureMailbox& texture_mailbox) { |
if (committed_texture_.IsValid() && !IsTextureInUse(committed_texture_)) { |
- bound_graphics_3d_->ReturnFrontBuffer( |
+ committed_texture_graphics_3d_->ReturnFrontBuffer( |
committed_texture_.mailbox(), committed_texture_consumed_sync_token_, |
false); |
} |
committed_texture_ = texture_mailbox; |
+ committed_texture_graphics_3d_ = bound_graphics_3d_; |
committed_texture_consumed_sync_token_ = gpu::SyncToken(); |
if (!texture_layer_) { |
@@ -804,7 +805,8 @@ void PepperPluginInstanceImpl::PassCommittedTextureToTextureLayer() { |
std::unique_ptr<cc::SingleReleaseCallback> callback( |
cc::SingleReleaseCallback::Create(base::Bind( |
&PepperPluginInstanceImpl::FinishedConsumingCommittedTexture, |
- weak_factory_.GetWeakPtr(), committed_texture_))); |
+ weak_factory_.GetWeakPtr(), committed_texture_, |
+ committed_texture_graphics_3d_))); |
IncrementTextureReferenceCount(committed_texture_); |
texture_layer_->SetTextureMailbox(committed_texture_, std::move(callback)); |
@@ -812,6 +814,7 @@ void PepperPluginInstanceImpl::PassCommittedTextureToTextureLayer() { |
void PepperPluginInstanceImpl::FinishedConsumingCommittedTexture( |
const cc::TextureMailbox& texture_mailbox, |
+ scoped_refptr<PPB_Graphics3D_Impl> graphics_3d, |
const gpu::SyncToken& sync_token, |
bool is_lost) { |
bool removed = DecrementTextureReferenceCount(texture_mailbox); |
@@ -824,8 +827,8 @@ void PepperPluginInstanceImpl::FinishedConsumingCommittedTexture( |
} |
if (removed && !is_committed_texture) { |
- bound_graphics_3d_->ReturnFrontBuffer(texture_mailbox.mailbox(), sync_token, |
- is_lost); |
+ graphics_3d->ReturnFrontBuffer(texture_mailbox.mailbox(), sync_token, |
+ is_lost); |
} |
} |