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 25 matching lines...) Expand all Loading... |
36 #include "core/dom/ExceptionCode.h" | 36 #include "core/dom/ExceptionCode.h" |
37 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
38 #include "core/frame/Settings.h" | 38 #include "core/frame/Settings.h" |
39 #include "core/html/ImageData.h" | 39 #include "core/html/ImageData.h" |
40 #include "core/html/canvas/Canvas2DContextAttributes.h" | 40 #include "core/html/canvas/Canvas2DContextAttributes.h" |
41 #include "core/html/canvas/CanvasRenderingContext2D.h" | 41 #include "core/html/canvas/CanvasRenderingContext2D.h" |
42 #include "core/html/canvas/WebGLContextAttributes.h" | 42 #include "core/html/canvas/WebGLContextAttributes.h" |
43 #include "core/html/canvas/WebGLContextEvent.h" | 43 #include "core/html/canvas/WebGLContextEvent.h" |
44 #include "core/html/canvas/WebGLRenderingContext.h" | 44 #include "core/html/canvas/WebGLRenderingContext.h" |
45 #include "core/rendering/RenderHTMLCanvas.h" | 45 #include "core/rendering/RenderHTMLCanvas.h" |
46 #include "core/rendering/RenderLayer.h" | |
47 #include "platform/MIMETypeRegistry.h" | 46 #include "platform/MIMETypeRegistry.h" |
48 #include "platform/RuntimeEnabledFeatures.h" | 47 #include "platform/RuntimeEnabledFeatures.h" |
49 #include "platform/graphics/Canvas2DImageBufferSurface.h" | 48 #include "platform/graphics/Canvas2DImageBufferSurface.h" |
50 #include "platform/graphics/GraphicsContextStateSaver.h" | 49 #include "platform/graphics/GraphicsContextStateSaver.h" |
51 #include "platform/graphics/ImageBuffer.h" | 50 #include "platform/graphics/ImageBuffer.h" |
52 #include "platform/graphics/RecordingImageBufferSurface.h" | 51 #include "platform/graphics/RecordingImageBufferSurface.h" |
53 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 52 #include "platform/graphics/UnacceleratedImageBufferSurface.h" |
54 #include "platform/graphics/gpu/WebGLImageBufferSurface.h" | 53 #include "platform/graphics/gpu/WebGLImageBufferSurface.h" |
55 #include "platform/transforms/AffineTransform.h" | 54 #include "platform/transforms/AffineTransform.h" |
56 #include "public/platform/Platform.h" | 55 #include "public/platform/Platform.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 { | 205 { |
207 if (m_dirtyRect.isEmpty()) | 206 if (m_dirtyRect.isEmpty()) |
208 return; | 207 return; |
209 | 208 |
210 // Propagate the m_dirtyRect accumulated so far to the compositor | 209 // Propagate the m_dirtyRect accumulated so far to the compositor |
211 // before restarting with a blank dirty rect. | 210 // before restarting with a blank dirty rect. |
212 FloatRect srcRect(0, 0, size().width(), size().height()); | 211 FloatRect srcRect(0, 0, size().width(), size().height()); |
213 m_dirtyRect.intersect(srcRect); | 212 m_dirtyRect.intersect(srcRect); |
214 if (RenderBox* ro = renderBox()) { | 213 if (RenderBox* ro = renderBox()) { |
215 FloatRect mappedDirtyRect = mapRect(m_dirtyRect, srcRect, ro->contentBox
Rect()); | 214 FloatRect mappedDirtyRect = mapRect(m_dirtyRect, srcRect, ro->contentBox
Rect()); |
216 // For querying RenderLayer::compositingState() | |
217 // FIXME: is this invalidation using the correct compositing state? | |
218 DisableCompositingQueryAsserts disabler; | |
219 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect)); | 215 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect)); |
220 } | 216 } |
221 notifyObserversCanvasChanged(m_dirtyRect); | 217 notifyObserversCanvasChanged(m_dirtyRect); |
222 blink::Platform::current()->currentThread()->removeTaskObserver(this); | 218 blink::Platform::current()->currentThread()->removeTaskObserver(this); |
223 m_dirtyRect = FloatRect(); | 219 m_dirtyRect = FloatRect(); |
224 } | 220 } |
225 | 221 |
226 void HTMLCanvasElement::resetDirtyRect() | 222 void HTMLCanvasElement::resetDirtyRect() |
227 { | 223 { |
228 if (m_dirtyRect.isEmpty()) | 224 if (m_dirtyRect.isEmpty()) |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 { | 739 { |
744 return !originClean(); | 740 return !originClean(); |
745 } | 741 } |
746 | 742 |
747 FloatSize HTMLCanvasElement::sourceSize() const | 743 FloatSize HTMLCanvasElement::sourceSize() const |
748 { | 744 { |
749 return FloatSize(width(), height()); | 745 return FloatSize(width(), height()); |
750 } | 746 } |
751 | 747 |
752 } | 748 } |
OLD | NEW |