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

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

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 10 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
« no previous file with comments | « cc/resources/raster_tile_priority_queue_required.h ('k') | cc/resources/rasterizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "cc/resources/raster_tile_priority_queue_required.h"
6
7 #include "cc/resources/tiling_set_raster_queue_required.h"
8
9 namespace cc {
10
11 RasterTilePriorityQueueRequired::RasterTilePriorityQueueRequired() {
12 }
13
14 RasterTilePriorityQueueRequired::~RasterTilePriorityQueueRequired() {
15 }
16
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();
27
28 if (!tiling_set)
29 continue;
30
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());
36 }
37 }
38
39 bool RasterTilePriorityQueueRequired::IsEmpty() const {
40 return tiling_set_queues_.empty();
41 }
42
43 Tile* RasterTilePriorityQueueRequired::Top() {
44 DCHECK(!IsEmpty());
45 return tiling_set_queues_.back()->Top();
46 }
47
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();
53 }
54
55 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/raster_tile_priority_queue_required.h ('k') | cc/resources/rasterizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698