Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 1991563003: Inflate rect instead of m_dirtyRect in HTMLCanvasElement::didDraw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5c8f2329b9f16f6332811ff126ce444d048ada06..52556b3111db5cba61a8c639ea8039108964a793 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -269,9 +269,13 @@ void HTMLCanvasElement::didDraw(const FloatRect& rect)
clearCopiedImage();
if (layoutObject())
layoutObject()->setMayNeedPaintInvalidation();
- m_dirtyRect.unite(rect);
- if (m_context && m_context->is2d() && m_context->shouldAntialias() && page() && page()->deviceScaleFactor() > 1.0f)
- m_dirtyRect.inflate(1);
+ if (m_context && m_context->is2d() && m_context->shouldAntialias() && page() && page()->deviceScaleFactor() > 1.0f) {
+ FloatRect inflatedRect = rect;
+ inflatedRect.inflate(1);
+ m_dirtyRect.unite(inflatedRect);
+ } else {
+ m_dirtyRect.unite(rect);
+ }
if (m_context && m_context->is2d() && hasImageBuffer())
buffer()->didDraw(rect);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698