diff options
author | brianosman <brianosman@google.com> | 2016-04-13 13:10:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-13 13:10:14 -0700 |
commit | b461d3457567cf79a3efac3123c00f7afc37fecb (patch) | |
tree | 6b1600d0da18cefc3e29568419354bd68c9e5b41 /gm/surface.cpp | |
parent | 54ef1a7c95bcc8e507f7d6ccd9a49bd9a110ba90 (diff) |
Rename lots of things from 'sRGB' to 'GammaCorrect', where appropriate
Trying to be much more explicit about where we really mean sRGB as a format,
and where we mean gamma-correct, as in: "not legacy behavior". Most of the
changes to rendering behavior are dependent on the latter, so let's be precise.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1884873006
Review URL: https://codereview.chromium.org/1884873006
Diffstat (limited to 'gm/surface.cpp')
-rw-r--r-- | gm/surface.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gm/surface.cpp b/gm/surface.cpp index e104cb5ecf..503b887f1f 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 allowSRGBInputs) { + int disallowAA, int disallowDither, bool gammaCorrect) { uint32_t flags = 0; if (disallowAA) { flags |= SkSurfaceProps::kDisallowAntiAlias_Flag; @@ -30,8 +30,8 @@ static sk_sp<SkSurface> make_surface(GrContext* ctx, const SkImageInfo& info, Sk if (disallowDither) { flags |= SkSurfaceProps::kDisallowDither_Flag; } - if (allowSRGBInputs) { - flags |= SkSurfaceProps::kAllowSRGBInputs_Flag; + if (gammaCorrect) { + flags |= SkSurfaceProps::kGammaCorrect_Flag; } SkSurfaceProps props(flags, geo); @@ -80,7 +80,7 @@ protected: const SkImageInfo info = SkImageInfo::MakeN32(W, H, kOpaque_SkAlphaType, canvas->imageInfo().profileType()); SkSurfaceProps canvasProps(SkSurfaceProps::kLegacyFontHost_InitType); - bool allowSRGBInputs = canvas->getProps(&canvasProps) && canvasProps.allowSRGBInputs(); + bool gammaCorrrect = canvas->getProps(&canvasProps) && canvasProps.isGammaCorrect(); const struct { SkPixelGeometry fGeo; @@ -99,7 +99,7 @@ protected: SkScalar y = 0; for (size_t i = 0; i < SK_ARRAY_COUNT(rec); ++i) { auto surface(make_surface(ctx, info, rec[i].fGeo, disallowAA, disallowDither, - allowSRGBInputs)); + gammaCorrrect)); test_draw(surface->getCanvas(), rec[i].fLabel); surface->draw(canvas, x, y, nullptr); y += H; |