void Path::addPathForRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius, RoundedRectStrategy strategy) { if (strategy == PreferNativeRoundedRect) { #if USE(CG) || PLATFORM(BLACKBERRY) platformAddPathForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius); return; #endif } addBeziersForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius); }
void Path::addPathForRoundedRect(const FloatRect& rect, const FloatSize& topLeftRadius, const FloatSize& topRightRadius, const FloatSize& bottomLeftRadius, const FloatSize& bottomRightRadius, RoundedRectStrategy strategy) { if (strategy == PreferBezierRoundedRect) { addBeziersForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius); return; } #if USE(CG) platformAddPathForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius); #else addBeziersForRoundedRect(rect, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius); #endif }
void Path::addRoundedRect(const FloatRoundedRect& r, RoundedRectStrategy strategy) { if (r.isEmpty()) return; const FloatRoundedRect::Radii& radii = r.radii(); const FloatRect& rect = r.rect(); if (!r.isRenderable()) { // If all the radii cannot be accommodated, return a rect. addRect(rect); return; } if (strategy == PreferNativeRoundedRect) { #if USE(CG) platformAddPathForRoundedRect(rect, radii.topLeft(), radii.topRight(), radii.bottomLeft(), radii.bottomRight()); return; #endif } addBeziersForRoundedRect(rect, radii.topLeft(), radii.topRight(), radii.bottomLeft(), radii.bottomRight()); }