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

Side by Side Diff: Source/core/rendering/RenderLayerReflectionInfo.cpp

Issue 869323003: Oilpan: move RenderObjects off heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review-induced improvements Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "core/rendering/RenderReplica.h" 50 #include "core/rendering/RenderReplica.h"
51 #include "core/rendering/style/RenderStyle.h" 51 #include "core/rendering/style/RenderStyle.h"
52 #include "platform/transforms/ScaleTransformOperation.h" 52 #include "platform/transforms/ScaleTransformOperation.h"
53 #include "platform/transforms/TranslateTransformOperation.h" 53 #include "platform/transforms/TranslateTransformOperation.h"
54 54
55 #include "wtf/RefPtr.h" 55 #include "wtf/RefPtr.h"
56 56
57 namespace blink { 57 namespace blink {
58 58
59 RenderLayerReflectionInfo::RenderLayerReflectionInfo(RenderBox& renderer) 59 RenderLayerReflectionInfo::RenderLayerReflectionInfo(RenderBox& renderer)
60 : m_box(renderer) 60 : m_box(&renderer)
61 , m_isPaintingInsideReflection(false) 61 , m_isPaintingInsideReflection(false)
62 { 62 {
63 UseCounter::count(box().document(), UseCounter::Reflection); 63 UseCounter::count(box().document(), UseCounter::Reflection);
64 64
65 m_reflection = RenderReplica::createAnonymous(&box().document()); 65 m_reflection = RenderReplica::createAnonymous(&box().document());
66 m_reflection->setParent(m_box); // We create a 1-way connection. 66 m_reflection->setParent(m_box); // We create a 1-way connection.
67 } 67 }
68 68
69 void RenderLayerReflectionInfo::destroy() 69 void RenderLayerReflectionInfo::destroy()
70 { 70 {
71 if (!m_reflection->documentBeingDestroyed()) 71 if (!m_reflection->documentBeingDestroyed())
72 m_reflection->removeLayers(box().layer()); 72 m_reflection->removeLayers(box().layer());
73 73
74 m_reflection->setParent(0); 74 m_reflection->setParent(0);
75 m_reflection->destroy(); 75 m_reflection->destroy();
76 m_reflection = nullptr; 76 m_reflection = nullptr;
77 } 77 }
78 78
79 void RenderLayerReflectionInfo::trace(Visitor* visitor)
80 {
81 visitor->trace(m_box);
82 visitor->trace(m_reflection);
83 }
84
85 RenderLayer* RenderLayerReflectionInfo::reflectionLayer() const 79 RenderLayer* RenderLayerReflectionInfo::reflectionLayer() const
86 { 80 {
87 return m_reflection->layer(); 81 return m_reflection->layer();
88 } 82 }
89 83
90 void RenderLayerReflectionInfo::updateAfterStyleChange(const RenderStyle* oldSty le) 84 void RenderLayerReflectionInfo::updateAfterStyleChange(const RenderStyle* oldSty le)
91 { 85 {
92 RefPtr<RenderStyle> newStyle = RenderStyle::create(); 86 RefPtr<RenderStyle> newStyle = RenderStyle::create();
93 newStyle->inheritFrom(box().style()); 87 newStyle->inheritFrom(box().style());
94 88
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 if (m_isPaintingInsideReflection) 134 if (m_isPaintingInsideReflection)
141 return; 135 return;
142 136
143 // Mark that we are now inside replica painting. 137 // Mark that we are now inside replica painting.
144 m_isPaintingInsideReflection = true; 138 m_isPaintingInsideReflection = true;
145 LayerPainter(*reflectionLayer()).paintLayer(context, paintingInfo, flags); 139 LayerPainter(*reflectionLayer()).paintLayer(context, paintingInfo, flags);
146 m_isPaintingInsideReflection = false; 140 m_isPaintingInsideReflection = false;
147 } 141 }
148 142
149 } // namespace blink 143 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerReflectionInfo.h ('k') | Source/core/rendering/RenderLayerScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698