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

Side by Side Diff: Source/platform/graphics/paint/ClipPathRecorder.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
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 "platform/graphics/paint/ClipPathRecorder.h" 6 #include "platform/graphics/paint/ClipPathRecorder.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/ClipPathDisplayItem.h" 10 #include "platform/graphics/paint/ClipPathDisplayItem.h"
11 #include "platform/graphics/paint/DisplayItemList.h" 11 #include "platform/graphics/paint/DisplayItemList.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 ClipPathRecorder::ClipPathRecorder(GraphicsContext& context, const DisplayItemCl ientWrapper& client, const Path& clipPath) 15 ClipPathRecorder::ClipPathRecorder(GraphicsContext& context, const DisplayItemCl ientWrapper& client, const Path& clipPath)
16 : m_context(context) 16 : m_context(context)
17 , m_client(client) 17 , m_client(client)
18 { 18 {
19 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 19 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
20 ASSERT(m_context.displayItemList()); 20 ASSERT(m_context.displayItemList());
21 if (m_context.displayItemList()->displayItemConstructionIsDisabled()) 21 if (m_context.displayItemList()->displayItemConstructionIsDisabled())
22 return; 22 return;
23 m_context.displayItemList()->add(BeginClipPathDisplayItem::create(m_clie nt, clipPath)); 23 m_context.displayItemList()->createAndAppend<BeginClipPathDisplayItem>(m _client, clipPath);
24 } else { 24 } else {
25 BeginClipPathDisplayItem clipPathDisplayItem(m_client, clipPath); 25 BeginClipPathDisplayItem clipPathDisplayItem(m_client, clipPath);
26 clipPathDisplayItem.replay(m_context); 26 clipPathDisplayItem.replay(m_context);
27 } 27 }
28 } 28 }
29 29
30 ClipPathRecorder::~ClipPathRecorder() 30 ClipPathRecorder::~ClipPathRecorder()
31 { 31 {
32 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 32 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
33 ASSERT(m_context.displayItemList()); 33 ASSERT(m_context.displayItemList());
34 if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) { 34 if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) {
35 if (m_context.displayItemList()->lastDisplayItemIsNoopBegin()) 35 if (m_context.displayItemList()->lastDisplayItemIsNoopBegin())
36 m_context.displayItemList()->removeLastDisplayItem(); 36 m_context.displayItemList()->removeLastDisplayItem();
37 else 37 else
38 m_context.displayItemList()->add(EndClipPathDisplayItem::create( m_client)); 38 m_context.displayItemList()->createAndAppend<EndClipPathDisplayI tem>(m_client);
39 } 39 }
40 } else { 40 } else {
41 EndClipPathDisplayItem endClipPathDisplayItem(m_client); 41 EndClipPathDisplayItem endClipPathDisplayItem(m_client);
42 endClipPathDisplayItem.replay(m_context); 42 endClipPathDisplayItem.replay(m_context);
43 } 43 }
44 } 44 }
45 45
46 } // namespace blink 46 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/paint/ClipPathDisplayItem.h ('k') | Source/platform/graphics/paint/ClipRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698