| 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/location.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 case 1: | 1237 case 1: |
| 1238 // Only the root layer draws, the child is hidden. | 1238 // Only the root layer draws, the child is hidden. |
| 1239 EXPECT_TRUE(saw_root); | 1239 EXPECT_TRUE(saw_root); |
| 1240 EXPECT_FALSE(saw_child); | 1240 EXPECT_FALSE(saw_child); |
| 1241 break; | 1241 break; |
| 1242 case 2: | 1242 case 2: |
| 1243 // Copy happening here, the child will draw. | 1243 // Copy happening here, the child will draw. |
| 1244 EXPECT_TRUE(saw_root); | 1244 EXPECT_TRUE(saw_root); |
| 1245 EXPECT_TRUE(saw_child); | 1245 EXPECT_TRUE(saw_child); |
| 1246 // Make another draw happen after doing the copy request. | 1246 // Make another draw happen after doing the copy request. |
| 1247 host_impl->SetNeedsRedrawRect(gfx::Rect(1, 1)); | 1247 host_impl->SetViewportDamage(gfx::Rect(1, 1)); |
| 1248 host_impl->SetNeedsRedraw(); |
| 1248 break; | 1249 break; |
| 1249 case 3: | 1250 case 3: |
| 1250 // If LayerTreeHostImpl does the wrong thing, it will try to draw the | 1251 // If LayerTreeHostImpl does the wrong thing, it will try to draw the |
| 1251 // layer which had a copy request. But only the root should draw. | 1252 // layer which had a copy request. But only the root should draw. |
| 1252 EXPECT_TRUE(saw_root); | 1253 EXPECT_TRUE(saw_root); |
| 1253 EXPECT_FALSE(saw_child); | 1254 EXPECT_FALSE(saw_child); |
| 1254 | 1255 |
| 1255 // End the test! Don't race with copy request callbacks, so post the end | 1256 // End the test! Don't race with copy request callbacks, so post the end |
| 1256 // to the main thread. | 1257 // to the main thread. |
| 1257 draw_happened_ = true; | 1258 draw_happened_ = true; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1284 int num_draws_; | 1285 int num_draws_; |
| 1285 bool copy_happened_; | 1286 bool copy_happened_; |
| 1286 bool draw_happened_; | 1287 bool draw_happened_; |
| 1287 }; | 1288 }; |
| 1288 | 1289 |
| 1289 SINGLE_AND_MULTI_THREAD_TEST_F( | 1290 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 1290 LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest); | 1291 LayerTreeHostCopyRequestTestMultipleDrawsHiddenCopyRequest); |
| 1291 | 1292 |
| 1292 } // namespace | 1293 } // namespace |
| 1293 } // namespace cc | 1294 } // namespace cc |
| OLD | NEW |