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

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

Issue 22613002: Allow ImageBitmaps derived from HTMLImageElements to be evicted from RAM. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make destructor virtual. Created 7 years, 4 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 | « Source/core/core.gypi ('k') | Source/core/page/ImageBitmap.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 2643b2707c497d700f66fffd3cfa9ce284147c83..ce3d9c2917371fc51dcad983cd01fa94086f0259 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1294,9 +1294,10 @@ void CanvasRenderingContext2D::drawImage(ImageBitmap* bitmap,
FloatRect intersectRect = intersection(bitmapRect, normalizedSrcRect);
FloatRect actualSrcRect(intersectRect);
- actualSrcRect.move(-bitmapRect.x(), -bitmapRect.y());
- FloatRect imageRect = FloatRect(FloatPoint(), bitmapRect.size());
+ IntPoint bitmapOffset = bitmap->bitmapOffset();
+ actualSrcRect.move(bitmapOffset - bitmapRect.location());
+ FloatRect imageRect = FloatRect(bitmapOffset, bitmapRect.size());
FloatRect actualDstRect(FloatPoint(intersectRect.location() - normalizedSrcRect.location()), bitmapRect.size());
actualDstRect.scale(normalizedDstRect.width() / normalizedSrcRect.width() * intersectRect.width() / bitmapRect.width(),
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/page/ImageBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698