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

Side by Side Diff: Source/core/rendering/RenderBoxModelObject.cpp

Issue 25977004: Should not use clipOutRoundedRect when a given rounded rect is empty. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/platform/linux/fast/borders/empty-border-radius-expected.png ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 } 1878 }
1879 1879
1880 bool clipToOuterBorder = outerBorder.isRounded(); 1880 bool clipToOuterBorder = outerBorder.isRounded();
1881 GraphicsContextStateSaver stateSaver(*graphicsContext, clipToOuterBorder); 1881 GraphicsContextStateSaver stateSaver(*graphicsContext, clipToOuterBorder);
1882 if (clipToOuterBorder) { 1882 if (clipToOuterBorder) {
1883 // Clip to the inner and outer radii rects. 1883 // Clip to the inner and outer radii rects.
1884 if (bleedAvoidance != BackgroundBleedUseTransparencyLayer) 1884 if (bleedAvoidance != BackgroundBleedUseTransparencyLayer)
1885 graphicsContext->clipRoundedRect(outerBorder); 1885 graphicsContext->clipRoundedRect(outerBorder);
1886 // isRenderable() check avoids issue described in https://bugs.webkit.or g/show_bug.cgi?id=38787 1886 // isRenderable() check avoids issue described in https://bugs.webkit.or g/show_bug.cgi?id=38787
1887 // The inside will be clipped out later (in clipBorderSideForComplexInne rPath) 1887 // The inside will be clipped out later (in clipBorderSideForComplexInne rPath)
1888 if (innerBorder.isRenderable()) 1888 if (innerBorder.isRenderable() && !innerBorder.isEmpty())
1889 graphicsContext->clipOutRoundedRect(innerBorder); 1889 graphicsContext->clipOutRoundedRect(innerBorder);
1890 } 1890 }
1891 1891
1892 // If only one edge visible antialiasing doesn't create seams 1892 // If only one edge visible antialiasing doesn't create seams
1893 bool antialias = shouldAntialiasLines(graphicsContext) || numEdgesVisible == 1; 1893 bool antialias = shouldAntialiasLines(graphicsContext) || numEdgesVisible == 1;
1894 RoundedRect unadjustedInnerBorder = (bleedAvoidance == BackgroundBleedBackgr oundOverBorder) ? style->getRoundedInnerBorderFor(rect, includeLogicalLeftEdge, includeLogicalRightEdge) : innerBorder; 1894 RoundedRect unadjustedInnerBorder = (bleedAvoidance == BackgroundBleedBackgr oundOverBorder) ? style->getRoundedInnerBorderFor(rect, includeLogicalLeftEdge, includeLogicalRightEdge) : innerBorder;
1895 IntPoint innerBorderAdjustment(innerBorder.rect().x() - unadjustedInnerBorde r.rect().x(), innerBorder.rect().y() - unadjustedInnerBorder.rect().y()); 1895 IntPoint innerBorderAdjustment(innerBorder.rect().x() - unadjustedInnerBorde r.rect().x(), innerBorder.rect().y() - unadjustedInnerBorder.rect().y());
1896 if (haveAlphaColor) 1896 if (haveAlphaColor)
1897 paintTranslucentBorderSides(graphicsContext, style, outerBorder, unadjus tedInnerBorder, innerBorderAdjustment, edges, edgesToDraw, bleedAvoidance, inclu deLogicalLeftEdge, includeLogicalRightEdge, antialias); 1897 paintTranslucentBorderSides(graphicsContext, style, outerBorder, unadjus tedInnerBorder, innerBorderAdjustment, edges, edgesToDraw, bleedAvoidance, inclu deLogicalLeftEdge, includeLogicalRightEdge, antialias);
1898 else 1898 else
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
2342 break; 2342 break;
2343 } 2343 }
2344 2344
2345 return RoundedRect(newRect, newRadii); 2345 return RoundedRect(newRect, newRadii);
2346 } 2346 }
2347 2347
2348 void RenderBoxModelObject::clipBorderSideForComplexInnerPath(GraphicsContext* gr aphicsContext, const RoundedRect& outerBorder, const RoundedRect& innerBorder, 2348 void RenderBoxModelObject::clipBorderSideForComplexInnerPath(GraphicsContext* gr aphicsContext, const RoundedRect& outerBorder, const RoundedRect& innerBorder,
2349 BoxSide side, const class BorderEdge edges[]) 2349 BoxSide side, const class BorderEdge edges[])
2350 { 2350 {
2351 graphicsContext->clip(calculateSideRectIncludingInner(outerBorder, edges, si de)); 2351 graphicsContext->clip(calculateSideRectIncludingInner(outerBorder, edges, si de));
2352 graphicsContext->clipOutRoundedRect(calculateAdjustedInnerBorder(innerBorder , side)); 2352 RoundedRect adjustedInnerRect = calculateAdjustedInnerBorder(innerBorder, si de);
2353 if (!adjustedInnerRect.isEmpty())
2354 graphicsContext->clipOutRoundedRect(adjustedInnerRect);
2353 } 2355 }
2354 2356
2355 void RenderBoxModelObject::getBorderEdgeInfo(BorderEdge edges[], const RenderSty le* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const 2357 void RenderBoxModelObject::getBorderEdgeInfo(BorderEdge edges[], const RenderSty le* style, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const
2356 { 2358 {
2357 bool horizontal = style->isHorizontalWritingMode(); 2359 bool horizontal = style->isHorizontalWritingMode();
2358 2360
2359 edges[BSTop] = BorderEdge(style->borderTopWidth(), 2361 edges[BSTop] = BorderEdge(style->borderTopWidth(),
2360 resolveColor(style, CSSPropertyBorderTopColor), 2362 resolveColor(style, CSSPropertyBorderTopColor),
2361 style->borderTopStyle(), 2363 style->borderTopStyle(),
2362 style->borderTopIsTransparent(), 2364 style->borderTopIsTransparent(),
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2828 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); 2830 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
2829 for (RenderObject* child = startChild; child && child != endChild; ) { 2831 for (RenderObject* child = startChild; child && child != endChild; ) {
2830 // Save our next sibling as moveChildTo will clear it. 2832 // Save our next sibling as moveChildTo will clear it.
2831 RenderObject* nextSibling = child->nextSibling(); 2833 RenderObject* nextSibling = child->nextSibling();
2832 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); 2834 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert);
2833 child = nextSibling; 2835 child = nextSibling;
2834 } 2836 }
2835 } 2837 }
2836 2838
2837 } // namespace WebCore 2839 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/platform/linux/fast/borders/empty-border-radius-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698