mozilla :: #apz

6 Jan 2017
16:41katsbotond: ping
17:46botondkats-afk: pong
19:03botond(kats: pong again)
19:04katsbotond: hey, were you able to reproduce the google sheets thing?
19:04botondkats: not yet. was going to try and install windows 10 today
19:04katsbotond: ok
19:05katsbotond: i just wasn't sure how much time i should spend digging into it, if you're going to investigate it anyway
19:06botondkats: if i can repro on windows 10, i'm happy to pick up the investigation
19:06katsbotond: sounds good, i'll hold off on spending more time on it until you do that
20:31rbarkerbotond: ping?
20:31botondrbarker: pong
20:32rbarkerbotond: I have C++ question I was hoping you might be able to answer.
20:32botondrbarker: sure
20:32rbarkerbotond: I'll do my best to describe it:
20:33rbarkerI'm trying to use NewRunnableMethod to wrap a member function for dispatch on a different thread.
20:33rbarkerNow NewRunnableMethod needs "this" to be ref counted.
20:34rbarkerThe problem is that the member function I'm trying to call is defined on the parent class which is not ref counted.
20:35rbarkerAnd the compiler is converting "this" to the parent class for instantiation.
20:35rbarkerI can't figure out how to give the compiler a hint to use the child class that is ref counted in the template instantiation.
20:36botondrbarker: can you post (or link to) the call you're trying to make?
20:37rbarkerbotond: So I have a patch where I did a work around in
20:38rbarkerbotond: my work around was to create a function called DoInvalidateAndRender which calls the funciton InvalidateAndRender in the parent class.
20:39rbarkerbotond: but I would obviously like to be able to just pass InvalidateAndRender in so I don't need the wrapper.
20:40botondrbarker: what is the parent class?\
20:40rbarkerbotond: I tried scoping the function as well as adding a using PUICompositorControllerChild::InvalidateAndRender in UICompositorControllerChild.h
20:41rbarkerwhich is an ipdl class.
20:41rbarkerdefined in this patch:
20:41botondrbarker: casting the pointer at the call site should work, but i'm not sure if that would be an improvement
20:43rbarkerbotond: I was hoping there was a hint I could give the compiler since it is being a little "helpful".
20:43botondrbarker: that is, instead of passing &PUiCompositorControllerChild::InvalidateAndRender, you could pass (void(UiCompositorControllerChild::*)(const int64_t&))&PUiCompositorControllerChild::InvalidateAndRender
20:43botondrbarker: but that's pretty gross
20:44rbarkerbotond: well let me see if that will work...
20:46rbarkerbotond: Well that does work :)
20:47rbarkerI guess it is better than having a wrapper I guess :) (a little at least)
20:47botondrbarker: you can make it slightly nicer by introducing a utility functin to deduce the signature
20:48botondrbarker: that is, given the following utility function:
20:48botondrbarker: you can write it as AsDerivedFn<UiCompositorControllerChild>(&PUiCompositorControllerChild::InvalidateAndRender)
20:49rbarkerbotond: Hm, but now we have more code that just wrapping in the Do function I created :/
20:49botondrbarker: but the utility function can live in ${general_place} and be reused by others in a similar situations :)
20:51rbarkerbotond: ah okay. I think I will file it as a follow up though as I want to get this patch landed and putting it in a general place will probably take review time of some one very busy :)
20:51botondrbarker: now, in theory, one ought to be able to use some template-foo to modify NewRunnableMethod to Just Accept &PUiCompositorControllerChild::InvalidateAndRender
20:52rbarkerbotond: that is way outside of my template comprehension sphere :)
20:52botondrbarker: if you file a follow-up for that, i can give that a try
20:52botondrbarker: but for now you should probably go with one of the mentioned workarounds
20:52rbarkerbotond: Okay, thanks, I&#39;ll file it now and cc you on it.
20:53rbarkerbotond: I think I just leave the wrapper function since that is the code I already have and have tested.
20:53rbarkerbotond: thanks.
21:06rbarkerbotond: Bug 1329319 I hope the description makes sense :)
21:06firebot NEW, Find a solution for using NewRunnableMethod where the member function is defined on a class that is
21:31rbarkerbotond: Do the layer ids start at 0 or 1? I just realized I assumed 0 was invalid but am having trouble finding where they are allocated. Since they are an int64_t I realized invalid *could* be -1.
21:34botondrbarker: i believe they&#39;re allocated here:
21:35botondrbarker: and since mNextLayerTreeId starts at 0 and the function returns ++mNextLayerTreeId, they should start at 1
21:35rbarkerbotond: thanks!
7 Jan 2017
No messages
Last message: 10 days and 20 hours ago