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

Side by Side Diff: ui/compositor/layer.cc

Issue 2860293002: Change cc::ElementId to be a uint64_t (Closed)
Patch Set: Merge branch 'master' into secondaryid Created 3 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 610
611 for (size_t i = 0; i < children_.size(); ++i) { 611 for (size_t i = 0; i < children_.size(); ++i) {
612 DCHECK(children_[i]->cc_layer_); 612 DCHECK(children_[i]->cc_layer_);
613 cc_layer_->AddChild(children_[i]->cc_layer_); 613 cc_layer_->AddChild(children_[i]->cc_layer_);
614 } 614 }
615 cc_layer_->SetLayerClient(this); 615 cc_layer_->SetLayerClient(this);
616 cc_layer_->SetTransformOrigin(gfx::Point3F()); 616 cc_layer_->SetTransformOrigin(gfx::Point3F());
617 cc_layer_->SetContentsOpaque(fills_bounds_opaquely_); 617 cc_layer_->SetContentsOpaque(fills_bounds_opaquely_);
618 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN); 618 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
619 cc_layer_->SetHideLayerAndSubtree(!visible_); 619 cc_layer_->SetHideLayerAndSubtree(!visible_);
620 cc_layer_->SetElementId(cc::ElementId(cc_layer_->id(), 0)); 620 cc_layer_->SetElementId(cc::ElementId(cc_layer_->id()));
621 621
622 SetLayerFilters(); 622 SetLayerFilters();
623 SetLayerBackgroundFilters(); 623 SetLayerBackgroundFilters();
624 } 624 }
625 625
626 void Layer::SwitchCCLayerForTest() { 626 void Layer::SwitchCCLayerForTest() {
627 scoped_refptr<cc::Layer> new_layer = cc::PictureLayer::Create(this); 627 scoped_refptr<cc::Layer> new_layer = cc::PictureLayer::Create(this);
628 SwitchToLayer(new_layer); 628 SwitchToLayer(new_layer);
629 content_layer_ = new_layer; 629 content_layer_ = new_layer;
630 } 630 }
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 nine_patch_layer_ = cc::NinePatchLayer::Create(); 1160 nine_patch_layer_ = cc::NinePatchLayer::Create();
1161 cc_layer_ = nine_patch_layer_.get(); 1161 cc_layer_ = nine_patch_layer_.get();
1162 } else { 1162 } else {
1163 content_layer_ = cc::PictureLayer::Create(this); 1163 content_layer_ = cc::PictureLayer::Create(this);
1164 cc_layer_ = content_layer_.get(); 1164 cc_layer_ = content_layer_.get();
1165 } 1165 }
1166 cc_layer_->SetTransformOrigin(gfx::Point3F()); 1166 cc_layer_->SetTransformOrigin(gfx::Point3F());
1167 cc_layer_->SetContentsOpaque(true); 1167 cc_layer_->SetContentsOpaque(true);
1168 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN); 1168 cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
1169 cc_layer_->SetLayerClient(this); 1169 cc_layer_->SetLayerClient(this);
1170 cc_layer_->SetElementId(cc::ElementId(cc_layer_->id(), 0)); 1170 cc_layer_->SetElementId(cc::ElementId(cc_layer_->id()));
1171 RecomputePosition(); 1171 RecomputePosition();
1172 } 1172 }
1173 1173
1174 gfx::Transform Layer::transform() const { 1174 gfx::Transform Layer::transform() const {
1175 return cc_layer_->transform(); 1175 return cc_layer_->transform();
1176 } 1176 }
1177 1177
1178 void Layer::RecomputeDrawsContentAndUVRect() { 1178 void Layer::RecomputeDrawsContentAndUVRect() {
1179 DCHECK(cc_layer_); 1179 DCHECK(cc_layer_);
1180 gfx::Size size(bounds_.size()); 1180 gfx::Size size(bounds_.size());
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1227 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1228 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1228 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1229 return mirror_ptr.get() == mirror; 1229 return mirror_ptr.get() == mirror;
1230 }); 1230 });
1231 1231
1232 DCHECK(it != mirrors_.end()); 1232 DCHECK(it != mirrors_.end());
1233 mirrors_.erase(it); 1233 mirrors_.erase(it);
1234 } 1234 }
1235 1235
1236 } // namespace ui 1236 } // namespace ui
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/VisualViewportTest.cpp ('k') | ui/compositor/layer_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698