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

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: just the vector 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
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 4f6110442eca4c506945e1e5e923558e5347daba..c1e9727da8353754020c1f70eb9cf065e849b60f 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -136,7 +136,7 @@ scoped_ptr<LayerImpl> LayerImpl::RemoveChild(LayerImpl* child) {
it != children_.end();
++it) {
if (*it == child) {
- scoped_ptr<LayerImpl> ret = children_.take(it);
+ scoped_ptr<LayerImpl> ret = it->Pass();
children_.erase(it);
layer_tree_impl()->set_needs_update_draw_properties();
return ret.Pass();
danakj 2015/11/17 01:12:17 oops, shame on me
vmpstr 2015/11/17 23:26:24 Done.
@@ -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 it = requests->begin(); it != requests->end(); ++it)
ericrk 2015/11/16 21:59:49 not sure if we can use it, but a more C++11-y way
danakj 2015/11/17 01:12:17 Cool! Someone should propose it to cxx@ now that m
vmpstr 2015/11/17 23:26:23 I could do it as std::move(requests->begin(), re
vmpstr 2015/11/17 23:26:24 Done.
+ copy_requests_.push_back(it->Pass());
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 it = copy_requests_.begin(); it != copy_requests_.end(); ++it)
ericrk 2015/11/16 21:59:49 same here.
+ requests->push_back(it->Pass());
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;

Powered by Google App Engine
This is Rietveld 408576698