Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(746)

Unified Diff: cc/test/fake_compositor_frame_sink.cc

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: nit Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/surfaces_pixeltest.cc ('k') | cc/test/surface_aggregator_test_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 64ab5e35f37426658c815307992f03e7bce5603d..a4e19cb09524645460ddbb38a17323916769b298 100644
--- a/cc/test/fake_compositor_frame_sink.cc
+++ b/cc/test/fake_compositor_frame_sink.cc
@@ -40,23 +40,17 @@ 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());
- }
- }
+ 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(
FROM_HERE,
@@ -69,9 +63,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_)
« no previous file with comments | « cc/surfaces/surfaces_pixeltest.cc ('k') | cc/test/surface_aggregator_test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698