| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 id()); | 108 id()); |
| 109 } else { | 109 } else { |
| 110 updater_ = BitmapContentLayerUpdater::Create( | 110 updater_ = BitmapContentLayerUpdater::Create( |
| 111 painter.Pass(), | 111 painter.Pass(), |
| 112 rendering_stats_instrumentation(), | 112 rendering_stats_instrumentation(), |
| 113 id()); | 113 id()); |
| 114 } | 114 } |
| 115 updater_->SetOpaque(contents_opaque()); | 115 updater_->SetOpaque(contents_opaque()); |
| 116 if (client_) | 116 if (client_) |
| 117 updater_->SetFillsBoundsCompletely(client_->FillsBoundsCompletely()); | 117 updater_->SetFillsBoundsCompletely(client_->FillsBoundsCompletely()); |
| 118 updater_->SetBackgroundColor(background_color()); |
| 118 | 119 |
| 119 SetTextureFormat( | 120 SetTextureFormat( |
| 120 layer_tree_host()->GetRendererCapabilities().best_texture_format); | 121 layer_tree_host()->GetRendererCapabilities().best_texture_format); |
| 121 } | 122 } |
| 122 | 123 |
| 123 void ContentLayer::SetContentsOpaque(bool opaque) { | 124 void ContentLayer::SetContentsOpaque(bool opaque) { |
| 124 Layer::SetContentsOpaque(opaque); | 125 Layer::SetContentsOpaque(opaque); |
| 125 if (updater_.get()) | 126 if (updater_.get()) |
| 126 updater_->SetOpaque(opaque); | 127 updater_->SetOpaque(opaque); |
| 127 } | 128 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 155 return picture; | 156 return picture; |
| 156 } | 157 } |
| 157 | 158 |
| 158 void ContentLayer::OnOutputSurfaceCreated() { | 159 void ContentLayer::OnOutputSurfaceCreated() { |
| 159 SetTextureFormat( | 160 SetTextureFormat( |
| 160 layer_tree_host()->GetRendererCapabilities().best_texture_format); | 161 layer_tree_host()->GetRendererCapabilities().best_texture_format); |
| 161 TiledLayer::OnOutputSurfaceCreated(); | 162 TiledLayer::OnOutputSurfaceCreated(); |
| 162 } | 163 } |
| 163 | 164 |
| 164 } // namespace cc | 165 } // namespace cc |
| OLD | NEW |