blob: 7a4df7295a3e83ebab247e318ccf8f0b64101eab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/layers/layer_lists.h"
#include "cc/layers/layer.h"
namespace cc {
RenderSurfaceLayerList::RenderSurfaceLayerList() {}
RenderSurfaceLayerList::~RenderSurfaceLayerList() {
for (size_t i = 0; i < size(); ++i)
at(size() - 1 - i)->ClearRenderSurface();
}
Layer* RenderSurfaceLayerList::at(size_t i) const {
return list_.at(i).get();
}
void RenderSurfaceLayerList::pop_back() {
list_.pop_back();
}
void RenderSurfaceLayerList::push_back(const scoped_refptr<Layer>& layer) {
list_.push_back(layer);
}
Layer* RenderSurfaceLayerList::back() {
return list_.back().get();
}
size_t RenderSurfaceLayerList::size() const {
return list_.size();
}
scoped_refptr<Layer>& RenderSurfaceLayerList::operator[](size_t i) {
return list_[i];
}
const scoped_refptr<Layer>& RenderSurfaceLayerList::operator[](size_t i) const {
return list_[i];
}
LayerList::iterator RenderSurfaceLayerList::begin() {
return list_.begin();
}
LayerList::iterator RenderSurfaceLayerList::end() {
return list_.end();
}
LayerList::const_iterator RenderSurfaceLayerList::begin() const {
return list_.begin();
}
LayerList::const_iterator RenderSurfaceLayerList::end() const {
return list_.end();
}
void RenderSurfaceLayerList::clear() {
for (size_t i = 0; i < list_.size(); ++i)
DCHECK(!list_[i]->render_surface());
list_.clear();
}
} // namespace cc
|