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

Issue 10245003: Makes ImageSkia more like SkBitmap (Closed)

Created:
8 years, 8 months ago by pkotwicz
Modified:
8 years, 7 months ago
CC:
chromium-reviews, oshima, tfarina
Visibility:
Public.

Description

This patch makes ImageSkia more like SkBitmap. The goal is to make swapping from SkBitmap to ImageSkia easier. Notable changes: - ImageSkia can be cheaply copied - Added extractSubset, will remove after SkBitmaps have been converted to ImageSkia - Modified API to look more like SkBitmap Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=137520

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 22

Patch Set 5 : In progress #

Patch Set 6 : New patch #

Patch Set 7 : Nicer diff #

Total comments: 2

Patch Set 8 : Patch #

Patch Set 9 : Nicer diff #

Patch Set 10 : Patch #

Total comments: 12

Patch Set 11 : Changes as requested #

Patch Set 12 : Nicer diff #

Total comments: 19

Patch Set 13 : Changes as requested #

Patch Set 14 : Nicer diff #

Total comments: 8

Patch Set 15 : Changes as requested #

Total comments: 1

Patch Set 16 : Fixes segfault #

Patch Set 17 : Rebased #

Patch Set 18 : Fixes for try bots #

Patch Set 19 : Nicer diff #

Patch Set 20 : patch #

Patch Set 21 : Patch #

Patch Set 22 : Fixed null return #

Patch Set 23 : Updated comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+565 lines, -420 lines) Patch
M chrome/browser/extensions/image_loading_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/extensions/image_loading_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/themes/browser_theme_pack.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +22 lines, -19 lines 0 comments Download
M chrome/browser/web_applications/web_app_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -3 lines 0 comments Download
M skia/ext/skia_utils_mac.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -4 lines 0 comments Download
M skia/ext/skia_utils_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +14 lines, -32 lines 0 comments Download
M skia/ext/skia_utils_mac_unittest.mm View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -30 lines 0 comments Download
M ui/base/resource/resource_bundle.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +12 lines, -10 lines 0 comments Download
M ui/gfx/canvas.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +34 lines, -22 lines 0 comments Download
ui/gfx/canvas.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +76 lines, -31 lines 0 comments Download
ui/gfx/image/image.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +5 lines, -4 lines 0 comments Download
M ui/gfx/image/image.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 8 chunks +22 lines, -16 lines 0 comments Download
M ui/gfx/image/image_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +28 lines, -7 lines 0 comments Download
M ui/gfx/image/image_mac_unittest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +49 lines, -43 lines 0 comments Download
M ui/gfx/image/image_skia.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +93 lines, -59 lines 0 comments Download
ui/gfx/image/image_skia.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +143 lines, -97 lines 0 comments Download
M ui/gfx/image/image_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +41 lines, -35 lines 0 comments Download

Messages

Total messages: 52 (0 generated)
pkotwicz
This makes gfx::ImageSkia look more like SkBitmap and will make changing the API to use ...
8 years, 8 months ago (2012-04-27 02:23:54 UTC) #1
pkotwicz
Also moves the paint functions out of gfx::ImageSkia as to make conversion easier.
8 years, 8 months ago (2012-04-27 02:24:37 UTC) #2
sky
I didn't make it very far. Before I continue with this could you outline how ...
8 years, 8 months ago (2012-04-27 15:47:56 UTC) #3
pkotwicz
This is how I suggest we will handle change in DPI 1) Add a method ...
8 years, 8 months ago (2012-04-27 16:14:32 UTC) #4
pkotwicz
http://codereview.chromium.org/10245003/diff/6001/ui/gfx/image/image_skia.h File ui/gfx/image/image_skia.h (right): http://codereview.chromium.org/10245003/diff/6001/ui/gfx/image/image_skia.h#newcode35 ui/gfx/image/image_skia.h:35: ImageSkia(const SkBitmap& bitmap); This cannot be explicit. In this ...
8 years, 8 months ago (2012-04-27 16:14:40 UTC) #5
sky
Instead of this how about this. Add a resource id to ImageSkia. It's id of ...
8 years, 8 months ago (2012-04-27 17:57:01 UTC) #6
pkotwicz
To paraphrase, ImageSkia will inherit from MonitorObserver. Upon detecting a scale change, ImageSkia will query ...
8 years, 8 months ago (2012-04-27 20:19:12 UTC) #7
pkotwicz
The reason that I had ImageSkia know about multiple images is that NSImage on the ...
8 years, 8 months ago (2012-04-27 20:23:24 UTC) #8
sky
Close. I don't want ImageSkia to be a MonitorObserver, that's just tooooooo many MonitorObservers. What ...
8 years, 8 months ago (2012-04-27 20:38:21 UTC) #9
sky
I get why multiple images is nice, but I don't think we need it and ...
8 years, 8 months ago (2012-04-27 20:39:12 UTC) #10
pkotwicz
I think we will still need a structure which contains multiple images. There was one ...
8 years, 8 months ago (2012-04-27 21:39:57 UTC) #11
sky
http://codereview.chromium.org/10245003/diff/6001/ui/gfx/canvas.cc File ui/gfx/canvas.cc (right): http://codereview.chromium.org/10245003/diff/6001/ui/gfx/canvas.cc#newcode269 ui/gfx/canvas.cc:269: if (image.ShouldBuildMipMap()) Can we hide this in ImageSkia? By ...
8 years, 8 months ago (2012-04-27 23:33:58 UTC) #12
tfarina
http://codereview.chromium.org/10245003/diff/6001/ui/gfx/image/image_skia.h File ui/gfx/image/image_skia.h (right): http://codereview.chromium.org/10245003/diff/6001/ui/gfx/image/image_skia.h#newcode76 ui/gfx/image/image_skia.h:76: bool isNull() const { return storage_ == NULL; } ...
8 years, 7 months ago (2012-04-30 00:14:58 UTC) #13
pkotwicz
Changes kind of as requested. A couple differences: I would like to be able to ...
8 years, 7 months ago (2012-04-30 20:27:07 UTC) #14
tfarina
Why is ImageSkia replacing SkBitmap? Can we have a bug filed for this with the ...
8 years, 7 months ago (2012-04-30 20:36:48 UTC) #15
sky
http://codereview.chromium.org/10245003/diff/6001/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): http://codereview.chromium.org/10245003/diff/6001/ui/gfx/image/image_skia.cc#newcode43 ui/gfx/image/image_skia.cc:43: std::vector<const SkBitmap*> bitmaps_; On 2012/04/30 20:27:07, pkotwicz wrote: > ...
8 years, 7 months ago (2012-04-30 21:03:32 UTC) #16
sky
Also, I'm ok with transitional APIs, but they need to be clearly marked as such ...
8 years, 7 months ago (2012-04-30 21:07:24 UTC) #17
oshima
I have a couple of question I want to ask offline. I'll ping you later. ...
8 years, 7 months ago (2012-04-30 21:10:08 UTC) #18
pkotwicz
Marked transitional APIs as such. I would rather convert the vector of SkBitmap* to SkBitmap ...
8 years, 7 months ago (2012-05-01 17:50:32 UTC) #19
sky
On Tue, May 1, 2012 at 10:50 AM, <pkotwicz@chromium.org> wrote: > Marked transitional APIs as ...
8 years, 7 months ago (2012-05-01 18:17:48 UTC) #20
pkotwicz
I think I would have to deprecate ImageSkia::ImageSkia(SkBitmap*) in order to convert the vector to ...
8 years, 7 months ago (2012-05-01 18:58:46 UTC) #21
sky
On Tue, May 1, 2012 at 11:58 AM, <pkotwicz@chromium.org> wrote: > I think I would ...
8 years, 7 months ago (2012-05-01 19:09:04 UTC) #22
pkotwicz
Changed vector to be of SkBitmap instead of SkBitmap* Fixed up unittests
8 years, 7 months ago (2012-05-04 19:44:05 UTC) #23
sky
http://codereview.chromium.org/10245003/diff/30002/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): http://codereview.chromium.org/10245003/diff/30002/ui/gfx/image/image_skia.cc#newcode33 ui/gfx/image/image_skia.cc:33: void set_size(gfx::Size size) { size_ = size; } const ...
8 years, 7 months ago (2012-05-04 20:12:24 UTC) #24
pkotwicz
http://codereview.chromium.org/10245003/diff/30002/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): http://codereview.chromium.org/10245003/diff/30002/ui/gfx/image/image_skia.cc#newcode106 ui/gfx/image/image_skia.cc:106: if (isNull()) Right now we assume that bitmap sizes ...
8 years, 7 months ago (2012-05-04 22:35:36 UTC) #25
sky
http://codereview.chromium.org/10245003/diff/30002/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): http://codereview.chromium.org/10245003/diff/30002/ui/gfx/image/image_skia.cc#newcode106 ui/gfx/image/image_skia.cc:106: if (isNull()) On 2012/05/04 22:35:36, pkotwicz wrote: > Right ...
8 years, 7 months ago (2012-05-04 23:41:42 UTC) #26
pkotwicz
8 years, 7 months ago (2012-05-05 00:37:37 UTC) #27
Robert Sesek
Thanks for doing this, btw! http://codereview.chromium.org/10245003/diff/42003/skia/ext/skia_utils_mac.mm File skia/ext/skia_utils_mac.mm (right): http://codereview.chromium.org/10245003/diff/42003/skia/ext/skia_utils_mac.mm#newcode260 skia/ext/skia_utils_mac.mm:260: scoped_nsobject<NSBitmapImageRep> bitmap( nit: over-indented ...
8 years, 7 months ago (2012-05-05 02:08:34 UTC) #28
pkotwicz
Changes as requested http://codereview.chromium.org/10245003/diff/42003/ui/gfx/image/image_skia.cc File ui/gfx/image/image_skia.cc (right): http://codereview.chromium.org/10245003/diff/42003/ui/gfx/image/image_skia.cc#newcode27 ui/gfx/image/image_skia.cc:27: void add_bitmap(const SkBitmap& bitmap) { On ...
8 years, 7 months ago (2012-05-08 22:10:14 UTC) #29
sky
http://codereview.chromium.org/10245003/diff/30004/chrome/browser/themes/browser_theme_pack.cc File chrome/browser/themes/browser_theme_pack.cc (right): http://codereview.chromium.org/10245003/diff/30004/chrome/browser/themes/browser_theme_pack.cc#newcode318 chrome/browser/themes/browser_theme_pack.cc:318: const SkBitmap bitmap = src_bitmaps[i]; const SkBitmap& http://codereview.chromium.org/10245003/diff/30004/ui/base/resource/resource_bundle.cc File ...
8 years, 7 months ago (2012-05-08 22:38:07 UTC) #30
Robert Sesek
http://codereview.chromium.org/10245003/diff/30004/chrome/browser/themes/browser_theme_pack.cc File chrome/browser/themes/browser_theme_pack.cc (right): http://codereview.chromium.org/10245003/diff/30004/chrome/browser/themes/browser_theme_pack.cc#newcode998 chrome/browser/themes/browser_theme_pack.cc:998: const gfx::ImageSkia* image_to_tint = (it->second)->ToImageSkia(); nit: don't need () ...
8 years, 7 months ago (2012-05-08 23:30:46 UTC) #31
pkotwicz
Changes as requested
8 years, 7 months ago (2012-05-08 23:58:49 UTC) #32
sky
LGTM
8 years, 7 months ago (2012-05-09 03:21:13 UTC) #33
Robert Sesek
LGTM % one question http://codereview.chromium.org/10245003/diff/30009/ui/gfx/image/image.cc File ui/gfx/image/image.cc (left): http://codereview.chromium.org/10245003/diff/30009/ui/gfx/image/image.cc#oldcode390 ui/gfx/image/image.cc:390: CHECK(internal::NSImageToSkBitmaps(nsimage_rep->image(), &bitmaps)); Could removing this ...
8 years, 7 months ago (2012-05-09 15:34:12 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkotwicz@chromium.org/10245003/38006
8 years, 7 months ago (2012-05-09 16:51:39 UTC) #35
commit-bot: I haz the power
Can't apply patch for file ui/base/resource/resource_bundle.cc. While running patch -p1 --forward --force; patching file ui/base/resource/resource_bundle.cc ...
8 years, 7 months ago (2012-05-09 16:51:56 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkotwicz@chromium.org/10245003/35009
8 years, 7 months ago (2012-05-09 23:48:37 UTC) #37
commit-bot: I haz the power
Try job failure for 10245003-35009 (retry) on mac_rel for step "compile" (clobber build). It's a ...
8 years, 7 months ago (2012-05-10 00:15:36 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkotwicz@chromium.org/10245003/50004
8 years, 7 months ago (2012-05-10 01:58:01 UTC) #39
commit-bot: I haz the power
Try job failure for 10245003-50004 (retry) on win for step "compile" (clobber build). It's a ...
8 years, 7 months ago (2012-05-10 02:20:21 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkotwicz@chromium.org/10245003/50004
8 years, 7 months ago (2012-05-10 03:13:56 UTC) #41
commit-bot: I haz the power
Try job failure for 10245003-50004 (retry) on win_rel for step "compile" (clobber build). It's a ...
8 years, 7 months ago (2012-05-10 03:35:47 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkotwicz@chromium.org/10245003/47010
8 years, 7 months ago (2012-05-10 03:51:27 UTC) #43
commit-bot: I haz the power
Try job failure for 10245003-47010 (retry) on android for steps "Compile, build". It's a second ...
8 years, 7 months ago (2012-05-10 04:02:07 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkotwicz@chromium.org/10245003/31048
8 years, 7 months ago (2012-05-10 04:48:21 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkotwicz@chromium.org/10245003/31048
8 years, 7 months ago (2012-05-10 13:33:56 UTC) #46
commit-bot: I haz the power
Change committed as 136304
8 years, 7 months ago (2012-05-10 15:06:59 UTC) #47
reed1
We are seeing some leaked bitmaps now http://code.google.com/p/chromium/issues/detail?id=127717 Don't know what the cause it, but ...
8 years, 7 months ago (2012-05-11 13:57:09 UTC) #48
sky
In the bug you mention this could be either a Skia roll or Peters changes. ...
8 years, 7 months ago (2012-05-11 16:31:41 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkotwicz@chromium.org/10245003/35033
8 years, 7 months ago (2012-05-16 19:42:33 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pkotwicz@chromium.org/10245003/31054
8 years, 7 months ago (2012-05-16 19:44:12 UTC) #51
commit-bot: I haz the power
8 years, 7 months ago (2012-05-16 21:30:18 UTC) #52
Change committed as 137520

Powered by Google App Engine
This is Rietveld 408576698