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

Side by Side Diff: Source/platform/graphics/Path.cpp

Issue 170503002: Implement addPath() method for Path object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved.
3 * 2006 Rob Buis <buis@kde.org> 3 * 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2013 Google Inc. All rights reserved. 5 * Copyright (C) 2013 Google Inc. All rights reserved.
6 * Copyright (C) 2013 Intel Corporation. All rights reserved. 6 * Copyright (C) 2013 Intel Corporation. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 FloatPoint(rect.x(), rect.maxY() - bottomLeftRadius.height())); 429 FloatPoint(rect.x(), rect.maxY() - bottomLeftRadius.height()));
430 addLineTo(FloatPoint(rect.x(), rect.y() + topLeftRadius.height())); 430 addLineTo(FloatPoint(rect.x(), rect.y() + topLeftRadius.height()));
431 if (topLeftRadius.width() > 0 || topLeftRadius.height() > 0) 431 if (topLeftRadius.width() > 0 || topLeftRadius.height() > 0)
432 addBezierCurveTo(FloatPoint(rect.x(), rect.y() + topLeftRadius.height() * gCircleControlPoint), 432 addBezierCurveTo(FloatPoint(rect.x(), rect.y() + topLeftRadius.height() * gCircleControlPoint),
433 FloatPoint(rect.x() + topLeftRadius.width() * gCircleControlPoint, r ect.y()), 433 FloatPoint(rect.x() + topLeftRadius.width() * gCircleControlPoint, r ect.y()),
434 FloatPoint(rect.x() + topLeftRadius.width(), rect.y())); 434 FloatPoint(rect.x() + topLeftRadius.width(), rect.y()));
435 435
436 closeSubpath(); 436 closeSubpath();
437 } 437 }
438 438
439 void Path::addPath(const Path& src, const AffineTransform& transform)
440 {
441 m_path.addPath(src.skPath(), affineTransformToSkMatrix(transform));
442 }
jbroman 2014/02/18 16:06:47 drive-by nit: newline below this method, please.
pals 2014/02/19 11:47:22 Done.
439 void Path::translate(const FloatSize& size) 443 void Path::translate(const FloatSize& size)
440 { 444 {
441 m_path.offset(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(s ize.height())); 445 m_path.offset(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(s ize.height()));
442 } 446 }
443 447
444 bool Path::unionPath(const Path& other) 448 bool Path::unionPath(const Path& other)
445 { 449 {
446 return Op(m_path, other.m_path, kUnion_PathOp, &m_path); 450 return Op(m_path, other.m_path, kUnion_PathOp, &m_path);
447 } 451 }
448 452
449 #if !ASSERT_DISABLED 453 #if !ASSERT_DISABLED
450 bool ellipseIsRenderable(float startAngle, float endAngle) 454 bool ellipseIsRenderable(float startAngle, float endAngle)
451 { 455 {
452 return (std::abs(endAngle - startAngle) < 2 * piFloat) 456 return (std::abs(endAngle - startAngle) < 2 * piFloat)
453 || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), 2 * piFloat) ; 457 || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), 2 * piFloat) ;
454 } 458 }
455 #endif 459 #endif
456 460
457 } 461 }
OLDNEW
« Source/core/html/canvas/DOMPath.h ('K') | « Source/platform/graphics/Path.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698