Use QUIC v25.
[chromium-blink-merge.git] / cc / resources / raster_tile_priority_queue_required.cc
blob3bf00ed33789aff3231aee88fe46898a24b498f9
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/resources/raster_tile_priority_queue_required.h"
7 #include "cc/resources/tiling_set_raster_queue_required.h"
9 namespace cc {
11 RasterTilePriorityQueueRequired::RasterTilePriorityQueueRequired() {
14 RasterTilePriorityQueueRequired::~RasterTilePriorityQueueRequired() {
17 void RasterTilePriorityQueueRequired::Build(
18 const std::vector<PictureLayerImpl::Pair>& paired_layers,
19 Type type) {
20 DCHECK_NE(static_cast<int>(type), static_cast<int>(Type::ALL));
21 for (const auto& pair : paired_layers) {
22 PictureLayerTilingSet* tiling_set = nullptr;
23 if (type == Type::REQUIRED_FOR_DRAW && pair.active)
24 tiling_set = pair.active->picture_layer_tiling_set();
25 else if (type == Type::REQUIRED_FOR_ACTIVATION && pair.pending)
26 tiling_set = pair.pending->picture_layer_tiling_set();
28 if (!tiling_set)
29 continue;
31 scoped_ptr<TilingSetRasterQueueRequired> tiling_set_queue(
32 new TilingSetRasterQueueRequired(tiling_set, type));
33 if (tiling_set_queue->IsEmpty())
34 continue;
35 tiling_set_queues_.push_back(tiling_set_queue.Pass());
39 bool RasterTilePriorityQueueRequired::IsEmpty() const {
40 return tiling_set_queues_.empty();
43 Tile* RasterTilePriorityQueueRequired::Top() {
44 DCHECK(!IsEmpty());
45 return tiling_set_queues_.back()->Top();
48 void RasterTilePriorityQueueRequired::Pop() {
49 DCHECK(!IsEmpty());
50 tiling_set_queues_.back()->Pop();
51 if (tiling_set_queues_.back()->IsEmpty())
52 tiling_set_queues_.pop_back();
55 } // namespace cc