OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/quads/shared_quad_state.h" | 5 #include "cc/quads/shared_quad_state.h" |
6 | 6 |
7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "base/trace_event/trace_event_argument.h" | 8 #include "base/trace_event/trace_event_argument.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
11 #include "cc/debug/traced_value.h" | 11 #include "cc/debug/traced_value.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 SharedQuadState::SharedQuadState() | 15 SharedQuadState::SharedQuadState() |
16 : is_clipped(false), | 16 : is_clipped(false), |
17 opacity(0.f), | 17 opacity(0.f), |
18 blend_mode(SkXfermode::kSrcOver_Mode), | 18 blend_mode(SkXfermode::kSrcOver_Mode), |
19 sorting_context_id(0) { | 19 sorting_context_id(0) { |
20 } | 20 } |
21 | 21 |
22 SharedQuadState::SharedQuadState(const SharedQuadState& other) | |
danakj
2016/06/01 22:37:46
use = default
Fady Samuel
2016/06/01 22:44:12
Done.
| |
23 : quad_to_target_transform(other.quad_to_target_transform), | |
24 quad_layer_bounds(other.quad_layer_bounds), | |
25 visible_quad_layer_rect(other.visible_quad_layer_rect), | |
26 clip_rect(other.clip_rect), | |
27 is_clipped(other.is_clipped), | |
28 opacity(other.opacity), | |
29 blend_mode(other.blend_mode), | |
30 sorting_context_id(other.sorting_context_id) {} | |
31 | |
22 SharedQuadState::~SharedQuadState() { | 32 SharedQuadState::~SharedQuadState() { |
23 TRACE_EVENT_OBJECT_DELETED_WITH_ID( | 33 TRACE_EVENT_OBJECT_DELETED_WITH_ID( |
24 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), | 34 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), |
25 "cc::SharedQuadState", this); | 35 "cc::SharedQuadState", this); |
26 } | 36 } |
27 | 37 |
28 void SharedQuadState::CopyFrom(const SharedQuadState* other) { | |
29 *this = *other; | |
30 } | |
31 | |
32 void SharedQuadState::SetAll(const gfx::Transform& quad_to_target_transform, | 38 void SharedQuadState::SetAll(const gfx::Transform& quad_to_target_transform, |
33 const gfx::Size& quad_layer_bounds, | 39 const gfx::Size& quad_layer_bounds, |
34 const gfx::Rect& visible_quad_layer_rect, | 40 const gfx::Rect& visible_quad_layer_rect, |
35 const gfx::Rect& clip_rect, | 41 const gfx::Rect& clip_rect, |
36 bool is_clipped, | 42 bool is_clipped, |
37 float opacity, | 43 float opacity, |
38 SkXfermode::Mode blend_mode, | 44 SkXfermode::Mode blend_mode, |
39 int sorting_context_id) { | 45 int sorting_context_id) { |
40 this->quad_to_target_transform = quad_to_target_transform; | 46 this->quad_to_target_transform = quad_to_target_transform; |
41 this->quad_layer_bounds = quad_layer_bounds; | 47 this->quad_layer_bounds = quad_layer_bounds; |
(...skipping 18 matching lines...) Expand all Loading... | |
60 value->SetDouble("opacity", opacity); | 66 value->SetDouble("opacity", opacity); |
61 value->SetString("blend_mode", SkXfermode::ModeName(blend_mode)); | 67 value->SetString("blend_mode", SkXfermode::ModeName(blend_mode)); |
62 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 68 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
63 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), | 69 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), |
64 value, | 70 value, |
65 "cc::SharedQuadState", | 71 "cc::SharedQuadState", |
66 this); | 72 this); |
67 } | 73 } |
68 | 74 |
69 } // namespace cc | 75 } // namespace cc |
OLD | NEW |