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

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: Rebase 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
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 7db4c547f56e735fe96e414d3463288cf7ad641c..7bba781874049780dee953ae4adb7646dbc0dcfa 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -1846,7 +1846,7 @@ void PepperPluginInstanceImpl::UpdateFlashFullscreenState(
return;
}
- UpdateLayer();
+ UpdateLayer(false);
bool old_plugin_focus = PluginHasFocus();
flash_fullscreen_ = flash_fullscreen;
@@ -1985,7 +1985,7 @@ bool PepperPluginInstanceImpl::PrintPDFOutput(PP_Resource print_output,
#endif
}
-void PepperPluginInstanceImpl::UpdateLayer() {
+void PepperPluginInstanceImpl::UpdateLayer(bool device_changed) {
if (!container_)
return;
@@ -2000,7 +2000,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_) {
@@ -2043,6 +2044,7 @@ void PepperPluginInstanceImpl::UpdateLayer() {
} else if (want_compositor_layer) {
compositor_layer_ = bound_compositor_->layer();
web_layer_.reset(new webkit::WebLayerImpl(compositor_layer_));
+ web_layer_.reset(new webkit::WebLayerImpl(compositor_layer_));
piman 2014/06/18 00:55:24 Why do this twice?
Peng 2014/06/18 02:35:03 Oops! Done
}
if (web_layer_) {
@@ -2241,7 +2243,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;
}
@@ -2277,13 +2279,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) {
@@ -2292,7 +2294,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;
}
}
@@ -3063,7 +3065,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();

Powered by Google App Engine
This is Rietveld 408576698