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

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

Issue 300223009: Implement basic parts of hit regions on canvas2d. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: exclude clipping region part Created 6 years, 6 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 void Path::addPath(const Path& src, const AffineTransform& transform) 475 void Path::addPath(const Path& src, const AffineTransform& transform)
476 { 476 {
477 m_path.addPath(src.skPath(), affineTransformToSkMatrix(transform)); 477 m_path.addPath(src.skPath(), affineTransformToSkMatrix(transform));
478 } 478 }
479 479
480 void Path::translate(const FloatSize& size) 480 void Path::translate(const FloatSize& size)
481 { 481 {
482 m_path.offset(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(s ize.height())); 482 m_path.offset(WebCoreFloatToSkScalar(size.width()), WebCoreFloatToSkScalar(s ize.height()));
483 } 483 }
484 484
485 bool Path::subtractPath(const Path& other)
486 {
487 return Op(m_path, other.m_path, kDifference_PathOp, &m_path);
488 }
489
490 bool Path::intersectPath(const Path& other)
491 {
492 return Op(m_path, other.m_path, kIntersect_PathOp, &m_path);
493 }
494
485 bool Path::unionPath(const Path& other) 495 bool Path::unionPath(const Path& other)
486 { 496 {
487 return Op(m_path, other.m_path, kUnion_PathOp, &m_path); 497 return Op(m_path, other.m_path, kUnion_PathOp, &m_path);
488 } 498 }
489 499
490 #if ASSERT_ENABLED 500 #if ASSERT_ENABLED
491 bool ellipseIsRenderable(float startAngle, float endAngle) 501 bool ellipseIsRenderable(float startAngle, float endAngle)
492 { 502 {
493 return (std::abs(endAngle - startAngle) < twoPiFloat) 503 return (std::abs(endAngle - startAngle) < twoPiFloat)
494 || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), twoPiFloat); 504 || WebCoreFloatNearlyEqual(std::abs(endAngle - startAngle), twoPiFloat);
495 } 505 }
496 #endif 506 #endif
497 507
498 } 508 }
OLDNEW
« Source/platform/graphics/GraphicsContext.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