| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 void HTMLCanvasElement::didFinalizeFrame() | 288 void HTMLCanvasElement::didFinalizeFrame() |
| 289 { | 289 { |
| 290 if (m_dirtyRect.isEmpty()) | 290 if (m_dirtyRect.isEmpty()) |
| 291 return; | 291 return; |
| 292 | 292 |
| 293 // Propagate the m_dirtyRect accumulated so far to the compositor | 293 // Propagate the m_dirtyRect accumulated so far to the compositor |
| 294 // before restarting with a blank dirty rect. | 294 // before restarting with a blank dirty rect. |
| 295 FloatRect srcRect(0, 0, size().width(), size().height()); | 295 FloatRect srcRect(0, 0, size().width(), size().height()); |
| 296 m_dirtyRect.intersect(srcRect); | 296 m_dirtyRect.intersect(srcRect); |
| 297 if (LayoutBox* ro = layoutBox()) { | 297 if (LayoutBox* ro = layoutBox()) { |
| 298 FloatRect mappedDirtyRect = mapRect(m_dirtyRect, srcRect, ro->contentBox
Rect()); | 298 LayoutRect mappedDirtyRect(enclosingIntRect(mapRect(m_dirtyRect, srcRect
, ro->contentBoxRect()))); |
| 299 // For querying Layer::compositingState() | 299 // For querying Layer::compositingState() |
| 300 // FIXME: is this invalidation using the correct compositing state? | 300 // FIXME: is this invalidation using the correct compositing state? |
| 301 DisableCompositingQueryAsserts disabler; | 301 DisableCompositingQueryAsserts disabler; |
| 302 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect)); | 302 ro->invalidatePaintRectangle(mappedDirtyRect); |
| 303 } | 303 } |
| 304 notifyObserversCanvasChanged(m_dirtyRect); | 304 notifyObserversCanvasChanged(m_dirtyRect); |
| 305 m_dirtyRect = FloatRect(); | 305 m_dirtyRect = FloatRect(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void HTMLCanvasElement::restoreCanvasMatrixClipStack() | 308 void HTMLCanvasElement::restoreCanvasMatrixClipStack() |
| 309 { | 309 { |
| 310 if (m_context && m_context->is2d()) | 310 if (m_context && m_context->is2d()) |
| 311 toCanvasRenderingContext2D(m_context.get())->restoreCanvasMatrixClipStac
k(); | 311 toCanvasRenderingContext2D(m_context.get())->restoreCanvasMatrixClipStac
k(); |
| 312 } | 312 } |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 { | 885 { |
| 886 return FloatSize(width(), height()); | 886 return FloatSize(width(), height()); |
| 887 } | 887 } |
| 888 | 888 |
| 889 bool HTMLCanvasElement::isOpaque() const | 889 bool HTMLCanvasElement::isOpaque() const |
| 890 { | 890 { |
| 891 return m_context && !m_context->hasAlpha(); | 891 return m_context && !m_context->hasAlpha(); |
| 892 } | 892 } |
| 893 | 893 |
| 894 } // blink | 894 } // blink |
| OLD | NEW |