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

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

Issue 318803002: Rename Repaint to Paint Invalidation part 3 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/RemoteFrameView.cpp ('k') | Source/core/html/HTMLFormControlElement.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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 clearCopiedImage(); 204 clearCopiedImage();
205 205
206 if (RenderBox* ro = renderBox()) { 206 if (RenderBox* ro = renderBox()) {
207 FloatRect destRect = ro->contentBoxRect(); 207 FloatRect destRect = ro->contentBoxRect();
208 FloatRect r = mapRect(rect, FloatRect(0, 0, size().width(), size().heigh t()), destRect); 208 FloatRect r = mapRect(rect, FloatRect(0, 0, size().width(), size().heigh t()), destRect);
209 r.intersect(destRect); 209 r.intersect(destRect);
210 if (r.isEmpty() || m_dirtyRect.contains(r)) 210 if (r.isEmpty() || m_dirtyRect.contains(r))
211 return; 211 return;
212 212
213 m_dirtyRect.unite(r); 213 m_dirtyRect.unite(r);
214 ro->repaintRectangle(enclosingIntRect(m_dirtyRect)); 214 ro->invalidatePaintRectangle(enclosingIntRect(m_dirtyRect));
215 } 215 }
216 216
217 notifyObserversCanvasChanged(rect); 217 notifyObserversCanvasChanged(rect);
218 } 218 }
219 219
220 void HTMLCanvasElement::notifyObserversCanvasChanged(const FloatRect& rect) 220 void HTMLCanvasElement::notifyObserversCanvasChanged(const FloatRect& rect)
221 { 221 {
222 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator end = m _observers.end(); 222 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator end = m _observers.end();
223 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it) 223 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it)
224 (*it)->canvasChanged(this, rect); 224 (*it)->canvasChanged(this, rect);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 toWebGLRenderingContext(m_context.get())->reshape(width(), height()); 266 toWebGLRenderingContext(m_context.get())->reshape(width(), height());
267 267
268 if (RenderObject* renderer = this->renderer()) { 268 if (RenderObject* renderer = this->renderer()) {
269 if (renderer->isCanvas()) { 269 if (renderer->isCanvas()) {
270 if (oldSize != size()) { 270 if (oldSize != size()) {
271 toRenderHTMLCanvas(renderer)->canvasSizeChanged(); 271 toRenderHTMLCanvas(renderer)->canvasSizeChanged();
272 if (renderBox() && renderBox()->hasAcceleratedCompositing()) 272 if (renderBox() && renderBox()->hasAcceleratedCompositing())
273 renderBox()->contentChanged(CanvasChanged); 273 renderBox()->contentChanged(CanvasChanged);
274 } 274 }
275 if (hadImageBuffer) 275 if (hadImageBuffer)
276 renderer->repaint(); 276 renderer->paintInvalidationForWholeRenderer();
277 } 277 }
278 } 278 }
279 279
280 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator end = m _observers.end(); 280 WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator end = m _observers.end();
281 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it) 281 for (WillBeHeapHashSet<RawPtrWillBeWeakMember<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it)
282 (*it)->canvasResized(this); 282 (*it)->canvasResized(this);
283 } 283 }
284 284
285 bool HTMLCanvasElement::paintsIntoCanvasBuffer() const 285 bool HTMLCanvasElement::paintsIntoCanvasBuffer() const
286 { 286 {
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 { 698 {
699 return !originClean(); 699 return !originClean();
700 } 700 }
701 701
702 FloatSize HTMLCanvasElement::sourceSize() const 702 FloatSize HTMLCanvasElement::sourceSize() const
703 { 703 {
704 return FloatSize(width(), height()); 704 return FloatSize(width(), height());
705 } 705 }
706 706
707 } 707 }
OLDNEW
« no previous file with comments | « Source/core/frame/RemoteFrameView.cpp ('k') | Source/core/html/HTMLFormControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698