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

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

Issue 341213002: Redraw only dirty area for accelerated 2D Canvas. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 m_dirtyRect.unite(r); 213 m_dirtyRect.unite(r);
214 ro->invalidatePaintRectangle(enclosingIntRect(m_dirtyRect)); 214 ro->invalidatePaintRectangle(enclosingIntRect(m_dirtyRect));
215 } 215 }
216 216
217 notifyObserversCanvasChanged(rect); 217 notifyObserversCanvasChanged(rect);
218 } 218 }
219 219
220 void HTMLCanvasElement::notifyObserversCanvasChanged(const FloatRect& rect) 220 void HTMLCanvasElement::notifyObserversCanvasChanged(const FloatRect& rect)
221 { 221 {
222 m_dirtyRect = rect;
Justin Novosad 2014/06/20 14:06:53 Storing the rect for later is a fragile approach b
222 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator end = m _observers.end(); 223 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator end = m _observers.end();
223 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it) 224 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it)
224 (*it)->canvasChanged(this, rect); 225 (*it)->canvasChanged(this, rect);
225 } 226 }
226 227
227 void HTMLCanvasElement::reset() 228 void HTMLCanvasElement::reset()
228 { 229 {
229 if (m_ignoreReset) 230 if (m_ignoreReset)
230 return; 231 return;
231 232
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 { 703 {
703 return !originClean(); 704 return !originClean();
704 } 705 }
705 706
706 FloatSize HTMLCanvasElement::sourceSize() const 707 FloatSize HTMLCanvasElement::sourceSize() const
707 { 708 {
708 return FloatSize(width(), height()); 709 return FloatSize(width(), height());
709 } 710 }
710 711
711 } 712 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698