Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: Source/platform/graphics/paint/SubsequenceRecorder.cpp

Issue 1313223002: Simplify subtree (now subsequence) caching (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "platform/graphics/paint/SubsequenceRecorder.h"
7
8 #include "platform/RuntimeEnabledFeatures.h"
9 #include "platform/graphics/GraphicsContext.h"
10 #include "platform/graphics/paint/CachedDisplayItem.h"
11 #include "platform/graphics/paint/DisplayItemList.h"
12 #include "platform/graphics/paint/SubsequenceDisplayItem.h"
13
14 namespace blink {
15
16 bool SubsequenceRecorder::useCachedSubsequenceIfPossible(GraphicsContext& contex t, const DisplayItemClientWrapper& client)
17 {
18 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
19 return false;
20
21 ASSERT(context.displayItemList());
22
23 if (context.displayItemList()->displayItemConstructionIsDisabled() || Runtim eEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled())
24 return false;
25
26 if (!context.displayItemList()->clientCacheIsValid(client.displayItemClient( )))
27 return false;
28
29 context.displayItemList()->createAndAppend<CachedDisplayItem>(client, Displa yItem::CachedSubsequence);
30 return true;
31 }
32
33 SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context, const Display ItemClientWrapper& client)
34 : m_displayItemList(context.displayItemList())
35 , m_client(client)
36 {
37 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
38 return;
39
40 ASSERT(m_displayItemList);
41 m_displayItemList->createAndAppend<BeginSubsequenceDisplayItem>(m_client);
42 }
43
44 SubsequenceRecorder::~SubsequenceRecorder()
45 {
46 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
47 return;
48
49 // Don't remove no-op BeginSubsequence/EndSubsequence pairs because we need to
50 // match them later with CachedSubsequences.
51 m_displayItemList->createAndAppend<EndSubsequenceDisplayItem>(m_client);
52 }
53
54 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/SubsequenceRecorder.h ('k') | Source/platform/graphics/paint/SubtreeDisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698