| Index: cc/layers/layer_impl.cc
|
| diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
|
| index 2ffd61ef4b4243e778a9a0f96bc604c8138fdd08..f48b7483ef670022f801e59c2f3eba0e1c31a091 100644
|
| --- a/cc/layers/layer_impl.cc
|
| +++ b/cc/layers/layer_impl.cc
|
| @@ -53,6 +53,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
|
| force_render_surface_(false),
|
| is_container_for_fixed_position_layers_(false),
|
| draw_depth_(0.f),
|
| + compositing_reasons_(WebKit::CompositingReasonUnknown),
|
| #ifndef NDEBUG
|
| between_will_draw_and_did_draw_(false),
|
| #endif
|
| @@ -352,6 +353,7 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
|
| layer->SetContentBounds(content_bounds());
|
| layer->SetContentsScale(contents_scale_x(), contents_scale_y());
|
| layer->SetDebugName(debug_name_);
|
| + layer->SetCompositingReasons(compositing_reasons_);
|
| layer->SetDoubleSided(double_sided_);
|
| layer->SetDrawCheckerboardForMissingTiles(
|
| draw_checkerboard_for_missing_tiles_);
|
| @@ -1003,11 +1005,130 @@ void LayerImpl::SetVerticalScrollbarLayer(ScrollbarLayerImpl* scrollbar_layer) {
|
| vertical_scrollbar_layer_->set_scroll_layer_id(id());
|
| }
|
|
|
| +scoped_ptr<base::Value>
|
| +CompositingReasonsAsValue(WebKit::WebCompositingReasons reasons) {
|
| + scoped_ptr<base::ListValue> reason_list(new base::ListValue());
|
| +
|
| + if (reasons == WebKit::CompositingReasonUnknown) {
|
| + reason_list->AppendString("No reasons given");
|
| + return reason_list.PassAs<base::Value>();
|
| + }
|
| +
|
| + if (reasons & WebKit::CompositingReason3DTransform)
|
| + reason_list->AppendString("Has a 3d Transform");
|
| +
|
| + if (reasons & WebKit::CompositingReasonVideo)
|
| + reason_list->AppendString("Is accelerated video");
|
| +
|
| + if (reasons & WebKit::CompositingReasonCanvas)
|
| + reason_list->AppendString("Is accelerated canvas");
|
| +
|
| + if (reasons & WebKit::CompositingReasonPlugin)
|
| + reason_list->AppendString("Is accelerated plugin");
|
| +
|
| + if (reasons & WebKit::CompositingReasonIFrame)
|
| + reason_list->AppendString("Is accelerated iframe");
|
| +
|
| + if (reasons & WebKit::CompositingReasonBackfaceVisibilityHidden)
|
| + reason_list->AppendString("Has backface-visibility: hidden");
|
| +
|
| + if (reasons & WebKit::CompositingReasonAnimation)
|
| + reason_list->AppendString("Has accelerated animation");
|
| +
|
| + if (reasons & WebKit::CompositingReasonFilters)
|
| + reason_list->AppendString("Has accelerated filters");
|
| +
|
| + if (reasons & WebKit::CompositingReasonPositionFixed)
|
| + reason_list->AppendString("Is fixed position");
|
| +
|
| + if (reasons & WebKit::CompositingReasonPositionSticky)
|
| + reason_list->AppendString("Is sticky position");
|
| +
|
| + if (reasons & WebKit::CompositingReasonOverflowScrollingTouch)
|
| + reason_list->AppendString("Is a scrollable overflow element");
|
| +
|
| + if (reasons & WebKit::CompositingReasonBlending)
|
| + reason_list->AppendString("Has a blend mode");
|
| +
|
| + if (reasons & WebKit::CompositingReasonAssumedOverlap)
|
| + reason_list->AppendString("Might overlap a composited animation");
|
| +
|
| + if (reasons & WebKit::CompositingReasonOverlap)
|
| + reason_list->AppendString("Overlaps other composited content");
|
| +
|
| + if (reasons & WebKit::CompositingReasonNegativeZIndexChildren)
|
| + reason_list->AppendString("Might overlap negative z-index "
|
| + "composited content");
|
| +
|
| + if (reasons & WebKit::CompositingReasonTransformWithCompositedDescendants)
|
| + reason_list->AppendString("Has a transform needed by a "
|
| + "composited descendant");
|
| +
|
| + if (reasons & WebKit::CompositingReasonOpacityWithCompositedDescendants)
|
| + reason_list->AppendString("Has opacity needed by a composited "
|
| + "descendant");
|
| +
|
| + if (reasons & WebKit::CompositingReasonMaskWithCompositedDescendants)
|
| + reason_list->AppendString("Has a mask needed by a composited "
|
| + "descendant");
|
| +
|
| + if (reasons & WebKit::CompositingReasonReflectionWithCompositedDescendants)
|
| + reason_list->AppendString("Has a reflection with a composited "
|
| + "descendant");
|
| +
|
| + if (reasons & WebKit::CompositingReasonFilterWithCompositedDescendants)
|
| + reason_list->AppendString("Is a filter effect with a composited "
|
| + "descendant");
|
| +
|
| + if (reasons & WebKit::CompositingReasonBlendingWithCompositedDescendants)
|
| + reason_list->AppendString("Has a blend mode with a composited "
|
| + "descendant");
|
| +
|
| + if (reasons & WebKit::CompositingReasonClipsCompositingDescendants)
|
| + reason_list->AppendString("Clips a composited descendant");
|
| +
|
| + if (reasons & WebKit::CompositingReasonPerspective)
|
| + reason_list->AppendString("Has a perspective transform needed by a "
|
| + "composited 3d descendant");
|
| +
|
| + if (reasons & WebKit::CompositingReasonPreserve3D)
|
| + reason_list->AppendString("Has preserves-3d style with composited "
|
| + "3d descendant");
|
| +
|
| + if (reasons & WebKit::CompositingReasonReflectionOfCompositedParent)
|
| + reason_list->AppendString("Is the reflection of a composited layer");
|
| +
|
| + if (reasons & WebKit::CompositingReasonRoot)
|
| + reason_list->AppendString("Is the root");
|
| +
|
| + if (reasons & WebKit::CompositingReasonLayerForClip)
|
| + reason_list->AppendString("Convenience layer, parent of main layer to "
|
| + "clip subtree");
|
| +
|
| + if (reasons & WebKit::CompositingReasonLayerForDescendantClip)
|
| + reason_list->AppendString("Convenience layer, child of main layer to "
|
| + "clip scrolling container");
|
| +
|
| + if (reasons & WebKit::CompositingReasonLayerForScrollbar)
|
| + reason_list->AppendString("Convenience layer for rendering scrollbar");
|
| +
|
| + if (reasons & WebKit::CompositingReasonsLayerForScrollingContainer)
|
| + reason_list->AppendString("Convenience layer, the scrolling container");
|
| +
|
| + if (reasons & WebKit::CompositingReasonsLayerForForeground)
|
| + reason_list->AppendString("Convenience layer, when main layer has "
|
| + "negative z-index content");
|
| +
|
| + return reason_list.PassAs<base::Value>();
|
| +}
|
| +
|
| void LayerImpl::AsValueInto(base::DictionaryValue* state) const {
|
| TracedValue::MakeDictIntoImplicitSnapshot(state, LayerTypeAsString(), this);
|
| state->SetInteger("layer_id", id());
|
| state->Set("bounds", MathUtil::AsValue(bounds()).release());
|
| state->SetInteger("draws_content", DrawsContent());
|
| + state->Set("compositing_reasons",
|
| + CompositingReasonsAsValue(compositing_reasons_).release());
|
|
|
| bool clipped;
|
| gfx::QuadF layer_quad = MathUtil::MapQuad(
|
|
|