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

Unified Diff: cc/layers/layer_impl.cc

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 4f6110442eca4c506945e1e5e923558e5347daba..e0b7f44738c05d72fb1d1e355c44fe479f8ef14f 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -135,11 +135,11 @@ scoped_ptr<LayerImpl> LayerImpl::RemoveChild(LayerImpl* child) {
for (OwnedLayerImplList::iterator it = children_.begin();
it != children_.end();
++it) {
- if (*it == child) {
- scoped_ptr<LayerImpl> ret = children_.take(it);
+ if (it->get() == child) {
+ scoped_ptr<LayerImpl> ret = it->Pass();
children_.erase(it);
layer_tree_impl()->set_needs_update_draw_properties();
- return ret.Pass();
+ return ret;
}
}
return nullptr;
@@ -260,7 +260,8 @@ void LayerImpl::SetEffectTreeIndex(int index) {
SetNeedsPushProperties();
}
-void LayerImpl::PassCopyRequests(ScopedPtrVector<CopyOutputRequest>* requests) {
+void LayerImpl::PassCopyRequests(
+ std::vector<scoped_ptr<CopyOutputRequest>>* requests) {
// In the case that a layer still has a copy request, this means that there's
// a commit to the active tree without a draw. This only happens in some
// edge cases during lost context or visibility changes, so don't try to
@@ -276,7 +277,8 @@ void LayerImpl::PassCopyRequests(ScopedPtrVector<CopyOutputRequest>* requests) {
DCHECK(render_surface());
bool was_empty = copy_requests_.empty();
- copy_requests_.insert_and_take(copy_requests_.end(), requests);
+ for (auto& request : *requests)
+ copy_requests_.push_back(std::move(request));
requests->clear();
if (was_empty && layer_tree_impl()->IsActiveTree())
@@ -285,17 +287,18 @@ void LayerImpl::PassCopyRequests(ScopedPtrVector<CopyOutputRequest>* requests) {
}
void LayerImpl::TakeCopyRequestsAndTransformToTarget(
- ScopedPtrVector<CopyOutputRequest>* requests) {
+ std::vector<scoped_ptr<CopyOutputRequest>>* requests) {
DCHECK(!copy_requests_.empty());
DCHECK(layer_tree_impl()->IsActiveTree());
DCHECK_EQ(render_target(), this);
size_t first_inserted_request = requests->size();
- requests->insert_and_take(requests->end(), &copy_requests_);
+ for (auto& request : copy_requests_)
+ requests->push_back(std::move(request));
copy_requests_.clear();
for (size_t i = first_inserted_request; i < requests->size(); ++i) {
- CopyOutputRequest* request = requests->at(i);
+ CopyOutputRequest* request = (*requests)[i].get();
if (!request->has_area())
continue;
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698