> > I don't want to remove > > the cairoSurfaceSetFilter function; however the cairo_pattern usually > > hasn't been created yet (and won't be created until the drawPixels or > > drawSurface function), so I'm not sure how to make SurfaceSetFilter do > > anything useful... > > Why is cairoSurfaceSetFilter needed? Should it just be removed?
The java call, Graphics2D.setRenderingHints(), loosely corresponds to the cairo call, cairo_pattern_set_filter(), so it feels sensible to have a JNI method to bridge the two... but functionally it's a bit difficult to manage. If no one has any objection to removing cairoSurfaceSetFilter (as is done in the proposed patch), though, then I'll go with it =) > > + else if > > (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY)) > > + return 3; // CAIRO_FILTER_BEST > > + > > + else if > > (hints.containsValue(RenderingHints.VALUE_ALPHA_INTERPOLATION_DEFAULT)) > > + return 4; // CAIRO_FILTER_GOOD > > These could be made static consts. Right. Now, these constants correspond to an enum in our native code; there isn't any way of sharing the two, is there, or do we just put comments in the java reminding people of the corresponding native enum? Thanks, Francis