| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 { | 197 { |
| 198 if (m_dirtyRect.isEmpty()) | 198 if (m_dirtyRect.isEmpty()) |
| 199 return; | 199 return; |
| 200 | 200 |
| 201 // Propagate the m_dirtyRect accumulated so far to the compositor | 201 // Propagate the m_dirtyRect accumulated so far to the compositor |
| 202 // before restarting with a blank dirty rect. | 202 // before restarting with a blank dirty rect. |
| 203 FloatRect srcRect(0, 0, size().width(), size().height()); | 203 FloatRect srcRect(0, 0, size().width(), size().height()); |
| 204 m_dirtyRect.intersect(srcRect); | 204 m_dirtyRect.intersect(srcRect); |
| 205 if (RenderBox* ro = renderBox()) { | 205 if (RenderBox* ro = renderBox()) { |
| 206 FloatRect mappedDirtyRect = mapRect(m_dirtyRect, srcRect, ro->contentBox
Rect()); | 206 FloatRect mappedDirtyRect = mapRect(m_dirtyRect, srcRect, ro->contentBox
Rect()); |
| 207 // For querying RenderLayer::compositingState() | |
| 208 // FIXME: is this invalidation using the correct compositing state? | |
| 209 DisableCompositingQueryAsserts disabler; | |
| 210 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect)); | 207 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect)); |
| 211 } | 208 } |
| 212 notifyObserversCanvasChanged(m_dirtyRect); | 209 notifyObserversCanvasChanged(m_dirtyRect); |
| 213 m_finalizeFrameTask.Cancel(); | 210 m_finalizeFrameTask.Cancel(); |
| 214 m_dirtyRect = FloatRect(); | 211 m_dirtyRect = FloatRect(); |
| 215 } | 212 } |
| 216 | 213 |
| 217 void HTMLCanvasElement::resetDirtyRect() | 214 void HTMLCanvasElement::resetDirtyRect() |
| 218 { | 215 { |
| 219 if (m_dirtyRect.isEmpty()) | 216 if (m_dirtyRect.isEmpty()) |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 } | 674 } |
| 678 return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled); | 675 return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled); |
| 679 } | 676 } |
| 680 | 677 |
| 681 FloatSize HTMLCanvasElement::sourceSize() const | 678 FloatSize HTMLCanvasElement::sourceSize() const |
| 682 { | 679 { |
| 683 return FloatSize(width(), height()); | 680 return FloatSize(width(), height()); |
| 684 } | 681 } |
| 685 | 682 |
| 686 } | 683 } |
| OLD | NEW |