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

Issue 1796293003: Image decode color: Push color profile from browser to renderer (Closed)

Created:
4 years, 9 months ago by ccameron
Modified:
4 years, 5 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, jam, kinuko+watch, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Image 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -89 lines) Patch
M content/browser/renderer_host/render_message_filter.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +0 lines, -6 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +0 lines, -15 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +11 lines, -0 lines 0 comments Download
M content/common/render_process_messages.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -4 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/renderer_blink_platform_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -21 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +49 lines, -32 lines 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/Platform.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -6 lines 0 comments Download
M ui/gfx/color_profile.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -4 lines 0 comments Download
M ui/gfx/color_profile.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (18 generated)
ccameron
https://codereview.chromium.org/1796293003/diff/60001/content/browser/renderer_host/render_view_host_impl.cc File content/browser/renderer_host/render_view_host_impl.cc (right): https://codereview.chromium.org/1796293003/diff/60001/content/browser/renderer_host/render_view_host_impl.cc#newcode342 content/browser/renderer_host/render_view_host_impl.cc:342: params.image_decode_color_profile = gfx::ColorProfile().profile(); Note that this default constructor actually ...
4 years, 9 months ago (2016-03-15 06:02:24 UTC) #5
Avi (use Gerrit)
I am very much liking the direction you are going here. Thank you for the ...
4 years, 9 months ago (2016-03-15 16:20:38 UTC) #8
ccameron
dcheng, ptal at *_messages.h This moves a parameter from a renderer-initiated sync IPC to a ...
4 years, 9 months ago (2016-03-15 17:10:08 UTC) #11
dcheng
https://codereview.chromium.org/1796293003/diff/100001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h (right): https://codereview.chromium.org/1796293003/diff/100001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h#newcode256 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h:256: static qcms_profile* qcmsOutputDeviceProfile(const ColorProfile* colorProfile = 0) = nullptr ...
4 years, 9 months ago (2016-03-15 17:28:09 UTC) #12
ccameron
Thanks -- updated. https://codereview.chromium.org/1796293003/diff/100001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h File third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h (right): https://codereview.chromium.org/1796293003/diff/100001/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h#newcode256 third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h:256: static qcms_profile* qcmsOutputDeviceProfile(const ColorProfile* colorProfile = ...
4 years, 9 months ago (2016-03-15 18:22:05 UTC) #13
dcheng
lgtm
4 years, 9 months ago (2016-03-15 18:32:51 UTC) #14
pdr.
This patch points the code in a better direction. LGTM on the blinky bits (sorry ...
4 years, 9 months ago (2016-03-16 03:45:18 UTC) #15
ccameron
Thanks!
4 years, 9 months ago (2016-03-16 05:45:51 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1796293003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1796293003/120001
4 years, 9 months ago (2016-03-16 05:46:07 UTC) #19
Noel Gordon
Time-zones and all ... Why are we removing the IPC pull model that shipped to ...
4 years, 9 months ago (2016-03-16 06:19:51 UTC) #21
ccameron
On 2016/03/16 06:19:51, noel gordon wrote: > Time-zones and all ... Why are we removing ...
4 years, 9 months ago (2016-03-17 02:10:50 UTC) #25
ccameron
I plan to re-resolve and commit this soon.
4 years, 7 months ago (2016-05-03 18:19:08 UTC) #26
Noel Gordon
With the pull model we ship to the field (the renderer IPC thing), do we ...
4 years, 7 months ago (2016-05-05 17:27:40 UTC) #27
ccameron
On 2016/05/05 17:27:40, noel gordon wrote: > With the pull model we ship to the ...
4 years, 7 months ago (2016-05-05 18:46:14 UTC) #28
Noel Gordon
On 2016/05/05 18:46:14, ccameron wrote: > On 2016/05/05 17:27:40, noel gordon wrote: > > With ...
4 years, 6 months ago (2016-06-01 05:41:51 UTC) #29
Noel Gordon
https://codereview.chromium.org/1796293003/diff/300001/ui/gfx/color_profile_win.cc File ui/gfx/color_profile_win.cc (right): https://codereview.chromium.org/1796293003/diff/300001/ui/gfx/color_profile_win.cc#newcode51 ui/gfx/color_profile_win.cc:51: // pre-existing behavior is to read them, and the ...
4 years, 6 months ago (2016-06-01 06:08:25 UTC) #30
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/1796293003/400001
4 years, 5 months ago (2016-06-28 17:32:58 UTC) #33
commit-bot: I haz the power
Committed patchset #15 (id:400001)
4 years, 5 months ago (2016-06-28 17:42:28 UTC) #35
commit-bot: I haz the power
4 years, 5 months ago (2016-06-28 17:45:35 UTC) #37
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/6fc2fd3b6c99c97632b7fe43bdbf1fa12ad352ca
Cr-Commit-Position: refs/heads/master@{#402501}

Powered by Google App Engine
This is Rietveld 408576698