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 16 matching lines...) Expand all Loading... |
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 if (m_displayItemList->lastDisplayItemIsNoopBegin()) | 34 if (m_displayItemList->lastDisplayItemIsNoopBegin()) |
35 m_displayItemList->removeLastDisplayItem(); | 35 m_displayItemList->removeLastDisplayItem(); |
36 else | 36 else |
37 m_displayItemList->add(EndSubtreeDisplayItem::create(m_subtreeRoot,
DisplayItem::paintPhaseToEndSubtreeType(m_paintPhase))); | 37 m_displayItemList->createAndAppend<EndSubtreeDisplayItem>(m_subtreeR
oot, DisplayItem::paintPhaseToEndSubtreeType(m_paintPhase)); |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 void SubtreeRecorder::begin() | 41 void SubtreeRecorder::begin() |
42 { | 42 { |
43 if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) | 43 if (!RuntimeEnabledFeatures::slimmingPaintEnabled()) |
44 return; | 44 return; |
45 if (m_displayItemList->displayItemConstructionIsDisabled()) | 45 if (m_displayItemList->displayItemConstructionIsDisabled()) |
46 return; | 46 return; |
47 m_displayItemList->add(BeginSubtreeDisplayItem::create(m_subtreeRoot, Displa
yItem::paintPhaseToBeginSubtreeType(m_paintPhase))); | 47 m_displayItemList->createAndAppend<BeginSubtreeDisplayItem>(m_subtreeRoot, D
isplayItem::paintPhaseToBeginSubtreeType(m_paintPhase)); |
48 m_begun = true; | 48 m_begun = true; |
49 } | 49 } |
50 | 50 |
51 } // namespace blink | 51 } // namespace blink |
OLD | NEW |