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

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

Issue 2825183002: Plumb CanvasColorParams to canvas image classes (Closed)
Patch Set: Require both runtime flags Created 3 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 32d3a1af819a0500f415c65406baeb8c5b2ac4fa..e64a0b19165133abee3d72082bd2e0e2e510dde8 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -243,9 +243,9 @@ PassRefPtr<Canvas2DLayerBridge> CanvasRenderingContext2DTest::MakeBridge(
std::unique_ptr<FakeWebGraphicsContext3DProvider> provider,
const IntSize& size,
Canvas2DLayerBridge::AccelerationMode acceleration_mode) {
- return AdoptRef(new Canvas2DLayerBridge(
- std::move(provider), size, 0, kNonOpaque, acceleration_mode,
- gfx::ColorSpace::CreateSRGB(), false, kN32_SkColorType));
+ return AdoptRef(new Canvas2DLayerBridge(std::move(provider), size, 0,
+ kNonOpaque, acceleration_mode,
+ CanvasColorParams()));
}
//============================================================================
@@ -346,12 +346,11 @@ class MockSurfaceFactory : public RecordingImageBufferFallbackSurfaceFactory {
std::unique_ptr<ImageBufferSurface> CreateSurface(
const IntSize& size,
OpacityMode mode,
- sk_sp<SkColorSpace> color_space,
- SkColorType color_type) override {
+ const CanvasColorParams& color_params) override {
EXPECT_EQ(kExpectFallback, expectation_);
did_fallback_ = true;
return WTF::WrapUnique(new UnacceleratedImageBufferSurface(
- size, mode, kInitializeImagePixels, color_space, color_type));
+ size, mode, kInitializeImagePixels, color_params));
}
~MockSurfaceFactory() override {
@@ -549,7 +548,7 @@ TEST_F(CanvasRenderingContext2DTest, NoLayerPromotionByDefault) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
EXPECT_FALSE(CanvasElement().ShouldBeDirectComposited());
@@ -561,7 +560,7 @@ TEST_F(CanvasRenderingContext2DTest, NoLayerPromotionUnderOverdrawLimit) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->setGlobalAlpha(0.5f); // To prevent overdraw optimization
@@ -580,7 +579,7 @@ TEST_F(CanvasRenderingContext2DTest, LayerPromotionOverOverdrawLimit) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->setGlobalAlpha(0.5f); // To prevent overdraw optimization
@@ -599,7 +598,7 @@ TEST_F(CanvasRenderingContext2DTest, NoLayerPromotionUnderImageSizeRatioLimit) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
NonThrowableExceptionState exception_state;
@@ -634,7 +633,7 @@ TEST_F(CanvasRenderingContext2DTest, LayerPromotionOverImageSizeRatioLimit) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
NonThrowableExceptionState exception_state;
@@ -671,7 +670,7 @@ TEST_F(CanvasRenderingContext2DTest,
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->beginPath();
@@ -696,7 +695,7 @@ TEST_F(CanvasRenderingContext2DTest,
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->beginPath();
@@ -720,7 +719,7 @@ TEST_F(CanvasRenderingContext2DTest, LayerPromotionWhenPathIsConcave) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->beginPath();
@@ -743,7 +742,7 @@ TEST_F(CanvasRenderingContext2DTest, NoLayerPromotionWithRectangleClip) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->beginPath();
@@ -760,7 +759,7 @@ TEST_F(CanvasRenderingContext2DTest, LayerPromotionWithComplexClip) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->beginPath();
@@ -784,7 +783,7 @@ TEST_F(CanvasRenderingContext2DTest, LayerPromotionWithBlurredShadow) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->setShadowColor(String("red"));
@@ -804,7 +803,7 @@ TEST_F(CanvasRenderingContext2DTest, NoLayerPromotionWithSharpShadow) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->setShadowColor(String("red"));
@@ -820,7 +819,7 @@ TEST_F(CanvasRenderingContext2DTest, NoFallbackWithSmallState) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->fillRect(0, 0, 1, 1); // To have a non-empty dirty rect
@@ -840,7 +839,7 @@ TEST_F(CanvasRenderingContext2DTest, FallbackWithLargeState) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->fillRect(0, 0, 1, 1); // To have a non-empty dirty rect
@@ -864,7 +863,7 @@ TEST_F(CanvasRenderingContext2DTest, OpaqueDisplayListFallsBackForText) {
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectFallback),
- kOpaque, nullptr));
+ kOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->fillText("Text", 0, 5);
@@ -877,7 +876,7 @@ TEST_F(CanvasRenderingContext2DTest,
WTF::WrapUnique(new RecordingImageBufferSurface(
IntSize(10, 10),
MockSurfaceFactory::Create(MockSurfaceFactory::kExpectNoFallback),
- kNonOpaque, nullptr));
+ kNonOpaque));
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(surface));
Context2d()->fillText("Text", 0, 5);

Powered by Google App Engine
This is Rietveld 408576698