GPU workaround to simulate Out of Memory errors with large textures
[chromium-blink-merge.git] / cc / resources / raster_tile_priority_queue.cc
blob12fcaa7e87b0394768f6097fde46e64cdd567d32
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.h"
7 #include "cc/resources/raster_tile_priority_queue_all.h"
8 #include "cc/resources/raster_tile_priority_queue_required.h"
10 namespace cc {
12 // static
13 scoped_ptr<RasterTilePriorityQueue> RasterTilePriorityQueue::Create(
14 const std::vector<PictureLayerImpl::Pair>& paired_layers,
15 TreePriority tree_priority,
16 Type type) {
17 switch (type) {
18 case Type::ALL: {
19 scoped_ptr<RasterTilePriorityQueueAll> queue(
20 new RasterTilePriorityQueueAll);
21 queue->Build(paired_layers, tree_priority);
22 return queue.Pass();
24 case Type::REQUIRED_FOR_ACTIVATION:
25 case Type::REQUIRED_FOR_DRAW: {
26 scoped_ptr<RasterTilePriorityQueueRequired> queue(
27 new RasterTilePriorityQueueRequired);
28 queue->Build(paired_layers, type);
29 return queue.Pass();
32 NOTREACHED();
33 return nullptr;
36 } // namespace cc