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

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

Issue 952273006: Make the constructor of a LayoutRect from an IntRect explicit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/LocalFrame.cpp ('k') | Source/core/html/HTMLTextFormControlElementTest.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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « Source/core/frame/LocalFrame.cpp ('k') | Source/core/html/HTMLTextFormControlElementTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698