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 "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
9 #include "cc/layers/content_layer_client.h" | 9 #include "cc/layers/content_layer_client.h" |
10 #include "cc/layers/picture_layer_impl.h" | 10 #include "cc/layers/picture_layer_impl.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 DCHECK_EQ(layer_impl->is_mask(), is_mask_); | 52 DCHECK_EQ(layer_impl->is_mask(), is_mask_); |
53 DropRecordingSourceContentIfInvalid(); | 53 DropRecordingSourceContentIfInvalid(); |
54 | 54 |
55 layer_impl->SetNearestNeighbor(inputs_.nearest_neighbor); | 55 layer_impl->SetNearestNeighbor(inputs_.nearest_neighbor); |
56 | 56 |
57 // Preserve lcd text settings from the current raster source. | 57 // Preserve lcd text settings from the current raster source. |
58 bool can_use_lcd_text = layer_impl->RasterSourceUsesLCDText(); | 58 bool can_use_lcd_text = layer_impl->RasterSourceUsesLCDText(); |
59 scoped_refptr<RasterSource> raster_source = | 59 scoped_refptr<RasterSource> raster_source = |
60 recording_source_->CreateRasterSource(can_use_lcd_text); | 60 recording_source_->CreateRasterSource(can_use_lcd_text); |
61 layer_impl->set_gpu_raster_max_texture_size( | 61 layer_impl->set_gpu_raster_max_texture_size( |
62 layer_tree_host()->device_viewport_size()); | 62 GetLayerTree()->device_viewport_size()); |
63 layer_impl->UpdateRasterSource(raster_source, &last_updated_invalidation_, | 63 layer_impl->UpdateRasterSource(raster_source, &last_updated_invalidation_, |
64 nullptr); | 64 nullptr); |
65 DCHECK(last_updated_invalidation_.IsEmpty()); | 65 DCHECK(last_updated_invalidation_.IsEmpty()); |
66 } | 66 } |
67 | 67 |
68 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { | 68 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { |
69 Layer::SetLayerTreeHost(host); | 69 Layer::SetLayerTreeHost(host); |
70 if (!host) | 70 if (!host) |
71 return; | 71 return; |
72 | 72 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 if (update_source_frame_number_ != source_frame_number && | 252 if (update_source_frame_number_ != source_frame_number && |
253 recording_source_bounds != layer_bounds) { | 253 recording_source_bounds != layer_bounds) { |
254 // Update may not get called for the layer (if it's not in the viewport | 254 // Update may not get called for the layer (if it's not in the viewport |
255 // for example), even though it has resized making the recording source no | 255 // for example), even though it has resized making the recording source no |
256 // longer valid. In this case just destroy the recording source. | 256 // longer valid. In this case just destroy the recording source. |
257 recording_source_->SetEmptyBounds(); | 257 recording_source_->SetEmptyBounds(); |
258 } | 258 } |
259 } | 259 } |
260 | 260 |
261 } // namespace cc | 261 } // namespace cc |
OLD | NEW |