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

Unified Diff: cc/trees/proxy_impl.cc

Issue 2409923002: cc: Rename SwapBuffers on CompositorFrameSink to SubmitCompositorFrame (Closed)
Patch Set: swap-to-submit: rebase Created 4 years, 2 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
« no previous file with comments | « cc/trees/proxy_impl.h ('k') | cc/trees/proxy_main.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/proxy_impl.cc
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc
index 659ff5c9ab13a2c1fea5c57a61b620943f47858e..1f712a3e2816b4e05db00e3e175ba01484fe53b7 100644
--- a/cc/trees/proxy_impl.cc
+++ b/cc/trees/proxy_impl.cc
@@ -268,11 +268,12 @@ void ProxyImpl::SetBeginFrameSource(BeginFrameSource* source) {
}
}
-void ProxyImpl::DidSwapBuffersCompleteOnImplThread() {
- TRACE_EVENT0("cc,benchmark", "ProxyImpl::DidSwapBuffersCompleteOnImplThread");
+void ProxyImpl::DidReceiveCompositorFrameAckOnImplThread() {
+ TRACE_EVENT0("cc,benchmark",
+ "ProxyImpl::DidReceiveCompositorFrameAckOnImplThread");
DCHECK(IsImplThread());
- scheduler_->DidSwapBuffersComplete();
- channel_impl_->DidCompleteSwapBuffers();
+ scheduler_->DidReceiveCompositorFrameAck();
+ channel_impl_->DidReceiveCompositorFrameAck();
}
void ProxyImpl::OnCanDrawStateChanged(bool can_draw) {
@@ -448,24 +449,22 @@ void ProxyImpl::ScheduledActionSendBeginMainFrame(const BeginFrameArgs& args) {
devtools_instrumentation::DidRequestMainThreadFrame(layer_tree_host_id_);
}
-DrawResult ProxyImpl::ScheduledActionDrawAndSwapIfPossible() {
- TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionDrawAndSwap");
+DrawResult ProxyImpl::ScheduledActionDrawIfPossible() {
+ TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionDraw");
DCHECK(IsImplThread());
- // SchedulerStateMachine::DidDrawIfPossibleCompleted isn't set up to
- // handle DRAW_ABORTED_CANT_DRAW. Moreover, the scheduler should
- // never generate this call when it can't draw.
+ // The scheduler should never generate this call when it can't draw.
DCHECK(layer_tree_host_impl_->CanDraw());
bool forced_draw = false;
- return DrawAndSwapInternal(forced_draw);
+ return DrawInternal(forced_draw);
}
-DrawResult ProxyImpl::ScheduledActionDrawAndSwapForced() {
- TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionDrawAndSwapForced");
+DrawResult ProxyImpl::ScheduledActionDrawForced() {
+ TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionDrawForced");
DCHECK(IsImplThread());
bool forced_draw = true;
- return DrawAndSwapInternal(forced_draw);
+ return DrawInternal(forced_draw);
}
void ProxyImpl::ScheduledActionCommit() {
@@ -538,8 +537,8 @@ void ProxyImpl::SendBeginMainFrameNotExpectedSoon() {
channel_impl_->BeginMainFrameNotExpectedSoon();
}
-DrawResult ProxyImpl::DrawAndSwapInternal(bool forced_draw) {
- TRACE_EVENT_SYNTHETIC_DELAY("cc.DrawAndSwap");
+DrawResult ProxyImpl::DrawInternal(bool forced_draw) {
+ TRACE_EVENT_SYNTHETIC_DELAY("cc.Draw");
DCHECK(IsImplThread());
DCHECK(layer_tree_host_impl_.get());
@@ -576,7 +575,8 @@ DrawResult ProxyImpl::DrawAndSwapInternal(bool forced_draw) {
if (draw_frame) {
if (layer_tree_host_impl_->DrawLayers(&frame))
- scheduler_->DidSwapBuffers();
+ // Drawing implies we submitted a frame to the CompositorFrameSink.
+ scheduler_->DidSubmitCompositorFrame();
result = DRAW_SUCCESS;
} else {
DCHECK_NE(DRAW_SUCCESS, result);
« no previous file with comments | « cc/trees/proxy_impl.h ('k') | cc/trees/proxy_main.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698