1// Copyright 2013 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#ifndef CC_LAYERS_LAYER_LISTS_H_
6#define CC_LAYERS_LAYER_LISTS_H_
7
8#include <vector>
9
10#include "base/memory/ref_counted.h"
11#include "cc/base/cc_export.h"
12#include "cc/base/scoped_ptr_vector.h"
13
14namespace cc {
15class Layer;
16class LayerImpl;
17
18typedef std::vector<scoped_refptr<Layer> > LayerList;
19
20typedef ScopedPtrVector<LayerImpl> OwnedLayerImplList;
21typedef std::vector<LayerImpl*> LayerImplList;
22
23class CC_EXPORT RenderSurfaceLayerList {
24 public:
25  RenderSurfaceLayerList();
26  ~RenderSurfaceLayerList();
27
28  Layer* at(size_t i) const;
29  void pop_back();
30  void push_back(const scoped_refptr<Layer>& layer);
31  Layer* back();
32  size_t size() const;
33  bool empty() const { return size() == 0u; }
34  LayerList::iterator begin();
35  LayerList::iterator end();
36  LayerList::const_iterator begin() const;
37  LayerList::const_iterator end() const;
38  void clear();
39
40 private:
41  LayerList list_;
42
43  DISALLOW_COPY_AND_ASSIGN(RenderSurfaceLayerList);
44};
45
46}  // namespace cc
47
48#endif  // CC_LAYERS_LAYER_LISTS_H_
49