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

Side by Side Diff: cc/layers/layer_lists.cc

Issue 502203003: Remove implicit conversions from scoped_refptr to T* in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to use .get() instead of rewriting local variable Created 6 years, 4 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/layers/delegated_renderer_layer_unittest.cc ('k') | cc/layers/layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer_lists.h" 5 #include "cc/layers/layer_lists.h"
6 6
7 #include "cc/layers/layer.h" 7 #include "cc/layers/layer.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 RenderSurfaceLayerList::RenderSurfaceLayerList() {} 11 RenderSurfaceLayerList::RenderSurfaceLayerList() {}
12 12
13 RenderSurfaceLayerList::~RenderSurfaceLayerList() { 13 RenderSurfaceLayerList::~RenderSurfaceLayerList() {
14 for (size_t i = 0; i < size(); ++i) 14 for (size_t i = 0; i < size(); ++i)
15 at(size() - 1 - i)->ClearRenderSurface(); 15 at(size() - 1 - i)->ClearRenderSurface();
16 } 16 }
17 17
18 Layer* RenderSurfaceLayerList::at(size_t i) const { 18 Layer* RenderSurfaceLayerList::at(size_t i) const {
19 return list_.at(i); 19 return list_.at(i).get();
20 } 20 }
21 21
22 void RenderSurfaceLayerList::pop_back() { 22 void RenderSurfaceLayerList::pop_back() {
23 list_.pop_back(); 23 list_.pop_back();
24 } 24 }
25 25
26 void RenderSurfaceLayerList::push_back(const scoped_refptr<Layer>& layer) { 26 void RenderSurfaceLayerList::push_back(const scoped_refptr<Layer>& layer) {
27 list_.push_back(layer); 27 list_.push_back(layer);
28 } 28 }
29 29
30 Layer* RenderSurfaceLayerList::back() { 30 Layer* RenderSurfaceLayerList::back() {
31 return list_.back(); 31 return list_.back().get();
32 } 32 }
33 33
34 size_t RenderSurfaceLayerList::size() const { 34 size_t RenderSurfaceLayerList::size() const {
35 return list_.size(); 35 return list_.size();
36 } 36 }
37 37
38 scoped_refptr<Layer>& RenderSurfaceLayerList::operator[](size_t i) { 38 scoped_refptr<Layer>& RenderSurfaceLayerList::operator[](size_t i) {
39 return list_[i]; 39 return list_[i];
40 } 40 }
41 const scoped_refptr<Layer>& RenderSurfaceLayerList::operator[](size_t i) const { 41 const scoped_refptr<Layer>& RenderSurfaceLayerList::operator[](size_t i) const {
(...skipping 16 matching lines...) Expand all
58 return list_.end(); 58 return list_.end();
59 } 59 }
60 60
61 void RenderSurfaceLayerList::clear() { 61 void RenderSurfaceLayerList::clear() {
62 for (size_t i = 0; i < list_.size(); ++i) 62 for (size_t i = 0; i < list_.size(); ++i)
63 DCHECK(!list_[i]->render_surface()); 63 DCHECK(!list_[i]->render_surface());
64 list_.clear(); 64 list_.clear();
65 } 65 }
66 66
67 } // namespace cc 67 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/delegated_renderer_layer_unittest.cc ('k') | cc/layers/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698