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

Unified Diff: cc/test/fake_compositor_frame_sink.cc

Issue 2503203002: Revert "Getting rid of DelegatedFrameData" (Closed)
Patch Set: 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 a4e19cb09524645460ddbb38a17323916769b298..64ab5e35f37426658c815307992f03e7bce5603d 100644
--- a/cc/test/fake_compositor_frame_sink.cc
+++ b/cc/test/fake_compositor_frame_sink.cc
@@ -40,17 +40,23 @@ void FakeCompositorFrameSink::SubmitCompositorFrame(CompositorFrame frame) {
last_sent_frame_.reset(new CompositorFrame(std::move(frame)));
++num_sent_frames_;
- if (!last_sent_frame_->render_pass_list.empty()) {
- last_swap_rect_ = last_sent_frame_->render_pass_list.back()->damage_rect;
+ 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;
last_swap_rect_valid_ = true;
} else {
last_swap_rect_ = gfx::Rect();
last_swap_rect_valid_ = false;
}
- resources_held_by_parent_.insert(resources_held_by_parent_.end(),
- last_sent_frame_->resource_list.begin(),
- last_sent_frame_->resource_list.end());
+ 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());
+ }
+ }
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
@@ -63,7 +69,9 @@ void FakeCompositorFrameSink::DidReceiveCompositorFrameAck() {
}
void FakeCompositorFrameSink::ReturnResourcesHeldByParent() {
- if (last_sent_frame_) {
+ // 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) {
// 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