OLD | NEW |
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 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 *dirtyRect = canvasRect; | 1736 *dirtyRect = canvasRect; |
1737 | 1737 |
1738 return true; | 1738 return true; |
1739 } | 1739 } |
1740 | 1740 |
1741 void CanvasRenderingContext2D::didDraw(const FloatRect& dirtyRect) | 1741 void CanvasRenderingContext2D::didDraw(const FloatRect& dirtyRect) |
1742 { | 1742 { |
1743 if (dirtyRect.isEmpty()) | 1743 if (dirtyRect.isEmpty()) |
1744 return; | 1744 return; |
1745 | 1745 |
1746 // If we are drawing to hardware and we have a composited layer, just call c
ontentChanged(). | 1746 // If we are drawing to hardware and we have a composited layer, just invali
date layer. |
1747 if (isAccelerated()) { | 1747 if (isAccelerated() && platformLayer()) { |
1748 RenderBox* renderBox = canvas()->renderBox(); | 1748 platformLayer()->invalidateRect(dirtyRect); |
1749 if (renderBox && renderBox->hasAcceleratedCompositing()) { | 1749 canvas()->clearCopiedImage(); |
1750 renderBox->contentChanged(CanvasPixelsChanged); | 1750 canvas()->notifyObserversCanvasChanged(dirtyRect); |
1751 canvas()->clearCopiedImage(); | 1751 return; |
1752 canvas()->notifyObserversCanvasChanged(dirtyRect); | |
1753 return; | |
1754 } | |
1755 } | 1752 } |
1756 | 1753 |
1757 canvas()->didDraw(dirtyRect); | 1754 canvas()->didDraw(dirtyRect); |
1758 } | 1755 } |
1759 | 1756 |
1760 GraphicsContext* CanvasRenderingContext2D::drawingContext() const | 1757 GraphicsContext* CanvasRenderingContext2D::drawingContext() const |
1761 { | 1758 { |
1762 if (isContextLost()) | 1759 if (isContextLost()) |
1763 return 0; | 1760 return 0; |
1764 return canvas()->drawingContext(); | 1761 return canvas()->drawingContext(); |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2435 | 2432 |
2436 unsigned CanvasRenderingContext2D::hitRegionsCount() const | 2433 unsigned CanvasRenderingContext2D::hitRegionsCount() const |
2437 { | 2434 { |
2438 if (m_hitRegionManager) | 2435 if (m_hitRegionManager) |
2439 return m_hitRegionManager->getHitRegionsCount(); | 2436 return m_hitRegionManager->getHitRegionsCount(); |
2440 | 2437 |
2441 return 0; | 2438 return 0; |
2442 } | 2439 } |
2443 | 2440 |
2444 } // namespace WebCore | 2441 } // namespace WebCore |
OLD | NEW |