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

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 341213002: Redraw only dirty area for accelerated 2D Canvas. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: New patch with cleanup applied 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index de7a380d673a8cd3a323a79cf499aaecd6e609af..3657d2d345152277010f70305813022dc5a3afa5 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1743,15 +1743,12 @@ void CanvasRenderingContext2D::didDraw(const FloatRect& dirtyRect)
if (dirtyRect.isEmpty())
return;
- // If we are drawing to hardware and we have a composited layer, just call contentChanged().
- if (isAccelerated()) {
- RenderBox* renderBox = canvas()->renderBox();
- if (renderBox && renderBox->hasAcceleratedCompositing()) {
- renderBox->contentChanged(CanvasPixelsChanged);
- canvas()->clearCopiedImage();
- canvas()->notifyObserversCanvasChanged(dirtyRect);
- return;
- }
+ // If we are drawing to hardware and we have a composited layer, just invalidate layer.
+ if (isAccelerated() && platformLayer()) {
+ platformLayer()->invalidateRect(dirtyRect);
+ canvas()->clearCopiedImage();
+ canvas()->notifyObserversCanvasChanged(dirtyRect);
+ return;
}
canvas()->didDraw(dirtyRect);
« no previous file with comments | « no previous file | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698