diff options
author | brianosman <brianosman@google.com> | 2016-07-26 11:36:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-26 11:36:05 -0700 |
commit | 3a0dbde1cfa84b08c7dd5b597142e9f6179f2d07 (patch) | |
tree | 8415ee29b45878e0c304955b4553fda4431c1d5f /gm | |
parent | dc2257bfab9fc232f96c6db0595b9d12b2f0cf36 (diff) |
Remove SkSurfaceProps gamma-correctness flag entirely.
This is no longer required - gamma-correctness is now just based on the
presence or absence of a color space.
Public API change is just removal of (unused) flag.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2188463002
TBR=bsalomon@google.com
Review-Url: https://codereview.chromium.org/2188463002
Diffstat (limited to 'gm')
-rw-r--r-- | gm/dftext.cpp | 5 | ||||
-rw-r--r-- | gm/surface.cpp | 10 | ||||
-rw-r--r-- | gm/textblobgeometrychange.cpp | 5 | ||||
-rw-r--r-- | gm/textblobmixedsizes.cpp | 5 | ||||
-rw-r--r-- | gm/textblobrandomfont.cpp | 5 |
5 files changed, 6 insertions, 24 deletions
diff --git a/gm/dftext.cpp b/gm/dftext.cpp index 8ab2df71ba..f1b972892e 100644 --- a/gm/dftext.cpp +++ b/gm/dftext.cpp @@ -43,10 +43,7 @@ protected: SkISize size = onISize(); SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), kPremul_SkAlphaType, sk_ref_sp(inputCanvas->imageInfo().colorSpace())); - SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); - uint32_t gammaCorrect = inputCanvas->getProps(&canvasProps) - ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0; - SkSurfaceProps props(SkSurfaceProps::kUseDeviceIndependentFonts_Flag | gammaCorrect, + SkSurfaceProps props(SkSurfaceProps::kUseDeviceIndependentFonts_Flag, SkSurfaceProps::kLegacyFontHost_InitType); auto surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info, 0, &props)); SkCanvas* canvas = surface ? surface->getCanvas() : inputCanvas; diff --git a/gm/surface.cpp b/gm/surface.cpp index bae77c5594..6846f727e2 100644 --- a/gm/surface.cpp +++ b/gm/surface.cpp @@ -22,7 +22,7 @@ static sk_sp<SkShader> make_shader() { } static sk_sp<SkSurface> make_surface(GrContext* ctx, const SkImageInfo& info, SkPixelGeometry geo, - int disallowAA, int disallowDither, bool gammaCorrect) { + int disallowAA, int disallowDither) { uint32_t flags = 0; if (disallowAA) { flags |= SkSurfaceProps::kDisallowAntiAlias_Flag; @@ -30,9 +30,6 @@ static sk_sp<SkSurface> make_surface(GrContext* ctx, const SkImageInfo& info, Sk if (disallowDither) { flags |= SkSurfaceProps::kDisallowDither_Flag; } - if (gammaCorrect) { - flags |= SkSurfaceProps::kGammaCorrect_Flag; - } SkSurfaceProps props(flags, geo); if (ctx) { @@ -79,8 +76,6 @@ protected: // must be opaque to have a hope of testing LCD text const SkImageInfo info = SkImageInfo::MakeN32(W, H, kOpaque_SkAlphaType, sk_ref_sp(canvas->imageInfo().colorSpace())); - SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); - bool gammaCorrect = canvas->getProps(&canvasProps) && canvasProps.isGammaCorrect(); const struct { SkPixelGeometry fGeo; @@ -98,8 +93,7 @@ protected: for (int disallowDither = 0; disallowDither <= 1; ++disallowDither) { SkScalar y = 0; for (const auto& rec : recs) { - auto surface(make_surface(ctx, info, rec.fGeo, disallowAA, disallowDither, - gammaCorrect)); + auto surface(make_surface(ctx, info, rec.fGeo, disallowAA, disallowDither)); if (!surface) { SkDebugf("failed to create surface! label: %s AA: %s dither: %s\n", rec.fLabel, (disallowAA == 1 ? "disallowed" : "allowed"), diff --git a/gm/textblobgeometrychange.cpp b/gm/textblobgeometrychange.cpp index a241c5c7ba..1b7bff319d 100644 --- a/gm/textblobgeometrychange.cpp +++ b/gm/textblobgeometrychange.cpp @@ -44,10 +44,7 @@ protected: SkImageInfo info = SkImageInfo::MakeN32(200, 200, kPremul_SkAlphaType, sk_ref_sp(canvas->imageInfo().colorSpace())); - SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); - uint32_t gammaCorrect = canvas->getProps(&canvasProps) - ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0; - SkSurfaceProps props(gammaCorrect, kUnknown_SkPixelGeometry); + SkSurfaceProps props(0, kUnknown_SkPixelGeometry); auto surface = canvas->makeSurface(info, &props); if (!surface) { surface = SkSurface::MakeRaster(info, &props); diff --git a/gm/textblobmixedsizes.cpp b/gm/textblobmixedsizes.cpp index 8fdf558206..4e3f0eaeb5 100644 --- a/gm/textblobmixedsizes.cpp +++ b/gm/textblobmixedsizes.cpp @@ -106,10 +106,7 @@ protected: sk_sp<SkColorSpace> colorSpace = sk_ref_sp(inputCanvas->imageInfo().colorSpace()); SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), kPremul_SkAlphaType, colorSpace); - SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); - uint32_t gammaCorrect = inputCanvas->getProps(&canvasProps) - ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0; - SkSurfaceProps props(SkSurfaceProps::kUseDeviceIndependentFonts_Flag | gammaCorrect, + SkSurfaceProps props(SkSurfaceProps::kUseDeviceIndependentFonts_Flag, SkSurfaceProps::kLegacyFontHost_InitType); surface = SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info, 0, &props); canvas = surface.get() ? surface->getCanvas() : inputCanvas; diff --git a/gm/textblobrandomfont.cpp b/gm/textblobrandomfont.cpp index 58f0dc6bd6..2e8249fc2c 100644 --- a/gm/textblobrandomfont.cpp +++ b/gm/textblobrandomfont.cpp @@ -99,10 +99,7 @@ protected: SkImageInfo info = SkImageInfo::MakeN32(kWidth, kHeight, kPremul_SkAlphaType, sk_ref_sp(canvas->imageInfo().colorSpace())); - SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); - uint32_t gammaCorrect = canvas->getProps(&canvasProps) - ? canvasProps.flags() & SkSurfaceProps::kGammaCorrect_Flag : 0; - SkSurfaceProps props(gammaCorrect, kUnknown_SkPixelGeometry); + SkSurfaceProps props(0, kUnknown_SkPixelGeometry); auto surface(canvas->makeSurface(info, &props)); if (surface) { SkPaint paint; |