| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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 "cc/layers/layer.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "cc/trees/layer_tree_host.h" | 27 #include "cc/trees/layer_tree_host.h" |
| 28 #include "cc/trees/layer_tree_impl.h" | 28 #include "cc/trees/layer_tree_impl.h" |
| 29 #include "third_party/skia/include/core/SkImageFilter.h" | 29 #include "third_party/skia/include/core/SkImageFilter.h" |
| 30 #include "ui/gfx/geometry/rect_conversions.h" | 30 #include "ui/gfx/geometry/rect_conversions.h" |
| 31 #include "ui/gfx/geometry/vector2d_conversions.h" | 31 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 32 | 32 |
| 33 namespace cc { | 33 namespace cc { |
| 34 | 34 |
| 35 base::StaticAtomicSequenceNumber g_next_layer_id; | 35 base::StaticAtomicSequenceNumber g_next_layer_id; |
| 36 | 36 |
| 37 scoped_refptr<Layer> Layer::Create() { | 37 scoped_refptr<Layer> Layer::Create(const LayerSettings& settings) { |
| 38 return make_scoped_refptr(new Layer()); | 38 return make_scoped_refptr(new Layer(settings)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 Layer::Layer() | 41 Layer::Layer(const LayerSettings& settings) |
| 42 : needs_push_properties_(false), | 42 : needs_push_properties_(false), |
| 43 num_dependents_need_push_properties_(false), | 43 num_dependents_need_push_properties_(false), |
| 44 stacking_order_changed_(false), | 44 stacking_order_changed_(false), |
| 45 // Layer IDs start from 1. | 45 // Layer IDs start from 1. |
| 46 layer_id_(g_next_layer_id.GetNext() + 1), | 46 layer_id_(g_next_layer_id.GetNext() + 1), |
| 47 ignore_set_needs_commit_(false), | 47 ignore_set_needs_commit_(false), |
| 48 sorting_context_id_(0), | 48 sorting_context_id_(0), |
| 49 parent_(nullptr), | 49 parent_(nullptr), |
| 50 layer_tree_host_(nullptr), | 50 layer_tree_host_(nullptr), |
| 51 scroll_clip_layer_id_(INVALID_ID), | 51 scroll_clip_layer_id_(INVALID_ID), |
| (...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 | 1516 |
| 1517 void Layer::DidBeginTracing() { | 1517 void Layer::DidBeginTracing() { |
| 1518 // We'll be dumping layer trees as part of trace, so make sure | 1518 // We'll be dumping layer trees as part of trace, so make sure |
| 1519 // PushPropertiesTo() propagates layer debug info to the impl | 1519 // PushPropertiesTo() propagates layer debug info to the impl |
| 1520 // side -- otherwise this won't happen for the the layers that | 1520 // side -- otherwise this won't happen for the the layers that |
| 1521 // remain unchanged since tracing started. | 1521 // remain unchanged since tracing started. |
| 1522 SetNeedsPushProperties(); | 1522 SetNeedsPushProperties(); |
| 1523 } | 1523 } |
| 1524 | 1524 |
| 1525 } // namespace cc | 1525 } // namespace cc |
| OLD | NEW |