Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(389)

Side by Side Diff: cc/trees/occlusion_tracker_unittest.cc

Issue 2184773002: cc: Move blend_mode to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/occlusion_tracker.cc ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/occlusion_tracker.h" 5 #include "cc/trees/occlusion_tracker.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 1955 matching lines...) Expand 10 before | Expand all | Expand 10 after
1966 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); 1966 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100));
1967 LayerImpl* blend_mode_layer = this->CreateDrawingLayer( 1967 LayerImpl* blend_mode_layer = this->CreateDrawingLayer(
1968 parent, this->identity_matrix, gfx::PointF(0.f, 0.f), 1968 parent, this->identity_matrix, gfx::PointF(0.f, 0.f),
1969 gfx::Size(100, 100), true); 1969 gfx::Size(100, 100), true);
1970 LayerImpl* top_layer = this->CreateDrawingLayer( 1970 LayerImpl* top_layer = this->CreateDrawingLayer(
1971 parent, this->identity_matrix, gfx::PointF(10.f, 12.f), 1971 parent, this->identity_matrix, gfx::PointF(10.f, 12.f),
1972 gfx::Size(20, 22), true); 1972 gfx::Size(20, 22), true);
1973 1973
1974 // Blend mode makes the layer own a surface. 1974 // Blend mode makes the layer own a surface.
1975 blend_mode_layer->test_properties()->force_render_surface = true; 1975 blend_mode_layer->test_properties()->force_render_surface = true;
1976 blend_mode_layer->SetBlendMode(SkXfermode::kMultiply_Mode); 1976 blend_mode_layer->test_properties()->blend_mode =
1977 SkXfermode::kMultiply_Mode;
1977 1978
1978 this->CalcDrawEtc(parent); 1979 this->CalcDrawEtc(parent);
1979 1980
1980 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); 1981 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000));
1981 1982
1982 this->VisitLayer(top_layer, &occlusion); 1983 this->VisitLayer(top_layer, &occlusion);
1983 // |top_layer| occludes. 1984 // |top_layer| occludes.
1984 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(), 1985 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(),
1985 occlusion.occlusion_from_inside_target().ToString()); 1986 occlusion.occlusion_from_inside_target().ToString());
1986 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); 1987 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty());
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2626 EXPECT_EQ(gfx::Rect(), 2627 EXPECT_EQ(gfx::Rect(),
2627 occlusion.UnoccludedSurfaceContentRect( 2628 occlusion.UnoccludedSurfaceContentRect(
2628 surface, gfx::Rect(80, 70, 50, 50))); 2629 surface, gfx::Rect(80, 70, 50, 50)));
2629 } 2630 }
2630 }; 2631 };
2631 2632
2632 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) 2633 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery)
2633 2634
2634 } // namespace 2635 } // namespace
2635 } // namespace cc 2636 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/occlusion_tracker.cc ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698