| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 { | 209 { |
| 210 if (m_dirtyRect.isEmpty()) | 210 if (m_dirtyRect.isEmpty()) |
| 211 return; | 211 return; |
| 212 m_finalizeFrameTask.Cancel(); | 212 m_finalizeFrameTask.Cancel(); |
| 213 m_dirtyRect = FloatRect(); | 213 m_dirtyRect = FloatRect(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void HTMLCanvasElement::finalizeFrameMicrotask() | 216 void HTMLCanvasElement::finalizeFrameMicrotask() |
| 217 { | 217 { |
| 218 // This method gets invoked if didDraw was called earlier in the current tas
k. | 218 // This method gets invoked if didDraw was called earlier in the current tas
k. |
| 219 ASSERT(!m_dirtyRect.isEmpty()); | |
| 220 if (is3D()) { | 219 if (is3D()) { |
| 221 didFinalizeFrame(); | 220 didFinalizeFrame(); |
| 222 } else { | 221 } else { |
| 223 ASSERT(hasImageBuffer()); | 222 ASSERT(hasImageBuffer()); |
| 224 m_imageBuffer->finalizeFrame(m_dirtyRect); | 223 m_imageBuffer->finalizeFrame(); |
| 225 } | 224 } |
| 226 ASSERT(m_dirtyRect.isEmpty()); | |
| 227 ASSERT(m_finalizeFrameTask.IsCancelled()); | 225 ASSERT(m_finalizeFrameTask.IsCancelled()); |
| 228 } | 226 } |
| 229 | 227 |
| 230 void HTMLCanvasElement::notifyObserversCanvasChanged(const FloatRect& rect) | 228 void HTMLCanvasElement::notifyObserversCanvasChanged(const FloatRect& rect) |
| 231 { | 229 { |
| 232 HashSet<RawPtr<CanvasObserver> >::iterator end = m_observers.end(); | 230 HashSet<RawPtr<CanvasObserver> >::iterator end = m_observers.end(); |
| 233 for (HashSet<RawPtr<CanvasObserver> >::iterator it = m_observers.begin(); it
!= end; ++it) | 231 for (HashSet<RawPtr<CanvasObserver> >::iterator it = m_observers.begin(); it
!= end; ++it) |
| 234 (*it)->canvasChanged(this, rect); | 232 (*it)->canvasChanged(this, rect); |
| 235 } | 233 } |
| 236 | 234 |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 } | 658 } |
| 661 return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled); | 659 return m_imageBuffer->copyImage(DontCopyBackingStore, Unscaled); |
| 662 } | 660 } |
| 663 | 661 |
| 664 FloatSize HTMLCanvasElement::sourceSize() const | 662 FloatSize HTMLCanvasElement::sourceSize() const |
| 665 { | 663 { |
| 666 return FloatSize(width(), height()); | 664 return FloatSize(width(), height()); |
| 667 } | 665 } |
| 668 | 666 |
| 669 } | 667 } |
| OLD | NEW |