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

Side by Side Diff: Source/core/paint/SVGPaintContext.cpp

Issue 1035463002: [S.P.] Use LayoutObject references instead of pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: codereview fixes Created 5 years, 9 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
« no previous file with comments | « Source/core/paint/SVGClipPainter.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 if (m_masker) { 59 if (m_masker) {
60 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); 60 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object));
61 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->mask er() == m_masker); 61 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->mask er() == m_masker);
62 SVGMaskPainter(*m_masker).finishEffect(m_object, m_paintInfo.context); 62 SVGMaskPainter(*m_masker).finishEffect(m_object, m_paintInfo.context);
63 } 63 }
64 64
65 if (m_clipper) { 65 if (m_clipper) {
66 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)); 66 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object));
67 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->clip per() == m_clipper); 67 ASSERT(SVGResourcesCache::cachedResourcesForLayoutObject(m_object)->clip per() == m_clipper);
68 SVGClipPainter(*m_clipper).postApplyStatefulResource(m_object, m_paintIn fo.context, m_clipperState); 68 SVGClipPainter(*m_clipper).postApplyStatefulResource(*m_object, m_paintI nfo.context, m_clipperState);
69 } 69 }
70 } 70 }
71 71
72 bool SVGPaintContext::applyClipMaskAndFilterIfNecessary() 72 bool SVGPaintContext::applyClipMaskAndFilterIfNecessary()
73 { 73 {
74 #if ENABLE(ASSERT) 74 #if ENABLE(ASSERT)
75 ASSERT(!m_applyClipMaskAndFilterIfNecessaryCalled); 75 ASSERT(!m_applyClipMaskAndFilterIfNecessaryCalled);
76 m_applyClipMaskAndFilterIfNecessaryCalled = true; 76 m_applyClipMaskAndFilterIfNecessaryCalled = true;
77 #endif 77 #endif
78 78
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo.con text, m_object->displayItemClient(), WebCoreCompositeToSkiaComposite(compositeOp , blendMode), opacity)); 121 m_compositingRecorder = adoptPtr(new CompositingRecorder(m_paintInfo.con text, m_object->displayItemClient(), WebCoreCompositeToSkiaComposite(compositeOp , blendMode), opacity));
122 } 122 }
123 } 123 }
124 124
125 bool SVGPaintContext::applyClipIfNecessary(SVGResources* resources) 125 bool SVGPaintContext::applyClipIfNecessary(SVGResources* resources)
126 { 126 {
127 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas 127 // resources->clipper() corresponds to the non-prefixed 'clip-path' whereas
128 // m_object->style()->clipPath() corresponds to '-webkit-clip-path'. 128 // m_object->style()->clipPath() corresponds to '-webkit-clip-path'.
129 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths. 129 // FIXME: We should unify the clip-path and -webkit-clip-path codepaths.
130 if (LayoutSVGResourceClipper* clipper = resources ? resources->clipper() : n ullptr) { 130 if (LayoutSVGResourceClipper* clipper = resources ? resources->clipper() : n ullptr) {
131 if (!SVGClipPainter(*clipper).applyStatefulResource(m_object, m_paintInf o.context, m_clipperState)) 131 if (!SVGClipPainter(*clipper).applyStatefulResource(*m_object, m_paintIn fo.context, m_clipperState))
132 return false; 132 return false;
133 m_clipper = clipper; 133 m_clipper = clipper;
134 } else { 134 } else {
135 ClipPathOperation* clipPathOperation = m_object->style()->clipPath(); 135 ClipPathOperation* clipPathOperation = m_object->style()->clipPath();
136 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation: :SHAPE) { 136 if (clipPathOperation && clipPathOperation->type() == ClipPathOperation: :SHAPE) {
137 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPath Operation); 137 ShapeClipPathOperation* clipPath = toShapeClipPathOperation(clipPath Operation);
138 if (!clipPath->isValid()) 138 if (!clipPath->isValid())
139 return false; 139 return false;
140 m_clipPathRecorder = adoptPtr(new ClipPathRecorder(*m_paintInfo.cont ext, m_object->displayItemClient(), clipPath->path(m_object->objectBoundingBox() ), clipPath->windRule())); 140 m_clipPathRecorder = adoptPtr(new ClipPathRecorder(*m_paintInfo.cont ext, m_object->displayItemClient(), clipPath->path(m_object->objectBoundingBox() ), clipPath->windRule()));
141 } 141 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 { 191 {
192 ASSERT(context); 192 ASSERT(context);
193 ASSERT(item); 193 ASSERT(item);
194 ASSERT(!item->needsLayout()); 194 ASSERT(!item->needsLayout());
195 195
196 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground, PaintBehaviorNormal); 196 PaintInfo info(context, LayoutRect::infiniteIntRect(), PaintPhaseForeground, PaintBehaviorNormal);
197 item->paint(info, IntPoint()); 197 item->paint(info, IntPoint());
198 } 198 }
199 199
200 } // namespace blink 200 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/SVGClipPainter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698