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

Side by Side Diff: content/renderer/render_widget.cc

Issue 925353002: Make commit for swap promises do not set can_cancel_commit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and comment Created 5 years, 10 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
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698