Changeset 114548 in webkit
- Timestamp:
- Apr 18, 2012 1:05:10 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r114545 r114548 1 2012-04-18 Levi Weintraub <leviw@chromium.org> 2 3 GraphicsContextCG's roundToDevicePixels should round even when there's no transform 4 https://bugs.webkit.org/show_bug.cgi?id=84191 5 6 Reviewed by Eric Seidel. 7 8 When painting with the identify transform, the roundToDevicePixels function in GraphicsContextCG 9 does an early return that simply returns the FloatRect that was passed in. This proved to be a 10 problem in sub-pixel layout, as we wouldn't adjust the paint rect for text underline, and it could 11 end up being more than one pixel wide. Adding a roundedIntRect method on FloatRect for the simple 12 short-circuit case. 13 14 No new tests. No change in behavior before switching to sub-pixel layout. 15 16 * platform/graphics/FloatRect.cpp: 17 (WebCore::roundedIntRect): 18 * platform/graphics/FloatRect.h: 19 * platform/graphics/cg/GraphicsContextCG.cpp: 20 (WebCore::GraphicsContext::roundToDevicePixels): 21 1 22 2012-04-18 Keishi Hattori <keishi@webkit.org> 2 23 -
trunk/Source/WebCore/platform/graphics/FloatRect.cpp
r113879 r114548 237 237 } 238 238 239 IntRect roundedIntRect(const FloatRect& rect) 240 { 241 return IntRect(roundedIntPoint(rect.location()), roundedIntSize(rect.size())); 242 } 243 239 244 FloatRect mapRect(const FloatRect& r, const FloatRect& srcRect, const FloatRect& destRect) 240 245 { -
trunk/Source/WebCore/platform/graphics/FloatRect.h
r109256 r114548 289 289 IntRect enclosedIntRect(const FloatRect&); 290 290 291 IntRect roundedIntRect(const FloatRect&); 292 291 293 // Map rect r from srcRect to an equivalent rect in destRect. 292 294 FloatRect mapRect(const FloatRect& r, const FloatRect& srcRect, const FloatRect& destRect); -
trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r113486 r114548 1314 1314 1315 1315 if (m_data->m_userToDeviceTransformKnownToBeIdentity) 1316 return r ect;1316 return roundedIntRect(rect); 1317 1317 1318 1318 CGAffineTransform deviceMatrix = CGContextGetUserSpaceToDeviceSpaceTransform(platformContext()); 1319 1319 if (CGAffineTransformIsIdentity(deviceMatrix)) { 1320 1320 m_data->m_userToDeviceTransformKnownToBeIdentity = true; 1321 return r ect;1321 return roundedIntRect(rect); 1322 1322 } 1323 1323
Note: See TracChangeset
for help on using the changeset viewer.