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

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

Issue 19393004: Allow eviction of ImageBitmaps that are created from ImageElements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use CachedImage as the backing store for ImageBitmap. Implement O(1) decode cache. Created 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index b2701331d1dffccff104b5be49378965be011792..94bcfcf1b8da693f6158ca45b81d726302c2a44b 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1260,7 +1260,6 @@ void CanvasRenderingContext2D::drawImage(ImageBitmap* bitmap,
return;
ASSERT(bitmap->height() && bitmap->width());
-
FloatRect normalizedSrcRect = normalizeRect(srcRect);
FloatRect normalizedDstRect = normalizeRect(dstRect);
FloatRect actualDstRect(FloatPoint(bitmap->bitmapOffset()), bitmap->bitmapSize());
@@ -1274,10 +1273,9 @@ void CanvasRenderingContext2D::drawImage(ImageBitmap* bitmap,
}
if (!imageRect.contains(normalizedSrcRect))
return;
+ RefPtr<Image> imageForRendering = bitmap->bitmapImage();
- Image* imageForRendering = bitmap->bitmapImage();
-
- drawImageInternal(imageForRendering, normalizedSrcRect, actualDstRect, state().m_globalComposite, state().m_globalBlend);
+ drawImageInternal(imageForRendering.get(), normalizedSrcRect, actualDstRect, state().m_globalComposite, state().m_globalBlend);
}
void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y, ExceptionCode& ec)

Powered by Google App Engine
This is Rietveld 408576698