OLD | NEW |
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_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 frame_connector_->SetChildFrameSurface(surface_id_, frame_size, | 415 frame_connector_->SetChildFrameSurface(surface_id_, frame_size, |
416 scale_factor, sequence); | 416 scale_factor, sequence); |
417 } | 417 } |
418 | 418 |
419 cc::SurfaceFactory::DrawCallback ack_callback = | 419 cc::SurfaceFactory::DrawCallback ack_callback = |
420 base::Bind(&RenderWidgetHostViewChildFrame::SurfaceDrawn, AsWeakPtr(), | 420 base::Bind(&RenderWidgetHostViewChildFrame::SurfaceDrawn, AsWeakPtr(), |
421 output_surface_id); | 421 output_surface_id); |
422 ack_pending_count_++; | 422 ack_pending_count_++; |
423 // If this value grows very large, something is going wrong. | 423 // If this value grows very large, something is going wrong. |
424 DCHECK_LT(ack_pending_count_, 1000U); | 424 DCHECK_LT(ack_pending_count_, 1000U); |
425 std::unique_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame); | 425 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame), |
426 *frame_copy = std::move(frame); | |
427 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame_copy), | |
428 ack_callback); | 426 ack_callback); |
429 | 427 |
430 ProcessFrameSwappedCallbacks(); | 428 ProcessFrameSwappedCallbacks(); |
431 } | 429 } |
432 | 430 |
433 void RenderWidgetHostViewChildFrame::ProcessFrameSwappedCallbacks() { | 431 void RenderWidgetHostViewChildFrame::ProcessFrameSwappedCallbacks() { |
434 // We only use callbacks once, therefore we make a new list for registration | 432 // We only use callbacks once, therefore we make a new list for registration |
435 // before we start, and discard the old list entries when we are done. | 433 // before we start, and discard the old list entries when we are done. |
436 FrameSwappedCallbackList process_callbacks; | 434 FrameSwappedCallbackList process_callbacks; |
437 process_callbacks.swap(frame_swapped_callbacks_); | 435 process_callbacks.swap(frame_swapped_callbacks_); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 | 692 |
695 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { | 693 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { |
696 return true; | 694 return true; |
697 } | 695 } |
698 | 696 |
699 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 697 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
700 return surface_id_; | 698 return surface_id_; |
701 }; | 699 }; |
702 | 700 |
703 } // namespace content | 701 } // namespace content |
OLD | NEW |