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

Issue 11028064: Resize images for hi-dpi based on a custom PNG chunk added by GRIT r78, and roll GRIT r78 (Closed)

Created:
8 years, 2 months ago by benrg
Modified:
8 years, 2 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Resize images for hi-dpi based on a custom PNG chunk added by GRIT r78, and roll GRIT r78 Doing both at once to avoid a checkin-and-egg problem. BUG=153892 TEST=manual with --force-device-scale-factor=2, with and without --highlight-missing-scaled-resources Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=162587

Patch Set 1 : . #

Total comments: 20

Patch Set 2 : scale factor instead of % #

Patch Set 3 : don't store source scale in csCl, add unit test #

Patch Set 4 : code adapted from issue 10914092 #

Total comments: 13

Patch Set 5 : comments #

Total comments: 14

Patch Set 6 : rebase (no other changes) #

Patch Set 7 : comments #

Total comments: 6

Patch Set 8 : back out ChromeBrowserMainPartsLinux::PreProfileInit change, add RoundToInt, move image loading to … #

Total comments: 5

Patch Set 9 : comments #

Total comments: 5

Patch Set 10 : only enable user chunk handling for resource bundle images #

Patch Set 11 : back out libpng/PNGCodec changes, scan for special chunks by hand (and rebase) #

Total comments: 6

Patch Set 12 : address comments #

Total comments: 3

Patch Set 13 : nits #

Patch Set 14 : roll grit 78 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -102 lines) Patch
M DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M ui/base/resource/resource_bundle.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +16 lines, -8 lines 0 comments Download
M ui/base/resource/resource_bundle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +102 lines, -92 lines 0 comments Download
M ui/gfx/image/image_skia.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gfx/image/image_skia.cc View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -1 line 0 comments Download

Messages

Total messages: 54 (0 generated)
benrg
http://codereview.chromium.org/11028064/diff/4001/ui/gfx/codec/png_codec.cc File ui/gfx/codec/png_codec.cc (right): http://codereview.chromium.org/11028064/diff/4001/ui/gfx/codec/png_codec.cc#newcode443 ui/gfx/codec/png_codec.cc:443: png_set_error_fn(png_ptr, NULL, LogLibPNGDecodeError, LogLibPNGDecodeWarning); This call wasn't in the ...
8 years, 2 months ago (2012-10-05 18:21:41 UTC) #1
oshima
I'm not right person to review ui/gfx/codec. Can you find someone from blame list? http://codereview.chromium.org/11028064/diff/4001/third_party/libpng/pngusr.h ...
8 years, 2 months ago (2012-10-05 20:33:11 UTC) #2
benrg
+erg for png_codec changes.
8 years, 2 months ago (2012-10-05 21:26:39 UTC) #3
oshima
http://codereview.chromium.org/11028064/diff/4001/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): http://codereview.chromium.org/11028064/diff/4001/ui/base/resource/resource_bundle.cc#newcode81 ui/base/resource/resource_bundle.cc:81: resource_id_, scale_factor, &image, &image_percent); On 2012/10/05 20:33:11, oshima wrote: ...
8 years, 2 months ago (2012-10-07 02:42:21 UTC) #4
benrg
https://chromiumcodereview.appspot.com/11028064/diff/4001/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/4001/ui/base/resource/resource_bundle.cc#newcode81 ui/base/resource/resource_bundle.cc:81: resource_id_, scale_factor, &image, &image_percent); On 2012/10/07 02:42:21, oshima wrote: ...
8 years, 2 months ago (2012-10-07 04:36:10 UTC) #5
oshima
https://chromiumcodereview.appspot.com/11028064/diff/4001/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/4001/ui/base/resource/resource_bundle.cc#newcode81 ui/base/resource/resource_bundle.cc:81: resource_id_, scale_factor, &image, &image_percent); On 2012/10/07 04:36:11, benrg wrote: ...
8 years, 2 months ago (2012-10-08 17:32:15 UTC) #6
benrg
Elliot: png ping. Oshima, read on: https://chromiumcodereview.appspot.com/11028064/diff/4001/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/4001/ui/base/resource/resource_bundle.cc#newcode81 ui/base/resource/resource_bundle.cc:81: resource_id_, scale_factor, &image, ...
8 years, 2 months ago (2012-10-09 00:07:06 UTC) #7
oshima
https://chromiumcodereview.appspot.com/11028064/diff/4001/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/4001/ui/base/resource/resource_bundle.cc#newcode336 ui/base/resource/resource_bundle.cc:336: // more efficient. On 2012/10/09 00:07:06, benrg wrote: > ...
8 years, 2 months ago (2012-10-09 18:28:35 UTC) #8
Elliot Glaysher
On 2012/10/09 00:07:06, benrg wrote: > Elliot: png ping. Oshima, read on: I'm not an ...
8 years, 2 months ago (2012-10-09 19:12:47 UTC) #9
benrg
https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc#newcode59 ui/base/resource/resource_bundle.cc:59: // will show the scaled image blended with red ...
8 years, 2 months ago (2012-10-09 21:37:17 UTC) #10
benrg
Sailesh, can you look at the PNG codec changes? Do we need a security review ...
8 years, 2 months ago (2012-10-09 21:38:22 UTC) #11
sail
the resource/* stuff mostly looks good to me is there anyone else that can review ...
8 years, 2 months ago (2012-10-09 22:01:37 UTC) #12
oshima
https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc#newcode332 ui/base/resource/resource_bundle.cc:332: image_source->GetImageForScale(primary_scale_factor); On 2012/10/09 21:37:18, benrg wrote: > On 2012/10/09 ...
8 years, 2 months ago (2012-10-09 22:06:07 UTC) #13
oshima
https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc#newcode327 ui/base/resource/resource_bundle.cc:327: // gfx::Screen::GetPrimaryDisplay().device_scale_factor()); On 2012/10/09 21:37:18, benrg wrote: > On ...
8 years, 2 months ago (2012-10-09 22:10:17 UTC) #14
benrg
brettw, can you review the PNG codec changes or suggest someone?
8 years, 2 months ago (2012-10-10 00:16:33 UTC) #15
benrg
+stevenjb for chrome_browser_main_chromeos.cc. https://codereview.chromium.org/11028064/diff/29003/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://codereview.chromium.org/11028064/diff/29003/ui/base/resource/resource_bundle.cc#newcode69 ui/base/resource/resource_bundle.cc:69: bool scale_fallback = false; On 2012/10/09 ...
8 years, 2 months ago (2012-10-10 02:18:13 UTC) #16
sail
resource/* LGTM https://codereview.chromium.org/11028064/diff/29003/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://codereview.chromium.org/11028064/diff/29003/ui/base/resource/resource_bundle.cc#newcode88 ui/base/resource/resource_bundle.cc:88: static_cast<int>(image.width() * scale + 0.5f), On 2012/10/10 ...
8 years, 2 months ago (2012-10-10 03:09:55 UTC) #17
brettw
I think pkasting is a good reviewer for the image decoder stuff.
8 years, 2 months ago (2012-10-10 03:12:31 UTC) #18
Peter Kasting
On 2012/10/10 03:12:31, brettw wrote: > I think pkasting is a good reviewer for the ...
8 years, 2 months ago (2012-10-10 03:27:56 UTC) #19
benrg
noel, can you review the PNG codec changes or suggest someone (maybe francoisk777@gmail.com or tony@chromium.org)?
8 years, 2 months ago (2012-10-10 15:25:31 UTC) #20
oshima
On 2012/10/09 22:06:07, oshima wrote: > https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc > File ui/base/resource/resource_bundle.cc (right): > > https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc#newcode332 > ...
8 years, 2 months ago (2012-10-10 16:20:59 UTC) #21
oshima
http://codereview.chromium.org/11028064/diff/26008/chrome/browser/chromeos/chrome_browser_main_chromeos.cc File chrome/browser/chromeos/chrome_browser_main_chromeos.cc (right): http://codereview.chromium.org/11028064/diff/26008/chrome/browser/chromeos/chrome_browser_main_chromeos.cc#newcode354 chrome/browser/chromeos/chrome_browser_main_chromeos.cc:354: // the device scale factor is available when loading ...
8 years, 2 months ago (2012-10-10 16:21:28 UTC) #22
stevenjb
Sorry to further delay this, but I am nervous about reordering the ash::Shell initialization. Can ...
8 years, 2 months ago (2012-10-10 17:07:27 UTC) #23
oshima
http://codereview.chromium.org/11028064/diff/26008/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): http://codereview.chromium.org/11028064/diff/26008/ui/base/resource/resource_bundle.cc#newcode323 ui/base/resource/resource_bundle.cc:323: gfx::Screen::GetPrimaryDisplay().device_scale_factor()); Looks this this need more work (see bot ...
8 years, 2 months ago (2012-10-10 18:13:47 UTC) #24
oshima
On 2012/10/10 17:07:27, stevenjb (chromium) wrote: > Sorry to further delay this, but I am ...
8 years, 2 months ago (2012-10-10 18:25:12 UTC) #25
benrg
oshima, PTAL https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/22004/ui/base/resource/resource_bundle.cc#newcode332 ui/base/resource/resource_bundle.cc:332: image_source->GetImageForScale(primary_scale_factor); On 2012/10/09 22:06:07, oshima wrote: > ...
8 years, 2 months ago (2012-10-10 21:03:56 UTC) #26
oshima
https://chromiumcodereview.appspot.com/11028064/diff/20006/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/20006/ui/base/resource/resource_bundle.cc#newcode98 ui/base/resource/resource_bundle.cc:98: RoundToInt(image.height() * scale)); Exactly how conversion should work depends ...
8 years, 2 months ago (2012-10-10 21:43:29 UTC) #27
benrg
https://chromiumcodereview.appspot.com/11028064/diff/20006/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/20006/ui/base/resource/resource_bundle.cc#newcode98 ui/base/resource/resource_bundle.cc:98: RoundToInt(image.height() * scale)); On 2012/10/10 21:43:29, oshima wrote: > ...
8 years, 2 months ago (2012-10-11 01:22:02 UTC) #28
oshima
https://chromiumcodereview.appspot.com/11028064/diff/19011/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://chromiumcodereview.appspot.com/11028064/diff/19011/ui/base/resource/resource_bundle.cc#newcode80 ui/base/resource/resource_bundle.cc:80: if (!found) and you should be able to return ...
8 years, 2 months ago (2012-10-11 01:31:54 UTC) #29
Noel Gordon
8 years, 2 months ago (2012-10-11 04:15:36 UTC) #30
Noel Gordon
On 2012/10/10 15:25:31, benrg wrote: > noel, can you review the PNG codec changes or ...
8 years, 2 months ago (2012-10-11 04:36:56 UTC) #31
sail
On 2012/10/11 04:36:56, noel chromium wrote: > On 2012/10/10 15:25:31, benrg wrote: > > noel, ...
8 years, 2 months ago (2012-10-11 04:40:22 UTC) #32
Noel Gordon
> That seems very wasteful. Not only would this increase binary size, it would > ...
8 years, 2 months ago (2012-10-11 05:00:58 UTC) #33
Peter Kasting
On 2012/10/11 05:00:58, noel chromium wrote: > We already ship both 1x and 2x, right? ...
8 years, 2 months ago (2012-10-11 05:21:32 UTC) #34
oshima
On 2012/10/11 05:00:58, noel chromium wrote: > > That seems very wasteful. Not only would ...
8 years, 2 months ago (2012-10-11 05:29:13 UTC) #35
oshima
On Wed, Oct 10, 2012 at 10:21 PM, <pkasting@chromium.org> wrote: > On 2012/10/11 05:00:58, noel ...
8 years, 2 months ago (2012-10-11 05:45:43 UTC) #36
Noel Gordon
On 2012/10/11 05:45:43, oshima wrote: > On Wed, Oct 10, 2012 at 10:21 PM, <mailto:pkasting@chromium.org> ...
8 years, 2 months ago (2012-10-11 06:57:56 UTC) #37
Noel Gordon
On 2012/10/11 05:29:13, oshima wrote: > On 2012/10/11 05:00:58, noel chromium wrote: > > > ...
8 years, 2 months ago (2012-10-11 07:01:44 UTC) #38
oshima
On 2012/10/11 06:57:56, noel chromium wrote: > On 2012/10/11 05:45:43, oshima wrote: > > On ...
8 years, 2 months ago (2012-10-11 07:18:42 UTC) #39
Noel Gordon
On 2012/10/11 05:29:13, oshima wrote: > We did consider the option to scale them in ...
8 years, 2 months ago (2012-10-11 07:22:13 UTC) #40
benrg
> Did you compare the cost of rescaling vs decoding? If PNG image > decoding ...
8 years, 2 months ago (2012-10-11 16:19:04 UTC) #41
oshima
On 2012/10/11 16:19:04, benrg wrote: > > Did you compare the cost of rescaling vs ...
8 years, 2 months ago (2012-10-11 17:24:29 UTC) #42
Noel Gordon
On 2012/10/11 17:24:29, oshima wrote: > On 2012/10/11 16:19:04, benrg wrote: > > > The ...
8 years, 2 months ago (2012-10-12 03:19:12 UTC) #43
Noel Gordon
On 2012/10/11 16:19:04, benrg wrote: > > Did you compare the cost of rescaling vs ...
8 years, 2 months ago (2012-10-12 03:29:29 UTC) #44
Noel Gordon
On 2012/10/11 16:19:04, benrg wrote: > > The maintainability of resource files seems like a ...
8 years, 2 months ago (2012-10-12 03:50:49 UTC) #45
benrg
On 2012/10/12 03:19:12, noel chromium wrote: > Note the lib being modified here is also ...
8 years, 2 months ago (2012-10-12 03:57:34 UTC) #46
benrg
oshima, PTAL. I removed all libpng/PNGCodec changes. https://codereview.chromium.org/11028064/diff/19011/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://codereview.chromium.org/11028064/diff/19011/ui/base/resource/resource_bundle.cc#newcode80 ui/base/resource/resource_bundle.cc:80: if (!found) ...
8 years, 2 months ago (2012-10-15 21:58:54 UTC) #47
oshima
thanks, looks better. https://codereview.chromium.org/11028064/diff/19011/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): https://codereview.chromium.org/11028064/diff/19011/ui/gfx/image/image_skia.cc#newcode66 ui/gfx/image/image_skia.cc:66: source_.reset(); On 2012/10/15 21:58:54, benrg wrote: ...
8 years, 2 months ago (2012-10-16 23:12:09 UTC) #48
benrg
oshima, PTAL. https://codereview.chromium.org/11028064/diff/54001/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): https://codereview.chromium.org/11028064/diff/54001/ui/base/resource/resource_bundle.cc#newcode68 ui/base/resource/resource_bundle.cc:68: if (size - pos < 12) On ...
8 years, 2 months ago (2012-10-17 15:57:25 UTC) #49
oshima
lgtm with nits http://codereview.chromium.org/11028064/diff/58001/ui/base/resource/resource_bundle.cc File ui/base/resource/resource_bundle.cc (right): http://codereview.chromium.org/11028064/diff/58001/ui/base/resource/resource_bundle.cc#newcode75 ui/base/resource/resource_bundle.cc:75: uint32 length; = 0;, just in ...
8 years, 2 months ago (2012-10-17 16:40:15 UTC) #50
benrg
Ben, requesting owner approval for ui/gfx/image/*, also a question: There's a chicken-and-egg problem with this ...
8 years, 2 months ago (2012-10-17 20:19:38 UTC) #51
Ben Goodger (Google)
lgtm
8 years, 2 months ago (2012-10-17 22:20:28 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benrg@chromium.org/11028064/62003
8 years, 2 months ago (2012-10-17 22:22:45 UTC) #53
commit-bot: I haz the power
8 years, 2 months ago (2012-10-18 00:42:15 UTC) #54
Change committed as 162587

Powered by Google App Engine
This is Rietveld 408576698