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

Unified Diff: components/mus/ws/platform_display.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: components/mus/ws/platform_display.cc
diff --git a/components/mus/ws/platform_display.cc b/components/mus/ws/platform_display.cc
index a6113c4a07a2d7e56f1132a070ce1b0eab7b6032..2ff795e27b1eae907673c400486313e259a6e587 100644
--- a/components/mus/ws/platform_display.cc
+++ b/components/mus/ws/platform_display.cc
@@ -258,7 +258,7 @@ void DefaultPlatformDisplay::Draw() {
return;
// TODO(fsamuel): We should add a trace for generating a top level frame.
- std::unique_ptr<cc::CompositorFrame> frame(GenerateCompositorFrame());
+ cc::CompositorFrame frame(GenerateCompositorFrame());
frame_pending_ = true;
if (display_compositor_) {
display_compositor_->SubmitCompositorFrame(
@@ -307,8 +307,7 @@ void DefaultPlatformDisplay::UpdateMetrics(const gfx::Size& size,
delegate_->OnViewportMetricsChanged(old_metrics, metrics_);
}
-std::unique_ptr<cc::CompositorFrame>
-DefaultPlatformDisplay::GenerateCompositorFrame() {
+cc::CompositorFrame DefaultPlatformDisplay::GenerateCompositorFrame() {
std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create();
render_pass->damage_rect = dirty_rect_;
render_pass->output_rect = gfx::Rect(metrics_.size_in_pixels);
@@ -321,8 +320,8 @@ DefaultPlatformDisplay::GenerateCompositorFrame() {
frame_data->device_scale_factor = metrics_.device_scale_factor;
frame_data->render_pass_list.push_back(std::move(render_pass));
- std::unique_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame);
- frame->delegated_frame_data = std::move(frame_data);
+ cc::CompositorFrame frame;
+ frame.delegated_frame_data = std::move(frame_data);
return frame;
}

Powered by Google App Engine
This is Rietveld 408576698