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

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

Issue 17204002: Revert 206020 "cc: Emulate BeginFrame in OutputSurfaces that don..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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 | Annotate | Revision Log
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::OnVSyncParametersChanged(base::TimeTicks timebase,
1075 base::TimeDelta interval) {
1076 client_->OnVSyncParametersChanged(timebase, interval);
1077 }
1078
1074 void LayerTreeHostImpl::BeginFrame(base::TimeTicks frame_time) { 1079 void LayerTreeHostImpl::BeginFrame(base::TimeTicks frame_time) {
1075 client_->BeginFrameOnImplThread(frame_time); 1080 client_->BeginFrameOnImplThread(frame_time);
1076 } 1081 }
1077 1082
1078 void LayerTreeHostImpl::OnSwapBuffersComplete( 1083 void LayerTreeHostImpl::OnSwapBuffersComplete(
1079 const CompositorFrameAck* ack) { 1084 const CompositorFrameAck* ack) {
1080 // TODO(piman): We may need to do some validation on this ack before 1085 // TODO(piman): We may need to do some validation on this ack before
1081 // processing it. 1086 // processing it.
1082 if (ack && renderer_) 1087 if (ack && renderer_)
1083 renderer_->ReceiveSwapBuffersAck(*ack); 1088 renderer_->ReceiveSwapBuffersAck(*ack);
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 settings_.num_raster_threads, 1507 settings_.num_raster_threads,
1503 settings_.use_color_estimator, 1508 settings_.use_color_estimator,
1504 rendering_stats_instrumentation_, 1509 rendering_stats_instrumentation_,
1505 using_map_image); 1510 using_map_image);
1506 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); 1511 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy());
1507 } 1512 }
1508 1513
1509 resource_provider_ = resource_provider.Pass(); 1514 resource_provider_ = resource_provider.Pass();
1510 } 1515 }
1511 1516
1512 // Setup BeginFrameEmulation if it's not supported natively
1513 if (!settings_.begin_frame_scheduling_enabled) {
1514 const base::TimeDelta display_refresh_interval =
1515 base::TimeDelta::FromMicroseconds(
1516 base::Time::kMicrosecondsPerSecond /
1517 settings_.refresh_rate);
1518
1519 output_surface->InitializeBeginFrameEmulation(
1520 proxy_->ImplThread(),
1521 settings_.throttle_frame_production,
1522 display_refresh_interval);
1523 }
1524
1525 int max_frames_pending =
1526 output_surface->capabilities().max_frames_pending;
1527 if (max_frames_pending <= 0)
1528 max_frames_pending = FrameRateController::DEFAULT_MAX_FRAMES_PENDING;
1529 output_surface->SetMaxFramesPending(max_frames_pending);
1530
1531 output_surface_ = output_surface.Pass(); 1517 output_surface_ = output_surface.Pass();
1532 1518
1533 if (!visible_) 1519 if (!visible_)
1534 renderer_->SetVisible(visible_); 1520 renderer_->SetVisible(visible_);
1535 1521
1536 client_->OnCanDrawStateChanged(CanDraw()); 1522 client_->OnCanDrawStateChanged(CanDraw());
1537 1523
1538 // See note in LayerTreeImpl::UpdateDrawProperties. Renderer needs 1524 // See note in LayerTreeImpl::UpdateDrawProperties. Renderer needs
1539 // to be initialized to get max texture size. 1525 // to be initialized to get max texture size.
1540 active_tree_->set_needs_update_draw_properties(); 1526 active_tree_->set_needs_update_draw_properties();
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
2336 } 2322 }
2337 2323
2338 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2324 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2339 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2325 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2340 paint_time_counter_->ClearHistory(); 2326 paint_time_counter_->ClearHistory();
2341 2327
2342 debug_state_ = debug_state; 2328 debug_state_ = debug_state;
2343 } 2329 }
2344 2330
2345 } // namespace cc 2331 } // namespace cc
OLDNEW
« no previous file with comments | « trunk/src/cc/trees/layer_tree_host_impl.h ('k') | trunk/src/cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698