Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 506553004: Make the compositing assert disabler for paint invalidation more targeted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/rendering/RenderImage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
46 #include "platform/MIMETypeRegistry.h" 47 #include "platform/MIMETypeRegistry.h"
47 #include "platform/RuntimeEnabledFeatures.h" 48 #include "platform/RuntimeEnabledFeatures.h"
48 #include "platform/graphics/Canvas2DImageBufferSurface.h" 49 #include "platform/graphics/Canvas2DImageBufferSurface.h"
49 #include "platform/graphics/GraphicsContextStateSaver.h" 50 #include "platform/graphics/GraphicsContextStateSaver.h"
50 #include "platform/graphics/ImageBuffer.h" 51 #include "platform/graphics/ImageBuffer.h"
51 #include "platform/graphics/RecordingImageBufferSurface.h" 52 #include "platform/graphics/RecordingImageBufferSurface.h"
52 #include "platform/graphics/UnacceleratedImageBufferSurface.h" 53 #include "platform/graphics/UnacceleratedImageBufferSurface.h"
53 #include "platform/graphics/gpu/WebGLImageBufferSurface.h" 54 #include "platform/graphics/gpu/WebGLImageBufferSurface.h"
54 #include "platform/transforms/AffineTransform.h" 55 #include "platform/transforms/AffineTransform.h"
55 #include "public/platform/Platform.h" 56 #include "public/platform/Platform.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 { 206 {
206 if (m_dirtyRect.isEmpty()) 207 if (m_dirtyRect.isEmpty())
207 return; 208 return;
208 209
209 // Propagate the m_dirtyRect accumulated so far to the compositor 210 // Propagate the m_dirtyRect accumulated so far to the compositor
210 // before restarting with a blank dirty rect. 211 // before restarting with a blank dirty rect.
211 FloatRect srcRect(0, 0, size().width(), size().height()); 212 FloatRect srcRect(0, 0, size().width(), size().height());
212 m_dirtyRect.intersect(srcRect); 213 m_dirtyRect.intersect(srcRect);
213 if (RenderBox* ro = renderBox()) { 214 if (RenderBox* ro = renderBox()) {
214 FloatRect mappedDirtyRect = mapRect(m_dirtyRect, srcRect, ro->contentBox Rect()); 215 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;
215 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect)); 219 ro->invalidatePaintRectangle(enclosingIntRect(mappedDirtyRect));
216 } 220 }
217 notifyObserversCanvasChanged(m_dirtyRect); 221 notifyObserversCanvasChanged(m_dirtyRect);
218 blink::Platform::current()->currentThread()->removeTaskObserver(this); 222 blink::Platform::current()->currentThread()->removeTaskObserver(this);
219 m_dirtyRect = FloatRect(); 223 m_dirtyRect = FloatRect();
220 } 224 }
221 225
222 void HTMLCanvasElement::resetDirtyRect() 226 void HTMLCanvasElement::resetDirtyRect()
223 { 227 {
224 if (m_dirtyRect.isEmpty()) 228 if (m_dirtyRect.isEmpty())
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 { 741 {
738 return !originClean(); 742 return !originClean();
739 } 743 }
740 744
741 FloatSize HTMLCanvasElement::sourceSize() const 745 FloatSize HTMLCanvasElement::sourceSize() const
742 { 746 {
743 return FloatSize(width(), height()); 747 return FloatSize(width(), height());
744 } 748 }
745 749
746 } 750 }
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/rendering/RenderImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698