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

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

Issue 2894093002: Don't access DisplayItemClient::VisualRect() for cached display items. (Closed)
Patch Set: - Created 3 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CompositingDisplayItem_h 5 #ifndef CompositingDisplayItem_h
6 #define CompositingDisplayItem_h 6 #define CompositingDisplayItem_h
7 7
8 #include "platform/geometry/FloatRect.h" 8 #include "platform/geometry/FloatRect.h"
9 #include "platform/graphics/GraphicsTypes.h" 9 #include "platform/graphics/GraphicsTypes.h"
10 #include "platform/graphics/paint/DisplayItem.h" 10 #include "platform/graphics/paint/DisplayItem.h"
(...skipping 15 matching lines...) Expand all
26 : PairedBeginDisplayItem(client, kBeginCompositing, sizeof(*this)), 26 : PairedBeginDisplayItem(client, kBeginCompositing, sizeof(*this)),
27 xfer_mode_(xfer_mode), 27 xfer_mode_(xfer_mode),
28 opacity_(opacity), 28 opacity_(opacity),
29 has_bounds_(bounds), 29 has_bounds_(bounds),
30 color_filter_(color_filter) { 30 color_filter_(color_filter) {
31 if (bounds) 31 if (bounds)
32 bounds_ = FloatRect(*bounds); 32 bounds_ = FloatRect(*bounds);
33 } 33 }
34 34
35 void Replay(GraphicsContext&) const override; 35 void Replay(GraphicsContext&) const override;
36 void AppendToWebDisplayItemList(const IntRect&, 36 void AppendToWebDisplayItemList(const LayoutSize&,
37 WebDisplayItemList*) const override; 37 WebDisplayItemList*) const override;
38 38
39 private: 39 private:
40 #ifndef NDEBUG 40 #ifndef NDEBUG
41 void DumpPropertiesAsDebugString(WTF::StringBuilder&) const override; 41 void DumpPropertiesAsDebugString(WTF::StringBuilder&) const override;
42 #endif 42 #endif
43 bool Equals(const DisplayItem& other) const final { 43 bool Equals(const DisplayItem& other) const final {
44 return DisplayItem::Equals(other) && 44 return DisplayItem::Equals(other) &&
45 xfer_mode_ == static_cast<const BeginCompositingDisplayItem&>(other) 45 xfer_mode_ == static_cast<const BeginCompositingDisplayItem&>(other)
46 .xfer_mode_ && 46 .xfer_mode_ &&
(...skipping 15 matching lines...) Expand all
62 ColorFilter color_filter_; 62 ColorFilter color_filter_;
63 }; 63 };
64 64
65 class PLATFORM_EXPORT EndCompositingDisplayItem final 65 class PLATFORM_EXPORT EndCompositingDisplayItem final
66 : public PairedEndDisplayItem { 66 : public PairedEndDisplayItem {
67 public: 67 public:
68 EndCompositingDisplayItem(const DisplayItemClient& client) 68 EndCompositingDisplayItem(const DisplayItemClient& client)
69 : PairedEndDisplayItem(client, kEndCompositing, sizeof(*this)) {} 69 : PairedEndDisplayItem(client, kEndCompositing, sizeof(*this)) {}
70 70
71 void Replay(GraphicsContext&) const override; 71 void Replay(GraphicsContext&) const override;
72 void AppendToWebDisplayItemList(const IntRect&, 72 void AppendToWebDisplayItemList(const LayoutSize&,
73 WebDisplayItemList*) const override; 73 WebDisplayItemList*) const override;
74 74
75 private: 75 private:
76 #if DCHECK_IS_ON() 76 #if DCHECK_IS_ON()
77 bool IsEndAndPairedWith(DisplayItem::Type other_type) const final { 77 bool IsEndAndPairedWith(DisplayItem::Type other_type) const final {
78 return other_type == kBeginCompositing; 78 return other_type == kBeginCompositing;
79 } 79 }
80 #endif 80 #endif
81 }; 81 };
82 82
83 } // namespace blink 83 } // namespace blink
84 84
85 #endif // CompositingDisplayItem_h 85 #endif // CompositingDisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698