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

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

Issue 1172763002: Always anti-alias full border rect paints. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/TestExpectations ('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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/BoxBorderPainter.h" 6 #include "core/paint/BoxBorderPainter.h"
7 7
8 #include "core/paint/BoxPainter.h" 8 #include "core/paint/BoxPainter.h"
9 #include "core/paint/PaintInfo.h" 9 #include "core/paint/PaintInfo.h"
10 #include "core/style/BorderEdge.h" 10 #include "core/style/BorderEdge.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 -edges[BSBottom].getDoubleBorderStripeWidth(stripe), 250 -edges[BSBottom].getDoubleBorderStripeWidth(stripe),
251 -edges[BSLeft].getDoubleBorderStripeWidth(stripe)); 251 -edges[BSLeft].getDoubleBorderStripeWidth(stripe));
252 } 252 }
253 253
254 void drawSolidBorderRect(GraphicsContext* context, const FloatRect& borderRect, 254 void drawSolidBorderRect(GraphicsContext* context, const FloatRect& borderRect,
255 float borderWidth, const Color& color) 255 float borderWidth, const Color& color)
256 { 256 {
257 FloatRect strokeRect(borderRect); 257 FloatRect strokeRect(borderRect);
258 strokeRect.inflate(-borderWidth / 2); 258 strokeRect.inflate(-borderWidth / 2);
259 259
260 bool antialias = BoxPainter::shouldAntialiasLines(context);
261 bool wasAntialias = context->shouldAntialias(); 260 bool wasAntialias = context->shouldAntialias();
262 if (antialias != wasAntialias) 261 if (!wasAntialias)
263 context->setShouldAntialias(antialias); 262 context->setShouldAntialias(true);
264 263
265 context->setStrokeStyle(SolidStroke); 264 context->setStrokeStyle(SolidStroke);
266 context->setStrokeColor(color); 265 context->setStrokeColor(color);
267 context->strokeRect(strokeRect, borderWidth); 266 context->strokeRect(strokeRect, borderWidth);
268 267
269 if (antialias != wasAntialias) 268 if (!wasAntialias)
270 context->setShouldAntialias(wasAntialias); 269 context->setShouldAntialias(false);
271 } 270 }
272 271
273 void drawBleedAdjustedDRRect(GraphicsContext* context, BackgroundBleedAvoidance bleedAvoidance, 272 void drawBleedAdjustedDRRect(GraphicsContext* context, BackgroundBleedAvoidance bleedAvoidance,
274 const FloatRoundedRect& outer, const FloatRoundedRect& inner, Color color) 273 const FloatRoundedRect& outer, const FloatRoundedRect& inner, Color color)
275 { 274 {
276 switch (bleedAvoidance) { 275 switch (bleedAvoidance) {
277 case BackgroundBleedBackgroundOverBorder: 276 case BackgroundBleedBackgroundOverBorder:
278 // BackgroundBleedBackgroundOverBorder draws an opaque background over t he inner rrect, 277 // BackgroundBleedBackgroundOverBorder draws an opaque background over t he inner rrect,
279 // so we can simply fill the outer rect here to avoid backdrop bleeding. 278 // so we can simply fill the outer rect here to avoid backdrop bleeding.
280 context->fillRoundedRect(outer, color); 279 context->fillRoundedRect(outer, color);
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 FloatPoint secondQuad[4]; 1187 FloatPoint secondQuad[4];
1189 secondQuad[0] = quad[0]; 1188 secondQuad[0] = quad[0];
1190 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy) ; 1189 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy) ;
1191 secondQuad[2] = quad[2]; 1190 secondQuad[2] = quad[2];
1192 secondQuad[3] = quad[3]; 1191 secondQuad[3] = quad[3];
1193 graphicsContext->clipPolygon(4, secondQuad, secondMiter == SoftMiter); 1192 graphicsContext->clipPolygon(4, secondQuad, secondMiter == SoftMiter);
1194 } 1193 }
1195 } 1194 }
1196 1195
1197 } // namespace blink 1196 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698