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

Side by Side Diff: Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp

Issue 6712027: Merge 80579 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 9 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
« no previous file with comments | « LayoutTests/fast/canvas/shadow-huge-blur-expected.txt ('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 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 if (!m_state.shadowsIgnoreTransforms) { 774 if (!m_state.shadowsIgnoreTransforms) {
775 CGAffineTransform userToBaseCTM = wkGetUserToBaseCTM(context); 775 CGAffineTransform userToBaseCTM = wkGetUserToBaseCTM(context);
776 776
777 CGFloat A = userToBaseCTM.a * userToBaseCTM.a + userToBaseCTM.b * userTo BaseCTM.b; 777 CGFloat A = userToBaseCTM.a * userToBaseCTM.a + userToBaseCTM.b * userTo BaseCTM.b;
778 CGFloat B = userToBaseCTM.a * userToBaseCTM.c + userToBaseCTM.b * userTo BaseCTM.d; 778 CGFloat B = userToBaseCTM.a * userToBaseCTM.c + userToBaseCTM.b * userTo BaseCTM.d;
779 CGFloat C = B; 779 CGFloat C = B;
780 CGFloat D = userToBaseCTM.c * userToBaseCTM.c + userToBaseCTM.d * userTo BaseCTM.d; 780 CGFloat D = userToBaseCTM.c * userToBaseCTM.c + userToBaseCTM.d * userTo BaseCTM.d;
781 781
782 CGFloat smallEigenvalue = narrowPrecisionToCGFloat(sqrt(0.5 * ((A + D) - sqrt(4 * B * C + (A - D) * (A - D))))); 782 CGFloat smallEigenvalue = narrowPrecisionToCGFloat(sqrt(0.5 * ((A + D) - sqrt(4 * B * C + (A - D) * (A - D)))));
783 783
784 // Extreme "blur" values can make text drawing crash or take crazy long times, so clamp 784 blurRadius = blur * smallEigenvalue;
785 blurRadius = min(blur * smallEigenvalue, narrowPrecisionToCGFloat(1000.0 ));
786 785
787 CGSize offsetInBaseSpace = CGSizeApplyAffineTransform(offset, userToBase CTM); 786 CGSize offsetInBaseSpace = CGSizeApplyAffineTransform(offset, userToBase CTM);
788 787
789 xOffset = offsetInBaseSpace.width; 788 xOffset = offsetInBaseSpace.width;
790 yOffset = offsetInBaseSpace.height; 789 yOffset = offsetInBaseSpace.height;
791 } 790 }
792 791
792 // Extreme "blur" values can make text drawing crash or take crazy long time s, so clamp
793 blurRadius = min(blurRadius, narrowPrecisionToCGFloat(1000.0));
794
793 // Work around <rdar://problem/5539388> by ensuring that the offsets will ge t truncated 795 // Work around <rdar://problem/5539388> by ensuring that the offsets will ge t truncated
794 // to the desired integer. 796 // to the desired integer.
795 static const CGFloat extraShadowOffset = narrowPrecisionToCGFloat(1.0 / 128) ; 797 static const CGFloat extraShadowOffset = narrowPrecisionToCGFloat(1.0 / 128) ;
796 if (xOffset > 0) 798 if (xOffset > 0)
797 xOffset += extraShadowOffset; 799 xOffset += extraShadowOffset;
798 else if (xOffset < 0) 800 else if (xOffset < 0)
799 xOffset -= extraShadowOffset; 801 xOffset -= extraShadowOffset;
800 802
801 if (yOffset > 0) 803 if (yOffset > 0)
802 yOffset += extraShadowOffset; 804 yOffset += extraShadowOffset;
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 break; 1279 break;
1278 case CompositePlusLighter: 1280 case CompositePlusLighter:
1279 target = kCGBlendModePlusLighter; 1281 target = kCGBlendModePlusLighter;
1280 break; 1282 break;
1281 } 1283 }
1282 CGContextSetBlendMode(platformContext(), target); 1284 CGContextSetBlendMode(platformContext(), target);
1283 } 1285 }
1284 #endif 1286 #endif
1285 1287
1286 } 1288 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/canvas/shadow-huge-blur-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698