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

Side by Side Diff: content/browser/frame_host/render_widget_host_view_guest.cc

Issue 2098953003: Make cc::CompositorFrames movable [Part 2 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed exo unittests Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_widget_host_view_guest.h" 5 #include "content/browser/frame_host/render_widget_host_view_guest.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 guest_->SetChildFrameSurface(surface_id_, frame_size, scale_factor, 275 guest_->SetChildFrameSurface(surface_id_, frame_size, scale_factor,
276 sequence); 276 sequence);
277 } 277 }
278 278
279 cc::SurfaceFactory::DrawCallback ack_callback = base::Bind( 279 cc::SurfaceFactory::DrawCallback ack_callback = base::Bind(
280 &RenderWidgetHostViewChildFrame::SurfaceDrawn, 280 &RenderWidgetHostViewChildFrame::SurfaceDrawn,
281 RenderWidgetHostViewChildFrame::AsWeakPtr(), output_surface_id); 281 RenderWidgetHostViewChildFrame::AsWeakPtr(), output_surface_id);
282 ack_pending_count_++; 282 ack_pending_count_++;
283 // If this value grows very large, something is going wrong. 283 // If this value grows very large, something is going wrong.
284 DCHECK(ack_pending_count_ < 1000); 284 DCHECK(ack_pending_count_ < 1000);
285 std::unique_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame); 285 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame),
286 *frame_copy = std::move(frame);
287 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame_copy),
288 ack_callback); 286 ack_callback);
289 287
290 ProcessFrameSwappedCallbacks(); 288 ProcessFrameSwappedCallbacks();
291 289
292 // If after detaching we are sent a frame, we should finish processing it, and 290 // If after detaching we are sent a frame, we should finish processing it, and
293 // then we should clear the surface so that we are not holding resources we 291 // then we should clear the surface so that we are not holding resources we
294 // no longer need. 292 // no longer need.
295 if (!guest_ || !guest_->attached()) 293 if (!guest_ || !guest_->attached())
296 ClearCompositorSurfaceIfNecessary(); 294 ClearCompositorSurfaceIfNecessary();
297 } 295 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 gesture_event.data.scrollUpdate.inertialPhase == 592 gesture_event.data.scrollUpdate.inertialPhase ==
595 blink::WebGestureEvent::MomentumPhase) { 593 blink::WebGestureEvent::MomentumPhase) {
596 return; 594 return;
597 } 595 }
598 host_->ForwardGestureEvent(gesture_event); 596 host_->ForwardGestureEvent(gesture_event);
599 return; 597 return;
600 } 598 }
601 } 599 }
602 600
603 } // namespace content 601 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698