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

Side by Side Diff: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceClipper.cpp

Issue 2748103015: Replace ASSERT with DCHECK in core/layout/<sub dirs> (Closed)
Patch Set: Rebase with latest Created 3 years, 8 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 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2011 Dirk Schulze <krit@webkit.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 m_clipContentPath.clear(); 109 m_clipContentPath.clear();
110 m_cachedPaintRecord.reset(); 110 m_cachedPaintRecord.reset();
111 m_localClipBounds = FloatRect(); 111 m_localClipBounds = FloatRect();
112 markAllClientsForInvalidation(markForInvalidation 112 markAllClientsForInvalidation(markForInvalidation
113 ? LayoutAndBoundariesInvalidation 113 ? LayoutAndBoundariesInvalidation
114 : ParentOnlyInvalidation); 114 : ParentOnlyInvalidation);
115 } 115 }
116 116
117 void LayoutSVGResourceClipper::removeClientFromCache(LayoutObject* client, 117 void LayoutSVGResourceClipper::removeClientFromCache(LayoutObject* client,
118 bool markForInvalidation) { 118 bool markForInvalidation) {
119 ASSERT(client); 119 DCHECK(client);
120 markClientForInvalidation(client, markForInvalidation 120 markClientForInvalidation(client, markForInvalidation
121 ? BoundariesInvalidation 121 ? BoundariesInvalidation
122 : ParentOnlyInvalidation); 122 : ParentOnlyInvalidation);
123 } 123 }
124 124
125 bool LayoutSVGResourceClipper::calculateClipContentPathIfNeeded() { 125 bool LayoutSVGResourceClipper::calculateClipContentPathIfNeeded() {
126 if (!m_clipContentPath.isEmpty()) 126 if (!m_clipContentPath.isEmpty())
127 return true; 127 return true;
128 128
129 // If the current clip-path gets clipped itself, we have to fallback to 129 // If the current clip-path gets clipped itself, we have to fallback to
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); 198 transform.scaleNonUniform(referenceBox.width(), referenceBox.height());
199 clipPath.transform(transform); 199 clipPath.transform(transform);
200 } 200 }
201 201
202 // Transform path by animatedLocalTransform. 202 // Transform path by animatedLocalTransform.
203 clipPath.transform(animatedLocalTransform); 203 clipPath.transform(animatedLocalTransform);
204 return true; 204 return true;
205 } 205 }
206 206
207 sk_sp<const PaintRecord> LayoutSVGResourceClipper::createPaintRecord() { 207 sk_sp<const PaintRecord> LayoutSVGResourceClipper::createPaintRecord() {
208 ASSERT(frame()); 208 DCHECK(frame());
209 if (m_cachedPaintRecord) 209 if (m_cachedPaintRecord)
210 return m_cachedPaintRecord; 210 return m_cachedPaintRecord;
211 211
212 // Using strokeBoundingBox (instead of visualRectInLocalSVGCoordinates) to 212 // Using strokeBoundingBox (instead of visualRectInLocalSVGCoordinates) to
213 // avoid the intersection with local clips/mask, which may yield incorrect 213 // avoid the intersection with local clips/mask, which may yield incorrect
214 // results when mixing objectBoundingBox and userSpaceOnUse units 214 // results when mixing objectBoundingBox and userSpaceOnUse units
215 // (http://crbug.com/294900). 215 // (http://crbug.com/294900).
216 FloatRect bounds = strokeBoundingBox(); 216 FloatRect bounds = strokeBoundingBox();
217 217
218 PaintRecordBuilder builder(bounds, nullptr, nullptr); 218 PaintRecordBuilder builder(bounds, nullptr, nullptr);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 toSVGClipPathElement(element())->calculateTransform( 303 toSVGClipPathElement(element())->calculateTransform(
304 SVGElement::IncludeMotionTransform); 304 SVGElement::IncludeMotionTransform);
305 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) { 305 if (clipPathUnits() == SVGUnitTypes::kSvgUnitTypeObjectboundingbox) {
306 transform.translate(referenceBox.x(), referenceBox.y()); 306 transform.translate(referenceBox.x(), referenceBox.y());
307 transform.scaleNonUniform(referenceBox.width(), referenceBox.height()); 307 transform.scaleNonUniform(referenceBox.width(), referenceBox.height());
308 } 308 }
309 return transform.mapRect(m_localClipBounds); 309 return transform.mapRect(m_localClipBounds);
310 } 310 }
311 311
312 } // namespace blink 312 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698