diff options
author | brianosman <brianosman@google.com> | 2016-07-21 13:28:36 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-21 13:28:36 -0700 |
commit | dfe4f2e4fe5b162d4adb4486fe751f1e3b30bea7 (patch) | |
tree | aa6ff74a25306386a0c5b5586a4843b470d80101 /tests | |
parent | 8602ede5fdfa721dcad4dcb11db028c1c24265f1 (diff) |
Add SkColorSpace to GrDrawContext
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2164363002
Review-Url: https://codereview.chromium.org/2164363002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ClearTest.cpp | 2 | ||||
-rw-r--r-- | tests/DFPathRendererTest.cpp | 1 | ||||
-rw-r--r-- | tests/GLProgramsTest.cpp | 4 | ||||
-rw-r--r-- | tests/ImageFilterTest.cpp | 2 | ||||
-rw-r--r-- | tests/PrimitiveProcessorTest.cpp | 3 | ||||
-rw-r--r-- | tests/ReadPixelsTest.cpp | 2 | ||||
-rw-r--r-- | tests/ReadWriteAlphaTest.cpp | 3 | ||||
-rw-r--r-- | tests/RectangleTextureTest.cpp | 3 | ||||
-rw-r--r-- | tests/SRGBMipMapTest.cpp | 9 | ||||
-rw-r--r-- | tests/SpecialSurfaceTest.cpp | 3 | ||||
-rw-r--r-- | tests/SurfaceTest.cpp | 2 | ||||
-rw-r--r-- | tests/TessellatingPathRendererTests.cpp | 1 | ||||
-rw-r--r-- | tests/WritePixelsTest.cpp | 2 |
13 files changed, 25 insertions, 12 deletions
diff --git a/tests/ClearTest.cpp b/tests/ClearTest.cpp index 64464aa18b..4afbabaa56 100644 --- a/tests/ClearTest.cpp +++ b/tests/ClearTest.cpp @@ -45,7 +45,7 @@ static bool reset_dc(sk_sp<GrDrawContext>* dc, GrContext* context, int w, int h) } 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 ad6e022332..e1af6acd93 100644 --- a/tests/DFPathRendererTest.cpp +++ b/tests/DFPathRendererTest.cpp @@ -66,6 +66,7 @@ DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(AADistanceFieldPathRenderer, reporter, ctxInfo) 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 16a2592078..393de53b74 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -158,6 +158,7 @@ static sk_sp<GrDrawContext> random_draw_context(GrContext* context, kRenderTargetWidth, kRenderTargetHeight, kRGBA_8888_GrPixelConfig, + nullptr, sampleCnt, origin)); return drawContext; @@ -345,7 +346,8 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) { 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 f46519d94e..65ea8cf6b2 100644 --- a/tests/ImageFilterTest.cpp +++ b/tests/ImageFilterTest.cpp @@ -367,7 +367,7 @@ static sk_sp<SkSpecialSurface> create_empty_special_surface(GrContext* context, 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 f121079153..acaf9e98af 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -105,7 +105,8 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { 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 6b6778d1ac..6aebe6effa 100644 --- a/tests/ReadPixelsTest.cpp +++ b/tests/ReadPixelsTest.cpp @@ -397,7 +397,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadPixels_Gpu, reporter, ctxInfo) { 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 630924aca6..16f43ea310 100644 --- a/tests/ReadWriteAlphaTest.cpp +++ b/tests/ReadWriteAlphaTest.cpp @@ -93,7 +93,8 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { // 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 2fa51e2ba2..b42b3bac6c 100644 --- a/tests/RectangleTextureTest.cpp +++ b/tests/RectangleTextureTest.cpp @@ -90,7 +90,8 @@ static void test_clear(skiatest::Reporter* reporter, GrContext* context, 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 1e62f88be8..f798119ad5 100644 --- a/tests/SRGBMipMapTest.cpp +++ b/tests/SRGBMipMapTest.cpp @@ -123,12 +123,17 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) { 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 2bb1005e2a..a0ec317651 100644 --- a/tests/SpecialSurfaceTest.cpp +++ b/tests/SpecialSurfaceTest.cpp @@ -81,7 +81,8 @@ DEF_TEST(SpecialSurface_Raster2, reporter) { 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 16db3e3c4e..8d2ba51e19 100644 --- a/tests/SurfaceTest.cpp +++ b/tests/SurfaceTest.cpp @@ -337,7 +337,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(UniqueImageSnapshot_Gpu, reporter, ctxInfo) { 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 80e65cd3f0..5e8d952f32 100644 --- a/tests/TessellatingPathRendererTests.cpp +++ b/tests/TessellatingPathRendererTests.cpp @@ -257,6 +257,7 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { 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 90f5d805f1..ec88f03c2b 100644 --- a/tests/WritePixelsTest.cpp +++ b/tests/WritePixelsTest.cpp @@ -416,7 +416,7 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixels_Gpu, reporter, ctxInfo) { 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()); } } |