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

Issue 1985903002: Prepare SkColorSpace to be a public API (Closed)

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

Description

Prepare SkColorSpace to be a public API Moves implementation details into SkColorSpacePriv.h BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1985903002 Committed: https://skia.googlesource.com/skia/+/bb9f77437dad6a127840e6898edb3f811e3e9e94

Patch Set 1 #

Patch Set 2 : #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+191 lines, -143 lines) Patch
M gm/color4f.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M src/codec/SkPngCodec.cpp View 3 chunks +12 lines, -6 lines 0 comments Download
M src/core/SkColorSpace.h View 1 2 chunks +17 lines, -93 lines 6 comments Download
M src/core/SkColorSpace.cpp View 1 6 chunks +65 lines, -32 lines 0 comments Download
A src/core/SkColorSpacePriv.h View 1 chunk +83 lines, -0 lines 2 comments Download
M tests/ColorSpaceTest.cpp View 3 chunks +11 lines, -10 lines 0 comments Download

Messages

Total messages: 16 (6 generated)
msarett
4 years, 7 months ago (2016-05-16 22:35:52 UTC) #3
reed1
like it https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpace.h File src/core/SkColorSpace.h (right): https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpace.h#newcode49 src/core/SkColorSpace.h:49: SkGammas* gammas() const { return fGammas.get(); } ...
4 years, 7 months ago (2016-05-17 13:59:24 UTC) #4
msarett
https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpace.h File src/core/SkColorSpace.h (right): https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpace.h#newcode49 src/core/SkColorSpace.h:49: SkGammas* gammas() const { return fGammas.get(); } On 2016/05/17 ...
4 years, 7 months ago (2016-05-17 15:40:53 UTC) #5
reed1
lgtm
4 years, 7 months ago (2016-05-17 15:46:28 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1985903002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1985903002/20001
4 years, 7 months ago (2016-05-17 15:47:17 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-17 16:06:47 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1985903002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1985903002/20001
4 years, 7 months ago (2016-05-17 16:30:17 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://skia.googlesource.com/skia/+/bb9f77437dad6a127840e6898edb3f811e3e9e94
4 years, 7 months ago (2016-05-17 16:31:23 UTC) #14
scroggo
https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpace.h File src/core/SkColorSpace.h (right): https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpace.h#newcode26 src/core/SkColorSpace.h:26: #include "SkTemplates.h" I think the new way to include ...
4 years, 7 months ago (2016-05-17 16:54:28 UTC) #15
msarett
4 years, 7 months ago (2016-05-17 17:27:13 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpace.h
File src/core/SkColorSpace.h (right):

https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpace.h...
src/core/SkColorSpace.h:26: #include "SkTemplates.h"
On 2016/05/17 16:54:27, scroggo wrote:
> I think the new way to include this file is "../private/SkTemplates.h"

Acknowledged.

https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpace.h...
src/core/SkColorSpace.h:49: SkGammas* gammas() const { return fGammas.get(); }
On 2016/05/17 16:54:27, scroggo wrote:
> On 2016/05/17 15:40:52, msarett wrote:
> > On 2016/05/17 13:59:24, reed1 wrote:
> > > Do we need this getter to be public? I guess its ok if we do, but since
> > SkGammas
> > > is private, its a little funny.
> > > 
> > 
> > Agreed that it's funny, but it's useful for test code.
> 
> Maybe we should document that it is only meant to be used in tests?
> 
> > 
> > > Related: do we have a way for clients to identify the gamma ...
> > > - precisely (if they care)?
> > > - roughly sRGB-ish or not?
> > 
> > As we discuseed, I think it'd be nice to add an API that returns an enum... 
> > Something like kSRGBish, kComplicated, kLinear.  I'll leave that for a
follow
> > up.
> 

sgtm

https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpacePr...
File src/core/SkColorSpacePriv.h (right):

https://codereview.chromium.org/1985903002/diff/20001/src/core/SkColorSpacePr...
src/core/SkColorSpacePriv.h:49: struct SkGammas : public SkRefCnt {
On 2016/05/17 16:54:27, scroggo wrote:
> Why is gamma ref counted? I guess it's because of SkGammaCurve::fTable that
you
> don't want to worry about copying?
> 

A couple reasons:
(1) As you say, it's nice to not have to std::move all the time.
(2) Now that it's a malloced ptr, it's nice to share a ref [ 2.2f, 2.2f, 2.2f ]
for the many images with standard gamma.

> It seems potentially problematic because it has public members that can be
> modified.

Ahh yes that's bad.  I think I can make these const, I'll follow up.

Powered by Google App Engine
This is Rietveld 408576698