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

Issue 1900953004: Switch DrawImage to sk_sp<> (Closed)

Created:
4 years, 8 months ago by tomhudson
Modified:
4 years, 8 months ago
Reviewers:
danakj, f(malita), vmpstr
CC:
chromium-reviews, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Switch DrawImage to sk_sp<> As suggested in https://codereview.chromium.org/1869753003/, converts DrawImage to storing and returning sk_sp<const SkImage> instead of const SkImage*. BUG=skia:5077 R=danakj@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/836d81873a23b3f3ad1fae3c3a96f7722df07510 Cr-Commit-Position: refs/heads/master@{#389264}

Patch Set 1 #

Patch Set 2 : Remove a RefPtr from the software image decode controller #

Patch Set 3 : converting out of and back into smart pointer can underflow refcnt #

Patch Set 4 : that goes for * as well as & #

Patch Set 5 : ...even outside SoftwareImageDecodeController #

Patch Set 6 : rebase #

Patch Set 7 : don't leak GrContextThreadSafeProxy #

Total comments: 55

Patch Set 8 : review (1/2) #

Patch Set 9 : review (2/2) #

Total comments: 20

Patch Set 10 : vmpstr's nits #

Patch Set 11 : std::move() to const& returns #

Total comments: 1

Patch Set 12 : Florin's nit #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+430 lines, -418 lines) Patch
M cc/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M cc/cc.gyp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/picture_layer_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -2 lines 0 comments Download
M cc/output/renderer_pixeltest.cc View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -4 lines 0 comments Download
M cc/playback/decoded_draw_image.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +11 lines, -18 lines 0 comments Download
A cc/playback/decoded_draw_image.cc View 1 2 3 4 5 6 7 1 chunk +30 lines, -0 lines 0 comments Download
M cc/playback/discardable_image_map.h View 3 chunks +3 lines, -3 lines 0 comments Download
M cc/playback/discardable_image_map.cc View 1 2 3 4 5 6 7 5 chunks +9 lines, -9 lines 0 comments Download
M cc/playback/discardable_image_map_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 14 chunks +31 lines, -31 lines 0 comments Download
M cc/playback/draw_image.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +6 lines, -3 lines 0 comments Download
M cc/playback/draw_image.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -9 lines 0 comments Download
M cc/playback/image_hijack_canvas.cc View 1 2 3 4 5 6 7 5 chunks +8 lines, -8 lines 0 comments Download
M cc/playback/raster_source_unittest.cc View 1 2 3 4 5 6 7 8 7 chunks +12 lines, -14 lines 0 comments Download
M cc/playback/recording_source_unittest.cc View 1 2 3 4 5 6 7 8 19 chunks +38 lines, -45 lines 0 comments Download
M cc/test/fake_content_layer_client.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -9 lines 0 comments Download
M cc/test/fake_content_layer_client.cc View 1 2 3 4 5 6 7 8 4 chunks +8 lines, -10 lines 0 comments Download
M cc/test/fake_recording_source.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +9 lines, -6 lines 0 comments Download
M cc/test/skia_common.h View 2 chunks +2 lines, -3 lines 0 comments Download
M cc/test/skia_common.cc View 2 chunks +3 lines, -6 lines 0 comments Download
M cc/tiles/gpu_image_decode_controller.h View 4 chunks +4 lines, -4 lines 0 comments Download
M cc/tiles/gpu_image_decode_controller.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +13 lines, -16 lines 0 comments Download
M cc/tiles/gpu_image_decode_controller_unittest.cc View 1 2 3 4 5 16 chunks +59 lines, -60 lines 0 comments Download
M cc/tiles/software_image_decode_controller.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +10 lines, -8 lines 1 comment Download
M cc/tiles/software_image_decode_controller.cc View 1 2 3 4 5 6 7 8 9 9 chunks +20 lines, -19 lines 0 comments Download
M cc/tiles/software_image_decode_controller_unittest.cc View 1 2 3 4 5 44 chunks +127 lines, -128 lines 0 comments Download
M cc/tiles/tile_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -3 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 52 (20 generated)
tomhudson
Dana, is this what you were asking for with your request to make image.image() return ...
4 years, 8 months ago (2016-04-19 19:17:23 UTC) #3
tomhudson
Notes from last night's debugging: the GetDecodedImageForDraw() unit test is setting up at least 4 ...
4 years, 8 months ago (2016-04-20 12:14:52 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1900953004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1900953004/80001
4 years, 8 months ago (2016-04-20 14:49:16 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/162576) mac_chromium_rel_ng on ...
4 years, 8 months ago (2016-04-20 14:51:32 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1900953004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1900953004/100001
4 years, 8 months ago (2016-04-20 16:21:53 UTC) #11
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-generic_chromium_compile_only_ng/builds/124873)
4 years, 8 months ago (2016-04-20 16:29:55 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1900953004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1900953004/120001
4 years, 8 months ago (2016-04-20 17:29:11 UTC) #15
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/200790)
4 years, 8 months ago (2016-04-20 18:45:08 UTC) #17
tomhudson
PTAL. I think this would *also* let us get rid of ImageDecodeTaskImpl::image_ref_, since DrawImage objects ...
4 years, 8 months ago (2016-04-20 18:45:34 UTC) #18
danakj
Thanks! Looks good, we can go a bit further, and reduce some ref churn in ...
4 years, 8 months ago (2016-04-20 20:02:20 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1900953004/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1900953004/140001
4 years, 8 months ago (2016-04-21 14:17:12 UTC) #21
tomhudson
(easy parts) https://codereview.chromium.org/1900953004/diff/120001/cc/playback/decoded_draw_image.cc File cc/playback/decoded_draw_image.cc (right): https://codereview.chromium.org/1900953004/diff/120001/cc/playback/decoded_draw_image.cc#newcode21 cc/playback/decoded_draw_image.cc:21: : image_(image), On 2016/04/20 20:02:18, danakj wrote: ...
4 years, 8 months ago (2016-04-21 14:17:25 UTC) #22
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/54172) android_clang_dbg_recipe on ...
4 years, 8 months ago (2016-04-21 14:27:59 UTC) #24
tomhudson
https://codereview.chromium.org/1900953004/diff/120001/cc/layers/picture_layer_unittest.cc File cc/layers/picture_layer_unittest.cc (right): https://codereview.chromium.org/1900953004/diff/120001/cc/layers/picture_layer_unittest.cc#newcode305 cc/layers/picture_layer_unittest.cc:305: client.add_draw_image(CreateDiscardableImage(layer_size).get(), gfx::Point(), On 2016/04/20 20:02:18, danakj wrote: > pass ...
4 years, 8 months ago (2016-04-21 14:37:50 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1900953004/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1900953004/160001
4 years, 8 months ago (2016-04-21 14:38:18 UTC) #27
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/57868)
4 years, 8 months ago (2016-04-21 16:55:23 UTC) #29
tomhudson
linux_android_rel_ng looks like a bot infra issue; after the 2nd review patchset I now think ...
4 years, 8 months ago (2016-04-21 17:22:14 UTC) #31
vmpstr
https://codereview.chromium.org/1900953004/diff/160001/cc/tiles/gpu_image_decode_controller.cc File cc/tiles/gpu_image_decode_controller.cc (right): https://codereview.chromium.org/1900953004/diff/160001/cc/tiles/gpu_image_decode_controller.cc#newcode684 cc/tiles/gpu_image_decode_controller.cc:684: SkPixmap p(image_info, image_data->decode.data->data(), nit: pixmap instead of p https://codereview.chromium.org/1900953004/diff/160001/cc/tiles/software_image_decode_controller.cc ...
4 years, 8 months ago (2016-04-21 18:40:58 UTC) #33
tomhudson
On 2016/04/21 18:40:58, vmpstr wrote: > https://codereview.chromium.org/1900953004/diff/160001/cc/tiles/gpu_image_decode_controller.cc#newcode684 > cc/tiles/gpu_image_decode_controller.cc:684: SkPixmap p(image_info, > image_data->decode.data->data(), > nit: ...
4 years, 8 months ago (2016-04-21 19:03:27 UTC) #34
f(malita)
https://codereview.chromium.org/1900953004/diff/160001/cc/playback/decoded_draw_image.h File cc/playback/decoded_draw_image.h (right): https://codereview.chromium.org/1900953004/diff/160001/cc/playback/decoded_draw_image.h#newcode44 cc/playback/decoded_draw_image.h:44: sk_sp<const SkImage> image_; I'm generally wary of sk_sp<const SkFoo>, ...
4 years, 8 months ago (2016-04-21 19:50:56 UTC) #35
danakj
https://codereview.chromium.org/1900953004/diff/120001/cc/playback/decoded_draw_image.h File cc/playback/decoded_draw_image.h (right): https://codereview.chromium.org/1900953004/diff/120001/cc/playback/decoded_draw_image.h#newcode29 cc/playback/decoded_draw_image.h:29: sk_sp<const SkImage> image() const { return image_; } On ...
4 years, 8 months ago (2016-04-21 20:01:31 UTC) #36
vmpstr
On 2016/04/21 19:03:27, tomhudson wrote: > On 2016/04/21 18:40:58, vmpstr wrote: > > > > ...
4 years, 8 months ago (2016-04-21 20:15:48 UTC) #37
f(malita)
https://codereview.chromium.org/1900953004/diff/120001/cc/playback/decoded_draw_image.h File cc/playback/decoded_draw_image.h (right): https://codereview.chromium.org/1900953004/diff/120001/cc/playback/decoded_draw_image.h#newcode29 cc/playback/decoded_draw_image.h:29: sk_sp<const SkImage> image() const { return image_; } On ...
4 years, 8 months ago (2016-04-21 20:23:39 UTC) #38
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1900953004/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1900953004/200001
4 years, 8 months ago (2016-04-21 20:31:05 UTC) #40
tomhudson
OK, I guess I know which side of the sleepy debate Florin is on now. ...
4 years, 8 months ago (2016-04-21 20:31:22 UTC) #41
f(malita)
non-owner lgtm https://codereview.chromium.org/1900953004/diff/200001/cc/playback/discardable_image_map_unittest.cc File cc/playback/discardable_image_map_unittest.cc (right): https://codereview.chromium.org/1900953004/diff/200001/cc/playback/discardable_image_map_unittest.cc#newcode346 cc/playback/discardable_image_map_unittest.cc:346: generator.canvas()->drawImage(discardable_image.get(), 0, 0, nullptr); nit: we can ...
4 years, 8 months ago (2016-04-21 20:49:13 UTC) #42
danakj
LGTM https://codereview.chromium.org/1900953004/diff/220001/cc/tiles/software_image_decode_controller.h File cc/tiles/software_image_decode_controller.h (right): https://codereview.chromium.org/1900953004/diff/220001/cc/tiles/software_image_decode_controller.h#newcode219 cc/tiles/software_image_decode_controller.h:219: sk_sp<const SkImage> image); I think florin was against ...
4 years, 8 months ago (2016-04-22 20:36:04 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1900953004/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1900953004/220001
4 years, 8 months ago (2016-04-22 20:46:15 UTC) #46
f(malita)
On 2016/04/22 20:36:04, danakj wrote: > LGTM > > https://codereview.chromium.org/1900953004/diff/220001/cc/tiles/software_image_decode_controller.h > File cc/tiles/software_image_decode_controller.h (right): > ...
4 years, 8 months ago (2016-04-22 20:46:59 UTC) #47
tomhudson
Thanks. > https://codereview.chromium.org/1900953004/diff/220001/cc/tiles/software_image_decode_controller.h > File cc/tiles/software_image_decode_controller.h (right): > > https://codereview.chromium.org/1900953004/diff/220001/cc/tiles/software_image_decode_controller.h#newcode219 > cc/tiles/software_image_decode_controller.h:219: sk_sp<const SkImage> image); ...
4 years, 8 months ago (2016-04-22 20:47:38 UTC) #48
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 8 months ago (2016-04-22 22:15:56 UTC) #50
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 22:17:18 UTC) #52
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/836d81873a23b3f3ad1fae3c3a96f7722df07510
Cr-Commit-Position: refs/heads/master@{#389264}

Powered by Google App Engine
This is Rietveld 408576698