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

Side by Side Diff: third_party/WebKit/Source/core/paint/RarePaintData.h

Issue 2812593003: Remove caching of contents paint properties (Closed)
Patch Set: Address reviewer comments Created 3 years, 8 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 RarePaintData_h 5 #ifndef RarePaintData_h
6 #define RarePaintData_h 6 #define RarePaintData_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 #include "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
(...skipping 18 matching lines...) Expand all
29 return paint_properties_.get(); 29 return paint_properties_.get();
30 } 30 }
31 ObjectPaintProperties& EnsurePaintProperties(); 31 ObjectPaintProperties& EnsurePaintProperties();
32 32
33 PropertyTreeState* LocalBorderBoxProperties() const { 33 PropertyTreeState* LocalBorderBoxProperties() const {
34 return local_border_box_properties_.get(); 34 return local_border_box_properties_.get();
35 } 35 }
36 36
37 void ClearLocalBorderBoxProperties(); 37 void ClearLocalBorderBoxProperties();
38 void SetLocalBorderBoxProperties(PropertyTreeState&); 38 void SetLocalBorderBoxProperties(PropertyTreeState&);
39 const PropertyTreeState* ContentsProperties() const; 39
40 // This is the complete set of property nodes that can be used to paint the
41 // contents of this object. It is similar to local_border_box_properties_ but
42 // includes properties (e.g., overflow clip, scroll translation) that apply
43 // to contents.
44 PropertyTreeState ContentsProperties() const;
40 45
41 private: 46 private:
42 // Holds references to the paint property nodes created by this object. 47 // Holds references to the paint property nodes created by this object.
43 std::unique_ptr<ObjectPaintProperties> paint_properties_; 48 std::unique_ptr<ObjectPaintProperties> paint_properties_;
44 49
45 // This is a complete set of property nodes that should be used as a 50 // This is a complete set of property nodes that should be used as a
46 // starting point to paint a LayoutObject. This data is cached because some 51 // starting point to paint a LayoutObject. This data is cached because some
47 // properties inherit from the containing block chain instead of the 52 // properties inherit from the containing block chain instead of the
48 // painting parent and cannot be derived in O(1) during the paint walk. 53 // painting parent and cannot be derived in O(1) during the paint walk.
49 // 54 //
50 // For example: <div style='opacity: 0.3;'/> 55 // For example: <div style='opacity: 0.3;'/>
51 // The div's local border box properties would have an opacity 0.3 effect 56 // The div's local border box properties would have an opacity 0.3 effect
52 // node. Even though the div has no transform, its local border box 57 // node. Even though the div has no transform, its local border box
53 // properties would have a transform node that points to the div's 58 // properties would have a transform node that points to the div's
54 // ancestor transform space. 59 // ancestor transform space.
55 std::unique_ptr<PropertyTreeState> local_border_box_properties_; 60 std::unique_ptr<PropertyTreeState> local_border_box_properties_;
56
57 // This is the complete set of property nodes that can be used to paint the
58 // contents of this object. It is similar to m_localBorderBoxProperties but
59 // includes properties (e.g., overflow clip, scroll translation) that apply
60 // to contents. This cached value is derived from m_localBorderBoxProperties
61 // and m_paintProperties and should be invalidated when these change.
62 mutable std::unique_ptr<PropertyTreeState> contents_properties_;
63 }; 61 };
64 62
65 } // namespace blink 63 } // namespace blink
66 64
67 #endif 65 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698