Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp |
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp |
index 2310b22d78ae55c3f8adef24c05d217ad13a18b1..38f21f45b6ecbf92032ab666c275e7253d270082 100644 |
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp |
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp |
@@ -10,6 +10,7 @@ |
#include "core/html/HTMLCanvasElement.h" |
#include "core/html/HTMLDocument.h" |
#include "core/html/ImageData.h" |
+#include "core/imagebitmap/ImageBitmapOptions.h" |
#include "core/loader/EmptyClients.h" |
#include "core/testing/DummyPageHolder.h" |
#include "modules/canvas2d/CanvasGradient.h" |
@@ -452,8 +453,9 @@ TEST_F(CanvasRenderingContext2DTest, NoLayerPromotionUnderImageSizeRatioLimit) |
OwnPtr<UnacceleratedImageBufferSurface> sourceSurface = adoptPtr(new UnacceleratedImageBufferSurface(sourceSize, NonOpaque)); |
sourceCanvas->createImageBufferUsingSurfaceForTesting(sourceSurface.release()); |
+ ImageBitmapOptions options; |
Justin Novosad
2016/02/05 14:46:41
Here, you are not setting any options, and you are
xidachen
2016/02/05 16:47:36
I tried to define this local variable as a global
|
// Go through an ImageBitmap to avoid triggering a display list fallback |
- RefPtrWillBeRawPtr<ImageBitmap> sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize)); |
+ RefPtrWillBeRawPtr<ImageBitmap> sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize), options); |
context2d()->drawImage(sourceImageBitmap.get(), 0, 0, 1, 1, 0, 0, 1, 1, exceptionState); |
EXPECT_FALSE(exceptionState.hadException()); |
@@ -475,8 +477,9 @@ TEST_F(CanvasRenderingContext2DTest, LayerPromotionOverImageSizeRatioLimit) |
OwnPtr<UnacceleratedImageBufferSurface> sourceSurface = adoptPtr(new UnacceleratedImageBufferSurface(sourceSize, NonOpaque)); |
sourceCanvas->createImageBufferUsingSurfaceForTesting(sourceSurface.release()); |
+ ImageBitmapOptions options; |
// Go through an ImageBitmap to avoid triggering a display list fallback |
- RefPtrWillBeRawPtr<ImageBitmap> sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize)); |
+ RefPtrWillBeRawPtr<ImageBitmap> sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize), options); |
context2d()->drawImage(sourceImageBitmap.get(), 0, 0, 1, 1, 0, 0, 1, 1, exceptionState); |
EXPECT_FALSE(exceptionState.hadException()); |
@@ -641,8 +644,9 @@ TEST_F(CanvasRenderingContext2DTest, ImageResourceLifetime) |
canvas->setWidth(40); |
RefPtrWillBeRawPtr<ImageBitmap> imageBitmapDerived = nullptr; |
{ |
- RefPtrWillBeRawPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::create(canvas, IntRect(0, 0, canvas->width(), canvas->height())); |
- imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), IntRect(0, 0, 20, 20)); |
+ ImageBitmapOptions options; |
+ RefPtrWillBeRawPtr<ImageBitmap> imageBitmapFromCanvas = ImageBitmap::create(canvas, IntRect(0, 0, canvas->width(), canvas->height()), options); |
+ imageBitmapDerived = ImageBitmap::create(imageBitmapFromCanvas.get(), IntRect(0, 0, 20, 20), options); |
} |
CanvasContextCreationAttributes attributes; |
CanvasRenderingContext2D* context = static_cast<CanvasRenderingContext2D*>(canvas->getCanvasRenderingContext("2d", attributes)); |