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

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

Issue 324983005: [PPAPI] Add browser tests for compositor API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor_api_impl_new
Patch Set: Disable the test on MACOSX Created 6 years, 6 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
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | ppapi/examples/compositor/compositor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9aa33542442c041efa67d7d04b5bc18cb1dff464..4aaad86e0dbf7002b1f6b76917348e1bcdd94e16 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -1877,7 +1877,7 @@ void PepperPluginInstanceImpl::UpdateFlashFullscreenState(
return;
}
- UpdateLayer();
+ UpdateLayer(false);
bool old_plugin_focus = PluginHasFocus();
flash_fullscreen_ = flash_fullscreen;
@@ -2016,7 +2016,7 @@ bool PepperPluginInstanceImpl::PrintPDFOutput(PP_Resource print_output,
#endif
}
-void PepperPluginInstanceImpl::UpdateLayer() {
+void PepperPluginInstanceImpl::UpdateLayer(bool device_changed) {
if (!container_)
return;
@@ -2031,7 +2031,8 @@ void PepperPluginInstanceImpl::UpdateLayer() {
bool want_texture_layer = want_3d_layer || want_2d_layer;
bool want_compositor_layer = !!bound_compositor_;
- if ((want_texture_layer == !!texture_layer_.get()) &&
+ if (!device_changed &&
+ (want_texture_layer == !!texture_layer_.get()) &&
(want_3d_layer == layer_is_hardware_) &&
(want_compositor_layer == !!compositor_layer_) &&
layer_bound_to_fullscreen_ == !!fullscreen_container_) {
@@ -2272,7 +2273,7 @@ PP_Bool PepperPluginInstanceImpl::BindGraphics(PP_Instance instance,
// Special-case clearing the current device.
if (!device) {
- UpdateLayer();
+ UpdateLayer(true);
InvalidateRect(gfx::Rect());
return PP_TRUE;
}
@@ -2308,13 +2309,13 @@ PP_Bool PepperPluginInstanceImpl::BindGraphics(PP_Instance instance,
if (compositor) {
if (compositor->BindToInstance(this)) {
bound_compositor_ = compositor;
- UpdateLayer();
+ UpdateLayer(true);
return PP_TRUE;
}
} else if (graphics_2d) {
if (graphics_2d->BindToInstance(this)) {
bound_graphics_2d_platform_ = graphics_2d;
- UpdateLayer();
+ UpdateLayer(true);
return PP_TRUE;
}
} else if (graphics_3d) {
@@ -2323,7 +2324,7 @@ PP_Bool PepperPluginInstanceImpl::BindGraphics(PP_Instance instance,
if (graphics_3d->pp_instance() == pp_instance() &&
graphics_3d->BindToInstance(true)) {
bound_graphics_3d_ = graphics_3d;
- UpdateLayer();
+ UpdateLayer(true);
return PP_TRUE;
}
}
@@ -3094,7 +3095,7 @@ bool PepperPluginInstanceImpl::FlashSetFullscreen(bool fullscreen,
DCHECK(!fullscreen_container_);
fullscreen_container_ =
render_frame_->CreatePepperFullscreenContainer(this);
- UpdateLayer();
+ UpdateLayer(false);
} else {
DCHECK(fullscreen_container_);
fullscreen_container_->Destroy();
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | ppapi/examples/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698