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

Side by Side Diff: sky/engine/core/html/HTMLCanvasElement.cpp

Issue 845093002: Delete an assortment of unneeded paint invalidation code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/core/frame/FrameView.cpp ('k') | sky/engine/core/rendering/RenderBlock.h » ('j') | 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 void HTMLCanvasElement::didFinalizeFrame() 194 void HTMLCanvasElement::didFinalizeFrame()
195 { 195 {
196 if (m_dirtyRect.isEmpty()) 196 if (m_dirtyRect.isEmpty())
197 return; 197 return;
198 198
199 // Propagate the m_dirtyRect accumulated so far to the compositor 199 // Propagate the m_dirtyRect accumulated so far to the compositor
200 // before restarting with a blank dirty rect. 200 // before restarting with a blank dirty rect.
201 FloatRect srcRect(0, 0, size().width(), size().height()); 201 FloatRect srcRect(0, 0, size().width(), size().height());
202 m_dirtyRect.intersect(srcRect); 202 m_dirtyRect.intersect(srcRect);
203 if (RenderBox* ro = renderBox()) {
204 FloatRect mappedDirtyRect = mapRect(m_dirtyRect, srcRect, ro->contentBox Rect());
205 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect));
206 }
207 notifyObserversCanvasChanged(m_dirtyRect); 203 notifyObserversCanvasChanged(m_dirtyRect);
208 m_finalizeFrameTask.Cancel(); 204 m_finalizeFrameTask.Cancel();
209 m_dirtyRect = FloatRect(); 205 m_dirtyRect = FloatRect();
210 } 206 }
211 207
212 void HTMLCanvasElement::resetDirtyRect() 208 void HTMLCanvasElement::resetDirtyRect()
213 { 209 {
214 if (m_dirtyRect.isEmpty()) 210 if (m_dirtyRect.isEmpty())
215 return; 211 return;
216 m_finalizeFrameTask.Cancel(); 212 m_finalizeFrameTask.Cancel();
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 } 660 }
665 return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled); 661 return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled);
666 } 662 }
667 663
668 FloatSize HTMLCanvasElement::sourceSize() const 664 FloatSize HTMLCanvasElement::sourceSize() const
669 { 665 {
670 return FloatSize(width(), height()); 666 return FloatSize(width(), height());
671 } 667 }
672 668
673 } 669 }
OLDNEW
« no previous file with comments | « sky/engine/core/frame/FrameView.cpp ('k') | sky/engine/core/rendering/RenderBlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698