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

Side by Side Diff: Source/platform/graphics/paint/ClipPathRecorder.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
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 ALLOW_UNUSED_LOCAL(m_context);
20 ASSERT(m_context.displayItemList()); 20 ALLOW_UNUSED_LOCAL(m_client);
21 if (m_context.displayItemList()->displayItemConstructionIsDisabled()) 21 //if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
22 return; 22 // ASSERT(m_context.displayItemList());
23 m_context.displayItemList()->add(BeginClipPathDisplayItem::create(m_clie nt, clipPath)); 23 // if (m_context.displayItemList()->displayItemConstructionIsDisabled())
24 } else { 24 // return;
25 BeginClipPathDisplayItem clipPathDisplayItem(m_client, clipPath); 25 // m_context.displayItemList()->add(BeginClipPathDisplayItem::create(m_cl ient, clipPath));
26 clipPathDisplayItem.replay(m_context); 26 //} else {
27 } 27 // BeginClipPathDisplayItem clipPathDisplayItem(m_client, clipPath);
28 // clipPathDisplayItem.replay(m_context);
29 //}
28 } 30 }
29 31
30 ClipPathRecorder::~ClipPathRecorder() 32 ClipPathRecorder::~ClipPathRecorder()
31 { 33 {
32 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 34 //if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
33 ASSERT(m_context.displayItemList()); 35 // ASSERT(m_context.displayItemList());
34 if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) { 36 // if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) {
35 if (m_context.displayItemList()->lastDisplayItemIsNoopBegin()) 37 // if (m_context.displayItemList()->lastDisplayItemIsNoopBegin())
36 m_context.displayItemList()->removeLastDisplayItem(); 38 // m_context.displayItemList()->removeLastDisplayItem();
37 else 39 // else
38 m_context.displayItemList()->add(EndClipPathDisplayItem::create( m_client)); 40 // m_context.displayItemList()->add(EndClipPathDisplayItem::creat e(m_client));
39 } 41 // }
40 } else { 42 //} else {
41 EndClipPathDisplayItem endClipPathDisplayItem(m_client); 43 // EndClipPathDisplayItem endClipPathDisplayItem(m_client);
42 endClipPathDisplayItem.replay(m_context); 44 // endClipPathDisplayItem.replay(m_context);
43 } 45 //}
44 } 46 }
45 47
46 } // namespace blink 48 } // 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