| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/picture_layer.h" | 5 #include "cc/layers/picture_layer.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "cc/layers/content_layer_client.h" | 8 #include "cc/layers/content_layer_client.h" |
| 9 #include "cc/layers/picture_layer_impl.h" | 9 #include "cc/layers/picture_layer_impl.h" |
| 10 #include "cc/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 DCHECK(client_); | 122 DCHECK(client_); |
| 123 updated |= | 123 updated |= |
| 124 pile_->UpdateAndExpandInvalidation(client_, | 124 pile_->UpdateAndExpandInvalidation(client_, |
| 125 &pile_invalidation_, | 125 &pile_invalidation_, |
| 126 SafeOpaqueBackgroundColor(), | 126 SafeOpaqueBackgroundColor(), |
| 127 contents_opaque(), | 127 contents_opaque(), |
| 128 client_->FillsBoundsCompletely(), | 128 client_->FillsBoundsCompletely(), |
| 129 layer_size, | 129 layer_size, |
| 130 visible_layer_rect, | 130 visible_layer_rect, |
| 131 update_source_frame_number_, | 131 update_source_frame_number_, |
| 132 RecordingMode(), | 132 Picture::RECORD_NORMALLY, |
| 133 rendering_stats_instrumentation()); | 133 rendering_stats_instrumentation()); |
| 134 last_updated_visible_content_rect_ = visible_content_rect(); | 134 last_updated_visible_content_rect_ = visible_content_rect(); |
| 135 | 135 |
| 136 if (updated) { | 136 if (updated) { |
| 137 SetNeedsPushProperties(); | 137 SetNeedsPushProperties(); |
| 138 } else { | 138 } else { |
| 139 // If this invalidation did not affect the pile, then it can be cleared as | 139 // If this invalidation did not affect the pile, then it can be cleared as |
| 140 // an optimization. | 140 // an optimization. |
| 141 pile_invalidation_.Clear(); | 141 pile_invalidation_.Clear(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 return updated; | 144 return updated; |
| 145 } | 145 } |
| 146 | 146 |
| 147 void PictureLayer::SetIsMask(bool is_mask) { | 147 void PictureLayer::SetIsMask(bool is_mask) { |
| 148 pile_->set_is_mask(is_mask); | 148 pile_->set_is_mask(is_mask); |
| 149 } | 149 } |
| 150 | 150 |
| 151 Picture::RecordingMode PictureLayer::RecordingMode() const { | |
| 152 switch (layer_tree_host()->settings().recording_mode) { | |
| 153 case LayerTreeSettings::RecordNormally: | |
| 154 return Picture::RECORD_NORMALLY; | |
| 155 case LayerTreeSettings::RecordWithSkRecord: | |
| 156 return Picture::RECORD_WITH_SKRECORD; | |
| 157 } | |
| 158 NOTREACHED(); | |
| 159 return Picture::RECORD_NORMALLY; | |
| 160 } | |
| 161 | |
| 162 bool PictureLayer::SupportsLCDText() const { | 151 bool PictureLayer::SupportsLCDText() const { |
| 163 return true; | 152 return true; |
| 164 } | 153 } |
| 165 | 154 |
| 166 void PictureLayer::UpdateCanUseLCDText() { | 155 void PictureLayer::UpdateCanUseLCDText() { |
| 167 if (can_use_lcd_text_last_frame_ == can_use_lcd_text()) | 156 if (can_use_lcd_text_last_frame_ == can_use_lcd_text()) |
| 168 return; | 157 return; |
| 169 | 158 |
| 170 can_use_lcd_text_last_frame_ = can_use_lcd_text(); | 159 can_use_lcd_text_last_frame_ = can_use_lcd_text(); |
| 171 if (client_) | 160 if (client_) |
| (...skipping 30 matching lines...) Expand all Loading... |
| 202 | 191 |
| 203 bool PictureLayer::HasDrawableContent() const { | 192 bool PictureLayer::HasDrawableContent() const { |
| 204 return client_ && Layer::HasDrawableContent(); | 193 return client_ && Layer::HasDrawableContent(); |
| 205 } | 194 } |
| 206 | 195 |
| 207 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 196 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
| 208 benchmark->RunOnLayer(this); | 197 benchmark->RunOnLayer(this); |
| 209 } | 198 } |
| 210 | 199 |
| 211 } // namespace cc | 200 } // namespace cc |
| OLD | NEW |