OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/tiles/checker_image_tracker.h" | 5 #include "cc/tiles/checker_image_tracker.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 // Change the partial image to complete and try again. It should still not | 409 // Change the partial image to complete and try again. It should still not |
410 // be checkered. | 410 // be checkered. |
411 gfx::Size image_size = gfx::Size(partial_image.sk_image()->width(), | 411 gfx::Size image_size = gfx::Size(partial_image.sk_image()->width(), |
412 partial_image.sk_image()->height()); | 412 partial_image.sk_image()->height()); |
413 PaintImage completed_paint_image = | 413 PaintImage completed_paint_image = |
414 PaintImage(partial_image.stable_id(), CreateDiscardableImage(image_size)); | 414 PaintImage(partial_image.stable_id(), CreateDiscardableImage(image_size)); |
415 EXPECT_FALSE(checker_image_tracker_->ShouldCheckerImage( | 415 EXPECT_FALSE(checker_image_tracker_->ShouldCheckerImage( |
416 completed_paint_image, WhichTree::PENDING_TREE)); | 416 completed_paint_image, WhichTree::PENDING_TREE)); |
417 } | 417 } |
418 | 418 |
| 419 TEST_F(CheckerImageTrackerTest, DontCheckerDisallowedImages) { |
| 420 SetUpTracker(true); |
| 421 |
| 422 PaintImage image = CreateImage(ImageType::CHECKERABLE); |
| 423 EXPECT_TRUE(checker_image_tracker_->ShouldCheckerImage( |
| 424 image, WhichTree::PENDING_TREE)); |
| 425 checker_image_tracker_->DisallowCheckeringForImage(image); |
| 426 EXPECT_FALSE(checker_image_tracker_->ShouldCheckerImage( |
| 427 image, WhichTree::PENDING_TREE)); |
| 428 checker_image_tracker_->ClearTracker(false); |
| 429 EXPECT_FALSE(checker_image_tracker_->ShouldCheckerImage( |
| 430 image, WhichTree::PENDING_TREE)); |
| 431 } |
| 432 |
419 } // namespace | 433 } // namespace |
420 } // namespace cc | 434 } // namespace cc |
OLD | NEW |