| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 raster_source_scale_ = 0.f; | 1005 raster_source_scale_ = 0.f; |
| 1006 raster_contents_scale_ = 0.f; | 1006 raster_contents_scale_ = 0.f; |
| 1007 low_res_raster_contents_scale_ = 0.f; | 1007 low_res_raster_contents_scale_ = 0.f; |
| 1008 } | 1008 } |
| 1009 | 1009 |
| 1010 bool PictureLayerImpl::CanHaveTilings() const { | 1010 bool PictureLayerImpl::CanHaveTilings() const { |
| 1011 if (!DrawsContent()) | 1011 if (!DrawsContent()) |
| 1012 return false; | 1012 return false; |
| 1013 if (pile_->recorded_region().IsEmpty()) | 1013 if (pile_->recorded_region().IsEmpty()) |
| 1014 return false; | 1014 return false; |
| 1015 if (!layer_tree_impl()->tile_manager()) | |
| 1016 return false; | |
| 1017 if (draw_properties().can_draw_directly_to_backbuffer && | 1015 if (draw_properties().can_draw_directly_to_backbuffer && |
| 1018 layer_tree_impl()->settings().force_direct_layer_drawing) | 1016 layer_tree_impl()->settings().force_direct_layer_drawing) |
| 1019 return false; | 1017 return false; |
| 1020 return true; | 1018 return true; |
| 1021 } | 1019 } |
| 1022 | 1020 |
| 1023 bool PictureLayerImpl::CanHaveTilingWithScale(float contents_scale) const { | 1021 bool PictureLayerImpl::CanHaveTilingWithScale(float contents_scale) const { |
| 1024 if (!CanHaveTilings()) | 1022 if (!CanHaveTilings()) |
| 1025 return false; | 1023 return false; |
| 1026 if (contents_scale < MinimumContentsScale()) | 1024 if (contents_scale < MinimumContentsScale()) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1041 state->Set("tilings", tilings_->AsValue().release()); | 1039 state->Set("tilings", tilings_->AsValue().release()); |
| 1042 state->Set("pictures", pile_->AsValue().release()); | 1040 state->Set("pictures", pile_->AsValue().release()); |
| 1043 state->Set("invalidation", invalidation_.AsValue().release()); | 1041 state->Set("invalidation", invalidation_.AsValue().release()); |
| 1044 } | 1042 } |
| 1045 | 1043 |
| 1046 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { | 1044 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { |
| 1047 return tilings_->GPUMemoryUsageInBytes(); | 1045 return tilings_->GPUMemoryUsageInBytes(); |
| 1048 } | 1046 } |
| 1049 | 1047 |
| 1050 } // namespace cc | 1048 } // namespace cc |
| OLD | NEW |