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

Unified Diff: Source/core/frame/ImageBitmapTest.cpp

Issue 795833004: Use dictionaries for context creation attributes. Eliminate custom bindings. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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/frame/ImageBitmapTest.cpp
diff --git a/Source/core/frame/ImageBitmapTest.cpp b/Source/core/frame/ImageBitmapTest.cpp
index 064c9ef74e8ce2433c81fe4572c72431c7ea15e9..7718579911c0d6f81f55c02b0a2411f44ef9510a 100644
--- a/Source/core/frame/ImageBitmapTest.cpp
+++ b/Source/core/frame/ImageBitmapTest.cpp
@@ -42,6 +42,7 @@
#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLVideoElement.h"
#include "core/html/canvas/CanvasRenderingContext2D.h"
+#include "core/html/canvas/WebGLRenderingContext.h"
#include "platform/graphics/BitmapImage.h"
#include "platform/graphics/skia/NativeImageSkia.h"
#include "platform/heap/Handle.h"
@@ -207,11 +208,13 @@ TEST_F(ImageBitmapTest, ImageResourceLifetime)
RefPtrWillBeRawPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::create(canvasElement.get(), IntRect(0, 0, canvasElement->width(), canvasElement->height()));
imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), IntRect(0, 0, 20, 20));
}
- CanvasRenderingContext* context = canvasElement->getContext("2d");
+ CanvasContextCreationAttributes attribs;
bashi 2014/12/12 00:35:24 attribs -> attributes?
Ken Russell (switch to Gerrit) 2014/12/12 06:59:31 Sure. Done.
+ CanvasRenderingContext2DOrWebGLRenderingContext context;
+ canvasElement->getContext("2d", attribs, context);
TrackExceptionState exceptionState;
CanvasImageSourceUnion imageSource;
imageSource.setImageBitmap(imageBitmapDerived);
- toCanvasRenderingContext2D(context)->drawImage(imageSource, 0, 0, exceptionState);
+ context.getAsCanvasRenderingContext2D()->drawImage(imageSource, 0, 0, exceptionState);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698