Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Unified Diff: gm/surface.cpp

Issue 2188463002: Remove SkSurfaceProps gamma-correctness flag entirely. (Closed) Base URL: https://skia.googlesource.com/skia.git@remove-is-gamma-correct
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/dftext.cpp ('k') | gm/textblobgeometrychange.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/surface.cpp
diff --git a/gm/surface.cpp b/gm/surface.cpp
index bae77c55946465dea63543141584bc7ef314bae2..6846f727e2d2bfd949024eeb6ae4145643099899 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"),
« no previous file with comments | « gm/dftext.cpp ('k') | gm/textblobgeometrychange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698