| 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 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 class LayerTreeHostOnDemandRasterPixelTest : public LayerTreePixelTest { | 22 class LayerTreeHostOnDemandRasterPixelTest : public LayerTreePixelTest { |
| 23 public: | 23 public: |
| 24 void InitializeSettings(LayerTreeSettings* settings) override { | 24 void InitializeSettings(LayerTreeSettings* settings) override { |
| 25 settings->impl_side_painting = true; | 25 settings->impl_side_painting = true; |
| 26 } | 26 } |
| 27 | 27 |
| 28 void BeginCommitOnThread(LayerTreeHostImpl* impl) override { | 28 void BeginCommitOnThread(LayerTreeHostImpl* impl) override { |
| 29 // Not enough memory available. Enforce on-demand rasterization. | 29 // Not enough memory available. Enforce on-demand rasterization. |
| 30 impl->SetMemoryPolicy( | 30 impl->SetMemoryPolicy( |
| 31 ManagedMemoryPolicy(1, gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, | 31 ManagedMemoryPolicy(1, gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING)); |
| 32 1000)); | |
| 33 } | 32 } |
| 34 | 33 |
| 35 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { | 34 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { |
| 36 // Find the PictureLayerImpl ask it to append quads to check their material. | 35 // Find the PictureLayerImpl ask it to append quads to check their material. |
| 37 // The PictureLayerImpl is assumed to be the first child of the root layer | 36 // The PictureLayerImpl is assumed to be the first child of the root layer |
| 38 // in the active tree. | 37 // in the active tree. |
| 39 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>( | 38 PictureLayerImpl* picture_layer = static_cast<PictureLayerImpl*>( |
| 40 host_impl->active_tree()->root_layer()->child_at(0)); | 39 host_impl->active_tree()->root_layer()->child_at(0)); |
| 41 | 40 |
| 42 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); | 41 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 115 |
| 117 TEST_F(LayerTreeHostOnDemandRasterPixelTestWithGpuRasterizationForced, | 116 TEST_F(LayerTreeHostOnDemandRasterPixelTestWithGpuRasterizationForced, |
| 118 RasterPictureLayer) { | 117 RasterPictureLayer) { |
| 119 RunOnDemandRasterPixelTest(); | 118 RunOnDemandRasterPixelTest(); |
| 120 } | 119 } |
| 121 | 120 |
| 122 } // namespace | 121 } // namespace |
| 123 } // namespace cc | 122 } // namespace cc |
| 124 | 123 |
| 125 #endif // OS_ANDROID | 124 #endif // OS_ANDROID |
| OLD | NEW |