Index: content/renderer/pepper/pepper_plugin_instance_impl.cc |
=================================================================== |
--- content/renderer/pepper/pepper_plugin_instance_impl.cc (revision 256299) |
+++ content/renderer/pepper/pepper_plugin_instance_impl.cc (working copy) |
@@ -700,9 +700,21 @@ |
} |
} |
+static void IgnoreCallback(unsigned, bool) {} |
+ |
void PepperPluginInstanceImpl::CommitBackingTexture() { |
- if (texture_layer_.get()) |
- texture_layer_->SetNeedsDisplay(); |
+ if (!texture_layer_.get()) |
+ return; |
+ PlatformContext3D* context = bound_graphics_3d_->platform_context(); |
+ gpu::Mailbox mailbox; |
+ uint32 sync_point = 0; |
+ context->GetBackingMailbox(&mailbox, &sync_point); |
+ DCHECK(!mailbox.IsZero()); |
+ DCHECK_NE(sync_point, 0u); |
+ texture_layer_->SetTextureMailbox( |
+ cc::TextureMailbox(mailbox, sync_point), |
+ cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback))); |
+ texture_layer_->SetNeedsDisplay(); |
} |
void PepperPluginInstanceImpl::InstanceCrashed() { |
@@ -1857,16 +1869,16 @@ |
#endif |
} |
-static void IgnoreCallback(unsigned, bool) {} |
- |
void PepperPluginInstanceImpl::UpdateLayer() { |
if (!container_) |
return; |
gpu::Mailbox mailbox; |
+ uint32 sync_point = 0; |
if (bound_graphics_3d_.get()) { |
PlatformContext3D* context = bound_graphics_3d_->platform_context(); |
- context->GetBackingMailbox(&mailbox); |
+ context->GetBackingMailbox(&mailbox, &sync_point); |
+ DCHECK_EQ(mailbox.IsZero(), sync_point == 0); |
} |
bool want_3d_layer = !mailbox.IsZero(); |
bool want_2d_layer = bound_graphics_2d_platform_ && |
@@ -1895,7 +1907,7 @@ |
texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL); |
opaque = bound_graphics_3d_->IsOpaque(); |
texture_layer_->SetTextureMailbox( |
- cc::TextureMailbox(mailbox, 0), |
+ cc::TextureMailbox(mailbox, sync_point), |
cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback))); |
} else { |
DCHECK(bound_graphics_2d_platform_); |