| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 rendering_stats_instrumentation(), | 120 rendering_stats_instrumentation(), |
| 121 id()); | 121 id()); |
| 122 } else { | 122 } else { |
| 123 updater_ = BitmapContentLayerUpdater::Create( | 123 updater_ = BitmapContentLayerUpdater::Create( |
| 124 painter.Pass(), | 124 painter.Pass(), |
| 125 rendering_stats_instrumentation(), | 125 rendering_stats_instrumentation(), |
| 126 id()); | 126 id()); |
| 127 } | 127 } |
| 128 updater_->SetOpaque(contents_opaque()); | 128 updater_->SetOpaque(contents_opaque()); |
| 129 | 129 |
| 130 unsigned texture_format = | 130 SetTextureFormat( |
| 131 layer_tree_host()->GetRendererCapabilities().best_texture_format; | 131 layer_tree_host()->GetRendererCapabilities().best_texture_format); |
| 132 SetTextureFormat(texture_format); | |
| 133 } | 132 } |
| 134 | 133 |
| 135 void ContentLayer::SetContentsOpaque(bool opaque) { | 134 void ContentLayer::SetContentsOpaque(bool opaque) { |
| 136 Layer::SetContentsOpaque(opaque); | 135 Layer::SetContentsOpaque(opaque); |
| 137 if (updater_.get()) | 136 if (updater_.get()) |
| 138 updater_->SetOpaque(opaque); | 137 updater_->SetOpaque(opaque); |
| 139 } | 138 } |
| 140 | 139 |
| 141 void ContentLayer::UpdateCanUseLCDText() { | 140 void ContentLayer::UpdateCanUseLCDText() { |
| 142 if (can_use_lcd_text_last_frame_ == can_use_lcd_text()) | 141 if (can_use_lcd_text_last_frame_ == can_use_lcd_text()) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 160 gfx::RectF opaque; | 159 gfx::RectF opaque; |
| 161 | 160 |
| 162 skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture); | 161 skia::RefPtr<SkPicture> picture = skia::AdoptRef(new SkPicture); |
| 163 SkCanvas* canvas = picture->beginRecording(width, height); | 162 SkCanvas* canvas = picture->beginRecording(width, height); |
| 164 client_->PaintContents(canvas, gfx::Rect(width, height), &opaque); | 163 client_->PaintContents(canvas, gfx::Rect(width, height), &opaque); |
| 165 picture->endRecording(); | 164 picture->endRecording(); |
| 166 return picture; | 165 return picture; |
| 167 } | 166 } |
| 168 | 167 |
| 169 } // namespace cc | 168 } // namespace cc |
| OLD | NEW |