| 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" |
| 11 #include "cc/test/mock_occlusion_tracker.h" | |
| 12 #include "cc/trees/layer_tree_impl.h" | 11 #include "cc/trees/layer_tree_impl.h" |
| 13 #include "third_party/skia/include/core/SkCanvas.h" | 12 #include "third_party/skia/include/core/SkCanvas.h" |
| 14 #include "third_party/skia/include/core/SkColor.h" | 13 #include "third_party/skia/include/core/SkColor.h" |
| 15 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
| 16 #include "ui/gfx/rect_f.h" | 15 #include "ui/gfx/rect_f.h" |
| 17 | 16 |
| 18 #if !defined(OS_ANDROID) | 17 #if !defined(OS_ANDROID) |
| 19 | 18 |
| 20 namespace cc { | 19 namespace cc { |
| 21 namespace { | 20 namespace { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 34 } | 33 } |
| 35 | 34 |
| 36 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, | 35 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, |
| 37 bool result) override { | 36 bool result) override { |
| 38 // Find the PictureLayerImpl ask it to append quads to check their material. | 37 // Find the PictureLayerImpl ask it to append quads to check their material. |
| 39 // The PictureLayerImpl is assumed to be the first child of the root layer | 38 // The PictureLayerImpl is assumed to be the first child of the root layer |
| 40 // in the active tree. | 39 // in the active tree. |
| 41 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>( | 40 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>( |
| 42 host_impl->active_tree()->root_layer()->child_at(0)); | 41 host_impl->active_tree()->root_layer()->child_at(0)); |
| 43 | 42 |
| 44 MockOcclusionTracker<LayerImpl> occlusion_tracker; | |
| 45 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); | 43 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
| 46 | 44 |
| 47 AppendQuadsData data; | 45 AppendQuadsData data; |
| 48 picture_layer->AppendQuads(render_pass.get(), occlusion_tracker, &data); | 46 picture_layer->AppendQuads(render_pass.get(), Occlusion(), &data); |
| 49 | 47 |
| 50 for (const auto& quad : render_pass->quad_list) | 48 for (const auto& quad : render_pass->quad_list) |
| 51 EXPECT_EQ(quad.material, DrawQuad::PICTURE_CONTENT); | 49 EXPECT_EQ(quad.material, DrawQuad::PICTURE_CONTENT); |
| 52 | 50 |
| 53 // Triggers pixel readback and ends the test. | 51 // Triggers pixel readback and ends the test. |
| 54 LayerTreePixelTest::SwapBuffersOnThread(host_impl, result); | 52 LayerTreePixelTest::SwapBuffersOnThread(host_impl, result); |
| 55 } | 53 } |
| 56 | 54 |
| 57 void RunOnDemandRasterPixelTest(); | 55 void RunOnDemandRasterPixelTest(); |
| 58 }; | 56 }; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 117 |
| 120 TEST_F(LayerTreeHostOnDemandRasterPixelTestWithGpuRasterizationForced, | 118 TEST_F(LayerTreeHostOnDemandRasterPixelTestWithGpuRasterizationForced, |
| 121 RasterPictureLayer) { | 119 RasterPictureLayer) { |
| 122 RunOnDemandRasterPixelTest(); | 120 RunOnDemandRasterPixelTest(); |
| 123 } | 121 } |
| 124 | 122 |
| 125 } // namespace | 123 } // namespace |
| 126 } // namespace cc | 124 } // namespace cc |
| 127 | 125 |
| 128 #endif // OS_ANDROID | 126 #endif // OS_ANDROID |
| OLD | NEW |