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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 if (tiling->resolution() == HIGH_RESOLUTION) { | 675 if (tiling->resolution() == HIGH_RESOLUTION) { |
676 DCHECK(!high_res) << "There can only be one high res tiling"; | 676 DCHECK(!high_res) << "There can only be one high res tiling"; |
677 high_res = tiling; | 677 high_res = tiling; |
678 continue; | 678 continue; |
679 } | 679 } |
680 for (PictureLayerTiling::CoverageIterator iter(tiling, | 680 for (PictureLayerTiling::CoverageIterator iter(tiling, |
681 contents_scale_x(), | 681 contents_scale_x(), |
682 rect); | 682 rect); |
683 iter; | 683 iter; |
684 ++iter) { | 684 ++iter) { |
685 if (!iter->tile_version().IsReadyToDraw()) | 685 if (!*iter || !iter->tile_version().IsReadyToDraw()) |
686 continue; | 686 continue; |
687 missing_region.Subtract(iter.geometry_rect()); | 687 missing_region.Subtract(iter.geometry_rect()); |
688 iter->mark_required_for_activation(); | 688 iter->mark_required_for_activation(); |
689 | 689 |
690 DCHECK_EQ(iter->priority(PENDING_TREE).distance_to_visible_in_pixels, 0); | 690 DCHECK_EQ(iter->priority(PENDING_TREE).distance_to_visible_in_pixels, 0); |
691 DCHECK_EQ(iter->priority(PENDING_TREE).time_to_visible_in_seconds, 0); | 691 DCHECK_EQ(iter->priority(PENDING_TREE).time_to_visible_in_seconds, 0); |
692 } | 692 } |
693 } | 693 } |
694 | 694 |
695 DCHECK(high_res) << "There must be one high res tiling"; | 695 DCHECK(high_res) << "There must be one high res tiling"; |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 state->Set("tilings", tilings_->AsValue().release()); | 1014 state->Set("tilings", tilings_->AsValue().release()); |
1015 state->Set("pictures", pile_->AsValue().release()); | 1015 state->Set("pictures", pile_->AsValue().release()); |
1016 state->Set("invalidation", invalidation_.AsValue().release()); | 1016 state->Set("invalidation", invalidation_.AsValue().release()); |
1017 } | 1017 } |
1018 | 1018 |
1019 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { | 1019 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { |
1020 return tilings_->GPUMemoryUsageInBytes(); | 1020 return tilings_->GPUMemoryUsageInBytes(); |
1021 } | 1021 } |
1022 | 1022 |
1023 } // namespace cc | 1023 } // namespace cc |
OLD | NEW |