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

Issue 1056673002: Make SkFunction copyable so it can go in containers. (Closed)

Created:
5 years, 8 months ago by mtklein_C
Modified:
5 years, 7 months ago
Reviewers:
bungeman-skia, mtklein
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Make SkFunction copyable so it can go in containers. This totally overhauls the implementation to use ordinary inheritance-based type erasure. I give up for now getting my manual vtable shenanigans to work with MSVC. Still those same "expected ; before ), also expected ) before ;" errors. I added support for uninitialized SkFunctions and operator=(), because it was fairly straightforward with this implementation. The main downside here is that I've removed the inline implementation. All SkFunctions involve a heap allocation, even when just wrapping function pointers. BUG=skia: Committed: https://skia.googlesource.com/skia/+/0d992db1cf5003340409ed02993266004cc0a57c

Patch Set 1 #

Patch Set 2 : tidier #

Patch Set 3 : compiling #

Patch Set 4 : is it this? #

Patch Set 5 : prune down to minimum feature set #

Patch Set 6 : real vtables #

Patch Set 7 : FnPtrImpl #

Patch Set 8 : TODO #

Patch Set 9 : TODOs #

Total comments: 6

Patch Set 10 : ben #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -80 lines) Patch
M src/core/SkFunction.h View 1 2 3 4 5 6 7 8 9 1 chunk +39 lines, -65 lines 0 comments Download
M tests/FunctionTest.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +34 lines, -15 lines 0 comments Download

Messages

Total messages: 40 (17 generated)
mtklein_C
5 years, 8 months ago (2015-04-01 21:30:43 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1056673002/20001
5 years, 8 months ago (2015-04-01 21:31:15 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/1056673002/40001
5 years, 8 months ago (2015-04-01 21:49:58 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1056673002/60001
5 years, 8 months ago (2015-04-01 21:56:01 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: Build-Win-MSVC-x86-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86-Debug-Trybot/builds/308)
5 years, 8 months ago (2015-04-01 22:15:20 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1056673002/80001
5 years, 8 months ago (2015-04-01 22:48:42 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot on client.skia (JOB_FAILED, http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-Trybot/builds/101) Build-Ubuntu-Clang-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, ...
5 years, 8 months ago (2015-04-01 22:50:17 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1056673002/60001
5 years, 7 months ago (2015-05-05 20:17:11 UTC) #17
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86-Debug-Trybot/builds/871)
5 years, 7 months ago (2015-05-05 20:20:51 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/1056673002/100001
5 years, 7 months ago (2015-05-05 22:14:24 UTC) #21
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86_64-Debug-Trybot/builds/891)
5 years, 7 months ago (2015-05-05 22:18:40 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1056673002/120001
5 years, 7 months ago (2015-05-06 13:27:21 UTC) #25
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 7 months ago (2015-05-06 13:33:24 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1056673002/180001
5 years, 7 months ago (2015-05-06 13:55:03 UTC) #29
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 7 months ago (2015-05-06 14:00:53 UTC) #31
mtklein
Righto Ben, PTAL if you can. I've given up fighting MSVC and fallen back to ...
5 years, 7 months ago (2015-05-06 14:04:10 UTC) #32
bungeman-skia
https://codereview.chromium.org/1056673002/diff/180001/src/core/SkFunction.h File src/core/SkFunction.h (right): https://codereview.chromium.org/1056673002/diff/180001/src/core/SkFunction.h#newcode24 src/core/SkFunction.h:24: SkFunction(const Fn& fn) : fFunction(SkNEW_ARGS(LambdaImpl<Fn>, (fn))) {} It's been ...
5 years, 7 months ago (2015-05-06 14:16:31 UTC) #33
bungeman-skia
https://codereview.chromium.org/1056673002/diff/180001/src/core/SkFunction.h File src/core/SkFunction.h (right): https://codereview.chromium.org/1056673002/diff/180001/src/core/SkFunction.h#newcode30 src/core/SkFunction.h:30: if (other.fFunction) { If the other guy doesn't have ...
5 years, 7 months ago (2015-05-06 14:18:26 UTC) #34
mtklein
https://codereview.chromium.org/1056673002/diff/180001/src/core/SkFunction.h File src/core/SkFunction.h (right): https://codereview.chromium.org/1056673002/diff/180001/src/core/SkFunction.h#newcode24 src/core/SkFunction.h:24: SkFunction(const Fn& fn) : fFunction(SkNEW_ARGS(LambdaImpl<Fn>, (fn))) {} On 2015/05/06 ...
5 years, 7 months ago (2015-05-06 14:22:10 UTC) #35
bungeman-skia
Maybe with vc++14 something sane will be possible for the small function optimization. lgtm
5 years, 7 months ago (2015-05-06 14:31:32 UTC) #36
mtklein
On 2015/05/06 14:31:32, bungeman1 wrote: > Maybe with vc++14 something sane will be possible for ...
5 years, 7 months ago (2015-05-06 14:34:31 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1056673002/200001
5 years, 7 months ago (2015-05-06 14:34:50 UTC) #39
commit-bot: I haz the power
5 years, 7 months ago (2015-05-06 14:40:29 UTC) #40
Message was sent while issue was closed.
Committed patchset #10 (id:200001) as
https://skia.googlesource.com/skia/+/0d992db1cf5003340409ed02993266004cc0a57c

Powered by Google App Engine
This is Rietveld 408576698