In libpr0n's imgFrame USE_WIN_SURFACES is currently a #define. For D2D we don't want this to be used though, and we want to be able to switch to D2D based on a pref. Therefor windows surface usage should not be compile time switched.
Created attachment 418217 [details] [diff] [review] make USE_WIN_SURFACE a global variable
Created attachment 418234 [details] [diff] [review] make USE_WIN_SURFACE a global variable v2 The previous patch a) didn't compile and b) wasn't really that good anyways. Here's a better one.
Comment on attachment 418234 [details] [diff] [review] make USE_WIN_SURFACE a global variable v2 We should be able to just test the global in ShouldUseImageSurface() and avoid change the preprocessor define and all that other code churn.
Created attachment 426316 [details] [diff] [review] Keep USE_WIN_SURFACE; add a global variable controlling it Address comments; makes this patch much simpler.
why is that variable not controlled by the render mode?
It will be, eventually. Probably as a follow-up to this patch.
As jrmuizel suggested, a better way is to use the ShouldUseImageSurfaces function which is already around. And the easiest way is to check the RenderMode from there directly, without a global. The D2D bug 527707 now contains a patch that does this.