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_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 | 594 |
595 void PictureLayerImpl::UpdateCanUseLCDTextAfterCommit() { | 595 void PictureLayerImpl::UpdateCanUseLCDTextAfterCommit() { |
596 // This function is only allowed to be called after commit, due to it not | 596 // This function is only allowed to be called after commit, due to it not |
597 // being smart about sharing tiles and because otherwise it would cause | 597 // being smart about sharing tiles and because otherwise it would cause |
598 // flashes by switching out tiles in place that may be currently on screen. | 598 // flashes by switching out tiles in place that may be currently on screen. |
599 DCHECK(layer_tree_impl()->IsSyncTree()); | 599 DCHECK(layer_tree_impl()->IsSyncTree()); |
600 | 600 |
601 // Don't allow the LCD text state to change once disabled. | 601 // Don't allow the LCD text state to change once disabled. |
602 if (!RasterSourceUsesLCDText()) | 602 if (!RasterSourceUsesLCDText()) |
603 return; | 603 return; |
604 if (can_use_lcd_text() == RasterSourceUsesLCDText()) | 604 if (CanUseLCDText() == RasterSourceUsesLCDText()) |
605 return; | 605 return; |
606 | 606 |
607 // Raster sources are considered const, so in order to update the state | 607 // Raster sources are considered const, so in order to update the state |
608 // a new one must be created and all tiles recreated. | 608 // a new one must be created and all tiles recreated. |
609 scoped_refptr<RasterSource> new_raster_source = | 609 scoped_refptr<RasterSource> new_raster_source = |
610 raster_source_->CreateCloneWithoutLCDText(); | 610 raster_source_->CreateCloneWithoutLCDText(); |
611 raster_source_.swap(new_raster_source); | 611 raster_source_.swap(new_raster_source); |
612 | 612 |
613 // Synthetically invalidate everything. | 613 // Synthetically invalidate everything. |
614 gfx::Rect bounds_rect(bounds()); | 614 gfx::Rect bounds_rect(bounds()); |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1291 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1292 return !layer_tree_impl()->IsRecycleTree(); | 1292 return !layer_tree_impl()->IsRecycleTree(); |
1293 } | 1293 } |
1294 | 1294 |
1295 bool PictureLayerImpl::HasValidTilePriorities() const { | 1295 bool PictureLayerImpl::HasValidTilePriorities() const { |
1296 return IsOnActiveOrPendingTree() && | 1296 return IsOnActiveOrPendingTree() && |
1297 is_drawn_render_surface_layer_list_member(); | 1297 is_drawn_render_surface_layer_list_member(); |
1298 } | 1298 } |
1299 | 1299 |
1300 } // namespace cc | 1300 } // namespace cc |
OLD | NEW |