OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 case 3: | 365 case 3: |
366 if (!delegating_renderer() && | 366 if (!delegating_renderer() && |
367 !host_impl->settings().impl_side_painting) { | 367 !host_impl->settings().impl_side_painting) { |
368 // The update rect in the child should be damaged. | 368 // The update rect in the child should be damaged. |
369 // TODO(danakj): Remove this when impl side painting is always on. | 369 // TODO(danakj): Remove this when impl side painting is always on. |
370 EXPECT_EQ(gfx::RectF(100+10, 100+11, 12, 13).ToString(), | 370 EXPECT_EQ(gfx::RectF(100+10, 100+11, 12, 13).ToString(), |
371 root_damage.ToString()); | 371 root_damage.ToString()); |
372 } else { | 372 } else { |
373 // When using a delegating renderer, or using impl side painting, the | 373 // When using a delegating renderer, or using impl side painting, the |
374 // entire child is considered damaged as we need to replace its | 374 // entire child is considered damaged as we need to replace its |
375 // resources with newly created ones. | 375 // resources with newly created ones. The damaged area is kept as it |
376 EXPECT_EQ(gfx::RectF(child_->position(), child_->bounds()).ToString(), | 376 // is, but entire child is painted. |
377 | |
378 // Verify damage area. | |
danakj
2013/12/02 15:09:49
Instead of saying "Verify damage area" which is cl
| |
379 EXPECT_EQ(gfx::RectF(100+10, 100+11, 12, 13).ToString(), | |
377 root_damage.ToString()); | 380 root_damage.ToString()); |
381 // Verify paint area. | |
danakj
2013/12/02 15:09:49
Same here, say what you're expecting or why rather
| |
382 gfx::RectF paint_rect = static_cast<gfx::RectF> | |
danakj
2013/12/02 15:06:52
You don't need to cast from Rect to RectF
| |
383 (child_->Updater()->content_rect()); | |
384 EXPECT_EQ((gfx::RectF(child_->bounds()).ToString()), | |
danakj
2013/12/02 15:06:52
you don't need () around the RectF.ToString() call
| |
385 paint_rect.ToString()); | |
prashant.n
2013/12/02 14:30:48
Do we need this as we can verify with actual value
| |
386 paint_rect.set_origin(child_->position()); | |
387 EXPECT_EQ(gfx::RectF(100, 100, 30, 30).ToString(), | |
388 paint_rect.ToString()); | |
389 EXPECT_FALSE(root_damage.Contains(paint_rect)); | |
prashant.n
2013/12/02 14:30:48
Should we verify this, as we have verified with ac
danakj
2013/12/02 15:06:52
I think the above check against layer->bounds() is
| |
378 } | 390 } |
379 EXPECT_FALSE(frame_data->has_no_damage); | 391 EXPECT_FALSE(frame_data->has_no_damage); |
380 | 392 |
381 // If we damage part of the frame, but also damage the full | 393 // If we damage part of the frame, but also damage the full |
382 // frame, then the whole frame should be damaged. | 394 // frame, then the whole frame should be damaged. |
383 child_damage_rect_ = gfx::RectF(10, 11, 12, 13); | 395 child_damage_rect_ = gfx::RectF(10, 11, 12, 13); |
384 host_impl->SetFullRootLayerDamage(); | 396 host_impl->SetFullRootLayerDamage(); |
385 break; | 397 break; |
386 case 4: | 398 case 4: |
387 // The whole frame is damaged. | 399 // The whole frame is damaged. |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
686 FakeContentLayerClient client_; | 698 FakeContentLayerClient client_; |
687 int swap_count_; | 699 int swap_count_; |
688 int prepare_to_draw_count_; | 700 int prepare_to_draw_count_; |
689 int update_visible_tile_count_; | 701 int update_visible_tile_count_; |
690 }; | 702 }; |
691 | 703 |
692 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestVisibleTilesStillTriggerDraws); | 704 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestVisibleTilesStillTriggerDraws); |
693 | 705 |
694 } // namespace | 706 } // namespace |
695 } // namespace cc | 707 } // namespace cc |
OLD | NEW |