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

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

Issue 2720503008: Add cc::SurfaceInfo::is_valid() (Closed)
Patch Set: Added Log() Created 3 years, 9 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/mus/window_port_mus.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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 // Filters. 175 // Filters.
176 clone->SetLayerSaturation(layer_saturation_); 176 clone->SetLayerSaturation(layer_saturation_);
177 clone->SetLayerBrightness(GetTargetBrightness()); 177 clone->SetLayerBrightness(GetTargetBrightness());
178 clone->SetLayerGrayscale(GetTargetGrayscale()); 178 clone->SetLayerGrayscale(GetTargetGrayscale());
179 clone->SetLayerInverted(layer_inverted_); 179 clone->SetLayerInverted(layer_inverted_);
180 if (alpha_shape_) 180 if (alpha_shape_)
181 clone->SetAlphaShape(base::MakeUnique<SkRegion>(*alpha_shape_)); 181 clone->SetAlphaShape(base::MakeUnique<SkRegion>(*alpha_shape_));
182 182
183 // cc::Layer state. 183 // cc::Layer state.
184 if (surface_layer_ && 184 if (surface_layer_ && surface_layer_->primary_surface_info().is_valid()) {
185 surface_layer_->primary_surface_info().id().is_valid()) {
186 clone->SetShowPrimarySurface(surface_layer_->primary_surface_info(), 185 clone->SetShowPrimarySurface(surface_layer_->primary_surface_info(),
187 surface_layer_->surface_reference_factory()); 186 surface_layer_->surface_reference_factory());
188 } else if (type_ == LAYER_SOLID_COLOR) { 187 } else if (type_ == LAYER_SOLID_COLOR) {
189 clone->SetColor(GetTargetColor()); 188 clone->SetColor(GetTargetColor());
190 } 189 }
191 return clone; 190 return clone;
192 } 191 }
193 192
194 std::unique_ptr<Layer> Layer::Mirror() { 193 std::unique_ptr<Layer> Layer::Mirror() {
195 auto mirror = Clone(); 194 auto mirror = Clone();
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(), 1175 const auto it = std::find_if(mirrors_.begin(), mirrors_.end(),
1177 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) { 1176 [mirror](const std::unique_ptr<LayerMirror>& mirror_ptr) {
1178 return mirror_ptr.get() == mirror; 1177 return mirror_ptr.get() == mirror;
1179 }); 1178 });
1180 1179
1181 DCHECK(it != mirrors_.end()); 1180 DCHECK(it != mirrors_.end());
1182 mirrors_.erase(it); 1181 mirrors_.erase(it);
1183 } 1182 }
1184 1183
1185 } // namespace ui 1184 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/mus/window_port_mus.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698