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

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 402613006: Fixing 2D canvas invalidation region tracking. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixups and baselines Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 *dirtyRect = canvasRect; 1738 *dirtyRect = canvasRect;
1739 1739
1740 return true; 1740 return true;
1741 } 1741 }
1742 1742
1743 void CanvasRenderingContext2D::didDraw(const FloatRect& dirtyRect) 1743 void CanvasRenderingContext2D::didDraw(const FloatRect& dirtyRect)
1744 { 1744 {
1745 if (dirtyRect.isEmpty()) 1745 if (dirtyRect.isEmpty())
1746 return; 1746 return;
1747 1747
1748 // If we are drawing to hardware and we have a composited layer, just invali date layer.
1749 if (isAccelerated() && platformLayer()) {
1750 platformLayer()->invalidateRect(dirtyRect);
1751 canvas()->clearCopiedImage();
1752 canvas()->notifyObserversCanvasChanged(dirtyRect);
1753 return;
1754 }
1755
1756 canvas()->didDraw(dirtyRect); 1748 canvas()->didDraw(dirtyRect);
1757 } 1749 }
1758 1750
1759 GraphicsContext* CanvasRenderingContext2D::drawingContext() const 1751 GraphicsContext* CanvasRenderingContext2D::drawingContext() const
1760 { 1752 {
1761 if (isContextLost()) 1753 if (isContextLost())
1762 return 0; 1754 return 0;
1763 return canvas()->drawingContext(); 1755 return canvas()->drawingContext();
1764 } 1756 }
1765 1757
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 2438
2447 unsigned CanvasRenderingContext2D::hitRegionsCount() const 2439 unsigned CanvasRenderingContext2D::hitRegionsCount() const
2448 { 2440 {
2449 if (m_hitRegionManager) 2441 if (m_hitRegionManager)
2450 return m_hitRegionManager->getHitRegionsCount(); 2442 return m_hitRegionManager->getHitRegionsCount();
2451 2443
2452 return 0; 2444 return 0;
2453 } 2445 }
2454 2446
2455 } // namespace WebCore 2447 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698