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

Unified Diff: LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html

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: LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html
diff --git a/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html b/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html
index 08ecd2caaa49ede0ed62550148aad23c2a2f4b3f..2e383e1870995f7ebf23cdc3585a21881667acfa 100644
--- a/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html
+++ b/LayoutTests/fast/canvas/canvas-createImageBitmap-drawImage.html
@@ -97,6 +97,13 @@ aCanvas.setAttribute("height", "200");
var aCtx = aCanvas.getContext("2d");
drawPattern(aCtx);
+var bCanvas = document.createElement("canvas");
+bCanvas.setAttribute("width", "200");
+bCanvas.setAttribute("height", "200");
+var bCtx = bCanvas.getContext("2d");
+bCtx.fillStyle = 'red';
+bCtx.fillRect(0, 0, 200, 200);
+
var canvas = document.createElement("canvas");
canvas.setAttribute("width", "500");
canvas.setAttribute("height", "500");
@@ -388,25 +395,28 @@ function callbackImmutable(imageBitmap) {
// change the underlying element to ensure that it does not change the imageBitmap
switch(i) {
case 0: // image
- image = new Image();
+ image.onload = function() { callbackNoCrop(imageBitmap); }
+ image.src = bCanvas.toDataURL();
break;
case 1: // canvas
clearContext(aCtx);
+ callbackNoCrop(imageBitmap);
break;
case 2: // data
d = 0;
+ callbackNoCrop(imageBitmap);
break;
case 3: // context
clearContext(aCtx);
+ callbackNoCrop(imageBitmap);
break;
case 4: // bitmap
testBitmap = 0;
+ callbackNoCrop(imageBitmap);
break;
default:
testFailed("Default should not be called.");
}
- // should be drawn to (0, 0), (200, 200)
- callbackNoCrop(imageBitmap);
// we potentially cleared our auxillary context, so redraw the image
drawPattern(aCtx);
« no previous file with comments | « no previous file | Source/core/html/canvas/CanvasRenderingContext2D.cpp » ('j') | Source/core/loader/cache/CachedResource.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698