| 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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 break; | 583 break; |
| 584 case 19: | 584 case 19: |
| 585 // Set another new frame, both layers should be damaged in the same | 585 // Set another new frame, both layers should be damaged in the same |
| 586 // ways. | 586 // ways. |
| 587 SetFrameData( | 587 SetFrameData( |
| 588 CreateFrameData(gfx::Rect(0, 0, 10, 10), gfx::Rect(3, 3, 1, 1))); | 588 CreateFrameData(gfx::Rect(0, 0, 10, 10), gfx::Rect(3, 3, 1, 1))); |
| 589 } | 589 } |
| 590 first_draw_for_source_frame_ = true; | 590 first_draw_for_source_frame_ = true; |
| 591 } | 591 } |
| 592 | 592 |
| 593 virtual DrawSwapReadbackResult::DrawResult PrepareToDrawOnThread( | 593 virtual DrawResult PrepareToDrawOnThread( |
| 594 LayerTreeHostImpl* host_impl, | 594 LayerTreeHostImpl* host_impl, |
| 595 LayerTreeHostImpl::FrameData* frame, | 595 LayerTreeHostImpl::FrameData* frame, |
| 596 DrawSwapReadbackResult::DrawResult draw_result) OVERRIDE { | 596 DrawResult draw_result) OVERRIDE { |
| 597 EXPECT_EQ(DrawSwapReadbackResult::DRAW_SUCCESS, draw_result); | 597 EXPECT_EQ(DRAW_SUCCESS, draw_result); |
| 598 | 598 |
| 599 if (!first_draw_for_source_frame_) | 599 if (!first_draw_for_source_frame_) |
| 600 return draw_result; | 600 return draw_result; |
| 601 | 601 |
| 602 gfx::Rect damage_rect; | 602 gfx::Rect damage_rect; |
| 603 if (!frame->has_no_damage) { | 603 if (!frame->has_no_damage) { |
| 604 damage_rect = frame->render_passes.back()->damage_rect; | 604 damage_rect = frame->render_passes.back()->damage_rect; |
| 605 } else { | 605 } else { |
| 606 // If there is no damage, then we have no render passes to send. | 606 // If there is no damage, then we have no render passes to send. |
| 607 EXPECT_TRUE(frame->render_passes.empty()); | 607 EXPECT_TRUE(frame->render_passes.empty()); |
| (...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2196 } | 2196 } |
| 2197 | 2197 |
| 2198 scoped_refptr<DelegatedRendererLayer> delegated_thief_; | 2198 scoped_refptr<DelegatedRendererLayer> delegated_thief_; |
| 2199 }; | 2199 }; |
| 2200 | 2200 |
| 2201 SINGLE_AND_MULTI_THREAD_TEST_F( | 2201 SINGLE_AND_MULTI_THREAD_TEST_F( |
| 2202 LayerTreeHostDelegatedTestRemoveAndChangeResources); | 2202 LayerTreeHostDelegatedTestRemoveAndChangeResources); |
| 2203 | 2203 |
| 2204 } // namespace | 2204 } // namespace |
| 2205 } // namespace cc | 2205 } // namespace cc |
| OLD | NEW |