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..b87d3fb7f4ac373d4b0e7cb4fb155d772443c00d 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp |
| @@ -323,12 +323,22 @@ 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 (FloatRect(ro->contentBoxRect()).contains(srcRect) && |
|
Justin Novosad
2016/10/21 15:56:03
"Contains" is not the right condition to determine
|
| + srcRect != FloatRect(ro->contentBoxRect())) { |
| + m_dirtyRect.expand(FloatSize(0.5, 0.5)); |
|
Justin Novosad
2016/10/21 15:56:03
You should use inflate here.
|
| + m_dirtyRect.move(FloatSize(-0.25, -0.25)); |
| + } |
| + |
| + m_dirtyRect.intersect(srcRect); |
| LayoutRect mappedDirtyRect(enclosingIntRect( |
| mapRect(m_dirtyRect, srcRect, FloatRect(ro->contentBoxRect())))); |
| // For querying PaintLayer::compositingState() |