| Index: content/renderer/pepper/pepper_compositor_host.cc
|
| diff --git a/content/renderer/pepper/pepper_compositor_host.cc b/content/renderer/pepper/pepper_compositor_host.cc
|
| index 47c0fccfe6cb06198183de4377c305c91e2c0e9c..d04b9ff8cde3fa74b416839dca05b90f213200cb 100644
|
| --- a/content/renderer/pepper/pepper_compositor_host.cc
|
| +++ b/content/renderer/pepper/pepper_compositor_host.cc
|
| @@ -10,6 +10,7 @@
|
| #include "cc/layers/solid_color_layer.h"
|
| #include "cc/layers/texture_layer.h"
|
| #include "cc/resources/texture_mailbox.h"
|
| +#include "cc/trees/layer_tree_host.h"
|
| #include "content/public/renderer/renderer_ppapi_host.h"
|
| #include "content/renderer/pepper/gfx_conversion.h"
|
| #include "content/renderer/pepper/host_globals.h"
|
| @@ -134,12 +135,6 @@ PepperCompositorHost::PepperCompositorHost(
|
| : ResourceHost(host->GetPpapiHost(), instance, resource),
|
| bound_instance_(NULL),
|
| weak_factory_(this) {
|
| - layer_ = cc::Layer::Create();
|
| - // TODO(penghuang): SetMasksToBounds() can be expensive if the layer is
|
| - // transformed. Possibly better could be to explicitly clip the child layers
|
| - // (by modifying their bounds).
|
| - layer_->SetMasksToBounds(true);
|
| - layer_->SetIsDrawable(true);
|
| }
|
|
|
| PepperCompositorHost::~PepperCompositorHost() {
|
| @@ -157,7 +152,18 @@ bool PepperCompositorHost::BindToInstance(
|
| if (bound_instance_ && new_instance)
|
| return false; // Can't change a bound device.
|
| bound_instance_ = new_instance;
|
| + layer_ = NULL;
|
| + layers_.clear();
|
| + if (bound_instance_) {
|
| + layer_ = cc::Layer::Create();
|
| + // TODO(penghuang): SetMasksToBounds() can be expensive if the layer is
|
| + // transformed. Possibly better could be to explicitly clip the child layers
|
| + // (by modifying their bounds).
|
| + layer_->SetMasksToBounds(true);
|
| + layer_->SetIsDrawable(true);
|
| + }
|
| return true;
|
| +
|
| }
|
|
|
| void PepperCompositorHost::ViewInitiatedPaint() {
|
| @@ -366,6 +372,11 @@ int32_t PepperCompositorHost::OnHostMsgCommitLayers(
|
| layers_.push_back(LayerData(cc_layer, *pp_layer));
|
| }
|
|
|
| + // We need force to commit on the parent layer, so the ViewInitiatedPaint()
|
| + // will be always called, even if all layers are not changed from previous
|
| + // CommitLayers() call.
|
| + if (layer_->layer_tree_host())
|
| + layer_->layer_tree_host()->SetNeedsCommit();
|
| return PP_OK_COMPLETIONPENDING;
|
| }
|
|
|
|
|