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

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

Issue 429643002: Add non-blocking frame rate limiting logic to display list 2D canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: applied corrections Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/graphics/Canvas2DImageBufferSurface.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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return m_context.get(); 188 return m_context.get();
189 } 189 }
190 190
191 return 0; 191 return 0;
192 } 192 }
193 193
194 void HTMLCanvasElement::didDraw(const FloatRect& rect) 194 void HTMLCanvasElement::didDraw(const FloatRect& rect)
195 { 195 {
196 clearCopiedImage(); 196 clearCopiedImage();
197 197
198 if (hasImageBuffer())
199 m_imageBuffer->didDraw();
200
198 if (RenderBox* ro = renderBox()) { 201 if (RenderBox* ro = renderBox()) {
199 FloatRect srcRect(0, 0, size().width(), size().height()); 202 FloatRect srcRect(0, 0, size().width(), size().height());
200 FloatRect r = rect; 203 FloatRect r = rect;
201 r.intersect(srcRect); 204 r.intersect(srcRect);
202 if (r.isEmpty() || m_dirtyRect.contains(r)) 205 if (r.isEmpty() || m_dirtyRect.contains(r))
203 return; 206 return;
204 m_dirtyRect.unite(r); 207 m_dirtyRect.unite(r);
205 FloatRect mappedDirtyRect = mapRect(r, srcRect, ro->contentBoxRect()); 208 FloatRect mappedDirtyRect = mapRect(r, srcRect, ro->contentBoxRect());
206 209
207 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect)); 210 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect));
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 { 716 {
714 return !originClean(); 717 return !originClean();
715 } 718 }
716 719
717 FloatSize HTMLCanvasElement::sourceSize() const 720 FloatSize HTMLCanvasElement::sourceSize() const
718 { 721 {
719 return FloatSize(width(), height()); 722 return FloatSize(width(), height());
720 } 723 }
721 724
722 } 725 }
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/Canvas2DImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698