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 "platform/graphics/paint/SubsequenceRecorder.h" | 6 #include "platform/graphics/paint/SubsequenceRecorder.h" |
7 | 7 |
8 #include "platform/RuntimeEnabledFeatures.h" | 8 #include "platform/RuntimeEnabledFeatures.h" |
9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
10 #include "platform/graphics/paint/CachedDisplayItem.h" | 10 #include "platform/graphics/paint/CachedDisplayItem.h" |
11 #include "platform/graphics/paint/PaintController.h" | 11 #include "platform/graphics/paint/PaintController.h" |
12 #include "platform/graphics/paint/SubsequenceDisplayItem.h" | 12 #include "platform/graphics/paint/SubsequenceDisplayItem.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& contex
t, const DisplayItemClientWrapper& client) | 16 bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& contex
t, const DisplayItemClient& client) |
17 { | 17 { |
18 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) | 18 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) |
19 return false; | 19 return false; |
20 | 20 |
21 if (context.paintController().displayItemConstructionIsDisabled()) | 21 if (context.paintController().displayItemConstructionIsDisabled()) |
22 return false; | 22 return false; |
23 | 23 |
24 if (!context.paintController().clientCacheIsValid(client.displayItemClient()
)) | 24 if (!context.paintController().clientCacheIsValid(client)) |
25 return false; | 25 return false; |
26 | 26 |
27 context.paintController().createAndAppend<CachedDisplayItem>(client, Display
Item::CachedSubsequence); | 27 context.paintController().createAndAppend<CachedDisplayItem>(client, Display
Item::CachedSubsequence); |
28 | 28 |
29 #if ENABLE(ASSERT) | 29 #if ENABLE(ASSERT) |
30 // When under-invalidation checking is enabled, we output CachedSubsequence
display item | 30 // When under-invalidation checking is enabled, we output CachedSubsequence
display item |
31 // followed by forced painting of the subsequence. | 31 // followed by forced painting of the subsequence. |
32 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) | 32 if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) |
33 return false; | 33 return false; |
34 #endif | 34 #endif |
35 | 35 |
36 return true; | 36 return true; |
37 } | 37 } |
38 | 38 |
39 SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context, const Display
ItemClientWrapper& client) | 39 SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context, const Display
ItemClient& client) |
40 : m_paintController(context.paintController()) | 40 : m_paintController(context.paintController()) |
41 , m_client(client) | 41 , m_client(client) |
42 , m_beginSubsequenceIndex(0) | 42 , m_beginSubsequenceIndex(0) |
43 { | 43 { |
44 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) | 44 if (!RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) |
45 return; | 45 return; |
46 | 46 |
47 if (m_paintController.displayItemConstructionIsDisabled()) | 47 if (m_paintController.displayItemConstructionIsDisabled()) |
48 return; | 48 return; |
49 | 49 |
(...skipping 28 matching lines...) Expand all Loading... |
78 return; | 78 return; |
79 | 79 |
80 if (m_paintController.displayItemConstructionIsDisabled()) | 80 if (m_paintController.displayItemConstructionIsDisabled()) |
81 return; | 81 return; |
82 | 82 |
83 ASSERT(m_paintController.newDisplayItemList()[m_beginSubsequenceIndex].type(
) == DisplayItem::Subsequence); | 83 ASSERT(m_paintController.newDisplayItemList()[m_beginSubsequenceIndex].type(
) == DisplayItem::Subsequence); |
84 m_paintController.newDisplayItemList()[m_beginSubsequenceIndex].setSkippedCa
che(); | 84 m_paintController.newDisplayItemList()[m_beginSubsequenceIndex].setSkippedCa
che(); |
85 } | 85 } |
86 | 86 |
87 } // namespace blink | 87 } // namespace blink |
OLD | NEW |