OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 #include "cc/layers/content_layer.h" | 6 #include "cc/layers/content_layer.h" |
7 #include "cc/output/copy_output_request.h" | 7 #include "cc/output/copy_output_request.h" |
8 #include "cc/output/copy_output_result.h" | 8 #include "cc/output/copy_output_result.h" |
9 #include "cc/test/layer_tree_pixel_test.h" | 9 #include "cc/test/layer_tree_pixel_test.h" |
10 #include "cc/test/paths.h" | 10 #include "cc/test/paths.h" |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 device_viewport_copy_subrect_ = gfx::Rect(50, 50, 100, 100); | 809 device_viewport_copy_subrect_ = gfx::Rect(50, 50, 100, 100); |
810 device_scale_factor_ = 2.f; | 810 device_scale_factor_ = 2.f; |
811 | 811 |
812 RunPixelTestWithReadbackTarget(GL_WITH_DEFAULT, | 812 RunPixelTestWithReadbackTarget(GL_WITH_DEFAULT, |
813 background, | 813 background, |
814 green.get(), | 814 green.get(), |
815 base::FilePath(FILE_PATH_LITERAL( | 815 base::FilePath(FILE_PATH_LITERAL( |
816 "green_small_with_blue_corner.png"))); | 816 "green_small_with_blue_corner.png"))); |
817 } | 817 } |
818 | 818 |
| 819 TEST_F(LayerTreeHostReadbackPixelTest, ReadbackNonRootLayerOutsideViewport) { |
| 820 scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer( |
| 821 gfx::Rect(200, 200), SK_ColorWHITE); |
| 822 |
| 823 scoped_refptr<SolidColorLayer> green = CreateSolidColorLayer( |
| 824 gfx::Rect(200, 200), SK_ColorGREEN); |
| 825 // Only the top left quarter of the layer is inside the viewport, so the |
| 826 // blue layer is entirely outside. |
| 827 green->SetPosition(gfx::Point(100, 100)); |
| 828 background->AddChild(green); |
| 829 |
| 830 scoped_refptr<SolidColorLayer> blue = CreateSolidColorLayer( |
| 831 gfx::Rect(150, 150, 50, 50), SK_ColorBLUE); |
| 832 green->AddChild(blue); |
| 833 |
| 834 RunPixelTestWithReadbackTarget(GL_WITH_DEFAULT, |
| 835 background, |
| 836 green.get(), |
| 837 base::FilePath(FILE_PATH_LITERAL( |
| 838 "green_with_blue_corner.png"))); |
| 839 } |
| 840 |
819 } // namespace | 841 } // namespace |
820 } // namespace cc | 842 } // namespace cc |
821 | 843 |
822 #endif // OS_ANDROID | 844 #endif // OS_ANDROID |
OLD | NEW |