| OLD | NEW |
| 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 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2108 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() | 2108 ? BeginFrameArgs::DefaultEstimatedParentDrawTime() |
| 2109 : base::TimeDelta(); | 2109 : base::TimeDelta(); |
| 2110 client_->SetEstimatedParentDrawTime(parent_draw_time); | 2110 client_->SetEstimatedParentDrawTime(parent_draw_time); |
| 2111 | 2111 |
| 2112 int max_frames_pending = output_surface_->capabilities().max_frames_pending; | 2112 int max_frames_pending = output_surface_->capabilities().max_frames_pending; |
| 2113 if (max_frames_pending <= 0) | 2113 if (max_frames_pending <= 0) |
| 2114 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; | 2114 max_frames_pending = OutputSurface::DEFAULT_MAX_FRAMES_PENDING; |
| 2115 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); | 2115 client_->SetMaxSwapsPendingOnImplThread(max_frames_pending); |
| 2116 client_->OnCanDrawStateChanged(CanDraw()); | 2116 client_->OnCanDrawStateChanged(CanDraw()); |
| 2117 | 2117 |
| 2118 // There will not be anything to draw here, so set high res |
| 2119 // to avoid checkerboards, typically when we are recovering |
| 2120 // from lost context. |
| 2121 active_tree_->SetRequiresHighResToDraw(); |
| 2122 |
| 2118 return true; | 2123 return true; |
| 2119 } | 2124 } |
| 2120 | 2125 |
| 2121 void LayerTreeHostImpl::CommitVSyncParameters(base::TimeTicks timebase, | 2126 void LayerTreeHostImpl::CommitVSyncParameters(base::TimeTicks timebase, |
| 2122 base::TimeDelta interval) { | 2127 base::TimeDelta interval) { |
| 2123 client_->CommitVSyncParameters(timebase, interval); | 2128 client_->CommitVSyncParameters(timebase, interval); |
| 2124 } | 2129 } |
| 2125 | 2130 |
| 2126 void LayerTreeHostImpl::DeferredInitialize() { | 2131 void LayerTreeHostImpl::DeferredInitialize() { |
| 2127 DCHECK(output_surface_->capabilities().deferred_gl_initialization); | 2132 DCHECK(output_surface_->capabilities().deferred_gl_initialization); |
| (...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3378 } | 3383 } |
| 3379 | 3384 |
| 3380 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3385 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3381 std::vector<PictureLayerImpl*>::iterator it = | 3386 std::vector<PictureLayerImpl*>::iterator it = |
| 3382 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3387 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3383 DCHECK(it != picture_layers_.end()); | 3388 DCHECK(it != picture_layers_.end()); |
| 3384 picture_layers_.erase(it); | 3389 picture_layers_.erase(it); |
| 3385 } | 3390 } |
| 3386 | 3391 |
| 3387 } // namespace cc | 3392 } // namespace cc |
| OLD | NEW |