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 "cc/layers/append_quads_data.h" | 5 #include "cc/layers/append_quads_data.h" |
6 #include "cc/layers/content_layer_client.h" | 6 #include "cc/layers/content_layer_client.h" |
7 #include "cc/layers/picture_layer.h" | 7 #include "cc/layers/picture_layer.h" |
8 #include "cc/layers/picture_layer_impl.h" | 8 #include "cc/layers/picture_layer_impl.h" |
9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
10 #include "cc/test/layer_tree_pixel_test.h" | 10 #include "cc/test/layer_tree_pixel_test.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 }; | 91 }; |
92 | 92 |
93 TEST_F(LayerTreeHostOnDemandRasterPixelTest, RasterPictureLayer) { | 93 TEST_F(LayerTreeHostOnDemandRasterPixelTest, RasterPictureLayer) { |
94 // Use multiple colors in a single layer to prevent bypassing on-demand | 94 // Use multiple colors in a single layer to prevent bypassing on-demand |
95 // rasterization if a single solid color is detected in picture analysis. | 95 // rasterization if a single solid color is detected in picture analysis. |
96 gfx::Rect layer_rect(200, 200); | 96 gfx::Rect layer_rect(200, 200); |
97 BlueYellowLayerClient client(layer_rect); | 97 BlueYellowLayerClient client(layer_rect); |
98 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); | 98 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); |
99 | 99 |
100 layer->SetIsDrawable(true); | 100 layer->SetIsDrawable(true); |
101 layer->SetAnchorPoint(gfx::PointF()); | |
102 layer->SetBounds(layer_rect.size()); | 101 layer->SetBounds(layer_rect.size()); |
103 layer->SetPosition(layer_rect.origin()); | 102 layer->SetPosition(layer_rect.origin()); |
104 | 103 |
105 RunPixelTest(GL_WITH_BITMAP, | 104 RunPixelTest(GL_WITH_BITMAP, |
106 layer, | 105 layer, |
107 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png"))); | 106 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png"))); |
108 } | 107 } |
109 | 108 |
110 } // namespace | 109 } // namespace |
111 } // namespace cc | 110 } // namespace cc |
112 | 111 |
113 #endif // OS_ANDROID | 112 #endif // OS_ANDROID |
OLD | NEW |