Chromium Code Reviews| Index: cc/test/fake_compositor_frame_sink.cc |
| diff --git a/cc/test/fake_compositor_frame_sink.cc b/cc/test/fake_compositor_frame_sink.cc |
| index aa01fb871f7258602cc390c1bfe8e252eeb90e88..50cab465ce4f724c66198258dad0b7d08e541d49 100644 |
| --- a/cc/test/fake_compositor_frame_sink.cc |
| +++ b/cc/test/fake_compositor_frame_sink.cc |
| @@ -33,22 +33,18 @@ void FakeCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) { |
| last_sent_frame_.reset(new CompositorFrame(std::move(frame))); |
| ++num_sent_frames_; |
| - if (last_sent_frame_->delegated_frame_data) { |
| - auto* frame_data = last_sent_frame_->delegated_frame_data.get(); |
| - last_swap_rect_ = frame_data->render_pass_list.back()->damage_rect; |
| + if (!last_sent_frame_->render_pass_list.empty()) { |
| + last_swap_rect_ = last_sent_frame_->render_pass_list.back()->damage_rect; |
| last_swap_rect_valid_ = true; |
| } else { |
| last_swap_rect_ = gfx::Rect(); |
| last_swap_rect_valid_ = false; |
| } |
| - if (last_sent_frame_->delegated_frame_data || !context_provider()) { |
| - if (last_sent_frame_->delegated_frame_data) { |
| - auto* frame_data = last_sent_frame_->delegated_frame_data.get(); |
| - resources_held_by_parent_.insert(resources_held_by_parent_.end(), |
| - frame_data->resource_list.begin(), |
| - frame_data->resource_list.end()); |
| - } |
| + if (!last_sent_frame_->resource_list.empty()) { |
|
danakj
2016/10/27 23:06:57
dont need this if at all, begin() and end() will d
Saman Sami
2016/10/28 16:47:36
Done.
|
| + resources_held_by_parent_.insert(resources_held_by_parent_.end(), |
| + last_sent_frame_->resource_list.begin(), |
| + last_sent_frame_->resource_list.end()); |
| } |
| base::ThreadTaskRunnerHandle::Get()->PostTask( |
| @@ -62,9 +58,7 @@ void FakeCompositorFrameSink::DidReceiveCompositorFrameAck() { |
| } |
| void FakeCompositorFrameSink::ReturnResourcesHeldByParent() { |
| - // Check |delegated_frame_data| because we shouldn't reclaim resources |
| - // for the Display which does not swap delegated frames. |
| - if (last_sent_frame_ && last_sent_frame_->delegated_frame_data) { |
| + if (last_sent_frame_) { |
| // Return the last frame's resources immediately. |
| ReturnedResourceArray resources; |
| for (const auto& resource : resources_held_by_parent_) |