diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/skiaserve/Request.cpp | 16 | ||||
-rwxr-xr-x | tools/viewer/sk_app/WindowContext.cpp | 11 |
2 files changed, 8 insertions, 19 deletions
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp index f61ed5554a..edc0a6820b 100644 --- a/tools/skiaserve/Request.cpp +++ b/tools/skiaserve/Request.cpp @@ -161,13 +161,12 @@ namespace { struct ColorAndProfile { SkColorType fColorType; bool fSRGB; - bool fGammaCorrect; }; ColorAndProfile ColorModes[] = { - { kN32_SkColorType, false, false }, - { kN32_SkColorType, true, true }, - { kRGBA_F16_SkColorType, true, true }, + { kN32_SkColorType, false }, + { kN32_SkColorType, true }, + { kRGBA_F16_SkColorType, true }, }; } @@ -178,9 +177,7 @@ SkSurface* Request::createCPUSurface() { auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); SkImageInfo info = SkImageInfo::Make(bounds.width(), bounds.height(), cap.fColorType, kPremul_SkAlphaType, cap.fSRGB ? srgbColorSpace : nullptr); - uint32_t flags = cap.fGammaCorrect ? SkSurfaceProps::kGammaCorrect_Flag : 0; - SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); - return SkSurface::MakeRaster(info, &props).release(); + return SkSurface::MakeRaster(info).release(); } SkSurface* Request::createGPUSurface() { @@ -190,10 +187,7 @@ SkSurface* Request::createGPUSurface() { auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); SkImageInfo info = SkImageInfo::Make(bounds.width(), bounds.height(), cap.fColorType, kPremul_SkAlphaType, cap.fSRGB ? srgbColorSpace : nullptr); - uint32_t flags = cap.fGammaCorrect ? SkSurfaceProps::kGammaCorrect_Flag : 0; - SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); - SkSurface* surface = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info, 0, - &props).release(); + SkSurface* surface = SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info).release(); return surface; } diff --git a/tools/viewer/sk_app/WindowContext.cpp b/tools/viewer/sk_app/WindowContext.cpp index 5d364bc497..458f66a67b 100755 --- a/tools/viewer/sk_app/WindowContext.cpp +++ b/tools/viewer/sk_app/WindowContext.cpp @@ -31,11 +31,6 @@ sk_sp<SkSurface> WindowContext::createRenderSurface(GrBackendRenderTargetDesc de sk_sp<SkSurface> WindowContext::createSurface( GrBackendRenderTargetDesc* rtDesc, int colorBits, bool offscreen, bool forceSRGB) { - auto flags = (fSurfaceProps.flags() & ~SkSurfaceProps::kGammaCorrect_Flag) | - (GrPixelConfigIsSRGB(fPixelConfig) || forceSRGB ? - SkSurfaceProps::kGammaCorrect_Flag : 0); - SkSurfaceProps props(flags, fSurfaceProps.pixelGeometry()); - if (!this->isGpuContext() || colorBits > 24 || offscreen || kRGBA_F16_SkColorType == fDisplayParams.fColorType) { // If we're rendering to F16, we need an off-screen surface - the current render @@ -52,12 +47,12 @@ sk_sp<SkSurface> WindowContext::createSurface( ); if (this->isGpuContext()) { return SkSurface::MakeRenderTarget(fContext, SkBudgeted::kNo, info, - fDisplayParams.fMSAASampleCount, &props); + fDisplayParams.fMSAASampleCount, &fSurfaceProps); } else { - return SkSurface::MakeRaster(info, &props); + return SkSurface::MakeRaster(info, &fSurfaceProps); } } else { - return SkSurface::MakeFromBackendRenderTarget(fContext, *rtDesc, &props); + return SkSurface::MakeFromBackendRenderTarget(fContext, *rtDesc, &fSurfaceProps); } } |