| 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 "platform/graphics/paint/SubsequenceRecorder.h" | 5 #include "platform/graphics/paint/SubsequenceRecorder.h" |
| 6 | 6 |
| 7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
| 8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
| 9 #include "platform/graphics/paint/PaintController.h" | 9 #include "platform/graphics/paint/PaintController.h" |
| 10 #include "platform/graphics/paint/SubsequenceDisplayItem.h" | 10 #include "platform/graphics/paint/SubsequenceDisplayItem.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 SubsequenceRecorder::~SubsequenceRecorder() { | 26 SubsequenceRecorder::~SubsequenceRecorder() { |
| 27 if (m_paintController.displayItemConstructionIsDisabled()) | 27 if (m_paintController.displayItemConstructionIsDisabled()) |
| 28 return; | 28 return; |
| 29 | 29 |
| 30 if (m_paintController.lastDisplayItemIsNoopBegin()) { | 30 if (m_paintController.lastDisplayItemIsNoopBegin()) { |
| 31 ASSERT(m_beginSubsequenceIndex == | 31 ASSERT(m_beginSubsequenceIndex == |
| 32 m_paintController.newDisplayItemList().size() - 1); | 32 m_paintController.newDisplayItemList().size() - 1); |
| 33 // Remove uncacheable no-op BeginSubsequence/EndSubsequence pairs. | 33 // Remove uncacheable no-op BeginSubsequence/EndSubsequence pairs. |
| 34 // Don't remove cacheable no-op pairs because we need to match them later wi
th CachedSubsequences. | 34 // Don't remove cacheable no-op pairs because we need to match them later |
| 35 // with CachedSubsequences. |
| 35 if (m_paintController.newDisplayItemList().last().skippedCache()) { | 36 if (m_paintController.newDisplayItemList().last().skippedCache()) { |
| 36 m_paintController.removeLastDisplayItem(); | 37 m_paintController.removeLastDisplayItem(); |
| 37 return; | 38 return; |
| 38 } | 39 } |
| 39 } | 40 } |
| 40 | 41 |
| 41 m_paintController.createAndAppend<EndSubsequenceDisplayItem>(m_client); | 42 m_paintController.createAndAppend<EndSubsequenceDisplayItem>(m_client); |
| 42 } | 43 } |
| 43 | 44 |
| 44 } // namespace blink | 45 } // namespace blink |
| OLD | NEW |