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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PropertyTreeState.h

Issue 2173363002: Improve code readibility of PaintPropertyTreeBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra "const" (might be a typo) Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef PropertyTreeState_h 5 #ifndef PropertyTreeState_h
6 #define PropertyTreeState_h 6 #define PropertyTreeState_h
7 7
8 #include "wtf/HashFunctions.h" 8 #include "wtf/HashFunctions.h"
9 #include "wtf/HashTraits.h" 9 #include "wtf/HashTraits.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 class TransformPaintPropertyNode; 13 class TransformPaintPropertyNode;
14 class ClipPaintPropertyNode; 14 class ClipPaintPropertyNode;
15 class EffectPaintPropertyNode; 15 class EffectPaintPropertyNode;
16 16
17 // Represents the combination of transform, clip and effect nodes for a particul ar coordinate space. 17 // Represents the combination of transform, clip and effect nodes for a particul ar coordinate space.
18 // See GeometryMapper. 18 // See GeometryMapper.
19 struct PropertyTreeState { 19 struct PropertyTreeState {
20 PropertyTreeState() : PropertyTreeState(nullptr, nullptr, nullptr) {} 20 PropertyTreeState() : PropertyTreeState(nullptr, nullptr, nullptr) {}
21 21
22 PropertyTreeState( 22 PropertyTreeState(
23 TransformPaintPropertyNode* transform, 23 const TransformPaintPropertyNode* transform,
24 ClipPaintPropertyNode* clip, 24 const ClipPaintPropertyNode* clip,
25 EffectPaintPropertyNode* effect) 25 const EffectPaintPropertyNode* effect)
26 : transform(transform), clip(clip), effect(effect) {} 26 : transform(transform), clip(clip), effect(effect) {}
27 27
28 RefPtr<TransformPaintPropertyNode> transform; 28 RefPtr<const TransformPaintPropertyNode> transform;
29 RefPtr<ClipPaintPropertyNode> clip; 29 RefPtr<const ClipPaintPropertyNode> clip;
30 RefPtr<EffectPaintPropertyNode> effect; 30 RefPtr<const EffectPaintPropertyNode> effect;
31 }; 31 };
32 32
33 template <class A> 33 template <class A>
34 unsigned propertyTreeNodeDepth(const A* node) 34 unsigned propertyTreeNodeDepth(const A* node)
35 { 35 {
36 unsigned depth = 0; 36 unsigned depth = 0;
37 while (node) { 37 while (node) {
38 depth++; 38 depth++;
39 node = node->parent(); 39 node = node->parent();
40 } 40 }
(...skipping 23 matching lines...) Expand all
64 while (a != b) { 64 while (a != b) {
65 a = a->parent(); 65 a = a->parent();
66 b = b->parent(); 66 b = b->parent();
67 } 67 }
68 return a; 68 return a;
69 } 69 }
70 70
71 } // namespace blink 71 } // namespace blink
72 72
73 #endif // PropertyTreeState_h 73 #endif // PropertyTreeState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698