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

Issue 12313139: captureVisibleTab Extension API producing garbled PNG results (Closed)

Created:
7 years, 9 months ago by Sam Larison
Modified:
7 years, 9 months ago
CC:
chromium-reviews, Ivan Korotkov
Visibility:
Public.

Description

captureVisibleTab Extension API producing garbled PNG results Patch from Sam Larison <qufighter@gmail.com>; new DCHECK will fail if rowBytes() on SkBitmap is too low "Windows drivers sometimes require that scanlines (rows in the image) be memory aligned. That is why they are sometimes larger than they would strictly need to be." Instead of attempting to compute row bytes, we should be using the rowBytes() provided by SkBitmap BUG=176062 TEST=The test case involves using the "Capture Visible Content" feature of the Google Screen Capture extension on a newly loaded http:// page after installation of the extension. The bug produces itself if after I size the window my window.innerWidth is 1000 or any other non-multiple of 16 (window.innerWidth % 16 != 0) Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=186472

Patch Set 1 #

Patch Set 2 : Added self to authors file #

Patch Set 3 : Added unittest #

Total comments: 8

Patch Set 4 : Unit test updated #

Patch Set 5 : Unit test updates no 2 #

Total comments: 2

Patch Set 6 : Unit test updates no 3 #

Patch Set 7 : rebase patch branch #

Patch Set 8 : DCHECK line caused signed/unsigned mismatch on try server #

Patch Set 9 : Casting input.rowBytes() for the Encode function #

Patch Set 10 : re-added properly cast dcheck #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -1 line) Patch
M AUTHORS View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/codec/png_codec.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M ui/gfx/codec/png_codec_unittest.cc View 1 2 3 4 5 1 chunk +42 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
Sam Larison
For some additional context about this patch and why I think it is necessary: http://stackoverflow.com/a/2004638 ...
7 years, 9 months ago (2013-02-27 18:52:21 UTC) #1
Ivan Korotkov
I'm not familiar with this code, suggesting some reviewers. If the original bug reproduces for ...
7 years, 9 months ago (2013-02-27 19:02:26 UTC) #2
Alexei Svitkine (slow)
rowBytes() is a SkBitmap method, so adding reed@ as a reviewer. Please put the BUG= ...
7 years, 9 months ago (2013-02-27 19:06:07 UTC) #3
Alexei Svitkine (slow)
ping: Mike, can you take a look at this patch?
7 years, 9 months ago (2013-03-01 15:45:48 UTC) #4
Sam Larison
Just in case anyone is trying to reproduce the bug I posted some additional details. ...
7 years, 9 months ago (2013-03-01 20:06:48 UTC) #5
Sam Larison
I was able to confirm that the patch fixes the bug (debug build 27.0.1424.0 (184717)) ...
7 years, 9 months ago (2013-03-01 21:09:30 UTC) #6
tony
qufighter has signed the CLA. This change looks OK to me, but I would like ...
7 years, 9 months ago (2013-03-04 22:01:12 UTC) #7
tony
Also, it should be pretty easy to write a unittest for this.
7 years, 9 months ago (2013-03-04 22:01:37 UTC) #8
Sam Larison
On 2013/03/04 22:01:37, tony wrote: > Also, it should be pretty easy to write a ...
7 years, 9 months ago (2013-03-04 22:58:02 UTC) #9
Alexei Svitkine (slow)
I think it should be possible to write a unit test that constructs a SkBitmap ...
7 years, 9 months ago (2013-03-04 23:01:28 UTC) #10
Sam Larison
I have added a unit test! With the patch applied it passes, otherwise fails. out\Debug\ui_unittests.exe ...
7 years, 9 months ago (2013-03-05 03:07:24 UTC) #11
tony
LGTM, but I am not an OWNER of this directory.
7 years, 9 months ago (2013-03-05 18:20:41 UTC) #12
Alexei Svitkine (slow)
(I'm an owner. Looking now.)
7 years, 9 months ago (2013-03-05 18:24:28 UTC) #13
Alexei Svitkine (slow)
https://codereview.chromium.org/12313139/diff/13001/ui/gfx/codec/png_codec_unittest.cc File ui/gfx/codec/png_codec_unittest.cc (right): https://codereview.chromium.org/12313139/diff/13001/ui/gfx/codec/png_codec_unittest.cc#newcode974 ui/gfx/codec/png_codec_unittest.cc:974: const int w = 20, h = 20, padded_w ...
7 years, 9 months ago (2013-03-05 18:29:26 UTC) #14
Sam Larison
https://codereview.chromium.org/12313139/diff/13001/ui/gfx/codec/png_codec_unittest.cc File ui/gfx/codec/png_codec_unittest.cc (right): https://codereview.chromium.org/12313139/diff/13001/ui/gfx/codec/png_codec_unittest.cc#newcode974 ui/gfx/codec/png_codec_unittest.cc:974: const int w = 20, h = 20, padded_w ...
7 years, 9 months ago (2013-03-05 20:30:41 UTC) #15
Alexei Svitkine (slow)
https://codereview.chromium.org/12313139/diff/13001/ui/gfx/codec/png_codec_unittest.cc File ui/gfx/codec/png_codec_unittest.cc (right): https://codereview.chromium.org/12313139/diff/13001/ui/gfx/codec/png_codec_unittest.cc#newcode974 ui/gfx/codec/png_codec_unittest.cc:974: const int w = 20, h = 20, padded_w ...
7 years, 9 months ago (2013-03-05 21:35:23 UTC) #16
Sam Larison
Updates to the unit test have been submitted. I verified the unit test still confirms ...
7 years, 9 months ago (2013-03-05 22:24:00 UTC) #17
Alexei Svitkine (slow)
Almost there. https://codereview.chromium.org/12313139/diff/26001/ui/gfx/codec/png_codec_unittest.cc File ui/gfx/codec/png_codec_unittest.cc (right): https://codereview.chromium.org/12313139/diff/26001/ui/gfx/codec/png_codec_unittest.cc#newcode978 ui/gfx/codec/png_codec_unittest.cc:978: int paddedPixels = kPaddedWidth * kHeight; Please ...
7 years, 9 months ago (2013-03-05 22:28:55 UTC) #18
Sam Larison
Should I send a reply to notify when posting updated patch sets? I have made ...
7 years, 9 months ago (2013-03-05 22:49:48 UTC) #19
Alexei Svitkine (slow)
LGTM On 2013/03/05 22:49:48, qufighter wrote: > Should I send a reply to notify when ...
7 years, 9 months ago (2013-03-05 22:52:46 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qufighter@gmail.com/12313139/31001
7 years, 9 months ago (2013-03-05 22:56:10 UTC) #21
commit-bot: I haz the power
Failed to apply patch for AUTHORS: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 9 months ago (2013-03-05 22:56:11 UTC) #22
Alexei Svitkine (slow)
Looks like some of the files were updated since you sent out your CL. Please ...
7 years, 9 months ago (2013-03-05 22:57:44 UTC) #23
Sam Larison
On 2013/03/05 22:57:44, Alexei Svitkine wrote: > Looks like some of the files were updated ...
7 years, 9 months ago (2013-03-06 00:08:13 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qufighter@gmail.com/12313139/35001
7 years, 9 months ago (2013-03-06 15:10:02 UTC) #25
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 9 months ago (2013-03-06 15:24:29 UTC) #26
Sam Larison
DCHECK line that I added was only compiling successfully on win_x64, removed the line, not ...
7 years, 9 months ago (2013-03-06 15:56:50 UTC) #27
Sam Larison
Added casting of input.rowBytes() Now mirrors JPEG side... as originally intended.
7 years, 9 months ago (2013-03-06 16:20:49 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qufighter@gmail.com/12313139/52001
7 years, 9 months ago (2013-03-06 16:25:39 UTC) #29
Alexei Svitkine (slow)
On 2013/03/06 15:56:50, qufighter wrote: > DCHECK line that I added was only compiling successfully ...
7 years, 9 months ago (2013-03-06 16:27:27 UTC) #30
Sam Larison
The dcheck is back in set 10, set 9 seems to be compiling properly elsewhere.
7 years, 9 months ago (2013-03-06 16:39:58 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/qufighter@gmail.com/12313139/58004
7 years, 9 months ago (2013-03-06 16:40:50 UTC) #32
commit-bot: I haz the power
7 years, 9 months ago (2013-03-06 19:06:58 UTC) #33
Message was sent while issue was closed.
Change committed as 186472

Powered by Google App Engine
This is Rietveld 408576698