OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 | 1433 |
1434 scoped_ptr<cc::SwapPromise> swap_promise = | 1434 scoped_ptr<cc::SwapPromise> swap_promise = |
1435 QueueMessageImpl(msg, | 1435 QueueMessageImpl(msg, |
1436 policy, | 1436 policy, |
1437 frame_swap_message_queue_.get(), | 1437 frame_swap_message_queue_.get(), |
1438 RenderThreadImpl::current()->sync_message_filter(), | 1438 RenderThreadImpl::current()->sync_message_filter(), |
1439 compositor_->GetSourceFrameNumber()); | 1439 compositor_->GetSourceFrameNumber()); |
1440 | 1440 |
1441 if (swap_promise) { | 1441 if (swap_promise) { |
1442 compositor_->QueueSwapPromise(swap_promise.Pass()); | 1442 compositor_->QueueSwapPromise(swap_promise.Pass()); |
1443 compositor_->SetNeedsCommit(); | 1443 // Request a commit. This might either A) request a commit ahead of time |
| 1444 // or B) request a commit which is not needed because there are not |
| 1445 // pending updates. If B) then the commit will be skipped and the swap |
| 1446 // promises will be broken (see EarlyOut_NoUpdates). To achieve that we |
| 1447 // call SetNeedsUpdateLayers instead of SetNeedsCommit so that |
| 1448 // can_cancel_commit is not unset. |
| 1449 compositor_->SetNeedsUpdateLayers(); |
1444 } | 1450 } |
1445 } | 1451 } |
1446 | 1452 |
1447 void RenderWidget::didCommitAndDrawCompositorFrame() { | 1453 void RenderWidget::didCommitAndDrawCompositorFrame() { |
1448 // NOTE: Tests may break if this event is renamed or moved. See | 1454 // NOTE: Tests may break if this event is renamed or moved. See |
1449 // tab_capture_performancetest.cc. | 1455 // tab_capture_performancetest.cc. |
1450 TRACE_EVENT0("gpu", "RenderWidget::didCommitAndDrawCompositorFrame"); | 1456 TRACE_EVENT0("gpu", "RenderWidget::didCommitAndDrawCompositorFrame"); |
1451 // Notify subclasses that we initiated the paint operation. | 1457 // Notify subclasses that we initiated the paint operation. |
1452 DidInitiatePaint(); | 1458 DidInitiatePaint(); |
1453 } | 1459 } |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2411 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2417 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2412 video_hole_frames_.AddObserver(frame); | 2418 video_hole_frames_.AddObserver(frame); |
2413 } | 2419 } |
2414 | 2420 |
2415 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2421 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2416 video_hole_frames_.RemoveObserver(frame); | 2422 video_hole_frames_.RemoveObserver(frame); |
2417 } | 2423 } |
2418 #endif // defined(VIDEO_HOLE) | 2424 #endif // defined(VIDEO_HOLE) |
2419 | 2425 |
2420 } // namespace content | 2426 } // namespace content |
OLD | NEW |