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

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

Issue 1193433004: Blink-side contiguous allocation of display items. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add ListContainer::AllocateAndConstructWithArguments and a TODO in DisplayItemList::findMatchingIte… Created 5 years, 5 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/FilterPainter.cpp ('k') | Source/core/paint/LayerClipRecorder.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/FloatClipRecorder.h" 6 #include "core/paint/FloatClipRecorder.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/FloatClipDisplayItem.h" 11 #include "platform/graphics/paint/FloatClipDisplayItem.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 FloatClipRecorder::FloatClipRecorder(GraphicsContext& context, const DisplayItem ClientWrapper& client, PaintPhase paintPhase, const FloatRect& clipRect) 15 FloatClipRecorder::FloatClipRecorder(GraphicsContext& context, const DisplayItem ClientWrapper& client, PaintPhase paintPhase, const FloatRect& clipRect)
16 : m_context(context) 16 : m_context(context)
17 , m_client(client) 17 , m_client(client)
18 , m_clipType(DisplayItem::paintPhaseToFloatClipType(paintPhase)) 18 , m_clipType(DisplayItem::paintPhaseToFloatClipType(paintPhase))
19 { 19 {
20 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 20 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
21 ASSERT(m_context.displayItemList()); 21 ASSERT(m_context.displayItemList());
22 if (m_context.displayItemList()->displayItemConstructionIsDisabled()) 22 if (m_context.displayItemList()->displayItemConstructionIsDisabled())
23 return; 23 return;
24 m_context.displayItemList()->add(FloatClipDisplayItem::create(m_client, m_clipType, clipRect)); 24 m_context.displayItemList()->createAndAppend<FloatClipDisplayItem>(m_cli ent, m_clipType, clipRect);
25 } else { 25 } else {
26 FloatClipDisplayItem clipDisplayItem(m_client, m_clipType, clipRect); 26 FloatClipDisplayItem floatClipDisplayItem(m_client, m_clipType, clipRect );
27 clipDisplayItem.replay(m_context); 27 floatClipDisplayItem.replay(m_context);
28 } 28 }
29 } 29 }
30 30
31 FloatClipRecorder::~FloatClipRecorder() 31 FloatClipRecorder::~FloatClipRecorder()
32 { 32 {
33 DisplayItem::Type endType = DisplayItem::floatClipTypeToEndFloatClipType(m_c lipType); 33 DisplayItem::Type endType = DisplayItem::floatClipTypeToEndFloatClipType(m_c lipType);
34 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 34 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
35 ASSERT(m_context.displayItemList()); 35 ASSERT(m_context.displayItemList());
36 if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) { 36 if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) {
37 if (m_context.displayItemList()->lastDisplayItemIsNoopBegin()) 37 if (m_context.displayItemList()->lastDisplayItemIsNoopBegin())
38 m_context.displayItemList()->removeLastDisplayItem(); 38 m_context.displayItemList()->removeLastDisplayItem();
39 else 39 else
40 m_context.displayItemList()->add(EndFloatClipDisplayItem::create (m_client, endType)); 40 m_context.displayItemList()->createAndAppend<EndFloatClipDisplay Item>(m_client, endType);
41 } 41 }
42 } else { 42 } else {
43 EndFloatClipDisplayItem endClipDisplayItem(m_client, endType); 43 EndFloatClipDisplayItem endClipDisplayItem(m_client, endType);
44 endClipDisplayItem.replay(m_context); 44 endClipDisplayItem.replay(m_context);
45 } 45 }
46 } 46 }
47 47
48 } // namespace blink 48 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/FilterPainter.cpp ('k') | Source/core/paint/LayerClipRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698