Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: cc/resources/tiling_set_raster_queue_required.cc

Issue 1051993002: cc: Remove tile sharing from tilings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/tiling_set_raster_queue_required.h ('k') | cc/test/fake_picture_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/tiling_set_raster_queue_required.cc
diff --git a/cc/resources/tiling_set_raster_queue_required.cc b/cc/resources/tiling_set_raster_queue_required.cc
index 89ddb044255ed905ddcb963dffd62276e324305b..b44ee084879bd0b9d798b359c84f09b69f3502d7 100644
--- a/cc/resources/tiling_set_raster_queue_required.cc
+++ b/cc/resources/tiling_set_raster_queue_required.cc
@@ -19,19 +19,39 @@ TilingSetRasterQueueRequired::TilingSetRasterQueueRequired(
DCHECK_NE(static_cast<int>(type),
static_cast<int>(RasterTilePriorityQueue::Type::ALL));
- // Any type of required tile would only come from a high resolution tiling.
- // The functions that determine this value is
- // PictureLayerTiling::IsTileRequiredFor*, which all return false if the
- // resolution is not HIGH_RESOLUTION.
- PictureLayerTiling* tiling =
- tiling_set->FindTilingWithResolution(HIGH_RESOLUTION);
- // If we don't have a high res tiling, then this queue will yield no tiles.
- // See PictureLayerImpl::CanHaveTilings for examples of when a HIGH_RESOLUTION
+ // Required tiles should only come from HIGH_RESOLUTION tilings. However, if
+ // we want required for activation tiles on the active tree, then it will come
+ // from tilings whose pending twin is high resolution.
+ PictureLayerTiling* tiling = nullptr;
+ if (type == RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION &&
+ tiling_set->client()->GetTree() == ACTIVE_TREE) {
+ for (size_t i = 0; i < tiling_set->num_tilings(); ++i) {
+ PictureLayerTiling* active_tiling = tiling_set->tiling_at(i);
+ const PictureLayerTiling* pending_twin =
+ tiling_set->client()->GetPendingOrActiveTwinTiling(active_tiling);
+ if (pending_twin && pending_twin->resolution() == HIGH_RESOLUTION) {
+ tiling = active_tiling;
+ break;
+ }
+ }
+ } else {
+ tiling = tiling_set->FindTilingWithResolution(HIGH_RESOLUTION);
+ }
+
+ // If we don't have a tiling, then this queue will yield no tiles. See
+ // PictureLayerImpl::CanHaveTilings for examples of when a HIGH_RESOLUTION
// tiling would not be generated.
if (!tiling)
return;
- iterator_ = TilingIterator(tiling, &tiling->tiling_data_);
+ if (type == RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION) {
+ iterator_ = TilingIterator(tiling, &tiling->tiling_data_,
+ tiling->pending_visible_rect());
+ } else {
+ iterator_ = TilingIterator(tiling, &tiling->tiling_data_,
+ tiling->current_visible_rect());
+ }
+
while (!iterator_.done() && !IsTileRequired(*iterator_))
++iterator_;
}
@@ -73,19 +93,11 @@ TilingSetRasterQueueRequired::TilingIterator::TilingIterator()
TilingSetRasterQueueRequired::TilingIterator::TilingIterator(
PictureLayerTiling* tiling,
- TilingData* tiling_data)
+ TilingData* tiling_data,
+ const gfx::Rect& rect)
: tiling_(tiling), tiling_data_(tiling_data), current_tile_(nullptr) {
- if (!tiling_->has_visible_rect_tiles()) {
- // Verify that if we would create the iterator, then it would be empty (ie
- // it would return false when evaluated as a bool).
- DCHECK(!TilingData::Iterator(tiling_data_, tiling->current_visible_rect(),
- false));
- return;
- }
-
visible_iterator_ =
- TilingData::Iterator(tiling_data_, tiling_->current_visible_rect(),
- false /* include_borders */);
+ TilingData::Iterator(tiling_data_, rect, false /* include_borders */);
if (!visible_iterator_)
return;
« no previous file with comments | « cc/resources/tiling_set_raster_queue_required.h ('k') | cc/test/fake_picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698