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

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: Ready for review 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
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()->createAndAppendIfNeeded<BeginClipPathDispla yItem>(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 return; 35 return;
36 m_context.displayItemList()->add(EndClipPathDisplayItem::create(m_client )); 36 m_context.displayItemList()->createAndAppendIfNeeded<EndClipPathDisplayI tem>(m_client);
37 } else { 37 } else {
38 EndClipPathDisplayItem endClipPathDisplayItem(m_client); 38 EndClipPathDisplayItem endClipPathDisplayItem(m_client);
39 endClipPathDisplayItem.replay(m_context); 39 endClipPathDisplayItem.replay(m_context);
40 } 40 }
41 } 41 }
42 42
43 } // namespace blink 43 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698