Changeset 106988 in webkit
- Timestamp:
- Feb 7, 2012 1:52:58 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106986 r106988 1 2012-02-07 Matthew Delaney <mdelaney@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=77912 4 Removing old CG shadow code. 5 6 A CG-specific shadow offset hack was added in http://trac.webkit.org/changeset/34317 7 for this particular setShadow method. However, this shadow offset adjustment for CG 8 has since moved down into platform specific code. Thus, this offset adjustment here 9 is now redundant. 10 11 The CG-only shadow setting code block in this setShadow method is now redundant. 12 Since it sets the shadow values to the CGContext directly - and not to the State object - 13 it will be overwritten later by any subsequent calls to setting shadow values such as 14 blur, offset, or shadow color. 15 16 Reviewed by Simon Fraser. 17 18 No new tests. Current canvas tests cover this path. 19 20 * html/canvas/CanvasRenderingContext2D.cpp: 21 (WebCore::CanvasRenderingContext2D::setShadow): 22 1 23 2012-02-07 James Robinson <jamesr@chromium.org> 2 24 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r106973 r106988 1102 1102 } 1103 1103 1104 #if USE(CG)1105 static inline CGSize adjustedShadowSize(CGFloat width, CGFloat height)1106 {1107 // Work around <rdar://problem/5539388> by ensuring that shadow offsets will get truncated1108 // to the desired integer.1109 static const CGFloat extraShadowOffset = narrowPrecisionToCGFloat(1.0 / 128);1110 if (width > 0)1111 width += extraShadowOffset;1112 else if (width < 0)1113 width -= extraShadowOffset;1114 1115 if (height > 0)1116 height += extraShadowOffset;1117 else if (height < 0)1118 height -= extraShadowOffset;1119 1120 return CGSizeMake(width, height);1121 }1122 #endif1123 1124 1104 void CanvasRenderingContext2D::setShadow(float width, float height, float blur) 1125 1105 { … … 1182 1162 state().m_shadowBlur = blur; 1183 1163 state().m_shadowColor = makeRGBAFromCMYKA(c, m, y, k, a); 1184 1185 GraphicsContext* dc = drawingContext();1186 if (!dc)1187 return;1188 #if USE(CG)1189 const CGFloat components[5] = { c, m, y, k, a };1190 CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceCMYK();1191 CGColorRef shadowColor = CGColorCreate(colorSpace, components);1192 CGColorSpaceRelease(colorSpace);1193 CGContextSetShadowWithColor(dc->platformContext(), adjustedShadowSize(width, -height), blur, shadowColor);1194 CGColorRelease(shadowColor);1195 #else1196 1164 applyShadow(); 1197 #endif1198 1165 } 1199 1166
Note: See TracChangeset
for help on using the changeset viewer.