Chromium Code Reviews| 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 172c3b7e1c1b740cfe74c72d0cf1dc991719d198..5f9aee44c4aa8b22a7468232cd4d77f2a40eaa49 100644 |
| --- a/content/renderer/pepper/pepper_plugin_instance_impl.cc |
| +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc |
| @@ -784,15 +784,18 @@ void PepperPluginInstanceImpl::ScrollRect(int dx, |
| } |
| void PepperPluginInstanceImpl::CommitBackingTexture() { |
| - if (!texture_layer_.get()) |
| + if (!texture_layer_.get()) { |
|
dcheng
2016/01/14 02:33:33
Nit: remove the .get(), since this is being update
David Yen
2016/01/14 19:14:36
Done. I removed all of them for texture_layer_.get
|
| + UpdateLayer(true); |
| return; |
| + } |
| + |
| gpu::Mailbox mailbox; |
| - uint32_t sync_point = 0; |
| - bound_graphics_3d_->GetBackingMailbox(&mailbox, &sync_point); |
| + gpu::SyncToken sync_token; |
| + bound_graphics_3d_->GetBackingMailbox(&mailbox, &sync_token); |
| DCHECK(!mailbox.IsZero()); |
| - DCHECK_NE(sync_point, 0u); |
| + DCHECK(sync_token.HasData()); |
| texture_layer_->SetTextureMailboxWithoutReleaseCallback( |
| - cc::TextureMailbox(mailbox, gpu::SyncToken(sync_point), GL_TEXTURE_2D)); |
| + cc::TextureMailbox(mailbox, sync_token, GL_TEXTURE_2D)); |
| texture_layer_->SetNeedsDisplay(); |
| } |
| @@ -1973,17 +1976,16 @@ bool PepperPluginInstanceImpl::PrintPDFOutput(PP_Resource print_output, |
| return false; |
| } |
| -void PepperPluginInstanceImpl::UpdateLayer(bool device_changed) { |
| +void PepperPluginInstanceImpl::UpdateLayer(bool force_creation) { |
| if (!container_) |
| return; |
| gpu::Mailbox mailbox; |
| - uint32_t sync_point = 0; |
| + gpu::SyncToken sync_token; |
| if (bound_graphics_3d_.get()) { |
| - bound_graphics_3d_->GetBackingMailbox(&mailbox, &sync_point); |
| - DCHECK_EQ(mailbox.IsZero(), sync_point == 0); |
| + bound_graphics_3d_->GetBackingMailbox(&mailbox, &sync_token); |
| } |
| - bool want_3d_layer = !mailbox.IsZero(); |
| + bool want_3d_layer = !mailbox.IsZero() && sync_token.HasData(); |
| bool want_2d_layer = !!bound_graphics_2d_platform_; |
| bool want_texture_layer = want_3d_layer || want_2d_layer; |
| bool want_compositor_layer = !!bound_compositor_; |
| @@ -1995,7 +1997,7 @@ void PepperPluginInstanceImpl::UpdateLayer(bool device_changed) { |
| want_compositor_layer = false; |
| } |
| - if (!device_changed && (want_texture_layer == !!texture_layer_.get()) && |
| + if (!force_creation && (want_texture_layer == !!texture_layer_.get()) && |
| (want_3d_layer == layer_is_hardware_) && |
| (want_compositor_layer == !!compositor_layer_.get()) && |
| layer_bound_to_fullscreen_ == !!fullscreen_container_) { |
| @@ -2024,8 +2026,7 @@ void PepperPluginInstanceImpl::UpdateLayer(bool device_changed) { |
| cc_blink::WebLayerImpl::LayerSettings(), NULL); |
| opaque = bound_graphics_3d_->IsOpaque(); |
| texture_layer_->SetTextureMailboxWithoutReleaseCallback( |
| - cc::TextureMailbox(mailbox, gpu::SyncToken(sync_point), |
| - GL_TEXTURE_2D)); |
| + cc::TextureMailbox(mailbox, sync_token, GL_TEXTURE_2D)); |
| } else { |
| DCHECK(bound_graphics_2d_platform_); |
| texture_layer_ = cc::TextureLayer::CreateForMailbox( |