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

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

Issue 2919373002: cc: De-special-case SurfaceLayer code (Closed)
Patch Set: Fix cc_unittests Created 3 years, 6 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 | « ui/aura/local/window_port_local.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 // Filters. 171 // Filters.
172 clone->SetLayerSaturation(layer_saturation_); 172 clone->SetLayerSaturation(layer_saturation_);
173 clone->SetLayerBrightness(GetTargetBrightness()); 173 clone->SetLayerBrightness(GetTargetBrightness());
174 clone->SetLayerGrayscale(GetTargetGrayscale()); 174 clone->SetLayerGrayscale(GetTargetGrayscale());
175 clone->SetLayerInverted(layer_inverted_); 175 clone->SetLayerInverted(layer_inverted_);
176 if (alpha_shape_) 176 if (alpha_shape_)
177 clone->SetAlphaShape(base::MakeUnique<SkRegion>(*alpha_shape_)); 177 clone->SetAlphaShape(base::MakeUnique<SkRegion>(*alpha_shape_));
178 178
179 // cc::Layer state. 179 // cc::Layer state.
180 if (surface_layer_ && surface_layer_->primary_surface_info().is_valid()) { 180 if (surface_layer_) {
181 clone->SetShowPrimarySurface(surface_layer_->primary_surface_info(), 181 if (surface_layer_->primary_surface_info().is_valid()) {
182 surface_layer_->surface_reference_factory()); 182 clone->SetShowPrimarySurface(surface_layer_->primary_surface_info(),
183 surface_layer_->surface_reference_factory());
184 }
185 if (surface_layer_->fallback_surface_info().is_valid())
186 clone->SetFallbackSurface(surface_layer_->fallback_surface_info());
183 } else if (type_ == LAYER_SOLID_COLOR) { 187 } else if (type_ == LAYER_SOLID_COLOR) {
184 clone->SetColor(GetTargetColor()); 188 clone->SetColor(GetTargetColor());
185 } 189 }
186 190
187 clone->SetTransform(GetTargetTransform()); 191 clone->SetTransform(GetTargetTransform());
188 clone->SetBounds(bounds_); 192 clone->SetBounds(bounds_);
189 clone->SetSubpixelPositionOffset(subpixel_position_offset_); 193 clone->SetSubpixelPositionOffset(subpixel_position_offset_);
190 clone->SetMasksToBounds(GetMasksToBounds()); 194 clone->SetMasksToBounds(GetMasksToBounds());
191 clone->SetOpacity(GetTargetOpacity()); 195 clone->SetOpacity(GetTargetOpacity());
192 clone->SetVisible(GetTargetVisibility()); 196 clone->SetVisible(GetTargetVisibility());
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1231 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1228 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1232 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1229 return mirror_ptr.get() == mirror; 1233 return mirror_ptr.get() == mirror;
1230 }); 1234 });
1231 1235
1232 DCHECK(it != mirrors_.end()); 1236 DCHECK(it != mirrors_.end());
1233 mirrors_.erase(it); 1237 mirrors_.erase(it);
1234 } 1238 }
1235 1239
1236 } // namespace ui 1240 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/local/window_port_local.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698