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

Side by Side Diff: Source/platform/graphics/paint/FixedPositionDisplayItem.h

Issue 1284203004: Generate scroll/clip display item hierarchy for SPv2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix assertion failure Created 5 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 FixedPositionDisplayItem_h 5 #ifndef FixedPositionDisplayItem_h
6 #define FixedPositionDisplayItem_h 6 #define FixedPositionDisplayItem_h
7 7
8 #include "platform/geometry/LayoutSize.h" 8 #include "platform/geometry/LayoutSize.h"
9 #include "platform/graphics/paint/DisplayItem.h" 9 #include "platform/graphics/paint/DisplayItem.h"
10 #include "wtf/FastAllocBase.h" 10 #include "wtf/FastAllocBase.h"
11 #include "wtf/PassOwnPtr.h" 11 #include "wtf/PassOwnPtr.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 class PLATFORM_EXPORT BeginFixedPositionDisplayItem final : public PairedBeginDi splayItem { 15 class PLATFORM_EXPORT BeginFixedPositionDisplayItem final : public PairedBeginDi splayItem {
16 public: 16 public:
17 BeginFixedPositionDisplayItem(const DisplayItemClientWrapper& client) 17 BeginFixedPositionDisplayItem(const DisplayItemClientWrapper& client, const DisplayItemClientWrapper& anchor)
18 : PairedBeginDisplayItem(client, BeginFixedPosition, sizeof(*this)) { } 18 : PairedBeginDisplayItem(client, BeginFixedPosition, sizeof(*this)), m_a nchor(anchor.displayItemClient()) { }
19 19
20 void replay(GraphicsContext&) final { } 20 void replay(GraphicsContext&) final { }
21 void appendToWebDisplayItemList(WebDisplayItemList*) const final; 21 void appendToWebDisplayItemList(WebDisplayItemList*) const final;
22
23 DisplayItemClient anchor() const { return m_anchor; }
jbroman 2015/09/09 19:58:31 nit: Would you mind a comment (here or as a class
24
25 // Note: This is only temporarily workaround before we implement true
26 // transform-tree-based rasterization. Do not use.
27 void setCounterScroll(const FloatSize& counterScroll) const { m_counterScrol l = counterScroll; }
28
29 private:
30 // Note: This is only temporarily workaround before we implement true
31 // transform-tree-based rasterization. Do not use.
32 mutable FloatSize m_counterScroll;
33
34 DisplayItemClient m_anchor;
22 }; 35 };
23 36
24 class PLATFORM_EXPORT EndFixedPositionDisplayItem final : public PairedEndDispla yItem { 37 class PLATFORM_EXPORT EndFixedPositionDisplayItem final : public PairedEndDispla yItem {
25 public: 38 public:
26 EndFixedPositionDisplayItem(const DisplayItemClientWrapper& client) 39 EndFixedPositionDisplayItem(const DisplayItemClientWrapper& client)
27 : PairedEndDisplayItem(client, EndFixedPosition, sizeof(*this)) { } 40 : PairedEndDisplayItem(client, EndFixedPosition, sizeof(*this)) { }
28 41
29 void replay(GraphicsContext&) final { } 42 void replay(GraphicsContext&) final { }
30 void appendToWebDisplayItemList(WebDisplayItemList*) const final; 43 void appendToWebDisplayItemList(WebDisplayItemList*) const final;
31 44
32 private: 45 private:
33 #if ENABLE(ASSERT) 46 #if ENABLE(ASSERT)
34 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot herType == BeginFixedPosition; } 47 bool isEndAndPairedWith(DisplayItem::Type otherType) const final { return ot herType == BeginFixedPosition; }
35 #endif 48 #endif
36 }; 49 };
37 50
38 } // namespace blink 51 } // namespace blink
39 52
40 #endif // FixedPositionDisplayItem_h 53 #endif // FixedPositionDisplayItem_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698