summaryrefslogtreecommitdiff
path: root/src/cairo-surface-fallback.c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce a new compositor architectureChris Wilson2011-09-121-1516/+47
| | | | | | | | | | | | | | | | | | Having spent the last dev cycle looking at how we could specialize the compositors for various backends, we once again look for the commonalities in order to reduce the duplication. In part this is motivated by the idea that spans is a good interface for both the existent GL backend and pixman, and so they deserve a dedicated compositor. xcb/xlib target an identical rendering system and so they should be using the same compositor, and it should be possible to run that same compositor locally against pixman to generate reference tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> P.S. This brings massive upheaval (read breakage) I've tried delaying in order to fix as many things as possible but now this one patch does far, far, far too much. Apologies in advance for breaking your favourite backend, but trust me in that the end result will be much better. :)
* stroke: Rely on the tessellator to remove self-intersectionsChris Wilson2011-08-131-60/+56
| | | | | | | | | | | | | As handling joins/caps between line segments shorter than half_line_width is tricky. Rather than also fixing the bug in traps, remove that code. The plan is to avoiding hitting the traps code, short-circuiting several steps along the fast rectangular paths. Fixes line-width-overlap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* image: move surface definition to new header for subclassingChris Wilson2011-08-131-0/+1
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Remove useless checks for NULL before freeingAndrea Canciani2011-07-311-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - }
* fallback: Prevent recursion when combining with the clipChris Wilson2011-07-291-20/+109
| | | | | | | | We need to special case the handling of unaligned clip regions in order to prevent the treatment of those as a general path requiring a clip+mask... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* composite: Pass unbounded extents to initialisationChris Wilson2011-07-261-14/+5
| | | | | | | | For an unbounded surface we cannot assume (0, 0, surface_width, surface_height) as that is wrong and causes the operation to appear clipped. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* clip: Rudimentary support for clip-polygon extractionChris Wilson2011-07-191-196/+63
| | | | | | | Step 1, fix the failings sighted recently by tracking clip-boxes as an explicit property of the clipping and of composition. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* pattern: Add observer hooksChris Wilson2011-07-151-0/+1
| | | | | | | | | In order for custom context to automatically track when a pattern is modify after being set on the context (and before it is used in an operator), we need for there to be a callback when the pattern is modified. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* polygon: Merge _cairo_polygon_init and _cairo_polygon_limitAndrea Canciani2010-12-101-4/+2
| | | | | | | _cairo_polygon_limit() had to be called immediately after _cairo_polygon_init() (or never at all). Merging the two calls is a simple way to enforce this rule.
* path: Do not access flags directlyAndrea Canciani2010-10-291-3/+3
| | | | | | | Use inline accessors to hide the flags in the code. This ensures that flags that need additional computations (example: is_rectilinear for the fill case) are always used correctly.
* Differentiate between reducing clip to composite extents and a rectangleChris Wilson2010-07-121-5/+5
| | | | | This is required for handling glyphs when rendering directly to the surface.
* fallback: Remove span renderer pathsBenjamin Otte2010-05-141-67/+0
| | | | | | | | Those paths were broken, as they didn't properly translate the polygon to the destination size. And rather than adding lots of code that allows translation, it's easier to just delete this code. Note that the only user of the code was the GL backend anyway.
* surface-fallback: Only destroy the clip after it has been initialized.Chris Wilson2010-05-071-3/+4
| | | | More memfault detected error path errors.
* surface-fallback: Handle memfaults during clipping.Chris Wilson2010-05-061-11/+15
| | | | Don't be lazy, propagate the error rather than asserting.
* fallback: Only do _fill/compsoite_rectangles on bounded sourceBenjamin Otte2010-04-291-7/+9
| | | | | For unbounded sources, these optimizations fail to take into account the regions outside the source.
* fallback: translate extents regions properlyBenjamin Otte2010-04-291-7/+10
| | | | | | | The extents clip regions that were created for unbounded operators were not translated properly. This has been changed now. This is a followup to 9ce8bef9d6e6d773dd1f4b184916ed5c96c3541d.
* fallback: Propagate extents properlyBenjamin Otte2010-04-281-34/+78
| | | | | | Otherwise unbounded operators will clear the full surface. Improves the score for the unbounded-operator test, in particular the output for the test-fallback case.
* fallback: Pass the correct extents for unbounbded operationsBenjamin Otte2010-04-281-7/+13
|
* fallback: Sanitize code that queries surface extentsBenjamin Otte2010-04-281-10/+10
| | | | | The previous code was setting extents.is_bounded, but that value has a completely different meaning.
* fallback: Fix clip_region handling in mask creationBenjamin Otte2010-04-281-1/+15
| | | | Fixes the xlib-expose-event test.
* Update FSF addressAndrea Canciani2010-04-271-1/+1
| | | | | | | | | | | I updated the Free Software Foundation address using the following script. for i in $(git grep Temple | cut -d: -f1 ) do sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i" done Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
* clip: Report the surface offset when retrieving the clip maskChris Wilson2010-04-251-10/+10
| | | | | | | | Stop the callers from guessing the origin of the clip surface by reporting it explicitly! This enables the clip to bypass any rectangles overlaid on top of the clip surface, which is common when the backends limit the clip to the extents of the operation -- but irrelevant to the actual content of the clip mask
* surface-fallback: Free traps on composite_trapezoids() errorChris Wilson2010-03-021-1/+2
|
* surface-fallback: Propagate NOTHING_TO_DOChris Wilson2010-03-021-12/+3
| | | | | NOTHING_TO_DO is converted to SUCCESS by the surface layer, so clean up the code slightly by reducing the number of checks and conversions.
* fallback: Initialize rects.is_bounded for span renderer.Chris Wilson2010-02-221-1/+2
|
* clip: Restrict composite extents to clip extentsChris Wilson2010-02-121-68/+3
| | | | Fixes test/clip-rectangle-twice.
* surface-fallback: We no longer own a reference to the clip surfaceChris Wilson2010-01-251-3/+0
| | | | | | | | | | | | | _cairo_clip_get_surface() now returns a borrowed reference to the cached surface on the clip, so we must not destroy it - as Carlos pointed out when he hit the assert: 12:55 < KaL> ickle: cairo-surface.c:595: cairo_surface_destroy: Assertion `((*&(&surface->ref_count)->ref_count) > 0)' failed. 12:56 < KaL> ickle: trying to render any pdf file with poppler glib demo after installing cairo from git master 13:00 < KaL> ickle: well, it seems it has nothing ot do with poppler, since it crashes in clearlooks src/clearlooks_draw.c:347
* surface-fallback: Convert to composite rectanglesChris Wilson2010-01-221-266/+130
|
* clip: Implement clipping using only the high-level operators.Chris Wilson2010-01-221-1/+1
| | | | | | | Revamp clipping in preparation for the removal of the low-level interface and promote backend to use the higher levels. The principle here is that the higher level interface gives the backend more scope for choosing better performing primitives.
* pattern: Add convenience patterns for stock coloursChris Wilson2010-01-221-11/+3
| | | | | | By preallocating in our data segment a couple of solid patterns for the stock colours, it becomes more convenient when using those in surface operations, such as when clearing.
* Alter definition of cairo_composite_rectangles_tChris Wilson2010-01-221-6/+7
| | | | | | | This is a more useful definition that is able to individually track the rectangles that compose the composite operation. This will be used by the specialist compositors as a means to perform the common extents determination for an operation.
* Constify stroke style and matrices.Chris Wilson2010-01-221-3/+3
| | | | | | As a simple step to ensure that we do not inadvertently modify (or at least generate compiler warns if we try) user data, mark the incoming style and matrices as constant.
* Move _cairo_error() to a standalone headerChris Wilson2010-01-221-0/+1
| | | | | A pending commit will want to include some utility code from cairo and so we need to extricate the error handling from the PLT symbol hiding.
* [gstate] Apply target device offsets to patterns immediatelyBenjamin Otte2009-10-181-35/+6
| | | | | | | | Previously target device offsets were applied in cairo-surface.c which could cause bugs when paths were taken as fallbacks, as for example pointed out by ade55037ffa596b690c6a1051394589f76eb1f48 and quick-fixed by 79190d89853958ee8252440d35a662fabf122afd. The quick-fix is now unnecessary and was removed.
* [surface] Don't AND in the desired content.Chris Wilson2009-10-161-2/+1
| | | | | | | | | | Gah, that was a horrible mistake. It was a flawed hack to create Pixmaps of the correct depth when cloning patterns for blitting to the xlib backend. However, it had the nasty side-effect of discarding alpha when targeting Window surfaces. The correct solution is to simply correct the Pixmap of the desired depth and render a matching pattern onto the surface - i.e. a reversal the current acquire -> clone. See the forthcoming revised xcb backend on how I should have done it originally.
* [fallback] Create intermediate surface with same content.Chris Wilson2009-10-161-5/+7
| | | | | | | | | | | The goal is to create a similar surface with an identical format to maximise performance in the subsequent blit, e.g. the xlib backend could make the similar surface with an identical depth and so use the core protocol, or the image surface could indeed make an identical copy so that pixman only has to do a fast memcpy. As there is no direct method to specify such a clone, we ask the backend for a similar surface of identical content, and trust that the semantics are clear enough for the intent to obvious.
* [surface] Avoid double application of device offset when calling fill()Chris Wilson2009-10-151-6/+35
| | | | | | | | | | _cairo_surface_fallback_paint() attempts to avoid a clipped operation if we can convert the paint into a fill of the clipmask. However by calling _cairo_surface_fill() we incur a double application of device offset to the source, triggering various failures. Company spotted this and managed to extract an excellent minimal test case, test/clip-device-offset. This commit fixes that failure.
* [fallback] Special case single composite rectangleChris Wilson2009-09-211-0/+42
| | | | | Avoid the overhead of region-from-traps extraction for the very frequent case of using a single (possibly clipped) rectangle with a pattern source.
* [fallback] Only eliminate the clip if the operation is boundedChris Wilson2009-09-041-15/+42
| | | | | For unbounded operations we still need to pass along the clip in order to correctly limit the extents of the operation.
* [clip] Apply surface offset when combining with clip maskChris Wilson2009-08-291-6/+2
| | | | | | In order to correctly combine the clip mask with the compositing mask the clip path must be offset so that it is relative to the destination surface.
* [clip] Pass in destination offset for combining with clip-maskChris Wilson2009-08-291-5/+9
| | | | | | When combining a clip-mask with a subsurface, as when used to combine with the composite mask, we need to pass the destination surface offset to the clip so that the paths can be corrected for the new surface.
* [fallback] Include implicit closes in the check for rectilinear pathsChris Wilson2009-08-291-2/+4
| | | | | | | | Fixes test/implicit-close By forgetting the implicit-close when checking for rectilinear paths, we tried to feed the triangle (and other diagclose) into the specialised rectilinear tesselators which completely mishandled that final edge.
* [gl] Use spans for trapezois.Chris Wilson2009-08-291-8/+2
| | | | | | | Always use spans, even for unaligned boxes. In the future (given a new interface) we may want to emit the common unaligned box code more efficient than a per-scanline computation -- but for now simply avoid the requirements to write a temporary CPU buffer.
* [fallback] Reduce paint + clipmask to fillChris Wilson2009-08-291-9/+17
| | | | | | | Under simple, yet common, conditions using a bounded operator and painting with a single complex clip we can reduce the strength of that operation to a fill. In effect this removes the need for a temporary mask for some backends (GL, drm, xlib).
* [clip] Use the rectangular tessellator to extract boxesChris Wilson2009-08-291-4/+4
|
* [tessellate] Rectangular special caseChris Wilson2009-08-291-5/+90
| | | | | | | | Add an even simpler sweep-line tessellator for rectangular trapezoids (as produced by the rectilinear stoker and box filler). This is so simple it even outperforms pixman's region validation code for the purposes of path-to-region conversion.
* [fill] Use trivial rectilinear_to_trapsChris Wilson2009-08-291-0/+14
| | | | | Avoid a small amount of unnecessary overhead by performing a simple conversion of the path to traps when it consists solely of simple boxes.
* [clip] Combine directly onto targetChris Wilson2009-08-291-24/+2
| | | | | Where it is unlikely that we will reuse the temporary clip surface, combine the clip directly with the mask.
* [clip] Use geometric clipping for unaligned clipsChris Wilson2009-08-291-123/+144
| | | | | | For the simple cases where the clip is an unaligned box (or boxes), apply the clip directly to the geometry and avoid having to use an intermediate clip-mask.
* [clip] Eliminate redundant clipsChris Wilson2009-08-291-30/+81
| | | | | | | | | First perform a simple geometric clip to catch the majority of cases where an unaligned clip has been set outside the operation extents that can be discarded without having to use an image surface. This causes a dramatic increase of over 13x for the poppler-bug-12266 trace and little impact elsewhere for more sensible clippers.