OLD | NEW |
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 LayoutObjectDrawingRecorder_h | 5 #ifndef LayoutObjectDrawingRecorder_h |
6 #define LayoutObjectDrawingRecorder_h | 6 #define LayoutObjectDrawingRecorder_h |
7 | 7 |
8 #include "core/layout/LayoutObject.h" | 8 #include "core/layout/LayoutObject.h" |
9 #include "core/paint/PaintPhase.h" | 9 #include "core/paint/PaintPhase.h" |
10 #include "platform/geometry/LayoutRect.h" | 10 #include "platform/geometry/LayoutRect.h" |
11 #include "platform/graphics/paint/DisplayItemCacheSkipper.h" | 11 #include "platform/graphics/paint/DisplayItemCacheSkipper.h" |
12 #include "platform/graphics/paint/DrawingRecorder.h" | 12 #include "platform/graphics/paint/DrawingRecorder.h" |
| 13 #include "wtf/Allocator.h" |
13 #include "wtf/Optional.h" | 14 #include "wtf/Optional.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class GraphicsContext; | 18 class GraphicsContext; |
18 | 19 |
19 // Convenience wrapper of DrawingRecorder for LayoutObject painters. | 20 // Convenience wrapper of DrawingRecorder for LayoutObject painters. |
20 class LayoutObjectDrawingRecorder final { | 21 class LayoutObjectDrawingRecorder final { |
| 22 ALLOW_ONLY_INLINE_ALLOCATION(); |
21 public: | 23 public: |
22 static bool useCachedDrawingIfPossible(GraphicsContext& context, const Layou
tObject& layoutObject, DisplayItem::Type displayItemType) | 24 static bool useCachedDrawingIfPossible(GraphicsContext& context, const Layou
tObject& layoutObject, DisplayItem::Type displayItemType) |
23 { | 25 { |
24 if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelay
edFull) | 26 if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelay
edFull) |
25 return false; | 27 return false; |
26 return DrawingRecorder::useCachedDrawingIfPossible(context, layoutObject
, displayItemType); | 28 return DrawingRecorder::useCachedDrawingIfPossible(context, layoutObject
, displayItemType); |
27 } | 29 } |
28 | 30 |
29 static bool useCachedDrawingIfPossible(GraphicsContext& context, const Layou
tObject& layoutObject, PaintPhase phase) | 31 static bool useCachedDrawingIfPossible(GraphicsContext& context, const Layou
tObject& layoutObject, PaintPhase phase) |
30 { | 32 { |
(...skipping 16 matching lines...) Expand all Loading... |
47 #endif | 49 #endif |
48 | 50 |
49 private: | 51 private: |
50 Optional<DisplayItemCacheSkipper> m_cacheSkipper; | 52 Optional<DisplayItemCacheSkipper> m_cacheSkipper; |
51 Optional<DrawingRecorder> m_drawingRecorder; | 53 Optional<DrawingRecorder> m_drawingRecorder; |
52 }; | 54 }; |
53 | 55 |
54 } // namespace blink | 56 } // namespace blink |
55 | 57 |
56 #endif // LayoutObjectDrawingRecorder_h | 58 #endif // LayoutObjectDrawingRecorder_h |
OLD | NEW |