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

Issue 12704026: Added new class gfx::ImageFamily. (Closed)

Created:
7 years, 9 months ago by Matt Giuca
Modified:
7 years, 7 months ago
CC:
chromium-reviews, rsesek+watch_chromium.org, benwells, chrome-apps-syd-reviews_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Added new class gfx::ImageFamily. This represents a collection of differently sized images, and has methods to pick the appropriately sized one. Initially, this is intended for use as the type for ShellIntegration::ShortcutInfo::favicon instead of gfx::Image. BUG=189137 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=192244

Patch Set 1 #

Patch Set 2 : Use Image::Size instead of Width and Height. #

Total comments: 34

Patch Set 3 : Respond to review feedback. #

Patch Set 4 : Respond to review feedback. #

Patch Set 5 : Refactor Get() method, splitting into three methods and simplifying the algorithm. #

Total comments: 24

Patch Set 6 : #

Total comments: 7

Patch Set 7 : Respond to reviewer feedback. #

Total comments: 12

Patch Set 8 : Respond to reviewer feedback. #

Patch Set 9 : Moved const_iterator constructors into .cc file [chromium-style]. #

Patch Set 10 : Fixed Windows build (missing UI_EXPORT). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+448 lines, -0 lines) Patch
A ui/gfx/image/image_family.h View 1 2 3 4 5 6 7 8 9 1 chunk +144 lines, -0 lines 0 comments Download
A ui/gfx/image/image_family.cc View 1 2 3 4 5 6 7 8 1 chunk +124 lines, -0 lines 0 comments Download
A ui/gfx/image/image_family_unittest.cc View 1 2 3 1 chunk +177 lines, -0 lines 0 comments Download
M ui/ui.gyp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M ui/ui_unittests.gypi View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
Matt Giuca
Hi, This is the first part of Issue 189137 (the second part work-in-progress, if you ...
7 years, 9 months ago (2013-03-27 02:47:46 UTC) #1
Matt Giuca
Adding pkotwicz.
7 years, 9 months ago (2013-03-27 05:55:59 UTC) #2
Robert Sesek
https://codereview.chromium.org/12704026/diff/5001/ui/gfx/image/image_family.cc File ui/gfx/image/image_family.cc (right): https://codereview.chromium.org/12704026/diff/5001/ui/gfx/image/image_family.cc#newcode20 ui/gfx/image/image_family.cc:20: { Opening braces go on the line of the ...
7 years, 9 months ago (2013-03-27 17:42:50 UTC) #3
pkotwicz
https://codereview.chromium.org/12704026/diff/5001/ui/gfx/image/image_family.cc File ui/gfx/image/image_family.cc (right): https://codereview.chromium.org/12704026/diff/5001/ui/gfx/image/image_family.cc#newcode14 ui/gfx/image/image_family.cc:14: class Size; Remove this? https://codereview.chromium.org/12704026/diff/5001/ui/gfx/image/image_family.cc#newcode23 ui/gfx/image/image_family.cc:23: int height = ...
7 years, 9 months ago (2013-03-27 19:04:53 UTC) #4
Matt Giuca
Hi, thanks to both for the detailed review and helpful comments. Regarding the refactor of ...
7 years, 9 months ago (2013-03-28 03:54:03 UTC) #5
pkotwicz
Looks pretty good. https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family.cc File ui/gfx/image/image_family.cc (right): https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family.cc#newcode21 ui/gfx/image/image_family.cc:21: map_[MapKey(1.0f, 0)] = image; Should we ...
7 years, 9 months ago (2013-03-29 00:25:35 UTC) #6
Matt Giuca
https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family.cc File ui/gfx/image/image_family.cc (right): https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family.cc#newcode21 ui/gfx/image/image_family.cc:21: map_[MapKey(1.0f, 0)] = image; On 2013/03/29 00:25:35, pkotwicz wrote: ...
7 years, 8 months ago (2013-03-30 00:54:14 UTC) #7
Robert Sesek
https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family_unittest.cc File ui/gfx/image/image_family_unittest.cc (right): https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family_unittest.cc#newcode17 ui/gfx/image/image_family_unittest.cc:17: // reported when a test fails. On 2013/03/30 00:54:14, ...
7 years, 8 months ago (2013-04-01 20:57:45 UTC) #8
Matt Giuca
https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family_unittest.cc File ui/gfx/image/image_family_unittest.cc (right): https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family_unittest.cc#newcode17 ui/gfx/image/image_family_unittest.cc:17: // reported when a test fails. Can you show ...
7 years, 8 months ago (2013-04-02 06:11:28 UTC) #9
pkotwicz
LGTM on my part https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family.cc File ui/gfx/image/image_family.cc (right): https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family.cc#newcode21 ui/gfx/image/image_family.cc:21: map_[MapKey(1.0f, 0)] = image; Fair ...
7 years, 8 months ago (2013-04-02 16:06:31 UTC) #10
Robert Sesek
LGTM % Peter's comments. https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family_unittest.cc File ui/gfx/image/image_family_unittest.cc (right): https://codereview.chromium.org/12704026/diff/20001/ui/gfx/image/image_family_unittest.cc#newcode17 ui/gfx/image/image_family_unittest.cc:17: // reported when a test ...
7 years, 8 months ago (2013-04-02 20:37:28 UTC) #11
Matt Giuca
Thanks, I fixed those last nits. ben@: Please approve (for OWNERS of the ui/ directory; ...
7 years, 8 months ago (2013-04-03 00:37:32 UTC) #12
Matt Giuca
https://codereview.chromium.org/12704026/diff/32001/ui/gfx/image/image_family.cc File ui/gfx/image/image_family.cc (right): https://codereview.chromium.org/12704026/diff/32001/ui/gfx/image/image_family.cc#newcode66 ui/gfx/image/image_family.cc:66: map_.lower_bound(MapKey(desired_aspect, 0.0f)); On 2013/04/02 16:06:31, pkotwicz wrote: > Nit: ...
7 years, 8 months ago (2013-04-03 00:37:43 UTC) #13
Ben Goodger (Google)
lgtm
7 years, 8 months ago (2013-04-03 17:53:11 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/12704026/41001
7 years, 8 months ago (2013-04-03 22:44:24 UTC) #15
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 8 months ago (2013-04-03 23:02:17 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/12704026/62001
7 years, 8 months ago (2013-04-03 23:57:59 UTC) #17
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 8 months ago (2013-04-04 00:42:15 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/12704026/76002
7 years, 8 months ago (2013-04-04 02:47:53 UTC) #19
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 8 months ago (2013-04-04 02:49:22 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/12704026/76002
7 years, 8 months ago (2013-04-04 04:24:51 UTC) #21
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 8 months ago (2013-04-04 04:28:22 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mgiuca@chromium.org/12704026/76002
7 years, 8 months ago (2013-04-04 05:38:48 UTC) #23
commit-bot: I haz the power
Change committed as 192244
7 years, 8 months ago (2013-04-04 08:43:37 UTC) #24
Nico
Do we really need this? ImageSkia already supports having multiple represenation bitmaps for a single ...
7 years, 7 months ago (2013-05-02 22:33:14 UTC) #25
Matt Giuca
On 2013/05/02 22:33:14, Nico wrote: > Do we really need this? ImageSkia already supports having ...
7 years, 7 months ago (2013-05-03 00:10:21 UTC) #26
Nico
7 years, 7 months ago (2013-05-03 00:11:57 UTC) #27
On Thu, May 2, 2013 at 5:10 PM, <mgiuca@chromium.org> wrote:

> On 2013/05/02 22:33:14, Nico wrote:
>
>> Do we really need this? ImageSkia already supports having multiple
>>
> represenation
>
>> bitmaps for a single bitmap.
>>
>
> The bug (http://crbug.com/189137) should serve as motivation for this, but
> briefly, ImageSkia only supports a single *image* with bitmaps for
> representing
> high-DPI versions of that image at different (fixed) scales (specifically
> 100%,
> 133%, 140%, 150%, 180% and 200%). Note that those are supposed to be
> different
> scales of the same image.
>
> We needed a way to represent a collection of different images
> (representing the
> same concept) at arbitrary different sizes. The most obvious use for this
> is
> application icons: icons can have any size, and differently-sized icons can
> contain different content (e.g., a 16x16 icon has perspective or details
> removed
> compared to a 128x128 icon). This is orthogonal to the image sizes in
> ImageSkia.
> For example, it is possible to have the 16x16 icon have a 200% high-DPI
> size,
> which is a 32x32 bitmap, but has the logical size of 16x16 (so it has the
> details removed compared to the 32x32 image).
>

I see. Could the class comment for ImageFamily call out that people want
ImageSkia if they just want an image at different scale factors? Someone
thought that ImageFamily is that class, because the name kinda suggests
this.


>
>
https://chromiumcodereview.**appspot.com/12704026/<https://chromiumcodereview...
>

Powered by Google App Engine
This is Rietveld 408576698