| 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_quad_culler.h" | 11 #include "cc/test/mock_quad_culler.h" |
| 12 #include "cc/trees/layer_tree_impl.h" | 12 #include "cc/trees/layer_tree_impl.h" |
| 13 #include "third_party/skia/include/core/SkCanvas.h" | 13 #include "third_party/skia/include/core/SkCanvas.h" |
| 14 #include "third_party/skia/include/core/SkColor.h" | 14 #include "third_party/skia/include/core/SkColor.h" |
| 15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 16 #include "ui/gfx/rect_f.h" | 16 #include "ui/gfx/rect_f.h" |
| 17 | 17 |
| 18 #if !defined(OS_ANDROID) | 18 #if !defined(OS_ANDROID) |
| 19 | 19 |
| 20 namespace cc { | 20 namespace cc { |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 class LayerTreeHostOnDemandRasterPixelTest : public LayerTreePixelTest { | 23 class LayerTreeHostOnDemandRasterPixelTest : public LayerTreePixelTest { |
| 24 public: | 24 public: |
| 25 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 25 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 26 settings->impl_side_painting = true; | 26 settings->impl_side_painting = true; |
| 27 } | 27 } |
| 28 | 28 |
| 29 virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 29 virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
| 30 TRACE_EVENT0("cc", "BeginCommitOnThreadbca") |
| 30 // Not enough memory available. Enforce on-demand rasterization. | 31 // Not enough memory available. Enforce on-demand rasterization. |
| 31 impl->SetMemoryPolicy( | 32 impl->SetMemoryPolicy( |
| 32 ManagedMemoryPolicy(1, ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING, | 33 ManagedMemoryPolicy(1, ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING, |
| 33 1, ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING), | 34 1, ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING), |
| 34 true); | 35 true); |
| 35 } | 36 } |
| 36 | 37 |
| 37 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, | 38 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, |
| 38 bool result) OVERRIDE { | 39 bool result) OVERRIDE { |
| 39 // Find the PictureLayerImpl ask it to append quads to check their material. | 40 // Find the PictureLayerImpl ask it to append quads to check their material. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 103 |
| 103 RunPixelTest(GL_WITH_BITMAP, | 104 RunPixelTest(GL_WITH_BITMAP, |
| 104 layer, | 105 layer, |
| 105 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png"))); | 106 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png"))); |
| 106 } | 107 } |
| 107 | 108 |
| 108 } // namespace | 109 } // namespace |
| 109 } // namespace cc | 110 } // namespace cc |
| 110 | 111 |
| 111 #endif // OS_ANDROID | 112 #endif // OS_ANDROID |
| OLD | NEW |