Commit 0832f906 authored by Andrew Lee's avatar Andrew Lee Committed by Commit Bot

Added more Layer Properties to show in Styles Panel

Added more helpful layer properties
(ex: opacity, background blur, brightness) to the Styles Panel.

Change-Id: Ib1079d07743db121268cbed34579efa918720fe7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1675339
Commit-Queue: MyungJae Lee <myungjaelee@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarWei Li <weili@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672548}
parent cfee36b5
......@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "components/ui_devtools/views/element_utility.h"
#include "base/strings/string_number_conversions.h"
#include "ui/compositor/layer_owner.h"
namespace ui_devtools {
......@@ -13,6 +15,25 @@ void AppendLayerProperties(
ret->emplace_back("layer-type", LayerTypeToString(layer->type()));
ret->emplace_back("has-layer-mask",
layer->layer_mask_layer() ? "true" : "false");
ret->emplace_back("layer-opacity", base::NumberToString((layer->opacity())));
ret->emplace_back("layer-combined-opacity",
base::NumberToString(layer->GetCombinedOpacity()));
ret->emplace_back("background-blur",
base::NumberToString(layer->background_blur()));
ret->emplace_back("layer-blur", base::NumberToString(layer->layer_blur()));
ret->emplace_back("layer-saturation",
base::NumberToString(layer->layer_saturation()));
ret->emplace_back("layer-brightness",
base::NumberToString(layer->layer_brightness()));
ret->emplace_back("layer-grayscale",
base::NumberToString(layer->layer_grayscale()));
const ui::Layer::ShapeRects* alpha_shape_bounds = layer->alpha_shape();
if (alpha_shape_bounds && alpha_shape_bounds->size()) {
gfx::Rect bounding_box;
for (auto& shape_bound : *alpha_shape_bounds)
bounding_box.Union(shape_bound);
ret->emplace_back("alpha-shape-bounding-box", bounding_box.ToString());
}
const cc::Layer* cc_layer = layer->cc_layer_for_testing();
if (cc_layer) {
// Property trees must be updated in order to get valid render surface
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment