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

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

Issue 2502373003: stop using SkXfermode -- use SkBlendMode instead (Closed)
Patch Set: rebase Created 4 years, 1 month 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/animation/animation_host.h" 9 #include "cc/animation/animation_host.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100)); 1765 this->identity_matrix, gfx::PointF(), gfx::Size(100, 100));
1766 LayerImpl* blend_mode_layer = this->CreateDrawingLayer( 1766 LayerImpl* blend_mode_layer = this->CreateDrawingLayer(
1767 parent, this->identity_matrix, gfx::PointF(0.f, 0.f), 1767 parent, this->identity_matrix, gfx::PointF(0.f, 0.f),
1768 gfx::Size(100, 100), true); 1768 gfx::Size(100, 100), true);
1769 LayerImpl* top_layer = this->CreateDrawingLayer( 1769 LayerImpl* top_layer = this->CreateDrawingLayer(
1770 parent, this->identity_matrix, gfx::PointF(10.f, 12.f), 1770 parent, this->identity_matrix, gfx::PointF(10.f, 12.f),
1771 gfx::Size(20, 22), true); 1771 gfx::Size(20, 22), true);
1772 1772
1773 // Blend mode makes the layer own a surface. 1773 // Blend mode makes the layer own a surface.
1774 blend_mode_layer->test_properties()->force_render_surface = true; 1774 blend_mode_layer->test_properties()->force_render_surface = true;
1775 blend_mode_layer->test_properties()->blend_mode = 1775 blend_mode_layer->test_properties()->blend_mode = SkBlendMode::kMultiply;
1776 SkXfermode::kMultiply_Mode;
1777 1776
1778 this->CalcDrawEtc(parent); 1777 this->CalcDrawEtc(parent);
1779 1778
1780 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); 1779 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000));
1781 1780
1782 this->VisitLayer(top_layer, &occlusion); 1781 this->VisitLayer(top_layer, &occlusion);
1783 // |top_layer| occludes. 1782 // |top_layer| occludes.
1784 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(), 1783 EXPECT_EQ(gfx::Rect(10, 12, 20, 22).ToString(),
1785 occlusion.occlusion_from_inside_target().ToString()); 1784 occlusion.occlusion_from_inside_target().ToString());
1786 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); 1785 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty());
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2426 EXPECT_EQ(gfx::Rect(), 2425 EXPECT_EQ(gfx::Rect(),
2427 occlusion.UnoccludedSurfaceContentRect( 2426 occlusion.UnoccludedSurfaceContentRect(
2428 surface, gfx::Rect(80, 70, 50, 50))); 2427 surface, gfx::Rect(80, 70, 50, 50)));
2429 } 2428 }
2430 }; 2429 };
2431 2430
2432 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) 2431 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery)
2433 2432
2434 } // namespace 2433 } // namespace
2435 } // namespace cc 2434 } // 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