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

Side by Side Diff: Source/core/paint/TransformRecorder.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 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/TransformRecorder.h" 6 #include "core/paint/TransformRecorder.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/TransformDisplayItem.h" 11 #include "platform/graphics/paint/TransformDisplayItem.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 TransformRecorder::TransformRecorder(GraphicsContext& context, const DisplayItem ClientWrapper& client, const AffineTransform& transform) 15 TransformRecorder::TransformRecorder(GraphicsContext& context, const DisplayItem ClientWrapper& client, const AffineTransform& transform)
16 : m_context(context) 16 : m_context(context)
17 , m_client(client) 17 , m_client(client)
18 { 18 {
19 m_skipRecordingForIdentityTransform = transform.isIdentity(); 19 m_skipRecordingForIdentityTransform = transform.isIdentity();
20 20
21 if (m_skipRecordingForIdentityTransform) 21 if (m_skipRecordingForIdentityTransform)
22 return; 22 return;
23 23
24 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 24 ALLOW_UNUSED_LOCAL(m_skipRecordingForIdentityTransform);
25 ASSERT(m_context.displayItemList()); 25 ALLOW_UNUSED_LOCAL(m_context);
26 if (m_context.displayItemList()->displayItemConstructionIsDisabled()) 26 ALLOW_UNUSED_LOCAL(m_client);
27 return; 27 //if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
28 m_context.displayItemList()->add(BeginTransformDisplayItem::create(m_cli ent, transform)); 28 // ASSERT(m_context.displayItemList());
29 } else { 29 // if (m_context.displayItemList()->displayItemConstructionIsDisabled())
30 BeginTransformDisplayItem beginTransform(m_client, transform); 30 // return;
31 beginTransform.replay(m_context); 31 // m_context.displayItemList()->add(BeginTransformDisplayItem::create(m_c lient, transform));
32 } 32 //} else {
33 // BeginTransformDisplayItem beginTransform(m_client, transform);
34 // beginTransform.replay(m_context);
35 //}
33 } 36 }
34 37
35 TransformRecorder::~TransformRecorder() 38 TransformRecorder::~TransformRecorder()
36 { 39 {
37 if (m_skipRecordingForIdentityTransform) 40 if (m_skipRecordingForIdentityTransform)
38 return; 41 return;
39 42
40 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) { 43 //if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
41 ASSERT(m_context.displayItemList()); 44 // ASSERT(m_context.displayItemList());
42 if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) { 45 // if (!m_context.displayItemList()->displayItemConstructionIsDisabled()) {
43 if (m_context.displayItemList()->lastDisplayItemIsNoopBegin()) 46 // if (m_context.displayItemList()->lastDisplayItemIsNoopBegin())
44 m_context.displayItemList()->removeLastDisplayItem(); 47 // m_context.displayItemList()->removeLastDisplayItem();
45 else 48 // else
46 m_context.displayItemList()->add(EndTransformDisplayItem::create (m_client)); 49 // m_context.displayItemList()->add(EndTransformDisplayItem::crea te(m_client));
47 } 50 // }
48 } else { 51 //} else {
49 EndTransformDisplayItem endTransform(m_client); 52 // EndTransformDisplayItem endTransform(m_client);
50 endTransform.replay(m_context); 53 // endTransform.replay(m_context);
51 } 54 //}
52 } 55 }
53 56
54 } // namespace blink 57 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/Transform3DRecorder.cpp ('k') | Source/platform/graphics/paint/CachedDisplayItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698