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

Side by Side Diff: Source/core/paint/SubtreeRecorder.cpp

Issue 892293002: First version of new merge algorithm (not enabled yet) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase again again Created 5 years, 10 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
« no previous file with comments | « Source/core/paint/SubtreeRecorder.h ('k') | Source/core/paint/ViewDisplayListTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "core/paint/SubtreeRecorder.h"
7
8 #include "core/layout/LayoutObject.h"
9 #include "platform/RuntimeEnabledFeatures.h"
10 #include "platform/graphics/GraphicsContext.h"
11 #include "platform/graphics/paint/DisplayItemList.h"
12 #include "platform/graphics/paint/SubtreeDisplayItem.h"
13
14 namespace blink {
15
16 SubtreeRecorder::SubtreeRecorder(GraphicsContext* context, const LayoutObject& s ubtreeRoot, PaintPhase paintPhase)
17 : m_displayItemList(context->displayItemList())
18 , m_subtreeRoot(subtreeRoot)
19 , m_paintPhase(paintPhase)
20 , m_begun(false)
21 {
22 if (!RuntimeEnabledFeatures::slimmingPaintEnabled() || !RuntimeEnabledFeatur es::slimmingPaintDisplayItemCacheEnabled())
23 return;
24
25 ASSERT(m_displayItemList);
26 }
27
28 SubtreeRecorder::~SubtreeRecorder()
29 {
30 if (!RuntimeEnabledFeatures::slimmingPaintEnabled() || !RuntimeEnabledFeatur es::slimmingPaintDisplayItemCacheEnabled())
31 return;
32
33 if (m_begun)
34 addDisplayItem(EndSubtreeDisplayItem::create(m_subtreeRoot.displayItemCl ient(), DisplayItem::paintPhaseToEndSubtreeType(m_paintPhase)));
35 else if (m_displayItemList->clientCacheIsValid(m_subtreeRoot.displayItemClie nt()))
36 addDisplayItem(SubtreeCachedDisplayItem::create(m_subtreeRoot.displayIte mClient(), DisplayItem::paintPhaseToSubtreeCachedType(m_paintPhase)));
37 }
38
39 void SubtreeRecorder::begin()
40 {
41 if (!RuntimeEnabledFeatures::slimmingPaintEnabled() || !RuntimeEnabledFeatur es::slimmingPaintDisplayItemCacheEnabled())
42 return;
43
44 addDisplayItem(BeginSubtreeDisplayItem::create(m_subtreeRoot.displayItemClie nt(), DisplayItem::paintPhaseToBeginSubtreeType(m_paintPhase)));
45 m_begun = true;
46 }
47
48 void SubtreeRecorder::addDisplayItem(PassOwnPtr<DisplayItem> displayItem)
49 {
50 #ifndef NDEBUG
51 displayItem->setClientDebugString(String::format("subtreeRoot: \"%p %s\"", & m_subtreeRoot, m_subtreeRoot.debugName().utf8().data()));
52 #endif
53 m_displayItemList->add(displayItem);
54 }
55
56 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/SubtreeRecorder.h ('k') | Source/core/paint/ViewDisplayListTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698