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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp

Issue 1928043002: Add drawImage() originClean() getSecurityOrigin() to OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drawImage API added to interface listing Created 4 years, 8 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: 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 65d43dec1c9be899a8ed191a0e91b0ff2591e50d..da34ec861272c150e010c12d3fc4592ff7ef9a8a 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -325,33 +325,33 @@ TEST_F(CanvasRenderingContext2DTest, detectOverdrawWithDrawImage)
createContext(NonOpaque);
NonThrowableExceptionState exceptionState;
- TEST_OVERDRAW_1(1, drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_1(1, drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_1(1, drawImage(&m_opaqueBitmap, 0, 0, 1, 1, 0, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_1(1, drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 1, 1, 0, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_2(0, setGlobalAlpha(0.5f), drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_2(0, setGlobalAlpha(0.5f), drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_1(0, drawImage(&m_alphaBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_1(0, drawImage(canvasElement().getExecutionContext(), &m_alphaBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_2(0, setGlobalAlpha(0.5f), drawImage(&m_alphaBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_2(0, setGlobalAlpha(0.5f), drawImage(canvasElement().getExecutionContext(), &m_alphaBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_1(0, drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 1, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_1(0, drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 1, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_1(0, drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 9, 9, exceptionState));
+ TEST_OVERDRAW_1(0, drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 9, 9, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_1(1, drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 11, 11, exceptionState));
+ TEST_OVERDRAW_1(1, drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 11, 11, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_2(1, translate(-1, 0), drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 1, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_2(1, translate(-1, 0), drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 1, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_2(0, translate(-1, 0), drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_2(0, translate(-1, 0), drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_2(0, setFillStyle(opaqueGradient()), drawImage(&m_alphaBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState)); // fillStyle ignored by drawImage
+ TEST_OVERDRAW_2(0, setFillStyle(opaqueGradient()), drawImage(canvasElement().getExecutionContext(), &m_alphaBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState)); // fillStyle ignored by drawImage
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_2(1, setFillStyle(alphaGradient()), drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState)); // fillStyle ignored by drawImage
+ TEST_OVERDRAW_2(1, setFillStyle(alphaGradient()), drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState)); // fillStyle ignored by drawImage
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_2(1, setGlobalCompositeOperation(String("copy")), drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 1, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_2(1, setGlobalCompositeOperation(String("copy")), drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 1, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
- TEST_OVERDRAW_3(0, rect(0, 0, 5, 5), clip(), drawImage(&m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
+ TEST_OVERDRAW_3(0, rect(0, 0, 5, 5), clip(), drawImage(canvasElement().getExecutionContext(), &m_opaqueBitmap, 0, 0, 10, 10, 0, 0, 10, 10, exceptionState));
EXPECT_FALSE(exceptionState.hadException());
}
@@ -457,7 +457,7 @@ TEST_F(CanvasRenderingContext2DTest, NoLayerPromotionUnderImageSizeRatioLimit)
// Go through an ImageBitmap to avoid triggering a display list fallback
ImageBitmap* sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize), defaultOptions);
- context2d()->drawImage(sourceImageBitmap, 0, 0, 1, 1, 0, 0, 1, 1, exceptionState);
+ context2d()->drawImage(canvasElement().getExecutionContext(), sourceImageBitmap, 0, 0, 1, 1, 0, 0, 1, 1, exceptionState);
EXPECT_FALSE(exceptionState.hadException());
EXPECT_FALSE(canvasElement().shouldBeDirectComposited());
@@ -481,7 +481,7 @@ TEST_F(CanvasRenderingContext2DTest, LayerPromotionOverImageSizeRatioLimit)
// Go through an ImageBitmap to avoid triggering a display list fallback
ImageBitmap* sourceImageBitmap = ImageBitmap::create(sourceCanvas, IntRect(IntPoint(0, 0), sourceSize), defaultOptions);
- context2d()->drawImage(sourceImageBitmap, 0, 0, 1, 1, 0, 0, 1, 1, exceptionState);
+ context2d()->drawImage(canvasElement().getExecutionContext(), sourceImageBitmap, 0, 0, 1, 1, 0, 0, 1, 1, exceptionState);
EXPECT_FALSE(exceptionState.hadException());
EXPECT_TRUE(canvasElement().shouldBeDirectComposited());
@@ -676,7 +676,7 @@ TEST_F(CanvasRenderingContext2DTest, ImageResourceLifetime)
TrackExceptionState exceptionState;
CanvasImageSourceUnion imageSource;
imageSource.setImageBitmap(imageBitmapDerived);
- context->drawImage(imageSource, 0, 0, exceptionState);
+ context->drawImage(canvas->getExecutionContext(), imageSource, 0, 0, exceptionState);
}
TEST_F(CanvasRenderingContext2DTest, GPUMemoryUpdateForAcceleratedCanvas)

Powered by Google App Engine
This is Rietveld 408576698