Bug 51435 - Issues with ContextShadow
Summary: Issues with ContextShadow
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-21 17:22 PST by Simon Fraser (smfr)
Modified: 2010-12-21 21:32 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2010-12-21 17:22:50 PST
I see some issues with ContextShadow:

1. Code cleanup:
 * Rename drawRectShadowWithoutTiling to drawUntiledRectShadow
 * Move tiled drawing code into drawRectShadowWithTiling
 * drawRectShadow() just calls one or the other

2. layer area calculation
  * the code that inflates the shadow rect by the radius happens in both drawRectShadow, and again down in calculateLayerBoundingRect. 
  * when drawRectShadow() calls calculateLayerBoundingRect, it passes the already-inflated rect, leading to double inflation, I think. This does not happen in the drawRectShadowWithoutTiling code path.

3. Clipping causes double inflation
  * the "intersect with the clip" code in calculateLayerBoundingRect can cause double inflation on sides of the shadow that are not clipped. I think you want to intersect with an inflated clip.

4. The comment for m_sourceRect is wrong. m_sourceRect can end up larger than the layer buffer when clipped. There is no member var that tracks the rect in the layer buffer to which blurring should be applied.