Commit 88b27fc7 authored by reveman's avatar reveman Committed by Commit bot

Re-land: exo: Take blending into account when setting opaque property.

This makes SetFillsBoundsOpaquely() call consistent with opaque_rect
used in UpdateSurface() when creating a texture quad.

BUG=549781

Review-Url: https://codereview.chromium.org/2101453002
Cr-Commit-Position: refs/heads/master@{#402648}
parent 474e1e11
...@@ -485,8 +485,7 @@ void Surface::CommitSurfaceHierarchy() { ...@@ -485,8 +485,7 @@ void Surface::CommitSurfaceHierarchy() {
window_->layer()->SetBounds( window_->layer()->SetBounds(
gfx::Rect(window_->layer()->bounds().origin(), content_size_)); gfx::Rect(window_->layer()->bounds().origin(), content_size_));
window_->layer()->SetFillsBoundsOpaquely( window_->layer()->SetFillsBoundsOpaquely(
state_.alpha == 1.0f && state_.blend_mode == SkXfermode::kSrc_Mode ||
state_.opaque_region.contains( state_.opaque_region.contains(
gfx::RectToSkIRect(gfx::Rect(content_size_)))); gfx::RectToSkIRect(gfx::Rect(content_size_))));
} }
......
...@@ -206,8 +206,6 @@ TEST_F(SurfaceTest, SetBlendMode) { ...@@ -206,8 +206,6 @@ TEST_F(SurfaceTest, SetBlendMode) {
surface->SetBlendMode(SkXfermode::kSrc_Mode); surface->SetBlendMode(SkXfermode::kSrc_Mode);
surface->Commit(); surface->Commit();
EXPECT_FALSE(surface->window()->layer()->fills_bounds_opaquely());
const cc::DelegatedFrameData* frame_data = GetFrameFromSurface(surface.get()); const cc::DelegatedFrameData* frame_data = GetFrameFromSurface(surface.get());
ASSERT_EQ(1u, frame_data->render_pass_list.size()); ASSERT_EQ(1u, frame_data->render_pass_list.size());
ASSERT_EQ(1u, frame_data->render_pass_list.back()->quad_list.size()); ASSERT_EQ(1u, frame_data->render_pass_list.back()->quad_list.size());
......
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