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

Issue 2270103002: New helper for creating a color space from another, with linear gamma (Closed)

Created:
4 years, 4 months ago by Brian Osman
Modified:
4 years, 3 months ago
Reviewers:
msarett, mtklein, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

New helper for creating a color space from another, with linear gamma Going to need this in many places once we expliclty require F16 surfaces to have linear gamma color spaces. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2270103002 Committed: https://skia.googlesource.com/skia/+/8aeec39f1fedfdd3508365ff0548cc3f876f6a00

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -0 lines) Patch
M include/core/SkColorSpace.h View 1 chunk +5 lines, -0 lines 0 comments Download
M src/core/SkColorSpace.cpp View 1 chunk +4 lines, -0 lines 1 comment Download

Dependent Patchsets:

Messages

Total messages: 18 (8 generated)
Brian Osman
4 years, 4 months ago (2016-08-23 17:52:32 UTC) #3
msarett
lgtm if the consensus is to always mark F16 buffers with linear color spaces https://codereview.chromium.org/2270103002/diff/1/src/core/SkColorSpace.cpp ...
4 years, 4 months ago (2016-08-23 18:01:12 UTC) #6
reed1
Will we also want a "named" singleton for linear-srgb? lgtm
4 years, 4 months ago (2016-08-24 10:22:27 UTC) #9
mtklein
On 2016/08/24 10:22:27, reed1 wrote: > Will we also want a "named" singleton for linear-srgb? ...
4 years, 4 months ago (2016-08-24 12:10:00 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2270103002/1
4 years, 4 months ago (2016-08-24 12:10:30 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://skia.googlesource.com/skia/+/8aeec39f1fedfdd3508365ff0548cc3f876f6a00
4 years, 4 months ago (2016-08-24 12:11:23 UTC) #14
reed1
On 2016/08/24 12:10:00, mtklein wrote: > On 2016/08/24 10:22:27, reed1 wrote: > > Will we ...
4 years, 4 months ago (2016-08-24 13:21:57 UTC) #15
mtklein
> Understood, but that is not as obviously going to return a singleton. I'm sure ...
4 years, 4 months ago (2016-08-24 14:00:29 UTC) #16
reed1
Hmmm. Its a small matter, but I can't see how offering kSRGB_Linear_Named as a single ...
4 years, 4 months ago (2016-08-24 19:33:01 UTC) #17
Brian Osman
4 years, 3 months ago (2016-08-25 16:54:49 UTC) #18
Message was sent while issue was closed.
On 2016/08/24 19:33:01, reed1 wrote:
> Hmmm. Its a small matter, but I can't see how offering kSRGB_Linear_Named as a
> single factory option would make it hard to be consistent with the two-step
> version.

I had an idea of doing something like this, if people agree:

SkColorSpace_Base {
+ sk_sp<SkColorSpace> fLinear;
}

SkColorSpace::makeLinearGamma() {
  if (this->fNamedGamma == Linear) {
    return this;
  }
  if (!this->fLinear) {
    fLinear = NewRGB(kLinear, fToXYZD50);
  }
  return fLinear;
}

It bloats all color spaces by another pointer, but basically gives us single
instances of the linear versions of anything that's already a singleton.

Powered by Google App Engine
This is Rietveld 408576698