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

Unified Diff: cc/test/fake_output_surface.cc

Issue 2374183006: Remove GLFrameData from CompositorFrame. (Closed)
Patch Set: Rebase + fix includes. Created 4 years, 2 months 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
Index: cc/test/fake_output_surface.cc
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
index f124764458ae3db707558f207689985fb55c3433..7d5a296b32e4d26de065c3d1320f6fd454212b6b 100644
--- a/cc/test/fake_output_surface.cc
+++ b/cc/test/fake_output_surface.cc
@@ -23,18 +23,12 @@ FakeOutputSurface::FakeOutputSurface(
FakeOutputSurface::~FakeOutputSurface() = default;
-void FakeOutputSurface::SwapBuffers(CompositorFrame frame) {
- ReturnResourcesHeldByParent();
-
- last_sent_frame_.reset(new CompositorFrame(std::move(frame)));
+void FakeOutputSurface::SwapBuffers(OutputSurfaceFrame frame) {
+ last_sent_frame_.reset(new OutputSurfaceFrame(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;
- last_swap_rect_valid_ = true;
- } else if (context_provider()) {
- last_swap_rect_ = last_sent_frame_->gl_frame_data->sub_buffer_rect;
+ if (context_provider()) {
+ last_swap_rect_ = last_sent_frame_->sub_buffer_rect;
last_swap_rect_valid_ = true;
} else {
// Unknown for direct software frames.
@@ -42,15 +36,6 @@ void FakeOutputSurface::SwapBuffers(CompositorFrame frame) {
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());
- }
- }
-
PostSwapBuffersComplete();
}
@@ -95,17 +80,4 @@ unsigned FakeOutputSurface::GetOverlayTextureId() const {
return 0;
}
-void FakeOutputSurface::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) {
- // Return the last frame's resources immediately.
- ReturnedResourceArray resources;
- for (const auto& resource : resources_held_by_parent_)
- resources.push_back(resource.ToReturnedResource());
- resources_held_by_parent_.clear();
- client_->ReclaimResources(resources);
- }
-}
-
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698