Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 185363009: ppapi: Send sync point whenever the pepper texture changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pepper: negates Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 2168d5a885cc1a5e03fa39a777eb7f41aba0ae25..5f62bb9c5e2085449fe3bf82e57fceca388d7a6b 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -727,9 +727,21 @@ void PepperPluginInstanceImpl::ScrollRect(int dx,
}
}
+static void IgnoreCallback(uint32, 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, GL_TEXTURE_2D, sync_point),
+ cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback)));
+ texture_layer_->SetNeedsDisplay();
}
void PepperPluginInstanceImpl::InstanceCrashed() {
@@ -1916,16 +1928,16 @@ bool PepperPluginInstanceImpl::PrintPDFOutput(PP_Resource print_output,
#endif
}
-static void IgnoreCallback(uint32, 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_ &&
@@ -1956,7 +1968,7 @@ void PepperPluginInstanceImpl::UpdateLayer() {
texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL);
opaque = bound_graphics_3d_->IsOpaque();
texture_layer_->SetTextureMailbox(
- cc::TextureMailbox(mailbox, GL_TEXTURE_2D, 0),
+ cc::TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point),
cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback)));
plugin_layer = texture_layer_;
} else {
« no previous file with comments | « content/renderer/pepper/pepper_platform_context_3d.cc ('k') | content/renderer/pepper/ppb_graphics_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698