| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 LayerImpl* inner_; | 114 LayerImpl* inner_; |
| 115 LayerImpl* outer_; | 115 LayerImpl* outer_; |
| 116 gfx::ScrollOffset viewport_in_content_coordinates_; | 116 gfx::ScrollOffset viewport_in_content_coordinates_; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 | 119 |
| 120 void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) { | 120 void DidVisibilityChange(LayerTreeHostImpl* id, bool visible) { |
| 121 if (visible) { | 121 if (visible) { |
| 122 TRACE_EVENT_ASYNC_BEGIN1("webkit", | 122 TRACE_EVENT_ASYNC_BEGIN1("cc", "LayerTreeHostImpl::SetVisible", id, |
| 123 "LayerTreeHostImpl::SetVisible", | 123 "LayerTreeHostImpl", id); |
| 124 id, | |
| 125 "LayerTreeHostImpl", | |
| 126 id); | |
| 127 return; | 124 return; |
| 128 } | 125 } |
| 129 | 126 |
| 130 TRACE_EVENT_ASYNC_END0("webkit", "LayerTreeHostImpl::SetVisible", id); | 127 TRACE_EVENT_ASYNC_END0("cc", "LayerTreeHostImpl::SetVisible", id); |
| 131 } | 128 } |
| 132 | 129 |
| 133 size_t GetMaxTransferBufferUsageBytes( | 130 size_t GetMaxTransferBufferUsageBytes( |
| 134 const ContextProvider::Capabilities& context_capabilities, | 131 const ContextProvider::Capabilities& context_capabilities, |
| 135 double refresh_rate) { | 132 double refresh_rate) { |
| 136 // We want to make sure the default transfer buffer size is equal to the | 133 // We want to make sure the default transfer buffer size is equal to the |
| 137 // amount of data that can be uploaded by the compositor to avoid stalling | 134 // amount of data that can be uploaded by the compositor to avoid stalling |
| 138 // the pipeline. | 135 // the pipeline. |
| 139 // For reference Chromebook Pixel can upload 1MB in about 0.5ms. | 136 // For reference Chromebook Pixel can upload 1MB in about 0.5ms. |
| 140 const size_t kMaxBytesUploadedPerMs = 1024 * 1024 * 2; | 137 const size_t kMaxBytesUploadedPerMs = 1024 * 1024 * 2; |
| (...skipping 3338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3479 } | 3476 } |
| 3480 | 3477 |
| 3481 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3478 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
| 3482 std::vector<PictureLayerImpl*>::iterator it = | 3479 std::vector<PictureLayerImpl*>::iterator it = |
| 3483 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3480 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
| 3484 DCHECK(it != picture_layers_.end()); | 3481 DCHECK(it != picture_layers_.end()); |
| 3485 picture_layers_.erase(it); | 3482 picture_layers_.erase(it); |
| 3486 } | 3483 } |
| 3487 | 3484 |
| 3488 } // namespace cc | 3485 } // namespace cc |
| OLD | NEW |