Chromium Code Reviews
DescriptionImage decode color: Push color profile from browser to renderer
We decode images into the output device's color space.
This color space is computed in blink::Platform::screenColorProfile,
which is implemented as RendererBlinkPlatformImpl::screenColorProfile
in the renderer process. This function will either
- On Windows, issue a synchronous IPC to the browser process to query
the color profile. This synchronous IPC is picked up in
RenderMessageFilter::OnGetMonitorColorProfile, where it will read
the color profile information from disk the first time it is called,
and then always return that cached value.
- On Mac, use the CG monitor/color APIs to query the color profile from
within the renderer process.
After this value is read the first time, it is cached in the renderer
process in a static local variable in blink::ImageDecoder::
qcmsOutputDeviceProfile.
This patch will has the browser push a color profile to the renderer
in ViewMsg_New, which is then pushed to the image decode code via the
new method ImageDecoder::setOutputDeviceColorProfile.
This patch also starts to clean up the gfx::ColorProfile API on Windows
by creating a separate function to update the cached profiles (which
will be reading from disk), and having the functions to read the color
profile only query the cache. There is much more clean-up and that will
be done here in future patches.
The up-sides to this patch are
- Removes a synchronous IPC to the browser on Windows
- Removes a use of CG monitor and color APIs from the renderer process
(towards allowing tightening of the standbox).
- Makes the gfx::ColorProfile API slightly more uniform across all
platforms (the query functions on Windows can now be called on the
UI and IO thread, with the wrinkle that someone needs to do an
update beforehand).
Some areas that still need cleanup include:
- The image decode color profile in Blink is still in a static local
variable, and cannot be updated after being initially set.
- The image decode color profile is still not multi-monitor aware, and
selects an arbitrary monitor's color profile for image decode.
- The process of calling UpdateDisplayColorProfileCache could be cleaned
up.
- This should be no more expensive than before in that we are still doing
about one BrowserThread::PostBlockingPoolTask per renderer -- we're
just doing it ahead of time now instead of in response to the IPC.
- There is much to be done in cleaning up gfx::ColorProfile and
meshing it with gfx::Display. This patch (pushing the color profile
to the renderer) is a prerequisite to that cleanup.
Committed: https://crrev.com/6fc2fd3b6c99c97632b7fe43bdbf1fa12ad352ca
Cr-Commit-Position: refs/heads/master@{#402501}
Patch Set 1 : Fix windows tests #
Total comments: 7
Patch Set 2 : Rebase and change header order #Patch Set 3 : Remove prototype #
Total comments: 4
Patch Set 4 : Incorporate review feedback #Patch Set 5 : Allow sRGB #Patch Set 6 : Add comment about sRGB #Patch Set 7 : Rebase and resolve #Patch Set 8 : Rebase and resolve again #Patch Set 9 : Fix non-qcms build #Patch Set 10 : Rebase #
Total comments: 1
Patch Set 11 : Rebase #Patch Set 12 : Remove extra includes #Patch Set 13 : Keep the same ipc structure as before #Patch Set 14 : git cl try #Patch Set 15 : leave empty check #Messages
Total messages: 37 (18 generated)
|