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

Unified Diff: cc/test/fake_output_surface.cc

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nits Created 4 years, 6 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
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/pixel_test_delegating_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_output_surface.cc
diff --git a/cc/test/fake_output_surface.cc b/cc/test/fake_output_surface.cc
index 3408964ff5708586ee7c6dec89beda6a648f2a08..f8a9b7cb6e0a40f83a2b2677ac338086bb92f54a 100644
--- a/cc/test/fake_output_surface.cc
+++ b/cc/test/fake_output_surface.cc
@@ -44,21 +44,23 @@ FakeOutputSurface::FakeOutputSurface(
FakeOutputSurface::~FakeOutputSurface() {}
-void FakeOutputSurface::SwapBuffers(CompositorFrame* frame) {
- if (frame->delegated_frame_data || !context_provider()) {
- frame->AssignTo(&last_sent_frame_);
+void FakeOutputSurface::SwapBuffers(CompositorFrame frame) {
+ std::unique_ptr<CompositorFrame> frame_copy(new CompositorFrame);
+ *frame_copy = std::move(frame);
+ if (frame_copy->delegated_frame_data || !context_provider()) {
+ last_sent_frame_ = std::move(frame_copy);
- if (last_sent_frame_.delegated_frame_data) {
+ if (last_sent_frame_->delegated_frame_data) {
resources_held_by_parent_.insert(
resources_held_by_parent_.end(),
- last_sent_frame_.delegated_frame_data->resource_list.begin(),
- last_sent_frame_.delegated_frame_data->resource_list.end());
+ last_sent_frame_->delegated_frame_data->resource_list.begin(),
+ last_sent_frame_->delegated_frame_data->resource_list.end());
}
++num_sent_frames_;
} else {
- last_swap_rect_ = frame->gl_frame_data->sub_buffer_rect;
- frame->AssignTo(&last_sent_frame_);
+ last_swap_rect_ = frame_copy->gl_frame_data->sub_buffer_rect;
+ last_sent_frame_ = std::move(frame_copy);
++num_sent_frames_;
}
PostSwapBuffersComplete();
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/pixel_test_delegating_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698