OLD | NEW |
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 #include "config.h" | 5 #include "config.h" |
6 #include "core/paint/SubtreeRecorder.h" | 6 #include "core/paint/SubtreeRecorder.h" |
7 | 7 |
8 #include "core/layout/LayoutObject.h" | 8 #include "core/layout/LayoutObject.h" |
9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
10 #include "platform/graphics/GraphicsContext.h" | 10 #include "platform/graphics/GraphicsContext.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 ASSERT(m_displayItemList); | 25 ASSERT(m_displayItemList); |
26 } | 26 } |
27 | 27 |
28 SubtreeRecorder::~SubtreeRecorder() | 28 SubtreeRecorder::~SubtreeRecorder() |
29 { | 29 { |
30 if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) | 30 if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) |
31 return; | 31 return; |
32 | 32 |
33 if (m_begun) | 33 if (m_begun) |
34 m_displayItemList->add(EndSubtreeDisplayItem::create(m_subtreeRoot, Disp
layItem::paintPhaseToEndSubtreeType(m_paintPhase))); | 34 m_displayItemList->createAndAppendIfNeeded<EndSubtreeDisplayItem>(m_subt
reeRoot, DisplayItem::paintPhaseToEndSubtreeType(m_paintPhase)); |
35 } | 35 } |
36 | 36 |
37 void SubtreeRecorder::begin() | 37 void SubtreeRecorder::begin() |
38 { | 38 { |
39 if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) | 39 if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) |
40 return; | 40 return; |
41 if (m_displayItemList->displayItemConstructionIsDisabled()) | 41 if (m_displayItemList->displayItemConstructionIsDisabled()) |
42 return; | 42 return; |
43 m_displayItemList->add(BeginSubtreeDisplayItem::create(m_subtreeRoot, Displa
yItem::paintPhaseToBeginSubtreeType(m_paintPhase))); | 43 m_displayItemList->createAndAppendIfNeeded<BeginSubtreeDisplayItem>(m_subtre
eRoot, DisplayItem::paintPhaseToBeginSubtreeType(m_paintPhase)); |
44 m_begun = true; | 44 m_begun = true; |
45 } | 45 } |
46 | 46 |
47 } // namespace blink | 47 } // namespace blink |
OLD | NEW |