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

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

Issue 16863005: cc: Add BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc12
Patch Set: Rebase Created 7 years, 6 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.h ('k') | cc/trees/layer_tree_host_impl_unittest.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 const gfx::Transform& transform, 1065 const gfx::Transform& transform,
1066 gfx::Rect viewport) { 1066 gfx::Rect viewport) {
1067 external_transform_ = transform; 1067 external_transform_ = transform;
1068 external_viewport_ = viewport; 1068 external_viewport_ = viewport;
1069 } 1069 }
1070 1070
1071 void LayerTreeHostImpl::SetNeedsRedrawRect(gfx::Rect damage_rect) { 1071 void LayerTreeHostImpl::SetNeedsRedrawRect(gfx::Rect damage_rect) {
1072 client_->SetNeedsRedrawRectOnImplThread(damage_rect); 1072 client_->SetNeedsRedrawRectOnImplThread(damage_rect);
1073 } 1073 }
1074 1074
1075 void LayerTreeHostImpl::BeginFrame(base::TimeTicks frame_time) { 1075 void LayerTreeHostImpl::BeginFrame(const BeginFrameArgs& args) {
1076 client_->BeginFrameOnImplThread(frame_time); 1076 client_->BeginFrameOnImplThread(args);
1077 } 1077 }
1078 1078
1079 void LayerTreeHostImpl::OnSwapBuffersComplete( 1079 void LayerTreeHostImpl::OnSwapBuffersComplete(
1080 const CompositorFrameAck* ack) { 1080 const CompositorFrameAck* ack) {
1081 // TODO(piman): We may need to do some validation on this ack before 1081 // TODO(piman): We may need to do some validation on this ack before
1082 // processing it. 1082 // processing it.
1083 if (ack && renderer_) 1083 if (ack && renderer_)
1084 renderer_->ReceiveSwapBuffersAck(*ack); 1084 renderer_->ReceiveSwapBuffersAck(*ack);
1085 1085
1086 client_->OnSwapBuffersCompleteOnImplThread(); 1086 client_->OnSwapBuffersCompleteOnImplThread();
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 1519
1520 output_surface->InitializeBeginFrameEmulation( 1520 output_surface->InitializeBeginFrameEmulation(
1521 proxy_->ImplThread() ? proxy_->ImplThread()->TaskRunner() : NULL, 1521 proxy_->ImplThread() ? proxy_->ImplThread()->TaskRunner() : NULL,
1522 settings_.throttle_frame_production, 1522 settings_.throttle_frame_production,
1523 display_refresh_interval); 1523 display_refresh_interval);
1524 } 1524 }
1525 1525
1526 int max_frames_pending = 1526 int max_frames_pending =
1527 output_surface->capabilities().max_frames_pending; 1527 output_surface->capabilities().max_frames_pending;
1528 if (max_frames_pending <= 0) 1528 if (max_frames_pending <= 0)
1529 max_frames_pending = FrameRateController::DEFAULT_MAX_FRAMES_PENDING; 1529 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING;
1530 output_surface->SetMaxFramesPending(max_frames_pending); 1530 output_surface->SetMaxFramesPending(max_frames_pending);
1531 1531
1532 output_surface_ = output_surface.Pass(); 1532 output_surface_ = output_surface.Pass();
1533 1533
1534 if (!visible_) 1534 if (!visible_)
1535 renderer_->SetVisible(visible_); 1535 renderer_->SetVisible(visible_);
1536 1536
1537 client_->OnCanDrawStateChanged(CanDraw()); 1537 client_->OnCanDrawStateChanged(CanDraw());
1538 1538
1539 // See note in LayerTreeImpl::UpdateDrawProperties. Renderer needs 1539 // See note in LayerTreeImpl::UpdateDrawProperties. Renderer needs
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 } 2337 }
2338 2338
2339 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2339 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2340 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2340 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2341 paint_time_counter_->ClearHistory(); 2341 paint_time_counter_->ClearHistory();
2342 2342
2343 debug_state_ = debug_state; 2343 debug_state_ = debug_state;
2344 } 2344 }
2345 2345
2346 } // namespace cc 2346 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698