| OLD | NEW |
| 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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 TestContentLayerImpl* opaque_layer = this->CreateDrawingLayer( | 916 TestContentLayerImpl* opaque_layer = this->CreateDrawingLayer( |
| 917 parent, layer_transform, gfx::PointF(30.f, 30.f), gfx::Size(500, 500), | 917 parent, layer_transform, gfx::PointF(30.f, 30.f), gfx::Size(500, 500), |
| 918 true); | 918 true); |
| 919 TestContentLayerImpl* opacity_layer = this->CreateDrawingLayer( | 919 TestContentLayerImpl* opacity_layer = this->CreateDrawingLayer( |
| 920 parent, layer_transform, gfx::PointF(30.f, 30.f), gfx::Size(500, 500), | 920 parent, layer_transform, gfx::PointF(30.f, 30.f), gfx::Size(500, 500), |
| 921 true); | 921 true); |
| 922 | 922 |
| 923 blur_layer->test_properties()->force_render_surface = true; | 923 blur_layer->test_properties()->force_render_surface = true; |
| 924 FilterOperations filters; | 924 FilterOperations filters; |
| 925 filters.Append(FilterOperation::CreateBlurFilter(10.f)); | 925 filters.Append(FilterOperation::CreateBlurFilter(10.f)); |
| 926 blur_layer->SetFilters(filters); | 926 blur_layer->test_properties()->filters = filters; |
| 927 | 927 |
| 928 opaque_layer->test_properties()->force_render_surface = true; | 928 opaque_layer->test_properties()->force_render_surface = true; |
| 929 filters.Clear(); | 929 filters.Clear(); |
| 930 filters.Append(FilterOperation::CreateGrayscaleFilter(0.5f)); | 930 filters.Append(FilterOperation::CreateGrayscaleFilter(0.5f)); |
| 931 opaque_layer->SetFilters(filters); | 931 opaque_layer->test_properties()->filters = filters; |
| 932 | 932 |
| 933 opacity_layer->test_properties()->force_render_surface = true; | 933 opacity_layer->test_properties()->force_render_surface = true; |
| 934 filters.Clear(); | 934 filters.Clear(); |
| 935 filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); | 935 filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); |
| 936 opacity_layer->SetFilters(filters); | 936 opacity_layer->test_properties()->filters = filters; |
| 937 | 937 |
| 938 this->CalcDrawEtc(parent); | 938 this->CalcDrawEtc(parent); |
| 939 | 939 |
| 940 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); | 940 TestOcclusionTrackerWithClip occlusion(gfx::Rect(0, 0, 1000, 1000)); |
| 941 | 941 |
| 942 // Opacity layer won't contribute to occlusion. | 942 // Opacity layer won't contribute to occlusion. |
| 943 this->VisitLayer(opacity_layer, &occlusion); | 943 this->VisitLayer(opacity_layer, &occlusion); |
| 944 this->EnterContributingSurface(opacity_layer, &occlusion); | 944 this->EnterContributingSurface(opacity_layer, &occlusion); |
| 945 | 945 |
| 946 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); | 946 EXPECT_TRUE(occlusion.occlusion_from_outside_target().IsEmpty()); |
| (...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2624 EXPECT_EQ(gfx::Rect(), | 2624 EXPECT_EQ(gfx::Rect(), |
| 2625 occlusion.UnoccludedSurfaceContentRect( | 2625 occlusion.UnoccludedSurfaceContentRect( |
| 2626 surface, gfx::Rect(80, 70, 50, 50))); | 2626 surface, gfx::Rect(80, 70, 50, 50))); |
| 2627 } | 2627 } |
| 2628 }; | 2628 }; |
| 2629 | 2629 |
| 2630 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) | 2630 ALL_OCCLUSIONTRACKER_TEST(OcclusionTrackerTestUnoccludedSurfaceQuery) |
| 2631 | 2631 |
| 2632 } // namespace | 2632 } // namespace |
| 2633 } // namespace cc | 2633 } // namespace cc |
| OLD | NEW |