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

Side by Side Diff: Source/core/paint/ClipRecorder.h

Issue 719353004: [Slimming Paint] Track clip renderers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address reviewer comments Created 6 years, 1 month 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 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 ClipRecorder_h 5 #ifndef ClipRecorder_h
6 #define ClipRecorder_h 6 #define ClipRecorder_h
7 7
8 #include "core/paint/ViewDisplayList.h" 8 #include "core/paint/ViewDisplayList.h"
9 #include "core/rendering/PaintPhase.h" 9 #include "core/rendering/PaintPhase.h"
10 #include "core/rendering/RenderLayerModelObject.h"
10 #include "platform/geometry/RoundedRect.h" 11 #include "platform/geometry/RoundedRect.h"
11 #include "wtf/Vector.h" 12 #include "wtf/Vector.h"
12 13
13 namespace blink { 14 namespace blink {
14 15
15 class ClipRect; 16 class ClipRect;
16 class GraphicsContext; 17 class GraphicsContext;
17 class RenderObject;
18 class RenderLayer;
19 18
20 class ClipDisplayItem : public DisplayItem { 19 class ClipDisplayItem : public DisplayItem {
21 public: 20 public:
22 ClipDisplayItem(RenderObject* renderer, RenderLayer*, Type type, IntRect cli pRect) 21 ClipDisplayItem(const RenderLayerModelObject* renderer, Type type, IntRect c lipRect)
23 : DisplayItem(renderer, type), m_clipRect(clipRect) { } 22 : DisplayItem(renderer, type), m_clipRect(clipRect) { }
24 23
25 Vector<RoundedRect>& roundedRectClips() { return m_roundedRectClips; } 24 Vector<RoundedRect>& roundedRectClips() { return m_roundedRectClips; }
26 25
27 private: 26 private:
28 virtual void replay(GraphicsContext*) override; 27 virtual void replay(GraphicsContext*) override;
29 28
30 IntRect m_clipRect; 29 IntRect m_clipRect;
31 Vector<RoundedRect> m_roundedRectClips; 30 Vector<RoundedRect> m_roundedRectClips;
32 #ifndef NDEBUG 31 #ifndef NDEBUG
33 virtual WTF::String asDebugString() const override; 32 virtual WTF::String asDebugString() const override;
34 #endif 33 #endif
35 }; 34 };
36 35
37 class EndClipDisplayItem : public DisplayItem { 36 class EndClipDisplayItem : public DisplayItem {
38 public: 37 public:
39 EndClipDisplayItem() : DisplayItem(0, EndClip) { } 38 EndClipDisplayItem(const RenderLayerModelObject* renderer) : DisplayItem(ren derer, EndClip) { }
40 39
41 private: 40 private:
42 virtual void replay(GraphicsContext*) override; 41 virtual void replay(GraphicsContext*) override;
43 }; 42 };
44 43
45 class ClipRecorder { 44 class ClipRecorder {
46 public: 45 public:
47 explicit ClipRecorder(RenderLayer*, GraphicsContext*, DisplayItem::Type, con st ClipRect&); 46 explicit ClipRecorder(const RenderLayerModelObject*, GraphicsContext*, Displ ayItem::Type, const ClipRect&);
48 void addRoundedRectClip(const RoundedRect&); 47 void addRoundedRectClip(const RoundedRect&);
49 48
50 ~ClipRecorder(); 49 ~ClipRecorder();
51 50
52 private: 51 private:
53 ClipDisplayItem* m_clipDisplayItem; 52 ClipDisplayItem* m_clipDisplayItem;
54 GraphicsContext* m_graphicsContext; 53 GraphicsContext* m_graphicsContext;
55 RenderLayer* m_renderLayer; 54 const RenderLayerModelObject* m_renderer;
56 }; 55 };
57 56
58 } // namespace blink 57 } // namespace blink
59 58
60 #endif // ViewDisplayList_h 59 #endif // ViewDisplayList_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/paint/ClipRecorder.cpp » ('j') | Source/core/paint/ViewDisplayListTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698