Bug 175858 - _WKThumbnailView should use the screen color space instead of sRGB
Summary: _WKThumbnailView should use the screen color space instead of sRGB
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-22 16:17 PDT by Tim Horton
Modified: 2017-08-23 11:15 PDT (History)
6 users (show)

See Also:


Attachments
Patch (40.08 KB, patch)
2017-08-22 16:21 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (41.30 KB, patch)
2017-08-22 16:41 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (46.54 KB, patch)
2017-08-22 17:45 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (46.21 KB, patch)
2017-08-22 18:06 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (46.09 KB, patch)
2017-08-22 18:13 PDT, Tim Horton
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2017-08-22 16:17:35 PDT
_WKThumbnailView should use the screen color space instead of sRGB
Comment 1 Tim Horton 2017-08-22 16:17:46 PDT
<rdar://problem/33925559>
Comment 2 Tim Horton 2017-08-22 16:21:25 PDT
Created attachment 318820 [details]
Patch
Comment 3 Tim Horton 2017-08-22 16:41:20 PDT
Created attachment 318824 [details]
Patch
Comment 4 Megan Gardner 2017-08-22 17:08:16 PDT
Comment on attachment 318824 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=318824&action=review

I don't really like switching supportsAlpha to isOpaque, but I see how it makes sense, as most things support alpha, thus allowing the default to more easily be default. I think that something like "noAlpha" might be more clear, though, as Alpha is the channel that is present or not.

Other than extraneous log, it looks good to me.

> Source/WebKit/Shared/cg/ShareableBitmapCG.cpp:77
> +

Leftover logging? Please remove if so.
Comment 5 Megan Gardner 2017-08-22 17:24:58 PDT
Well, looks good to what I am familiar with, obviously will need a real reviewer, and to fix the SharableBitmap build breaker.
Comment 6 Tim Horton 2017-08-22 17:44:40 PDT
(In reply to Megan Gardner from comment #4)
> Comment on attachment 318824 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=318824&action=review
> 
> I don't really like switching supportsAlpha to isOpaque, but I see how it
> makes sense, as most things support alpha, thus allowing the default to more
> easily be default. I think that something like "noAlpha" might be more
> clear, though, as Alpha is the channel that is present or not.

IsOpaque is the name used on e.g. CALayer/NSView/UIView (and our own RemoteLayerBackingStore, among others). Thoughts? :)

> Other than extraneous log, it looks good to me.

That and the fact that it doesn't build basically anywhere.

> > Source/WebKit/Shared/cg/ShareableBitmapCG.cpp:77
> > +
> 
> Leftover logging? Please remove if so.

Good call!
Comment 7 Tim Horton 2017-08-22 17:45:53 PDT
Created attachment 318836 [details]
Patch
Comment 8 Megan Gardner 2017-08-22 18:03:47 PDT
(In reply to Tim Horton from comment #6)
> (In reply to Megan Gardner from comment #4)
> > Comment on attachment 318824 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=318824&action=review
> > 
> > I don't really like switching supportsAlpha to isOpaque, but I see how it
> > makes sense, as most things support alpha, thus allowing the default to more
> > easily be default. I think that something like "noAlpha" might be more
> > clear, though, as Alpha is the channel that is present or not.
> 
> IsOpaque is the name used on e.g. CALayer/NSView/UIView (and our own
> RemoteLayerBackingStore, among others). Thoughts? :)

Ok looking at those flags, at least in CALayer and UIView, seems to be more about optimization of drawing, in that it is guarantees that all the pixels have relevant data rather than the presence or absence of an alpha channel, which I guess after looking at the code more closely is also sorta what ours is about. So I guess that makes sense. It's a shame that the SharableBitmap flag is SupportsAlpha though.

> 
> > Other than extraneous log, it looks good to me.
> 
> That and the fact that it doesn't build basically anywhere.

Yeah, also that

> 
> > > Source/WebKit/Shared/cg/ShareableBitmapCG.cpp:77
> > > +
> > 
> > Leftover logging? Please remove if so.
> 
> Good call!
Comment 9 Tim Horton 2017-08-22 18:05:59 PDT
(In reply to Megan Gardner from comment #8)
> (In reply to Tim Horton from comment #6)
> > (In reply to Megan Gardner from comment #4)
> Ok looking at those flags, at least in CALayer and UIView, seems to be more
> about optimization of drawing, in that it is guarantees that all the pixels
> have relevant data rather than the presence or absence of an alpha channel,
> which I guess after looking at the code more closely is also sorta what ours
> is about. So I guess that makes sense. It's a shame that the SharableBitmap
> flag is SupportsAlpha though.

Hmm, what? The ShareableBitmap flag is the one I changed. Is there another that I should change? I don't see any more SupportsAlpha in the tree after my change
Comment 10 Tim Horton 2017-08-22 18:06:14 PDT
Created attachment 318838 [details]
Patch
Comment 11 Megan Gardner 2017-08-22 18:08:35 PDT
Sry, I was looking at the unchanged code to compare flags and I got my streams crossed.

(In reply to Tim Horton from comment #9)
> (In reply to Megan Gardner from comment #8)
> > (In reply to Tim Horton from comment #6)
> > > (In reply to Megan Gardner from comment #4)
> > Ok looking at those flags, at least in CALayer and UIView, seems to be more
> > about optimization of drawing, in that it is guarantees that all the pixels
> > have relevant data rather than the presence or absence of an alpha channel,
> > which I guess after looking at the code more closely is also sorta what ours
> > is about. So I guess that makes sense. It's a shame that the SharableBitmap
> > flag is SupportsAlpha though.
> 
> Hmm, what? The ShareableBitmap flag is the one I changed. Is there another
> that I should change? I don't see any more SupportsAlpha in the tree after
> my change
Comment 12 Tim Horton 2017-08-22 18:13:33 PDT
Created attachment 318840 [details]
Patch
Comment 13 Dean Jackson 2017-08-22 18:29:43 PDT
Comment on attachment 318840 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=318840&action=review

> Source/WebKit/ChangeLog:13
> +        if the snapshot was instead originally painted in display space.

s/painted/taken/ ?

> Source/WebCore/platform/PlatformScreen.h:45
> +typedef struct CGColorSpace *CGColorSpaceRef;

We are inconsistent through WebCore as to whether the * should be on the left or right :(

> Source/WebKit/Shared/cg/ShareableBitmapCG.cpp:42
> +    return configuration.colorSpace.cgColorSpace.get() ?: sRGBColorSpaceRef();

What does this do? :)
Comment 14 Tim Horton 2017-08-22 21:58:35 PDT
(In reply to Dean Jackson from comment #13)
> Comment on attachment 318840 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=318840&action=review
> 
> > Source/WebKit/ChangeLog:13
> > +        if the snapshot was instead originally painted in display space.
> 
> s/painted/taken/ ?

Sure!

> > Source/WebCore/platform/PlatformScreen.h:45
> > +typedef struct CGColorSpace *CGColorSpaceRef;
> 
> We are inconsistent through WebCore as to whether the * should be on the
> left or right :(

Nah, this one isn't an ObjC type so it should be on the left. I think it just keeps ending up on the right because people copy it out of CGColorSpace.h and that's how it is there.

> > Source/WebKit/Shared/cg/ShareableBitmapCG.cpp:42
> > +    return configuration.colorSpace.cgColorSpace.get() ?: sRGBColorSpaceRef();
> 
> What does this do? :)

Haha :|

Thank you!
Comment 15 Tim Horton 2017-08-22 21:59:46 PDT
https://trac.webkit.org/changeset/221068/webkit
Comment 16 Don Olmstead 2017-08-23 11:04:45 PDT
This ended up breaking WinCairo builds since its including GraphicsContextCG.h

https://build.webkit.org/builders/WinCairo%2064-Bit%20Release/builds/5459/steps/compile-webkit/logs/stdio
Comment 17 Tim Horton 2017-08-23 11:11:38 PDT
(In reply to Don Olmstead from comment #16)
> This ended up breaking WinCairo builds since its including
> GraphicsContextCG.h
> 
> https://build.webkit.org/builders/WinCairo%2064-Bit%20Release/builds/5459/
> steps/compile-webkit/logs/stdio

Err, heh, yeah, I may have forgotten about WinCairo and thought I was safe. Easy to fix, anyway.
Comment 18 Don Olmstead 2017-08-23 11:13:59 PDT
(In reply to Tim Horton from comment #17)
> (In reply to Don Olmstead from comment #16)
> > This ended up breaking WinCairo builds since its including
> > GraphicsContextCG.h
> > 
> > https://build.webkit.org/builders/WinCairo%2064-Bit%20Release/builds/5459/
> > steps/compile-webkit/logs/stdio
> 
> Err, heh, yeah, I may have forgotten about WinCairo and thought I was safe.
> Easy to fix, anyway.

No worries. We really really need an EWS bot.
Comment 19 Tim Horton 2017-08-23 11:15:33 PDT
(In reply to Don Olmstead from comment #18)
> (In reply to Tim Horton from comment #17)
> > (In reply to Don Olmstead from comment #16)
> > > This ended up breaking WinCairo builds since its including
> > > GraphicsContextCG.h
> > > 
> > > https://build.webkit.org/builders/WinCairo%2064-Bit%20Release/builds/5459/
> > > steps/compile-webkit/logs/stdio
> > 
> > Err, heh, yeah, I may have forgotten about WinCairo and thought I was safe.
> > Easy to fix, anyway.
> 
> No worries. We really really need an EWS bot.

Should be fixed in https://trac.webkit.org/changeset/221088/webkit