| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/location.h" |
| 7 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "cc/layers/layer_iterator.h" | 11 #include "cc/layers/layer_iterator.h" |
| 9 #include "cc/output/copy_output_request.h" | 12 #include "cc/output/copy_output_request.h" |
| 10 #include "cc/output/copy_output_result.h" | 13 #include "cc/output/copy_output_result.h" |
| 11 #include "cc/test/fake_content_layer_client.h" | 14 #include "cc/test/fake_content_layer_client.h" |
| 12 #include "cc/test/fake_output_surface.h" | 15 #include "cc/test/fake_output_surface.h" |
| 13 #include "cc/test/fake_picture_layer.h" | 16 #include "cc/test/fake_picture_layer.h" |
| 14 #include "cc/test/layer_tree_test.h" | 17 #include "cc/test/layer_tree_test.h" |
| 15 #include "cc/trees/layer_tree_impl.h" | 18 #include "cc/trees/layer_tree_impl.h" |
| 16 #include "gpu/GLES2/gl2extchromium.h" | 19 #include "gpu/GLES2/gl2extchromium.h" |
| 17 | 20 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 40 layer_tree_host()->SetRootLayer(root); | 43 layer_tree_host()->SetRootLayer(root); |
| 41 LayerTreeHostCopyRequestTest::SetupTree(); | 44 LayerTreeHostCopyRequestTest::SetupTree(); |
| 42 client_.set_bounds(root->bounds()); | 45 client_.set_bounds(root->bounds()); |
| 43 } | 46 } |
| 44 | 47 |
| 45 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 48 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 46 | 49 |
| 47 void DidCommit() override { WaitForCallback(); } | 50 void DidCommit() override { WaitForCallback(); } |
| 48 | 51 |
| 49 void WaitForCallback() { | 52 void WaitForCallback() { |
| 50 base::MessageLoop::current()->PostTask( | 53 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 51 FROM_HERE, | 54 FROM_HERE, |
| 52 base::Bind(&LayerTreeHostCopyRequestTestMultipleRequests::NextStep, | 55 base::Bind(&LayerTreeHostCopyRequestTestMultipleRequests::NextStep, |
| 53 base::Unretained(this))); | 56 base::Unretained(this))); |
| 54 } | 57 } |
| 55 | 58 |
| 56 void NextStep() { | 59 void NextStep() { |
| 57 int frame = layer_tree_host()->source_frame_number(); | 60 int frame = layer_tree_host()->source_frame_number(); |
| 58 switch (frame) { | 61 switch (frame) { |
| 59 case 1: | 62 case 1: |
| 60 child->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest( | 63 child->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest( |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 int num_draws_; | 1267 int num_draws_; |
| 1265 bool copy_happened_; | 1268 bool copy_happened_; |
| 1266 bool draw_happened_; | 1269 bool draw_happened_; |
| 1267 }; | 1270 }; |
| 1268 | 1271 |
| 1269 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( | 1272 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F( |
| 1270 LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest); | 1273 LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest); |
| 1271 | 1274 |
| 1272 } // namespace | 1275 } // namespace |
| 1273 } // namespace cc | 1276 } // namespace cc |
| OLD | NEW |