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

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

Issue 2738863002: Replace ASSERT with DCHECK in core/svg/ (Closed)
Patch Set: Split DCHECKS wherever possible Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 } 285 }
286 } 286 }
287 287
288 AffineTransform SVGPreserveAspectRatio::getCTM(float logicalX, 288 AffineTransform SVGPreserveAspectRatio::getCTM(float logicalX,
289 float logicalY, 289 float logicalY,
290 float logicalWidth, 290 float logicalWidth,
291 float logicalHeight, 291 float logicalHeight,
292 float physicalWidth, 292 float physicalWidth,
293 float physicalHeight) const { 293 float physicalHeight) const {
294 ASSERT(logicalWidth); 294 DCHECK(logicalWidth);
295 ASSERT(logicalHeight); 295 DCHECK(logicalHeight);
296 ASSERT(physicalWidth); 296 DCHECK(physicalWidth);
297 ASSERT(physicalHeight); 297 DCHECK(physicalHeight);
298 298
299 AffineTransform transform; 299 AffineTransform transform;
300 if (m_align == kSvgPreserveaspectratioUnknown) 300 if (m_align == kSvgPreserveaspectratioUnknown)
301 return transform; 301 return transform;
302 302
303 double extendedLogicalX = logicalX; 303 double extendedLogicalX = logicalX;
304 double extendedLogicalY = logicalY; 304 double extendedLogicalY = logicalY;
305 double extendedLogicalWidth = logicalWidth; 305 double extendedLogicalWidth = logicalWidth;
306 double extendedLogicalHeight = logicalHeight; 306 double extendedLogicalHeight = logicalHeight;
307 double extendedPhysicalWidth = physicalWidth; 307 double extendedPhysicalWidth = physicalWidth;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 } 434 }
435 435
436 void SVGPreserveAspectRatio::calculateAnimatedValue( 436 void SVGPreserveAspectRatio::calculateAnimatedValue(
437 SVGAnimationElement* animationElement, 437 SVGAnimationElement* animationElement,
438 float percentage, 438 float percentage,
439 unsigned repeatCount, 439 unsigned repeatCount,
440 SVGPropertyBase* fromValue, 440 SVGPropertyBase* fromValue,
441 SVGPropertyBase* toValue, 441 SVGPropertyBase* toValue,
442 SVGPropertyBase*, 442 SVGPropertyBase*,
443 SVGElement*) { 443 SVGElement*) {
444 ASSERT(animationElement); 444 DCHECK(animationElement);
445 445
446 bool useToValue; 446 bool useToValue;
447 animationElement->animateDiscreteType(percentage, false, true, useToValue); 447 animationElement->animateDiscreteType(percentage, false, true, useToValue);
448 448
449 SVGPreserveAspectRatio* preserveAspectRatioToUse = 449 SVGPreserveAspectRatio* preserveAspectRatioToUse =
450 useToValue ? toSVGPreserveAspectRatio(toValue) 450 useToValue ? toSVGPreserveAspectRatio(toValue)
451 : toSVGPreserveAspectRatio(fromValue); 451 : toSVGPreserveAspectRatio(fromValue);
452 452
453 m_align = preserveAspectRatioToUse->m_align; 453 m_align = preserveAspectRatioToUse->m_align;
454 m_meetOrSlice = preserveAspectRatioToUse->m_meetOrSlice; 454 m_meetOrSlice = preserveAspectRatioToUse->m_meetOrSlice;
455 } 455 }
456 456
457 float SVGPreserveAspectRatio::calculateDistance(SVGPropertyBase* toValue, 457 float SVGPreserveAspectRatio::calculateDistance(SVGPropertyBase* toValue,
458 SVGElement* contextElement) { 458 SVGElement* contextElement) {
459 // No paced animations for SVGPreserveAspectRatio. 459 // No paced animations for SVGPreserveAspectRatio.
460 return -1; 460 return -1;
461 } 461 }
462 462
463 } // namespace blink 463 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGPolyElement.cpp ('k') | third_party/WebKit/Source/core/svg/SVGRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698