|
|
Chromium Code Reviews
Descriptiondon't need gfx::Canvas and its native context to convert HBITMAP
Because we can now hold onto the hbitmap for the life of the skia_bitmap, we save a copy over the prev. impl.
BUG=675977
Review-Url: https://codereview.chromium.org/2615683002
Cr-Commit-Position: refs/heads/master@{#441684}
Committed: https://chromium.googlesource.com/chromium/src/+/35b5c4707ee990bd2280d3b43e2d9ea5a6dddcf4
Patch Set 1 #Patch Set 2 : add include #Patch Set 3 : skia::InitializeDC #
Total comments: 8
Patch Set 4 : use ScopedGetDC #Patch Set 5 : operator HDC did not get invoked, have to use .Get explicitly #Messages
Total messages: 40 (26 generated)
reed@google.com changed reviewers: + fmalita@chromium.org
The CQ bit was checked by reed@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
reed@google.com changed reviewers: + bsalomon@chromium.org, halcanary@chromium.org
reed@google.com changed reviewers: + brianosman@google.com
Description was changed from ========== don't need gfx::Canvas and its native context to convert HBITMAP BUG=675977 ========== to ========== don't need gfx::Canvas and its native context to convert HBITMAP Because we can now hold onto the hbitmap for the life of the skia_bitmap, we save a copy over the prev. impl. BUG=675977 ==========
reed@google.com changed reviewers: + dcheng@chromium.org - halcanary@chromium.org
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by reed@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by reed@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
reed@google.com changed reviewers: - brianosman@google.com
ptal
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
reed@google.com changed reviewers: + pkasting@chromium.org
need owner for ui/base/clipboard/clipboard_win.cc
Seems reasonable to me, just one comment and a question https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... File ui/base/clipboard/clipboard_win.cc (right): https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... ui/base/clipboard/clipboard_win.cc:622: HDC hdc = CreateCompatibleDC(NULL); Nit: nullptr, and use ScopedCreateDC from base/win https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... ui/base/clipboard/clipboard_win.cc:623: skia::InitializeDC(hdc); Just curious: do we need to do this if we're just going to call SetDIBitsToDevice?
https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... File ui/base/clipboard/clipboard_win.cc (right): https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... ui/base/clipboard/clipboard_win.cc:622: HDC hdc = CreateCompatibleDC(NULL); On 2017/01/04 22:25:36, dcheng wrote: > Nit: nullptr, and use ScopedCreateDC from base/win I would use it like this? ScopedCreateDC scoped(::CreateCompatibleDC(NULL)); That classes doesn't seems to do anything with selecting in and out of my hbitmap. Is it applicable in my case? https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... ui/base/clipboard/clipboard_win.cc:623: skia::InitializeDC(hdc); On 2017/01/04 22:25:36, dcheng wrote: > Just curious: do we need to do this if we're just going to call > SetDIBitsToDevice? I need to draw 'bitmap' into my dst_hbitmap. Don't I need to create a DC around dst_hbitmap to do that?
https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... File ui/base/clipboard/clipboard_win.cc (right): https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... ui/base/clipboard/clipboard_win.cc:622: HDC hdc = CreateCompatibleDC(NULL); On 2017/01/05 02:24:46, reed1 wrote: > On 2017/01/04 22:25:36, dcheng wrote: > > Nit: nullptr, and use ScopedCreateDC from base/win > > I would use it like this? ScopedCreateDC scoped(::CreateCompatibleDC(NULL)); > > That classes doesn't seems to do anything with selecting in and out of my > hbitmap. Is it applicable in my case? > Yes, it would still need to be selected, but it would automatically handle the DeleteDC call. https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... ui/base/clipboard/clipboard_win.cc:623: skia::InitializeDC(hdc); On 2017/01/05 02:24:46, reed1 wrote: > On 2017/01/04 22:25:36, dcheng wrote: > > Just curious: do we need to do this if we're just going to call > > SetDIBitsToDevice? > > I need to draw 'bitmap' into my dst_hbitmap. Don't I need to create a DC around > dst_hbitmap to do that? I think the DC should already be initialized; it looks like InitializeDC just sets up some defaults that we shouldn't have to use anyway.
https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... File ui/base/clipboard/clipboard_win.cc (right): https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... ui/base/clipboard/clipboard_win.cc:623: skia::InitializeDC(hdc); On 2017/01/05 02:39:50, dcheng wrote: > On 2017/01/05 02:24:46, reed1 wrote: > > On 2017/01/04 22:25:36, dcheng wrote: > > > Just curious: do we need to do this if we're just going to call > > > SetDIBitsToDevice? > > > > I need to draw 'bitmap' into my dst_hbitmap. Don't I need to create a DC > around > > dst_hbitmap to do that? > > I think the DC should already be initialized; it looks like InitializeDC just > sets up some defaults that we shouldn't have to use anyway. Ah, I misinterpreted your question. Got it about InitializeDC. Thanks.
The CQ bit was checked by reed@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by reed@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... File ui/base/clipboard/clipboard_win.cc (right): https://codereview.chromium.org/2615683002/diff/40001/ui/base/clipboard/clipb... ui/base/clipboard/clipboard_win.cc:622: HDC hdc = CreateCompatibleDC(NULL); On 2017/01/05 02:39:50, dcheng wrote: > On 2017/01/05 02:24:46, reed1 wrote: > > On 2017/01/04 22:25:36, dcheng wrote: > > > Nit: nullptr, and use ScopedCreateDC from base/win > > > > I would use it like this? ScopedCreateDC scoped(::CreateCompatibleDC(NULL)); > > > > That classes doesn't seems to do anything with selecting in and out of my > > hbitmap. Is it applicable in my case? > > > > Yes, it would still need to be selected, but it would automatically handle the > DeleteDC call. Done.
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by reed@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 80001, "attempt_start_ts": 1483636407761700,
"parent_rev": "73af4f477cdc6b962b8fd069353ea8df80af8491", "commit_rev":
"35b5c4707ee990bd2280d3b43e2d9ea5a6dddcf4"}
Message was sent while issue was closed.
Description was changed from ========== don't need gfx::Canvas and its native context to convert HBITMAP Because we can now hold onto the hbitmap for the life of the skia_bitmap, we save a copy over the prev. impl. BUG=675977 ========== to ========== don't need gfx::Canvas and its native context to convert HBITMAP Because we can now hold onto the hbitmap for the life of the skia_bitmap, we save a copy over the prev. impl. BUG=675977 Review-Url: https://codereview.chromium.org/2615683002 Cr-Commit-Position: refs/heads/master@{#441684} Committed: https://chromium.googlesource.com/chromium/src/+/35b5c4707ee990bd2280d3b43e2d... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as https://chromium.googlesource.com/chromium/src/+/35b5c4707ee990bd2280d3b43e2d... |
