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

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: 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
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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 const gfx::Transform& transform, 1064 const gfx::Transform& transform,
1065 gfx::Rect viewport) { 1065 gfx::Rect viewport) {
1066 external_transform_ = transform; 1066 external_transform_ = transform;
1067 external_viewport_ = viewport; 1067 external_viewport_ = viewport;
1068 } 1068 }
1069 1069
1070 void LayerTreeHostImpl::SetNeedsRedrawRect(gfx::Rect damage_rect) { 1070 void LayerTreeHostImpl::SetNeedsRedrawRect(gfx::Rect damage_rect) {
1071 client_->SetNeedsRedrawRectOnImplThread(damage_rect); 1071 client_->SetNeedsRedrawRectOnImplThread(damage_rect);
1072 } 1072 }
1073 1073
1074 void LayerTreeHostImpl::BeginFrame(base::TimeTicks frame_time) { 1074 void LayerTreeHostImpl::BeginFrame(BeginFrameArgs args) {
1075 client_->BeginFrameOnImplThread(frame_time); 1075 client_->BeginFrameOnImplThread(args);
1076 } 1076 }
1077 1077
1078 void LayerTreeHostImpl::OnSwapBuffersComplete( 1078 void LayerTreeHostImpl::OnSwapBuffersComplete(
1079 const CompositorFrameAck* ack) { 1079 const CompositorFrameAck* ack) {
1080 // TODO(piman): We may need to do some validation on this ack before 1080 // TODO(piman): We may need to do some validation on this ack before
1081 // processing it. 1081 // processing it.
1082 if (ack && renderer_) 1082 if (ack && renderer_)
1083 renderer_->ReceiveSwapBuffersAck(*ack); 1083 renderer_->ReceiveSwapBuffersAck(*ack);
1084 1084
1085 client_->OnSwapBuffersCompleteOnImplThread(); 1085 client_->OnSwapBuffersCompleteOnImplThread();
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 1518
1519 output_surface->InitializeBeginFrameEmulation( 1519 output_surface->InitializeBeginFrameEmulation(
1520 proxy_->ImplThread(), 1520 proxy_->ImplThread(),
1521 settings_.throttle_frame_production, 1521 settings_.throttle_frame_production,
1522 display_refresh_interval); 1522 display_refresh_interval);
1523 } 1523 }
1524 1524
1525 int max_frames_pending = 1525 int max_frames_pending =
1526 output_surface->capabilities().max_frames_pending; 1526 output_surface->capabilities().max_frames_pending;
1527 if (max_frames_pending <= 0) 1527 if (max_frames_pending <= 0)
1528 max_frames_pending = FrameRateController::DEFAULT_MAX_FRAMES_PENDING; 1528 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING;
1529 output_surface->SetMaxFramesPending(max_frames_pending); 1529 output_surface->SetMaxFramesPending(max_frames_pending);
1530 1530
1531 output_surface_ = output_surface.Pass(); 1531 output_surface_ = output_surface.Pass();
1532 1532
1533 if (!visible_) 1533 if (!visible_)
1534 renderer_->SetVisible(visible_); 1534 renderer_->SetVisible(visible_);
1535 1535
1536 client_->OnCanDrawStateChanged(CanDraw()); 1536 client_->OnCanDrawStateChanged(CanDraw());
1537 1537
1538 // See note in LayerTreeImpl::UpdateDrawProperties. Renderer needs 1538 // See note in LayerTreeImpl::UpdateDrawProperties. Renderer needs
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after
2331 } 2331 }
2332 2332
2333 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2333 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2334 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2334 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2335 paint_time_counter_->ClearHistory(); 2335 paint_time_counter_->ClearHistory();
2336 2336
2337 debug_state_ = debug_state; 2337 debug_state_ = debug_state;
2338 } 2338 }
2339 2339
2340 } // namespace cc 2340 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698