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

Issue 7967007: Add heuristic for fixing the alpha channel when reading clipboard images on Windows (Closed)

Created:
9 years, 3 months ago by dcheng
Modified:
9 years, 3 months ago
Reviewers:
tony, Wez
CC:
chromium-reviews
Visibility:
Public.

Description

Add heuristic for fixing the alpha channel when reading clipboard images on Windows The code attempts to detect an image with a garbage in the alpha channel and reset the alpha channel to a sane state in that case. BUG=97160 TEST=Paste an image into a page using event.ClipboardData with the Windows Basic theme active. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=102317

Patch Set 1 #

Patch Set 2 : . #

Total comments: 2

Patch Set 3 : . #

Patch Set 4 : . #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -9 lines) Patch
M ui/base/clipboard/clipboard_win.cc View 1 2 3 2 chunks +36 lines, -9 lines 3 comments Download

Messages

Total messages: 12 (0 generated)
dcheng
It seems really sad that we have to do this. I cc'ed wez to see ...
9 years, 3 months ago (2011-09-19 23:59:05 UTC) #1
tony
LGTM, but a couple questions: What are the situations where we would have an alpha ...
9 years, 3 months ago (2011-09-20 00:52:21 UTC) #2
dcheng
On 2011/09/20 00:52:21, tony wrote: > LGTM, but a couple questions: > > What are ...
9 years, 3 months ago (2011-09-20 01:28:48 UTC) #3
Wez
On 2011/09/19 23:59:05, dcheng wrote: > I tried using DIBV5, but it didn't make a ...
9 years, 3 months ago (2011-09-20 14:22:09 UTC) #4
dcheng
On 2011/09/20 14:22:09, Wez wrote: > On 2011/09/19 23:59:05, dcheng wrote: > > I tried ...
9 years, 3 months ago (2011-09-20 14:27:16 UTC) #5
dcheng
Updated using the heuristic. It /seems/ to work.
9 years, 3 months ago (2011-09-20 23:19:39 UTC) #6
tony
http://codereview.chromium.org/7967007/diff/6001/ui/base/clipboard/clipboard_win.cc File ui/base/clipboard/clipboard_win.cc (right): http://codereview.chromium.org/7967007/diff/6001/ui/base/clipboard/clipboard_win.cc#newcode496 ui/base/clipboard/clipboard_win.cc:496: break; This only breaks out of the inner for ...
9 years, 3 months ago (2011-09-20 23:26:54 UTC) #7
dcheng
http://codereview.chromium.org/7967007/diff/6001/ui/base/clipboard/clipboard_win.cc File ui/base/clipboard/clipboard_win.cc (right): http://codereview.chromium.org/7967007/diff/6001/ui/base/clipboard/clipboard_win.cc#newcode496 ui/base/clipboard/clipboard_win.cc:496: break; On 2011/09/20 23:26:54, tony wrote: > This only ...
9 years, 3 months ago (2011-09-20 23:56:33 UTC) #8
tony
LGTM
9 years, 3 months ago (2011-09-21 01:20:49 UTC) #9
dcheng
Mind taking another look? The primary change is to always force <32 bpp images to ...
9 years, 3 months ago (2011-09-22 00:01:02 UTC) #10
tony
LGTM, you might also want to update the change description to be explicit about when ...
9 years, 3 months ago (2011-09-22 01:26:58 UTC) #11
Wez
9 years, 3 months ago (2011-09-22 10:55:41 UTC) #12
http://codereview.chromium.org/7967007/diff/9001/ui/base/clipboard/clipboard_...
File ui/base/clipboard/clipboard_win.cc (right):

http://codereview.chromium.org/7967007/diff/9001/ui/base/clipboard/clipboard_...
ui/base/clipboard/clipboard_win.cc:500: // Windows doesn't really handle alpha
channels well in many situations. When
nit: Technically it's applications which handle DIBV5 image data on the
clipboard poorly.

http://codereview.chromium.org/7967007/diff/9001/ui/base/clipboard/clipboard_...
ui/base/clipboard/clipboard_win.cc:502: // source image is 32 bpp, the alpha
channel might still contain garbage data.
Isn't it rather that some applications put images with alpha channels on the
clipboard but fail to set the alpha mask correctly in the bitmap header, so we
have to check for valid alpha channel if the mask is zero?

Powered by Google App Engine
This is Rietveld 408576698