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

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

Issue 657023006: GC::drawConvexPolygon() & friends cleanup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: speculative RenderThemeChromiumMac fix Created 6 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 | « no previous file | Source/core/paint/ObjectPainter.cpp » ('j') | 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 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2103 quad[2].x(), 2103 quad[2].x(),
2104 quad[2].y() - innerBorder.radii().bottomRight().height()), 2104 quad[2].y() - innerBorder.radii().bottomRight().height()),
2105 quad[2]); 2105 quad[2]);
2106 } 2106 }
2107 break; 2107 break;
2108 } 2108 }
2109 2109
2110 // If the border matches both of its adjacent sides, don't anti-alias the cl ip, and 2110 // If the border matches both of its adjacent sides, don't anti-alias the cl ip, and
2111 // if neither side matches, anti-alias the clip. 2111 // if neither side matches, anti-alias the clip.
2112 if (firstEdgeMatches == secondEdgeMatches) { 2112 if (firstEdgeMatches == secondEdgeMatches) {
2113 graphicsContext->clipConvexPolygon(4, quad, !firstEdgeMatches); 2113 graphicsContext->clipPolygon(4, quad, !firstEdgeMatches);
2114 return; 2114 return;
2115 } 2115 }
2116 2116
2117 // If antialiasing settings for the first edge and second edge is different, 2117 // If antialiasing settings for the first edge and second edge is different,
2118 // they have to be addressed separately. We do this by breaking the quad int o 2118 // they have to be addressed separately. We do this by breaking the quad int o
2119 // two parallelograms, made by moving quad[1] and quad[2]. 2119 // two parallelograms, made by moving quad[1] and quad[2].
2120 float ax = quad[1].x() - quad[0].x(); 2120 float ax = quad[1].x() - quad[0].x();
2121 float ay = quad[1].y() - quad[0].y(); 2121 float ay = quad[1].y() - quad[0].y();
2122 float bx = quad[2].x() - quad[1].x(); 2122 float bx = quad[2].x() - quad[1].x();
2123 float by = quad[2].y() - quad[1].y(); 2123 float by = quad[2].y() - quad[1].y();
(...skipping 11 matching lines...) Expand all
2135 2135
2136 r1 = (-ax * by + ay * bx) / (cx * by - cy * bx) + kExtendFill; 2136 r1 = (-ax * by + ay * bx) / (cx * by - cy * bx) + kExtendFill;
2137 r2 = (-cx * by + cy * bx) / (ax * by - ay * bx) + kExtendFill; 2137 r2 = (-cx * by + cy * bx) / (ax * by - ay * bx) + kExtendFill;
2138 } 2138 }
2139 2139
2140 FloatPoint firstQuad[4]; 2140 FloatPoint firstQuad[4];
2141 firstQuad[0] = quad[0]; 2141 firstQuad[0] = quad[0];
2142 firstQuad[1] = quad[1]; 2142 firstQuad[1] = quad[1];
2143 firstQuad[2] = FloatPoint(quad[3].x() + r2 * ax, quad[3].y() + r2 * ay); 2143 firstQuad[2] = FloatPoint(quad[3].x() + r2 * ax, quad[3].y() + r2 * ay);
2144 firstQuad[3] = quad[3]; 2144 firstQuad[3] = quad[3];
2145 graphicsContext->clipConvexPolygon(4, firstQuad, !firstEdgeMatches); 2145 graphicsContext->clipPolygon(4, firstQuad, !firstEdgeMatches);
2146 2146
2147 FloatPoint secondQuad[4]; 2147 FloatPoint secondQuad[4];
2148 secondQuad[0] = quad[0]; 2148 secondQuad[0] = quad[0];
2149 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); 2149 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy);
2150 secondQuad[2] = quad[2]; 2150 secondQuad[2] = quad[2];
2151 secondQuad[3] = quad[3]; 2151 secondQuad[3] = quad[3];
2152 graphicsContext->clipConvexPolygon(4, secondQuad, !secondEdgeMatches); 2152 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches);
2153 } 2153 }
2154 2154
2155 } // namespace blink 2155 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/paint/ObjectPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698