OLD | NEW |
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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 || !WebCoreFloatNearlyEqual(oRadii.topRight().height() - strokeSize.heig
ht(), iRadii.topRight().height()) | 967 || !WebCoreFloatNearlyEqual(oRadii.topRight().height() - strokeSize.heig
ht(), iRadii.topRight().height()) |
968 || !WebCoreFloatNearlyEqual(oRadii.bottomRight().width() - strokeSize.wi
dth(), iRadii.bottomRight().width()) | 968 || !WebCoreFloatNearlyEqual(oRadii.bottomRight().width() - strokeSize.wi
dth(), iRadii.bottomRight().width()) |
969 || !WebCoreFloatNearlyEqual(oRadii.bottomRight().height() - strokeSize.h
eight(), iRadii.bottomRight().height()) | 969 || !WebCoreFloatNearlyEqual(oRadii.bottomRight().height() - strokeSize.h
eight(), iRadii.bottomRight().height()) |
970 || !WebCoreFloatNearlyEqual(oRadii.bottomLeft().width() - strokeSize.wid
th(), iRadii.bottomLeft().width()) | 970 || !WebCoreFloatNearlyEqual(oRadii.bottomLeft().width() - strokeSize.wid
th(), iRadii.bottomLeft().width()) |
971 || !WebCoreFloatNearlyEqual(oRadii.bottomLeft().height() - strokeSize.he
ight(), iRadii.bottomLeft().height())) | 971 || !WebCoreFloatNearlyEqual(oRadii.bottomLeft().height() - strokeSize.he
ight(), iRadii.bottomLeft().height())) |
972 return false; | 972 return false; |
973 | 973 |
974 // We also ignore DRRects with a very thick relative stroke (shapes which ar
e mostly filled by | 974 // We also ignore DRRects with a very thick relative stroke (shapes which ar
e mostly filled by |
975 // the stroke): Skia's stroke outline can diverge significantly from the out
er/inner contours | 975 // the stroke): Skia's stroke outline can diverge significantly from the out
er/inner contours |
976 // in some edge cases, so we fall back to drawDRRect instead. | 976 // in some edge cases, so we fall back to drawDRRect instead. |
977 static float kMaxStrokeToSizeRatio = 0.75f; | 977 const float kMaxStrokeToSizeRatio = 0.75f; |
978 if (2 * strokeSize.width() / outer.rect().width() > kMaxStrokeToSizeRatio | 978 if (2 * strokeSize.width() / outer.rect().width() > kMaxStrokeToSizeRatio |
979 || 2 * strokeSize.height() / outer.rect().height() > kMaxStrokeToSizeRat
io) | 979 || 2 * strokeSize.height() / outer.rect().height() > kMaxStrokeToSizeRat
io) |
980 return false; | 980 return false; |
981 | 981 |
982 return true; | 982 return true; |
983 } | 983 } |
984 | 984 |
985 } // anonymous namespace | 985 } // anonymous namespace |
986 | 986 |
987 void GraphicsContext::fillDRRect(const FloatRoundedRect& outer, | 987 void GraphicsContext::fillDRRect(const FloatRoundedRect& outer, |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |