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

Side by Side Diff: cc/resources/tiling_set_raster_queue_required.cc

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/resources/tiling_set_raster_queue_required.h" 5 #include "cc/resources/tiling_set_raster_queue_required.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/resources/picture_layer_tiling_set.h" 9 #include "cc/resources/picture_layer_tiling_set.h"
10 #include "cc/resources/tile.h" 10 #include "cc/resources/tile.h"
11 #include "cc/resources/tile_priority.h" 11 #include "cc/resources/tile_priority.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 TilingSetRasterQueueRequired::TilingSetRasterQueueRequired( 15 TilingSetRasterQueueRequired::TilingSetRasterQueueRequired(
16 PictureLayerTilingSet* tiling_set, 16 PictureLayerTilingSet* tiling_set,
17 RasterTilePriorityQueue::Type type) 17 RasterTilePriorityQueue::Type type)
18 : type_(type) { 18 : type_(type) {
19 DCHECK_NE(static_cast<int>(type), 19 DCHECK_NE(static_cast<int>(type),
20 static_cast<int>(RasterTilePriorityQueue::Type::ALL)); 20 static_cast<int>(RasterTilePriorityQueue::Type::ALL));
21 21
22 // Any type of required tile would only come from a high resolution tiling. 22 // Any type of required tile would only come from a high resolution tiling.
23 // The functions that determine this value is 23 // The functions that determine this value is
24 // PictureLayerTiling::IsTileRequiredFor*, which all return false if the 24 // PictureLayerTiling::IsTileRequiredFor*, which all return false if the
25 // resolution is not HIGH_RESOLUTION. 25 // resolution is not HIGH_RESOLUTION.
26 PictureLayerTiling* tiling = 26 PictureLayerTiling* tiling =
27 tiling_set->FindTilingWithResolution(HIGH_RESOLUTION); 27 tiling_set->FindTilingWithResolution(HIGH_RESOLUTION);
28 DCHECK(tiling); 28 // If we don't have a high res tiling, then this queue will yield no tiles.
29 // See PictureLayerImpl::CanHaveTilings for examples of when a HIGH_RESOLUTION
30 // tiling would not be generated.
31 if (!tiling)
32 return;
33
29 iterator_ = TilingIterator(tiling, &tiling->tiling_data_); 34 iterator_ = TilingIterator(tiling, &tiling->tiling_data_);
30 while (!iterator_.done() && !IsTileRequired(*iterator_)) 35 while (!iterator_.done() && !IsTileRequired(*iterator_))
31 ++iterator_; 36 ++iterator_;
32 } 37 }
33 38
34 TilingSetRasterQueueRequired::~TilingSetRasterQueueRequired() { 39 TilingSetRasterQueueRequired::~TilingSetRasterQueueRequired() {
35 } 40 }
36 41
37 bool TilingSetRasterQueueRequired::IsEmpty() const { 42 bool TilingSetRasterQueueRequired::IsEmpty() const {
38 return iterator_.done(); 43 return iterator_.done();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // in the NOW bin, which means that it can be required. 132 // in the NOW bin, which means that it can be required.
128 break; 133 break;
129 } 134 }
130 135
131 if (current_tile_) 136 if (current_tile_)
132 tiling_->UpdateTileAndTwinPriority(current_tile_); 137 tiling_->UpdateTileAndTwinPriority(current_tile_);
133 return *this; 138 return *this;
134 } 139 }
135 140
136 } // namespace cc 141 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698