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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp

Issue 1994613002: Let dirty rect inflate after its unite with the affected area (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 262 }
263 263
264 void HTMLCanvasElement::didDraw(const FloatRect& rect) 264 void HTMLCanvasElement::didDraw(const FloatRect& rect)
265 { 265 {
266 if (rect.isEmpty()) 266 if (rect.isEmpty())
267 return; 267 return;
268 m_imageBufferIsClear = false; 268 m_imageBufferIsClear = false;
269 clearCopiedImage(); 269 clearCopiedImage();
270 if (layoutObject()) 270 if (layoutObject())
271 layoutObject()->setMayNeedPaintInvalidation(); 271 layoutObject()->setMayNeedPaintInvalidation();
272 m_dirtyRect.unite(rect);
272 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page() && page()->deviceScaleFactor() > 1.0f) 273 if (m_context && m_context->is2d() && m_context->shouldAntialias() && page() && page()->deviceScaleFactor() > 1.0f)
273 m_dirtyRect.inflate(1); 274 m_dirtyRect.inflate(1);
Justin Novosad 2016/05/18 19:11:42 what you meant to do is inflate "rect" before the
274 m_dirtyRect.unite(rect);
275 if (m_context && m_context->is2d() && hasImageBuffer()) 275 if (m_context && m_context->is2d() && hasImageBuffer())
276 buffer()->didDraw(rect); 276 buffer()->didDraw(rect);
277 } 277 }
278 278
279 void HTMLCanvasElement::didFinalizeFrame() 279 void HTMLCanvasElement::didFinalizeFrame()
280 { 280 {
281 notifyListenersCanvasChanged(); 281 notifyListenersCanvasChanged();
282 282
283 if (m_dirtyRect.isEmpty()) 283 if (m_dirtyRect.isEmpty())
284 return; 284 return;
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 } 1126 }
1127 1127
1128 String HTMLCanvasElement::getIdFromControl(const Element* element) 1128 String HTMLCanvasElement::getIdFromControl(const Element* element)
1129 { 1129 {
1130 if (m_context) 1130 if (m_context)
1131 return m_context->getIdFromControl(element); 1131 return m_context->getIdFromControl(element);
1132 return String(); 1132 return String();
1133 } 1133 }
1134 1134
1135 } // namespace blink 1135 } // namespace blink
OLDNEW
« 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