WebCore/ChangeLog

 12010-09-30 Alejandro G. Castro <alex@igalia.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 ContextShadow should not use the blur radius as kernel size of the
 6 box blurs
 7 https://bugs.webkit.org/show_bug.cgi?id=46918
 8
 9 Calculate the size of the kernel in the blur algorihtm using the
 10 radius instead of using directly.
 11
 12 * platform/graphics/ContextShadow.cpp:
 13 (WebCore::ContextShadow::blurLayerImage):
 14 (WebCore::ContextShadow::calculateLayerBoundingRect):
 15
1162010-09-29 Kent Tamura <tkent@chromium.org>
217
318 Reviewed by Dimitri Glazkov.

WebCore/platform/graphics/ContextShadow.cpp

@@static const int BlurSumShift = 15;
8585void ContextShadow::blurLayerImage(unsigned char* imageData, const IntSize& size, int rowStride)
8686{
8787 int channels[4] = { 3, 0, 1, 3 };
88  int dmax = m_blurRadius >> 1;
89  int dmin = dmax - 1 + (m_blurRadius & 1);
 88 unsigned kernelSize = max(2.f, (2 / 3.f) * m_blurRadius);
 89 int dmax = kernelSize >> 1;
 90 int dmin = dmax - 1 + (kernelSize & 1);
9091 if (dmin < 0)
9192 dmin = 0;
9293

@@void ContextShadow::calculateLayerBoundingRect(const FloatRect& layerArea, const
153154 destinationRect.move(m_offset);
154155 m_layerRect = enclosingIntRect(destinationRect);
155156
156  // We expand the area by the blur radius * 2 to give extra space for the blur transition.
157  m_layerRect.inflate((m_type == BlurShadow) ? ceil(m_blurRadius * 2) : 0);
 157 // We expand the area by the blur radius to give extra space for the blur transition.
 158 m_layerRect.inflate((m_type == BlurShadow) ? ceil(m_blurRadius) : 0);
158159
159160 if (!clipRect.contains(m_layerRect)) {
160161 // No need to have the buffer larger than the clip.

@@void ContextShadow::calculateLayerBoundingRect(const FloatRect& layerArea, const
167168 // We adjust again because the pixels at the borders are still
168169 // potentially affected by the pixels outside the buffer.
169170 if (m_type == BlurShadow)
170  m_layerRect.inflate((m_type == BlurShadow) ? ceil(m_blurRadius * 2) : 0);
 171 m_layerRect.inflate((m_type == BlurShadow) ? ceil(m_blurRadius) : 0);
171172 }
172173}
173174