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

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

Issue 1586883002: Converted Ppapi post swap buffer sync point to use sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added DCHECKs Created 4 years, 11 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 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(
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | content/renderer/pepper/ppb_graphics_3d_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698