| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/layers/content_layer.h" | 5 #include "cc/layers/content_layer.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "cc/layers/content_layer_client.h" | 10 #include "cc/layers/content_layer_client.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return NeedsIdlePaint(); | 92 return NeedsIdlePaint(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 LayerUpdater* ContentLayer::Updater() const { | 95 LayerUpdater* ContentLayer::Updater() const { |
| 96 return updater_.get(); | 96 return updater_.get(); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ContentLayer::CreateUpdaterIfNeeded() { | 99 void ContentLayer::CreateUpdaterIfNeeded() { |
| 100 if (updater_.get()) | 100 if (updater_.get()) |
| 101 return; | 101 return; |
| 102 scoped_ptr<LayerPainter> painter = | 102 scoped_ptr<LayerPainter> painter = ContentLayerPainter::Create(client_); |
| 103 ContentLayerPainter::Create(client_).PassAs<LayerPainter>(); | |
| 104 if (layer_tree_host()->settings().per_tile_painting_enabled) { | 103 if (layer_tree_host()->settings().per_tile_painting_enabled) { |
| 105 updater_ = BitmapSkPictureContentLayerUpdater::Create( | 104 updater_ = BitmapSkPictureContentLayerUpdater::Create( |
| 106 painter.Pass(), | 105 painter.Pass(), |
| 107 rendering_stats_instrumentation(), | 106 rendering_stats_instrumentation(), |
| 108 id()); | 107 id()); |
| 109 } else { | 108 } else { |
| 110 updater_ = BitmapContentLayerUpdater::Create( | 109 updater_ = BitmapContentLayerUpdater::Create( |
| 111 painter.Pass(), | 110 painter.Pass(), |
| 112 rendering_stats_instrumentation(), | 111 rendering_stats_instrumentation(), |
| 113 id()); | 112 id()); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 return picture; | 155 return picture; |
| 157 } | 156 } |
| 158 | 157 |
| 159 void ContentLayer::OnOutputSurfaceCreated() { | 158 void ContentLayer::OnOutputSurfaceCreated() { |
| 160 SetTextureFormat( | 159 SetTextureFormat( |
| 161 layer_tree_host()->GetRendererCapabilities().best_texture_format); | 160 layer_tree_host()->GetRendererCapabilities().best_texture_format); |
| 162 TiledLayer::OnOutputSurfaceCreated(); | 161 TiledLayer::OnOutputSurfaceCreated(); |
| 163 } | 162 } |
| 164 | 163 |
| 165 } // namespace cc | 164 } // namespace cc |
| OLD | NEW |