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

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

Issue 1316163002: Make the LayoutRect->FloatRect constructor explicit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
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 | 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 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"
(...skipping 13 matching lines...) Expand all
24 if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelay edFull) 24 if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelay edFull)
25 return false; 25 return false;
26 return DrawingRecorder::useCachedDrawingIfPossible(context, layoutObject , displayItemType); 26 return DrawingRecorder::useCachedDrawingIfPossible(context, layoutObject , displayItemType);
27 } 27 }
28 28
29 static bool useCachedDrawingIfPossible(GraphicsContext& context, const Layou tObject& layoutObject, PaintPhase phase) 29 static bool useCachedDrawingIfPossible(GraphicsContext& context, const Layou tObject& layoutObject, PaintPhase phase)
30 { 30 {
31 return useCachedDrawingIfPossible(context, layoutObject, DisplayItem::pa intPhaseToDrawingType(phase)); 31 return useCachedDrawingIfPossible(context, layoutObject, DisplayItem::pa intPhaseToDrawingType(phase));
32 } 32 }
33 33
34 LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& la youtObject, DisplayItem::Type displayItemType, const FloatRect& clip) 34 LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& la youtObject, DisplayItem::Type displayItemType, const LayoutRect& clip)
jbroman 2015/08/26 19:06:43 This is the root cause of a bunch of my other comm
chrishtr 2015/08/26 20:53:51 Done.
35 { 35 {
36 // We may paint a delayed-invalidation object before it's actually inval idated. 36 // We may paint a delayed-invalidation object before it's actually inval idated.
37 if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelay edFull) 37 if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelay edFull)
38 m_cacheSkipper.emplace(context); 38 m_cacheSkipper.emplace(context);
39 m_drawingRecorder.emplace(context, layoutObject, displayItemType, clip); 39 m_drawingRecorder.emplace(context, layoutObject, displayItemType, FloatR ect(clip));
40 } 40 }
41 41
42 LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& la youtObject, PaintPhase phase, const FloatRect& clip) 42 LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& la youtObject, PaintPhase phase, const LayoutRect& clip)
43 : LayoutObjectDrawingRecorder(context, layoutObject, DisplayItem::paintP haseToDrawingType(phase), clip) { } 43 : LayoutObjectDrawingRecorder(context, layoutObject, DisplayItem::paintP haseToDrawingType(phase), clip) { }
44 44
45 LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& la youtObject, DisplayItem::Type type, const LayoutRect& clip)
46 : LayoutObjectDrawingRecorder(context, layoutObject, type, pixelSnappedI ntRect(clip)) { }
47
48 #if ENABLE(ASSERT) 45 #if ENABLE(ASSERT)
49 void setUnderInvalidationCheckingMode(DrawingDisplayItem::UnderInvalidationC heckingMode mode) { m_drawingRecorder->setUnderInvalidationCheckingMode(mode); } 46 void setUnderInvalidationCheckingMode(DrawingDisplayItem::UnderInvalidationC heckingMode mode) { m_drawingRecorder->setUnderInvalidationCheckingMode(mode); }
50 #endif 47 #endif
51 48
52 private: 49 private:
53 Optional<DisplayItemCacheSkipper> m_cacheSkipper; 50 Optional<DisplayItemCacheSkipper> m_cacheSkipper;
54 Optional<DrawingRecorder> m_drawingRecorder; 51 Optional<DrawingRecorder> m_drawingRecorder;
55 }; 52 };
56 53
57 } // namespace blink 54 } // namespace blink
58 55
59 #endif // LayoutObjectDrawingRecorder_h 56 #endif // LayoutObjectDrawingRecorder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698