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

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

Issue 1319893002: Make classes and structures in core/paint fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Intel Corporation. All rights reserved. 3 * Copyright (C) 2013 Intel Corporation. All rights reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@web.de> 10 * Christian Biesinger <cbiesinger@web.de>
(...skipping 29 matching lines...) Expand all
40 * other provisions required by the MPL or the GPL, as the case may be. 40 * other provisions required by the MPL or the GPL, as the case may be.
41 * If you do not delete the provisions above, a recipient may use your 41 * If you do not delete the provisions above, a recipient may use your
42 * version of this file under any of the LGPL, the MPL or the GPL. 42 * version of this file under any of the LGPL, the MPL or the GPL.
43 */ 43 */
44 44
45 #ifndef DeprecatedPaintLayerPaintingInfo_h 45 #ifndef DeprecatedPaintLayerPaintingInfo_h
46 #define DeprecatedPaintLayerPaintingInfo_h 46 #define DeprecatedPaintLayerPaintingInfo_h
47 47
48 #include "core/paint/PaintPhase.h" 48 #include "core/paint/PaintPhase.h"
49 #include "platform/geometry/LayoutRect.h" 49 #include "platform/geometry/LayoutRect.h"
50 #include "wtf/Allocator.h"
50 51
51 namespace blink { 52 namespace blink {
52 53
53 class DeprecatedPaintLayer; 54 class DeprecatedPaintLayer;
54 class LayoutObject; 55 class LayoutObject;
55 56
56 enum PaintLayerFlag { 57 enum PaintLayerFlag {
57 PaintLayerNoFlag = 0, 58 PaintLayerNoFlag = 0,
58 PaintLayerHaveTransparency = 1, 59 PaintLayerHaveTransparency = 1,
59 PaintLayerAppliedTransform = 1 << 1, 60 PaintLayerAppliedTransform = 1 << 1,
60 PaintLayerUncachedClipRects = 1 << 2, 61 PaintLayerUncachedClipRects = 1 << 2,
61 PaintLayerPaintingReflection = 1 << 3, 62 PaintLayerPaintingReflection = 1 << 3,
62 PaintLayerPaintingOverlayScrollbars = 1 << 4, 63 PaintLayerPaintingOverlayScrollbars = 1 << 4,
63 PaintLayerPaintingCompositingBackgroundPhase = 1 << 5, 64 PaintLayerPaintingCompositingBackgroundPhase = 1 << 5,
64 PaintLayerPaintingCompositingForegroundPhase = 1 << 6, 65 PaintLayerPaintingCompositingForegroundPhase = 1 << 6,
65 PaintLayerPaintingCompositingMaskPhase = 1 << 7, 66 PaintLayerPaintingCompositingMaskPhase = 1 << 7,
66 PaintLayerPaintingCompositingScrollingPhase = 1 << 8, 67 PaintLayerPaintingCompositingScrollingPhase = 1 << 8,
67 PaintLayerPaintingOverflowContents = 1 << 9, 68 PaintLayerPaintingOverflowContents = 1 << 9,
68 PaintLayerPaintingRootBackgroundOnly = 1 << 10, 69 PaintLayerPaintingRootBackgroundOnly = 1 << 10,
69 PaintLayerPaintingSkipRootBackground = 1 << 11, 70 PaintLayerPaintingSkipRootBackground = 1 << 11,
70 PaintLayerPaintingChildClippingMaskPhase = 1 << 12, 71 PaintLayerPaintingChildClippingMaskPhase = 1 << 12,
71 PaintLayerPaintingRenderingClipPathAsMask = 1 << 13, 72 PaintLayerPaintingRenderingClipPathAsMask = 1 << 13,
72 PaintLayerPaintingCompositingAllPhases = (PaintLayerPaintingCompositingBackg roundPhase | PaintLayerPaintingCompositingForegroundPhase | PaintLayerPaintingCo mpositingMaskPhase) 73 PaintLayerPaintingCompositingAllPhases = (PaintLayerPaintingCompositingBackg roundPhase | PaintLayerPaintingCompositingForegroundPhase | PaintLayerPaintingCo mpositingMaskPhase)
73 }; 74 };
74 75
75 typedef unsigned PaintLayerFlags; 76 typedef unsigned PaintLayerFlags;
76 77
77 struct DeprecatedPaintLayerPaintingInfo { 78 struct DeprecatedPaintLayerPaintingInfo {
79 STACK_ALLOCATED();
78 DeprecatedPaintLayerPaintingInfo(DeprecatedPaintLayer* inRootLayer, const La youtRect& inDirtyRect, 80 DeprecatedPaintLayerPaintingInfo(DeprecatedPaintLayer* inRootLayer, const La youtRect& inDirtyRect,
79 GlobalPaintFlags globalPaintFlags, const LayoutSize& inSubPixelAccumulat ion, 81 GlobalPaintFlags globalPaintFlags, const LayoutSize& inSubPixelAccumulat ion,
80 LayoutObject* inPaintingRoot = 0) 82 LayoutObject* inPaintingRoot = 0)
81 : rootLayer(inRootLayer) 83 : rootLayer(inRootLayer)
82 , paintingRoot(inPaintingRoot) 84 , paintingRoot(inPaintingRoot)
83 , paintDirtyRect(inDirtyRect) 85 , paintDirtyRect(inDirtyRect)
84 , subPixelAccumulation(inSubPixelAccumulation) 86 , subPixelAccumulation(inSubPixelAccumulation)
85 , clipToDirtyRect(true) 87 , clipToDirtyRect(true)
86 , m_globalPaintFlags(globalPaintFlags) 88 , m_globalPaintFlags(globalPaintFlags)
87 { } 89 { }
88 90
89 GlobalPaintFlags globalPaintFlags() const { return m_globalPaintFlags; } 91 GlobalPaintFlags globalPaintFlags() const { return m_globalPaintFlags; }
90 92
91 // TODO(jchaffraix): We should encapsulate all these fields. 93 // TODO(jchaffraix): We should encapsulate all these fields.
92 DeprecatedPaintLayer* rootLayer; 94 DeprecatedPaintLayer* rootLayer;
93 LayoutObject* paintingRoot; // only paint descendants of this object 95 LayoutObject* paintingRoot; // only paint descendants of this object
94 LayoutRect paintDirtyRect; // relative to rootLayer; 96 LayoutRect paintDirtyRect; // relative to rootLayer;
95 LayoutSize subPixelAccumulation; 97 LayoutSize subPixelAccumulation;
96 IntSize scrollOffsetAccumulation; 98 IntSize scrollOffsetAccumulation;
97 bool clipToDirtyRect; 99 bool clipToDirtyRect;
98 100
99 private: 101 private:
100 const GlobalPaintFlags m_globalPaintFlags; 102 const GlobalPaintFlags m_globalPaintFlags;
101 }; 103 };
102 104
103 } // namespace blink 105 } // namespace blink
104 106
105 #endif // DeprecatedPaintLayerPaintingInfo_h 107 #endif // DeprecatedPaintLayerPaintingInfo_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698