Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| index 2a5a8ff5939da3b58adbbd60f3f5670202277781..5a262fb7603cc2239223fa1b5168535578e97a20 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| @@ -323,12 +323,21 @@ void HTMLCanvasElement::didFinalizeFrame() { |
| // Propagate the m_dirtyRect accumulated so far to the compositor |
| // before restarting with a blank dirty rect. |
| FloatRect srcRect(0, 0, size().width(), size().height()); |
| - m_dirtyRect.intersect(srcRect); |
| + |
| LayoutBox* ro = layoutBox(); |
| // Canvas content updates do not need to be propagated as |
| // paint invalidations if the canvas is accelerated, since |
| // the canvas contents are sent separately through a texture layer. |
| if (ro && (!m_context || !m_context->isAccelerated())) { |
| + // If ro->contentBoxRect() is larger than srcRect the canvas's image is |
| + // being stretched, so we need to account for color bleeding caused by the |
| + // interpollation filter. |
| + if (ro->contentBoxRect().width() > srcRect.width() || |
| + ro->contentBoxRect().height() > srcRect.height()) { |
| + m_dirtyRect.inflate(0.25); |
|
Justin Novosad
2016/10/25 14:30:15
Are you sure 0.25 is always enough? Even at very l
|
| + } |
| + |
| + m_dirtyRect.intersect(srcRect); |
| LayoutRect mappedDirtyRect(enclosingIntRect( |
| mapRect(m_dirtyRect, srcRect, FloatRect(ro->contentBoxRect())))); |
| // For querying PaintLayer::compositingState() |