| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |