Commit 8368a9c8 authored by Matt Jones's avatar Matt Jones Committed by Commit Bot

Ensure bottom toolbar propagates background color

Overlays need to ensure they propagate the correct background
information up the tree. In this case the bottom toolbar wasn't
doing this which would cause screen flashing in some cases.

Bug: 951115
Change-Id: I9c7af7844345c95ed07215802137c2bf67bcf77b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2437022Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Matthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811843}
parent d5e07845
......@@ -19,6 +19,8 @@ ScrollingBottomViewSceneLayer::ScrollingBottomViewSceneLayer(
JNIEnv* env,
const JavaRef<jobject>& jobj)
: SceneLayer(env, jobj),
should_show_background_(false),
background_color_(SK_ColorWHITE),
view_container_(cc::Layer::Create()),
view_layer_(cc::UIResourceLayer::Create()) {
layer()->SetIsDrawable(true);
......@@ -86,6 +88,18 @@ void ScrollingBottomViewSceneLayer::SetContentTree(
layer_->AddChild(content_tree->layer());
layer_->AddChild(view_container_);
}
// Propagate the background color up from the content layer.
should_show_background_ = content_tree->ShouldShowBackground();
background_color_ = content_tree->GetBackgroundColor();
}
SkColor ScrollingBottomViewSceneLayer::GetBackgroundColor() {
return background_color_;
}
bool ScrollingBottomViewSceneLayer::ShouldShowBackground() {
return should_show_background_;
}
static jlong JNI_ScrollingBottomViewSceneLayer_Init(
......
......@@ -44,7 +44,13 @@ class ScrollingBottomViewSceneLayer : public SceneLayer {
const base::android::JavaParamRef<jobject>& jobj,
const base::android::JavaParamRef<jobject>& jcontent_tree);
SkColor GetBackgroundColor() override;
bool ShouldShowBackground() override;
private:
bool should_show_background_;
SkColor background_color_;
scoped_refptr<cc::Layer> view_container_;
scoped_refptr<cc::UIResourceLayer> view_layer_;
......
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