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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp

Issue 1566193002: Always antialias clips in ClipDisplayItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 } 1061 }
1062 1062
1063 void GraphicsContext::strokeEllipse(const FloatRect& ellipse) 1063 void GraphicsContext::strokeEllipse(const FloatRect& ellipse)
1064 { 1064 {
1065 if (contextDisabled()) 1065 if (contextDisabled())
1066 return; 1066 return;
1067 1067
1068 drawOval(ellipse, immutableState()->strokePaint()); 1068 drawOval(ellipse, immutableState()->strokePaint());
1069 } 1069 }
1070 1070
1071 void GraphicsContext::clipRoundedRect(const FloatRoundedRect& rrect, SkRegion::O p regionOp) 1071 void GraphicsContext::clipRoundedRect(const FloatRoundedRect& rrect, SkRegion::O p regionOp, AntiAliasingMode shouldAntialias)
1072 { 1072 {
1073 if (contextDisabled()) 1073 if (contextDisabled())
1074 return; 1074 return;
1075 1075
1076 if (!rrect.isRounded()) { 1076 if (!rrect.isRounded()) {
1077 clipRect(rrect.rect(), NotAntiAliased, regionOp); 1077 clipRect(rrect.rect(), shouldAntialias, regionOp);
1078 return; 1078 return;
1079 } 1079 }
1080 1080
1081 clipRRect(rrect, AntiAliased, regionOp); 1081 clipRRect(rrect, shouldAntialias, regionOp);
1082 } 1082 }
1083 1083
1084 void GraphicsContext::clipOut(const Path& pathToClip) 1084 void GraphicsContext::clipOut(const Path& pathToClip)
1085 { 1085 {
1086 if (contextDisabled()) 1086 if (contextDisabled())
1087 return; 1087 return;
1088 1088
1089 // Use const_cast and temporarily toggle the inverse fill type instead of co pying the path. 1089 // Use const_cast and temporarily toggle the inverse fill type instead of co pying the path.
1090 SkPath& path = const_cast<SkPath&>(pathToClip.skPath()); 1090 SkPath& path = const_cast<SkPath&>(pathToClip.skPath());
1091 path.toggleInverseFillType(); 1091 path.toggleInverseFillType();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 static const SkPMColor colors[] = { 1360 static const SkPMColor colors[] = {
1361 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red 1361 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
1362 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray 1362 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray
1363 }; 1363 };
1364 1364
1365 return colors[index]; 1365 return colors[index];
1366 } 1366 }
1367 #endif 1367 #endif
1368 1368
1369 } // namespace blink 1369 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698