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

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

Issue 1636873005: blink: Fix naming and const-ness of constants and non-constants. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: constants: indents Created 4 years, 10 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp ('k') | third_party/WebKit/Source/web/ChromeClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698