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

Side by Side Diff: cc/trees/proxy_impl.cc

Issue 2317953002: cc: Merge the DrawLayer()/DrawFrame() and SwapBuffers() methods. (Closed)
Patch Set: merge-draw-swap-2: rebase Created 4 years, 3 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 | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "cc/trees/proxy_impl.h" 5 #include "cc/trees/proxy_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 593
594 DrawResult result; 594 DrawResult result;
595 if (layer_tree_host_impl_->CanDraw()) { 595 if (layer_tree_host_impl_->CanDraw()) {
596 result = layer_tree_host_impl_->PrepareToDraw(&frame); 596 result = layer_tree_host_impl_->PrepareToDraw(&frame);
597 draw_frame = forced_draw || result == DRAW_SUCCESS; 597 draw_frame = forced_draw || result == DRAW_SUCCESS;
598 } else { 598 } else {
599 result = DRAW_ABORTED_CANT_DRAW; 599 result = DRAW_ABORTED_CANT_DRAW;
600 } 600 }
601 601
602 if (draw_frame) { 602 if (draw_frame) {
603 layer_tree_host_impl_->DrawLayers(&frame); 603 if (layer_tree_host_impl_->DrawLayers(&frame))
604 if (layer_tree_host_impl_->SwapBuffers(frame))
605 scheduler_->DidSwapBuffers(); 604 scheduler_->DidSwapBuffers();
606 result = DRAW_SUCCESS; 605 result = DRAW_SUCCESS;
607 } else { 606 } else {
608 DCHECK_NE(DRAW_SUCCESS, result); 607 DCHECK_NE(DRAW_SUCCESS, result);
609 } 608 }
610 609
611 layer_tree_host_impl_->DidDrawAllLayers(frame); 610 layer_tree_host_impl_->DidDrawAllLayers(frame);
612 611
613 bool start_ready_animations = draw_frame; 612 bool start_ready_animations = draw_frame;
614 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); 613 layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
(...skipping 15 matching lines...) Expand all
630 bool ProxyImpl::IsMainThreadBlocked() const { 629 bool ProxyImpl::IsMainThreadBlocked() const {
631 return task_runner_provider_->IsMainThreadBlocked(); 630 return task_runner_provider_->IsMainThreadBlocked();
632 } 631 }
633 632
634 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { 633 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() {
635 DCHECK(IsMainThreadBlocked() && commit_completion_event_); 634 DCHECK(IsMainThreadBlocked() && commit_completion_event_);
636 return main_thread_blocked_commit_vars_unsafe_; 635 return main_thread_blocked_commit_vars_unsafe_;
637 } 636 }
638 637
639 } // namespace cc 638 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698