| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "cc/test/fake_layer_tree_host_client.h" | 38 #include "cc/test/fake_layer_tree_host_client.h" |
| 39 #include "cc/test/fake_output_surface.h" | 39 #include "cc/test/fake_output_surface.h" |
| 40 #include "cc/test/fake_painted_scrollbar_layer.h" | 40 #include "cc/test/fake_painted_scrollbar_layer.h" |
| 41 #include "cc/test/fake_picture_layer.h" | 41 #include "cc/test/fake_picture_layer.h" |
| 42 #include "cc/test/fake_picture_layer_impl.h" | 42 #include "cc/test/fake_picture_layer_impl.h" |
| 43 #include "cc/test/fake_proxy.h" | 43 #include "cc/test/fake_proxy.h" |
| 44 #include "cc/test/fake_recording_source.h" | 44 #include "cc/test/fake_recording_source.h" |
| 45 #include "cc/test/fake_scoped_ui_resource.h" | 45 #include "cc/test/fake_scoped_ui_resource.h" |
| 46 #include "cc/test/fake_video_frame_provider.h" | 46 #include "cc/test/fake_video_frame_provider.h" |
| 47 #include "cc/test/geometry_test_utils.h" | 47 #include "cc/test/geometry_test_utils.h" |
| 48 #include "cc/test/layer_internals_for_test.h" |
| 48 #include "cc/test/layer_tree_test.h" | 49 #include "cc/test/layer_tree_test.h" |
| 49 #include "cc/test/test_shared_bitmap_manager.h" | 50 #include "cc/test/test_shared_bitmap_manager.h" |
| 50 #include "cc/test/test_web_graphics_context_3d.h" | 51 #include "cc/test/test_web_graphics_context_3d.h" |
| 51 #include "cc/trees/layer_tree_host_impl.h" | 52 #include "cc/trees/layer_tree_host_impl.h" |
| 52 #include "cc/trees/layer_tree_impl.h" | 53 #include "cc/trees/layer_tree_impl.h" |
| 53 #include "cc/trees/single_thread_proxy.h" | 54 #include "cc/trees/single_thread_proxy.h" |
| 54 #include "gpu/GLES2/gl2extchromium.h" | 55 #include "gpu/GLES2/gl2extchromium.h" |
| 55 #include "testing/gmock/include/gmock/gmock.h" | 56 #include "testing/gmock/include/gmock/gmock.h" |
| 56 #include "third_party/khronos/GLES2/gl2.h" | 57 #include "third_party/khronos/GLES2/gl2.h" |
| 57 #include "third_party/khronos/GLES2/gl2ext.h" | 58 #include "third_party/khronos/GLES2/gl2ext.h" |
| (...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 layer_tree_host()->SetRootLayer(root_); | 1110 layer_tree_host()->SetRootLayer(root_); |
| 1110 LayerTreeHostTest::SetupTree(); | 1111 LayerTreeHostTest::SetupTree(); |
| 1111 } | 1112 } |
| 1112 | 1113 |
| 1113 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 1114 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 1114 | 1115 |
| 1115 void DidCommit() override { | 1116 void DidCommit() override { |
| 1116 if (layer_tree_host()->source_frame_number() == 1) { | 1117 if (layer_tree_host()->source_frame_number() == 1) { |
| 1117 gfx::Transform scale; | 1118 gfx::Transform scale; |
| 1118 scale.Scale(2.0, 2.0); | 1119 scale.Scale(2.0, 2.0); |
| 1119 child_->OnTransformAnimated(scale); | 1120 LayerInternalsForTest(child_.get()).OnTransformAnimated(scale); |
| 1120 } | 1121 } |
| 1121 } | 1122 } |
| 1122 | 1123 |
| 1123 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { | 1124 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { |
| 1124 if (impl->sync_tree()->source_frame_number() == 0) | 1125 if (impl->sync_tree()->source_frame_number() == 0) |
| 1125 PostSetNeedsCommitToMainThread(); | 1126 PostSetNeedsCommitToMainThread(); |
| 1126 } | 1127 } |
| 1127 | 1128 |
| 1128 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* impl, | 1129 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* impl, |
| 1129 LayerTreeHostImpl::FrameData* frame_data, | 1130 LayerTreeHostImpl::FrameData* frame_data, |
| (...skipping 5561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6691 EndTest(); | 6692 EndTest(); |
| 6692 } | 6693 } |
| 6693 | 6694 |
| 6694 void AfterTest() override {} | 6695 void AfterTest() override {} |
| 6695 }; | 6696 }; |
| 6696 | 6697 |
| 6697 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6698 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
| 6698 | 6699 |
| 6699 } // namespace | 6700 } // namespace |
| 6700 } // namespace cc | 6701 } // namespace cc |
| OLD | NEW |