|
|
DescriptionSK_ARRAY_COUNT shouldn't work on pointers.
Simpler version of https://codereview.chromium.org/1123923002/
BUG=skia:3593
R=brucedawson@chromium.org,reed@google.com,tfarina@chromium.org
No public API changes.
TBR=reed@google.com
Committed: https://skia.googlesource.com/skia/+/fc00a7c5015ea534b0f28f8115bfb6253d275e1e
Patch Set 1 #Patch Set 2 : count #Messages
Total messages: 22 (6 generated)
The CQ bit was checked by mtklein@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1114283003/1
mtklein@chromium.org changed reviewers: + brucedawson@chromium.org, tfarina@chromium.org - mtklein@google.com
Looks like we don't need the GCC workaround anymore?
lgtm
The CQ bit was checked by mtklein@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1114283003/20001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
fyi, looks like we don't need the workaround in Chromium either. https://codereview.chromium.org/1115993004/.
VC++ does have some known differences in its handling of templates. The VC++ team may address these in VC.Next (after VS 2015). So, don't let compiler differences be a blocker -- they are expected.
On 2015/05/06 00:20:00, brucedawson wrote: > VC++ does have some known differences in its handling of templates. The VC++ > team may address these in VC.Next (after VS 2015). So, don't let compiler > differences be a blocker -- they are expected. Sorry, I didn't follow that. Which compiler differences are you talking about? I don't see anything going wrong.
On 2015/05/06 12:55:35, mtklein wrote: > On 2015/05/06 00:20:00, brucedawson wrote: > > VC++ does have some known differences in its handling of templates. The VC++ > > team may address these in VC.Next (after VS 2015). So, don't let compiler > > differences be a blocker -- they are expected. > > Sorry, I didn't follow that. Which compiler differences are you talking about? > I don't see anything going wrong. I wasn't suggesting that there was anything wrong. I was just commenting on some mention of compiler template differences and the gcc/VC++ workaround. That's nice that the workaround doesn't seem necessary anymore.
On 2015/05/06 17:17:49, brucedawson wrote: > On 2015/05/06 12:55:35, mtklein wrote: > > On 2015/05/06 00:20:00, brucedawson wrote: > > > VC++ does have some known differences in its handling of templates. The VC++ > > > team may address these in VC.Next (after VS 2015). So, don't let compiler > > > differences be a blocker -- they are expected. > > > > Sorry, I didn't follow that. Which compiler differences are you talking > about? > > I don't see anything going wrong. > > I wasn't suggesting that there was anything wrong. I was just commenting on some > mention of compiler template differences and the gcc/VC++ workaround. > > That's nice that the workaround doesn't seem necessary anymore. Sorry... I still don't understand. What are we not letting be a blocker for what? Does this CL look correct to you?
I think the confusion arose because of the creation of a new CL. My comment was only applicable to the old CL and I didn't notice the change. lgtm.
On 2015/05/06 17:43:43, brucedawson wrote: > I think the confusion arose because of the creation of a new CL. My comment was > only applicable to the old CL and I didn't notice the change. > > lgtm. Gotcha. Thanks!
mtklein@google.com changed reviewers: + reed@google.com
+reed This doesn't change public API, but I figured you might enjoy looking at what references to arrays look like.
The "reference to array" technique can be useful elsewhere, BTW. CreateLinear, for instance could be improved by this. Currently it has this prototype: static SkShader* CreateLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkShader::TileMode mode, uint32_t flags, const SkMatrix* localMatrix); It could be changed to be like this: Template<size_t count> SkShader* CreateLinear_safe(const SkPoint (&pts)[2], const SkColor (&colors)[count], const SkScalar pos[], SkShader::TileMode mode, uint32_t flags, const SkMatrix* localMatrix) { return CreateLinear(pts, colors, pos, count, mode, flags, localMatrix); } This *_safe function guarantees that the first parameter is an array with two elements (currently any const SkPoint* will do) and it infers the size of the colors array instead of requiring that it be passed in. The original CreateLinear function can sometimes then be made private to make misuse impossible (note that it continues to be the actual implementation). Something to consider for future API design. I've had excellent luck with this in the past.
The CQ bit was checked by mtklein@google.com
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1114283003/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as https://skia.googlesource.com/skia/+/fc00a7c5015ea534b0f28f8115bfb6253d275e1e |