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

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

Issue 1203343002: WIP for display item list backed by ListContainer Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/core/paint/SVGMaskPainter.cpp ('k') | Source/core/paint/SubtreeRecorder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "core/paint/ScrollRecorder.h" 6 #include "core/paint/ScrollRecorder.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/DisplayItemList.h" 10 #include "platform/graphics/paint/DisplayItemList.h"
11 #include "platform/graphics/paint/ScrollDisplayItem.h" 11 #include "platform/graphics/paint/ScrollDisplayItem.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 ScrollRecorder::ScrollRecorder(GraphicsContext& context, const DisplayItemClient Wrapper& client, PaintPhase phase, const IntSize& currentOffset) 15 ScrollRecorder::ScrollRecorder(GraphicsContext& context, const DisplayItemClient Wrapper& client, PaintPhase phase, const IntSize& currentOffset)
16 : m_client(client) 16 : m_client(client)
17 , m_beginItemType(DisplayItem::paintPhaseToScrollType(phase)) 17 , m_beginItemType(DisplayItem::paintPhaseToScrollType(phase))
18 , m_context(context) 18 , m_context(context)
19 { 19 {
20 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 20 ALLOW_UNUSED_LOCAL(m_client);
21 ASSERT(m_context.displayItemList()); 21 ALLOW_UNUSED_LOCAL(m_beginItemType);
22 if (m_context.displayItemList()->displayItemConstructionIsDisabled()) 22 ALLOW_UNUSED_LOCAL(m_context);
23 return; 23 //if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
24 m_context.displayItemList()->add(BeginScrollDisplayItem::create(m_client , m_beginItemType, currentOffset)); 24 // ASSERT(m_context.displayItemList());
25 } else { 25 // if (m_context.displayItemList()->displayItemConstructionIsDisabled())
26 BeginScrollDisplayItem scrollDisplayItem(m_client, m_beginItemType, curr entOffset); 26 // return;
27 scrollDisplayItem.replay(m_context); 27 // m_context.displayItemList()->add(BeginScrollDisplayItem::create(m_clie nt, m_beginItemType, currentOffset));
28 } 28 //} else {
29 // BeginScrollDisplayItem scrollDisplayItem(m_client, m_beginItemType, cu rrentOffset);
30 // scrollDisplayItem.replay(m_context);
31 //}
29 } 32 }
30 33
31 ScrollRecorder::~ScrollRecorder() 34 ScrollRecorder::~ScrollRecorder()
32 { 35 {
33 DisplayItem::Type endItemType = DisplayItem::scrollTypeToEndScrollType(m_beg inItemType); 36 //DisplayItem::Type endItemType = DisplayItem::scrollTypeToEndScrollType(m_b eginItemType);
34 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 37 //if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
35 ASSERT(m_context.displayItemList()); 38 // ASSERT(m_context.displayItemList());
36 if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) { 39 // if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) {
37 if (m_context.displayItemList()->lastDisplayItemIsNoopBegin()) 40 // if (m_context.displayItemList()->lastDisplayItemIsNoopBegin())
38 m_context.displayItemList()->removeLastDisplayItem(); 41 // m_context.displayItemList()->removeLastDisplayItem();
39 else 42 // else
40 m_context.displayItemList()->add(EndScrollDisplayItem::create(m_ client, endItemType)); 43 // m_context.displayItemList()->add(EndScrollDisplayItem::create( m_client, endItemType));
41 } 44 // }
42 } else { 45 //} else {
43 EndScrollDisplayItem endScrollDisplayItem(m_client, endItemType); 46 // EndScrollDisplayItem endScrollDisplayItem(m_client, endItemType);
44 endScrollDisplayItem.replay(m_context); 47 // endScrollDisplayItem.replay(m_context);
45 } 48 //}
46 } 49 }
47 50
48 } // namespace blink 51 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/SVGMaskPainter.cpp ('k') | Source/core/paint/SubtreeRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698