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/CachedDisplayItem.h" | 9 #include "platform/graphics/paint/CachedDisplayItem.h" |
10 #include "platform/graphics/paint/PaintController.h" | 10 #include "platform/graphics/paint/PaintController.h" |
11 #include "platform/graphics/paint/SubsequenceDisplayItem.h" | 11 #include "platform/graphics/paint/SubsequenceDisplayItem.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& contex
t, const DisplayItemClient& client) | 15 bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& contex
t, const DisplayItemClient& client) |
16 { | 16 { |
17 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) | 17 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) |
18 return false; | 18 return false; |
19 | 19 |
20 if (context.paintController().displayItemConstructionIsDisabled()) | 20 if (context.paintController().displayItemConstructionIsDisabled() || context
.paintController().subsequenceCachingIsDisabled()) |
21 return false; | 21 return false; |
22 | 22 |
23 if (!context.paintController().clientCacheIsValid(client)) | 23 if (!context.paintController().clientCacheIsValid(client)) |
24 return false; | 24 return false; |
25 | 25 |
26 context.paintController().createAndAppend<CachedDisplayItem>(client, Display
Item::CachedSubsequence); | 26 context.paintController().createAndAppend<CachedDisplayItem>(client, Display
Item::CachedSubsequence); |
27 | 27 |
28 #if ENABLE(ASSERT) | 28 #if ENABLE(ASSERT) |
29 // When under-invalidation checking is enabled, we output CachedSubsequence
display item | 29 // When under-invalidation checking is enabled, we output CachedSubsequence
display item |
30 // followed by forced painting of the subsequence. | 30 // followed by forced painting of the subsequence. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 if (m_paintController.newDisplayItemList().last().skippedCache()) { | 65 if (m_paintController.newDisplayItemList().last().skippedCache()) { |
66 m_paintController.removeLastDisplayItem(); | 66 m_paintController.removeLastDisplayItem(); |
67 return; | 67 return; |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 m_paintController.createAndAppend<EndSubsequenceDisplayItem>(m_client); | 71 m_paintController.createAndAppend<EndSubsequenceDisplayItem>(m_client); |
72 } | 72 } |
73 | 73 |
74 } // namespace blink | 74 } // namespace blink |
OLD | NEW |