Add SkColorSpace to GrDrawContext
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2164363002
Review-Url: https://codereview.chromium.org/2164363002
diff --git a/tests/ClearTest.cpp b/tests/ClearTest.cpp
index 64464aa..4afbaba 100644
--- a/tests/ClearTest.cpp
+++ b/tests/ClearTest.cpp
@@ -45,7 +45,7 @@
}
context->freeGpuResources();
- *dc = context->newDrawContext(SkBackingFit::kExact, w, h, kRGBA_8888_GrPixelConfig);
+ *dc = context->newDrawContext(SkBackingFit::kExact, w, h, kRGBA_8888_GrPixelConfig, nullptr);
SkASSERT((*dc)->accessRenderTarget()->getUniqueID() != oldID);
diff --git a/tests/DFPathRendererTest.cpp b/tests/DFPathRendererTest.cpp
index ad6e022..e1af6ac 100644
--- a/tests/DFPathRendererTest.cpp
+++ b/tests/DFPathRendererTest.cpp
@@ -66,6 +66,7 @@
sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBackingFit::kApprox,
800, 800,
kSkia8888_GrPixelConfig,
+ nullptr,
0,
kTopLeft_GrSurfaceOrigin));
if (!drawContext) {
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 16a2592..393de53 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -158,6 +158,7 @@
kRenderTargetWidth,
kRenderTargetHeight,
kRGBA_8888_GrPixelConfig,
+ nullptr,
sampleCnt,
origin));
return drawContext;
@@ -345,7 +346,8 @@
sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kExact,
kRenderTargetWidth,
kRenderTargetHeight,
- kRGBA_8888_GrPixelConfig));
+ kRGBA_8888_GrPixelConfig,
+ nullptr));
if (!drawContext) {
SkDebugf("Could not allocate a drawContext");
return false;
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index f46519d..65ea8cf 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -367,7 +367,7 @@
if (context) {
return SkSpecialSurface::MakeRenderTarget(context,
widthHeight, widthHeight,
- kSkia8888_GrPixelConfig);
+ kSkia8888_GrPixelConfig, nullptr);
} else
#endif
{
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index f121079..acaf9e9 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -105,7 +105,8 @@
GrContext* context = ctxInfo.grContext();
sk_sp<GrDrawContext> drawContext(context->newDrawContext(SkBackingFit::kApprox,
- 1, 1, kRGBA_8888_GrPixelConfig));
+ 1, 1, kRGBA_8888_GrPixelConfig,
+ nullptr));
if (!drawContext) {
ERRORF(reporter, "Could not create draw context.");
return;
diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp
index 6b6778d..6aebe6e 100644
--- a/tests/ReadPixelsTest.cpp
+++ b/tests/ReadPixelsTest.cpp
@@ -397,7 +397,7 @@
desc.fOrigin = origin;
SkAutoTUnref<GrTexture> surfaceTexture(
ctxInfo.grContext()->textureProvider()->createTexture(desc, SkBudgeted::kNo));
- auto surface(SkSurface::MakeRenderTargetDirect(surfaceTexture->asRenderTarget()));
+ auto surface(SkSurface::MakeRenderTargetDirect(surfaceTexture->asRenderTarget(), nullptr));
desc.fFlags = kNone_GrSurfaceFlags;
test_readpixels(reporter, surface, kLast_BitmapInit);
}
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp
index 630924a..16f43ea 100644
--- a/tests/ReadWriteAlphaTest.cpp
+++ b/tests/ReadWriteAlphaTest.cpp
@@ -93,7 +93,8 @@
// Now try writing on the single channel texture (if we could create as a RT).
if (texture->asRenderTarget()) {
- sk_sp<SkSurface> surf(SkSurface::MakeRenderTargetDirect(texture->asRenderTarget()));
+ sk_sp<SkSurface> surf(SkSurface::MakeRenderTargetDirect(texture->asRenderTarget(),
+ nullptr));
SkCanvas* canvas = surf->getCanvas();
SkPaint paint;
diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp
index 2fa51e2..b42b3ba 100644
--- a/tests/RectangleTextureTest.cpp
+++ b/tests/RectangleTextureTest.cpp
@@ -90,7 +90,8 @@
GrTexture* rectangleTexture) {
if (rectangleTexture->asRenderTarget()) {
sk_sp<GrDrawContext> dc(
- context->drawContext(sk_ref_sp(rectangleTexture->asRenderTarget())));
+ context->drawContext(sk_ref_sp(rectangleTexture->asRenderTarget()),
+ nullptr));
if (!dc) {
ERRORF(reporter, "Could not get GrDrawContext for rectangle texture.");
return;
diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp
index 1e62f88..f798119 100644
--- a/tests/SRGBMipMapTest.cpp
+++ b/tests/SRGBMipMapTest.cpp
@@ -123,12 +123,17 @@
SkSurfaceProps l32Props(SkSurfaceProps::kLegacyFontHost_InitType);
SkSurfaceProps s32Props(SkSurfaceProps::kGammaCorrect_Flag,
SkSurfaceProps::kLegacyFontHost_InitType);
+ sk_sp<SkColorSpace> srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
sk_sp<GrDrawContext> l32DrawContext = context->newDrawContext(SkBackingFit::kExact, rtS, rtS,
- kSkia8888_GrPixelConfig, 0,
+ kSkia8888_GrPixelConfig,
+ nullptr,
+ 0,
kDefault_GrSurfaceOrigin,
&l32Props);
sk_sp<GrDrawContext> s32DrawContext = context->newDrawContext(SkBackingFit::kExact, rtS, rtS,
- kSkiaGamma8888_GrPixelConfig, 0,
+ kSkiaGamma8888_GrPixelConfig,
+ std::move(srgbColorSpace),
+ 0,
kDefault_GrSurfaceOrigin,
&s32Props);
diff --git a/tests/SpecialSurfaceTest.cpp b/tests/SpecialSurfaceTest.cpp
index 2bb1005..a0ec317 100644
--- a/tests/SpecialSurfaceTest.cpp
+++ b/tests/SpecialSurfaceTest.cpp
@@ -81,7 +81,8 @@
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialSurface_Gpu1, reporter, ctxInfo) {
sk_sp<SkSpecialSurface> surf(SkSpecialSurface::MakeRenderTarget(ctxInfo.grContext(),
kSmallerSize, kSmallerSize,
- kSkia8888_GrPixelConfig));
+ kSkia8888_GrPixelConfig,
+ nullptr));
test_surface(surf, reporter, 0);
}
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 16db3e3..8d2ba51 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -337,7 +337,7 @@
desc.fTextureHandle = textureObject;
GrTexture* texture = context->textureProvider()->wrapBackendTexture(desc);
{
- auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarget()));
+ auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarget(), nullptr));
test_unique_image_snap(reporter, surface.get(), true, imageBackingStore,
surfaceBackingStore);
}
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index 80e65cd..5e8d952 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -257,6 +257,7 @@
sk_sp<GrDrawContext> drawContext(ctxInfo.grContext()->newDrawContext(SkBackingFit::kApprox,
800, 800,
kSkia8888_GrPixelConfig,
+ nullptr,
0,
kTopLeft_GrSurfaceOrigin));
if (!drawContext) {
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 90f5d80..ec88f03 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -416,7 +416,7 @@
desc.fOrigin = origin;
SkAutoTUnref<GrTexture> texture(
ctxInfo.grContext()->textureProvider()->createTexture(desc, SkBudgeted::kNo));
- auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarget()));
+ auto surface(SkSurface::MakeRenderTargetDirect(texture->asRenderTarget(), nullptr));
test_write_pixels(reporter, surface.get());
}
}