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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 if (tiling->contents_scale() < min_acceptable_scale) | 549 if (tiling->contents_scale() < min_acceptable_scale) |
550 continue; | 550 continue; |
551 | 551 |
552 for (PictureLayerTiling::CoverageIterator iter(tiling, | 552 for (PictureLayerTiling::CoverageIterator iter(tiling, |
553 contents_scale_x(), | 553 contents_scale_x(), |
554 rect); | 554 rect); |
555 iter; | 555 iter; |
556 ++iter) { | 556 ++iter) { |
557 if (should_force_uploads && *iter) | 557 if (should_force_uploads && *iter) |
558 layer_tree_impl()->tile_manager()->ForceTileUploadToComplete(*iter); | 558 layer_tree_impl()->tile_manager()->ForceTileUploadToComplete(*iter); |
| 559 |
| 560 bool tile_ready = false; |
559 // A null tile (i.e. no recording) is considered "ready". | 561 // A null tile (i.e. no recording) is considered "ready". |
560 if (!*iter || iter->drawing_info().IsReadyToDraw()) | 562 if (!*iter) { |
| 563 tile_ready = true; |
| 564 } else if (iter->drawing_info().IsReadyToDraw()) { |
| 565 tile_ready = true; |
| 566 } else if (!iter->priority(PENDING_TREE).is_live) { |
| 567 NOTREACHED() << "All tiles considered for activation should be live"; |
| 568 tile_ready = true; |
| 569 } |
| 570 if (tile_ready) |
561 missing_region.Subtract(iter.geometry_rect()); | 571 missing_region.Subtract(iter.geometry_rect()); |
562 } | 572 } |
563 } | 573 } |
564 | 574 |
565 return missing_region.IsEmpty(); | 575 return missing_region.IsEmpty(); |
566 } | 576 } |
567 | 577 |
568 PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) { | 578 PictureLayerTiling* PictureLayerImpl::AddTiling(float contents_scale) { |
569 DCHECK(contents_scale >= MinimumContentsScale()); | 579 DCHECK(contents_scale >= MinimumContentsScale()); |
570 | 580 |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { | 888 scoped_ptr<base::Value> PictureLayerImpl::AsValue() const { |
879 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 889 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
880 LayerImpl::AsValueInto(state.get()); | 890 LayerImpl::AsValueInto(state.get()); |
881 | 891 |
882 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); | 892 state->SetDouble("ideal_contents_scale", ideal_contents_scale_); |
883 state->Set("tilings", tilings_->AsValue().release()); | 893 state->Set("tilings", tilings_->AsValue().release()); |
884 return state.PassAs<base::Value>(); | 894 return state.PassAs<base::Value>(); |
885 } | 895 } |
886 | 896 |
887 } // namespace cc | 897 } // namespace cc |
OLD | NEW |