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

Unified Diff: cc/surfaces/surface_aggregator.cc

Issue 2098953003: Make cc::CompositorFrames movable [Part 2 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android compiles locally 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
Index: cc/surfaces/surface_aggregator.cc
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index 066ffc8adb902fb4f194d3c9fae5ae64c64d6a16..0de6f290bce57d70ac94dc26cdd544d15a68375a 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -770,23 +770,20 @@ void SurfaceAggregator::PropagateCopyRequestPasses() {
}
}
-std::unique_ptr<CompositorFrame> SurfaceAggregator::Aggregate(
- SurfaceId surface_id) {
+CompositorFrame SurfaceAggregator::Aggregate(SurfaceId surface_id) {
Surface* surface = manager_->GetSurfaceForId(surface_id);
DCHECK(surface);
contained_surfaces_[surface_id] = surface->frame_index();
const CompositorFrame* root_surface_frame = surface->GetEligibleFrame();
- if (!root_surface_frame)
- return nullptr;
+ if (!root_surface_frame->delegated_frame_data)
+ return CompositorFrame();
TRACE_EVENT0("cc", "SurfaceAggregator::Aggregate");
- std::unique_ptr<CompositorFrame> frame(new CompositorFrame);
- frame->delegated_frame_data = base::WrapUnique(new DelegatedFrameData);
-
- DCHECK(root_surface_frame->delegated_frame_data);
+ CompositorFrame frame;
+ frame.delegated_frame_data = base::WrapUnique(new DelegatedFrameData);
- dest_resource_list_ = &frame->delegated_frame_data->resource_list;
- dest_pass_list_ = &frame->delegated_frame_data->render_pass_list;
+ dest_resource_list_ = &frame.delegated_frame_data->resource_list;
+ dest_pass_list_ = &frame.delegated_frame_data->render_pass_list;
valid_surfaces_.clear();
PrewalkResult prewalk_result;
@@ -807,7 +804,7 @@ std::unique_ptr<CompositorFrame> SurfaceAggregator::Aggregate(
DCHECK(referenced_surfaces_.empty());
if (dest_pass_list_->empty())
- return nullptr;
+ return CompositorFrame();
dest_pass_list_ = NULL;
ProcessAddedAndRemovedSurfaces();
@@ -819,7 +816,7 @@ std::unique_ptr<CompositorFrame> SurfaceAggregator::Aggregate(
++it) {
Surface* surface = manager_->GetSurfaceForId(it->first);
if (surface)
- surface->TakeLatencyInfo(&frame->metadata.latency_info);
+ surface->TakeLatencyInfo(&frame.metadata.latency_info);
}
// TODO(jamesr): Aggregate all resource references into the returned frame's

Powered by Google App Engine
This is Rietveld 408576698