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

Side by Side Diff: Source/core/paint/BoxPainter.cpp

Issue 1139413002: Simplified BoxPainter edge adjacency test. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | « no previous file | 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/BoxPainter.h" 6 #include "core/paint/BoxPainter.h"
7 7
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/html/HTMLFrameOwnerElement.h" 10 #include "core/html/HTMLFrameOwnerElement.h"
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1703 paintTranslucentBorderSides(graphicsContext, style, outerBorder, innerBo rder, borderInfo.edges, 1703 paintTranslucentBorderSides(graphicsContext, style, outerBorder, innerBo rder, borderInfo.edges,
1704 borderInfo.visibleEdgeSet, bleedAvoidance, includeLogicalLeftEdge, inclu deLogicalRightEdge, antialias); 1704 borderInfo.visibleEdgeSet, bleedAvoidance, includeLogicalLeftEdge, inclu deLogicalRightEdge, antialias);
1705 } else { 1705 } else {
1706 paintBorderSides(graphicsContext, style, outerBorder, innerBorder, borde rInfo.edges, 1706 paintBorderSides(graphicsContext, style, outerBorder, innerBorder, borde rInfo.edges,
1707 borderInfo.visibleEdgeSet, bleedAvoidance, includeLogicalLeftEdge, inclu deLogicalRightEdge, antialias); 1707 borderInfo.visibleEdgeSet, bleedAvoidance, includeLogicalLeftEdge, inclu deLogicalRightEdge, antialias);
1708 } 1708 }
1709 } 1709 }
1710 1710
1711 static inline bool includesAdjacentEdges(BorderEdgeFlags flags) 1711 static inline bool includesAdjacentEdges(BorderEdgeFlags flags)
1712 { 1712 {
1713 return (flags & (TopBorderEdge | RightBorderEdge)) == (TopBorderEdge | Right BorderEdge) 1713 // The set includes adjacent edges iff it contains at least one horizontal a nd one vertical edge.
1714 || (flags & (RightBorderEdge | BottomBorderEdge)) == (RightBorderEdge | BottomBorderEdge) 1714 return (flags & (TopBorderEdge | BottomBorderEdge))
1715 || (flags & (BottomBorderEdge | LeftBorderEdge)) == (BottomBorderEdge | LeftBorderEdge) 1715 && (flags & (LeftBorderEdge | RightBorderEdge));
1716 || (flags & (LeftBorderEdge | TopBorderEdge)) == (LeftBorderEdge | TopBo rderEdge);
1717 } 1716 }
1718 1717
1719 void BoxPainter::paintTranslucentBorderSides(GraphicsContext* graphicsContext, c onst ComputedStyle& style, 1718 void BoxPainter::paintTranslucentBorderSides(GraphicsContext* graphicsContext, c onst ComputedStyle& style,
1720 const FloatRoundedRect& outerBorder, const FloatRoundedRect& innerBorder, co nst BorderEdge edges[], 1719 const FloatRoundedRect& outerBorder, const FloatRoundedRect& innerBorder, co nst BorderEdge edges[],
1721 BorderEdgeFlags edgesToDraw, BackgroundBleedAvoidance bleedAvoidance, bool i ncludeLogicalLeftEdge, 1720 BorderEdgeFlags edgesToDraw, BackgroundBleedAvoidance bleedAvoidance, bool i ncludeLogicalLeftEdge,
1722 bool includeLogicalRightEdge, bool antialias) 1721 bool includeLogicalRightEdge, bool antialias)
1723 { 1722 {
1724 // willBeOverdrawn assumes that we draw in order: top, bottom, left, right. 1723 // willBeOverdrawn assumes that we draw in order: top, bottom, left, right.
1725 // This is different from BoxSide enum order. 1724 // This is different from BoxSide enum order.
1726 static const BoxSide paintOrder[] = { BSTop, BSBottom, BSLeft, BSRight }; 1725 static const BoxSide paintOrder[] = { BSTop, BSBottom, BSLeft, BSRight };
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 2296
2298 FloatPoint secondQuad[4]; 2297 FloatPoint secondQuad[4];
2299 secondQuad[0] = quad[0]; 2298 secondQuad[0] = quad[0];
2300 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); 2299 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy);
2301 secondQuad[2] = quad[2]; 2300 secondQuad[2] = quad[2];
2302 secondQuad[3] = quad[3]; 2301 secondQuad[3] = quad[3];
2303 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); 2302 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches);
2304 } 2303 }
2305 2304
2306 } // namespace blink 2305 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698