Excerpts from Albert Astals Cid's message of mar ene 25 21:05:46 +0100 2011:
> A Dimarts, 25 de gener de 2011, Adrian Johnson va escriure:
> > On 25/01/11 00:56, Thomas Freitag wrote:
> > > I had a quick look at what Adrian has done in Gfc.cc, and think, that is
> > > a little bit misusing of out->gouraudTriangleShadedFill( state, shading)
> > > and out->patchMeshShadedFill( state, shading):
> > >
> > > When these functions returns gTrue, this indicates that all work has
> > > already be done in the output device. How Adrian implements it is very
> > > special to Cairo. But it is quite ease to change it:
> > > Just move the lines
> > >
> > > + double xMin, yMin, xMax, yMax;
> > > +
> > > + // get the clip region bbox
> > > + state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
> > > + state->moveTo(xMin, yMin);
> > > + state->lineTo(xMin, yMax);
> > > + state->lineTo(xMax, yMax);
> > > + state->lineTo(xMax, yMin);
> > > + state->closePath();
> > > + if (!contentIsHidden())
> > > + out->fill(state);
> > > + state->clearPath();
> > >
> > > to CairoOutputDev::gouraudTriangleShadedFill respectively to
> > > CairoOutputDev::patchMeshShadedFill, i.e. if the actual implementation
> > > of gouraudTriangleShadedFill in CairoUtputDev would be renamed to
> > > formerGouraudTriangleShadedFill then do it like
> > >
> > > GBool CairoOutputDev::gouraudTriangleShadedFill(GfxState *state,
> > > GfxGouraudTriangleShading *shading) {
> > >
> > > if (formerGouraudTriangleShadedFill(state, shading)) {
> > >
> > > double xMin, yMin, xMax, yMax;
> > >
> > > // get the clip region bbox
> > > state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
> > > state->moveTo(xMin, yMin);
> > > state->lineTo(xMin, yMax);
> > > state->lineTo(xMax, yMax);
> > > state->lineTo(xMax, yMin);
> > > state->closePath();
> > > fill(state);
> > > state->clearPath();
> > > return gTrue;
> > >
> > > } else
> > >
> > > return gFalse;
> > >
> > > }
> > >
> > > patchMeshShadedFill simular. Then You don't need to change Gfx, and it
> > > fits to the other shading routines.
> >
> > I'm attaching a new patch that moves the fill into the cairo backend.
>
> Pending the discussion if we really need to do anything or not if content is
> hidden (i'd vote for no but not really strong) this patch looks good to me.Ok, I'll push the patch and change axial and radial gradients to also return early when content is hidden. Ok? > Albert -- Carlos Garcia Campos PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462
signature.asc
Description: PGP signature
_______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
