1. 22 Mar, 2010 1 commit
  2. 22 Jan, 2010 4 commits
    • Chris Wilson's avatar
      Add cairo_device_t · f617d5fc
      Chris Wilson authored
      The device is a generic method for accessing the underlying interface
      with the native graphics subsystem, typically the X connection or
      perhaps the GL context. By exposing a cairo_device_t on a surface and
      its various methods we enable finer control over interoperability with
      external interactions of the device by applications. The use case in
      mind is, for example, a multi-threaded gstreamer which needs to serialise
      its own direct access to the device along with Cairo's across many
      threads.
      
      Secondly, the cairo_device_t is a unifying API for the mismash of
      backend specific methods for controlling creation of surfaces with
      explicit devices and a convenient hook for debugging and introspection.
      
      The principal components of the API are the memory management of:
      
        cairo_device_reference(),
        cairo_device_finish() and
        cairo_device_destroy();
      
      along with a pair of routines for serialising interaction:
      
        cairo_device_acquire() and
        cairo_device_release()
      
      and a method to flush any outstanding accesses:
      
        cairo_device_flush().
      
      The device for a particular surface may be retrieved using:
      
        cairo_surface_get_device().
      
      The device returned is owned by the surface.
      f617d5fc
    • Chris Wilson's avatar
      Remove content matching from snapshot lookup. · 6b3e19aa
      Chris Wilson authored
      This was never used, so remove the complexity from the interface.
      6b3e19aa
    • Chris Wilson's avatar
      Constify stroke style and matrices. · cfd20482
      Chris Wilson authored
      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.
      cfd20482
    • Chris Wilson's avatar
      Move _cairo_error() to a standalone header · c50c8b90
      Chris Wilson authored
      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.
      c50c8b90
  3. 21 Oct, 2009 1 commit
  4. 30 Sep, 2009 1 commit
    • Benjamin Otte's avatar
      [API] Make _cairo_meta_surface_replay() private again · 6809e121
      Benjamin Otte authored
      Replaying a meta surface can be achieved by using it as a source for a
      cairo_paint() so exporting a separate API is unnecesary and confusing.
      So after consulting Chris and Carl, we decided to remove the function
      again.
      6809e121
  5. 29 Aug, 2009 1 commit
  6. 23 Jul, 2009 1 commit
    • Chris Wilson's avatar
      Remove clip handling from generic surface layer. · bed2701e
      Chris Wilson authored
      Handling clip as part of the surface state, as opposed to being part of
      the operation state, is cumbersome and a hindrance to providing true proxy
      surface support. For example, the clip must be copied from the surface
      onto the fallback image, but this was forgotten causing undue hassle in
      each backend. Another example is the contortion the meta surface
      endures to ensure the clip is correctly recorded. By contrast passing the
      clip along with the operation is quite simple and enables us to write
      generic handlers for providing surface wrappers. (And in the future, we
      should be able to write more esoteric wrappers, e.g. automatic 2x FSAA,
      trivially.)
      
      In brief, instead of the surface automatically applying the clip before
      calling the backend, the backend can call into a generic helper to apply
      clipping. For raster surfaces, clip regions are handled automatically as
      part of the composite interface. For vector surfaces, a clip helper is
      introduced to replay and callback into an intersect_clip_path() function
      as necessary.
      
      Whilst this is not primarily a performance related change (the change
      should just move the computation of the clip from the moment it is applied
      by the user to the moment it is required by the backend), it is important
      to track any potential regression:
      
      ppc:
      Speedups
      ========
      image-rgba         evolution-20090607-0    1026085.22 0.18% -> 672972.07 0.77%:  1.52x speedup
      ▌
      image-rgba         evolution-20090618-0    680579.98 0.12% -> 573237.66  0.16%:  1.19x speedup
      ▎
      image-rgba      swfdec-fill-rate-4xaa-0    460296.92 0.36% -> 407464.63  0.42%:  1.13x speedup
      ▏
      image-rgba      swfdec-fill-rate-2xaa-0    128431.95 0.47% -> 115051.86  0.42%:  1.12x speedup
      ▏
      Slowdowns
      =========
      image-rgba     firefox-periodic-table-0    56837.61 0.78% -> 66055.17    3.20%:  1.09x slowdown
      ▏
      bed2701e
  7. 04 Jul, 2009 2 commits
  8. 03 Jul, 2009 1 commit
    • Chris Wilson's avatar
      Export meta-surface · 6003ab77
      Chris Wilson authored
      The meta-surface is a vital tool to record a trace of drawing commands
      in-memory. As such it is used throughout cairo.
      
      The value of such a surface is immediately obvious and should be
      applicable for many applications. The first such case is by
      cairo-test-trace which wants to record the entire graph of drawing commands
      that affect a surface in the event of a failure.
      6003ab77
  9. 18 Jun, 2009 1 commit
  10. 02 Jun, 2009 1 commit
    • Chris Wilson's avatar
      Add a generic cow-snapshotting framework · cffb398f
      Chris Wilson authored
      Provide a mechanism for backends to attach and remove snapshots. This can
      be used by backends to provide a cache for _cairo_surface_clone_similar(),
      or by the meta-surfaces to only emit a single pattern for each unique
      snapshot.
      
      In order to prevent stale data being returned upon a snapshot operation,
      if the surface is modified (via the 5 high level operations, and on
      notification of external modification) we break the association with any
      current snapshot of the surface and thus preserve the current data for
      their use.
      cffb398f
  11. 18 Dec, 2008 1 commit
    • Chris Wilson's avatar
      Query the backend to see if we can repaint the solid pattern. · ce0b136a
      Chris Wilson authored
      If we are dithering on the Xlib backend we can not simply repaint the
      surface used for a solid pattern and must recreate it from scratch.
      However, for ordinary XRender usage we do not want to have to pay that
      price - so query the backend to see if we can reuse the surface.
      ce0b136a
  12. 06 Dec, 2008 1 commit
    • M. Pihlaja's avatar
      [cairo-spans] Add a check/create_span_renderer backend methods. · 4a9b274e
      M. Pihlaja authored
      A surface will have the chance to use span rendering at cairo_fill()
      time by creating a renderer for a specific combination of
      pattern/dst/op before the path is scan converted.  The protocol is to
      first call check_span_renderer() to see if the surface wants to render
      with spans and then later call create_span_renderer() to create the
      renderer for real once the extents of the path are known.
      
      No backends have an implementation yet.
      4a9b274e
  13. 29 Nov, 2008 2 commits
  14. 02 Nov, 2008 2 commits
    • Adrian Johnson's avatar
      Make meta-surface store and replay extents of each operation · fb7cfdd9
      Adrian Johnson authored
      To be able to provide the extents of each operation to the backend
      during the render phase the meta-surface needs to store the extents
      computed by the analysis surface during the analysis phase.
      
      The extents argument is either a pointer to the extents of the operation
      stored in the meta-surface or NULL. During analysis the analysis surface
      writes the extents to the meta-surface. During the render phase the extents
      is made available to paginated surface backends.
      fb7cfdd9
    • Adrian Johnson's avatar
      Add an extents argument to the high level surface backend functions · d682d275
      Adrian Johnson authored
      Add a "cairo_rectangle_int_t *extents" argument to to the following
      backend functions:
        paint
        mask,
        stroke
        fill
        show_glyphs
        show_text_glyphs
      
      This will be used to pass the extents of each operation computed by
      the analysis surface to the backend. This is required for implementing
      EXTEND_PAD.
      d682d275
  15. 30 Oct, 2008 1 commit
    • Chris Wilson's avatar
      [pattern] Avoid needless copying of patterns. · 79446018
      Chris Wilson authored
      Only copy the pattern if we need to modify it, e.g. preserve a copy in a
      snapshot or a soft-mask, or to modify the matrix. Otherwise we can
      continue to use the original pattern and mark it as const in order to
      generate compiler warnings if we do attempt to write to it.
      79446018
  16. 21 Oct, 2008 1 commit
    • Chris Wilson's avatar
      Ensure that the scaled font is frozen for the lifetime of the scaled glyph. · 1db8949f
      Chris Wilson authored
      After discussing the scaled font locking with Behdad, it transpired that it
      is not sufficient for a font to be locked for the lifetime of a scaled glyph,
      but that the scaled font's glyph cache must be frozen for the glyph'
      lifetime.  If the cache is not frozen, then there is a possibility that the
      glyph may be evicted before the reference goes out of scope i.e. the glyph
      becomes invalid whilst we are trying to use it.
      
      Since the freezing of the cache is the stronger barrier, we remove the
      locking/unlocking of the mutex from the backends and instead move the
      mutex acquisition into the freeze/thaw routines. Then update the rule on
      acquiring glyphs to enforce that the cache is frozen and review the usage
      of freeze/thaw by all the backends to ensure that the cache is frozen for
      the lifetime of the glyph.
      1db8949f
  17. 19 Oct, 2008 1 commit
  18. 16 Oct, 2008 1 commit
  19. 18 Sep, 2008 1 commit
    • Behdad Esfahbod's avatar
      [show_text_glyphs] Replace the bool backward with cairo_text_cluster_flags · 1fe7088a
      Behdad Esfahbod authored
      Chris rightfully complained that having a boolean function argument is
      new in cairo_show_text_glyphs, and indeed avoiding them has been one
      of the API design criteria for cairo.  Trying to come up with alternatives,
      Owen suggested using a flag type which nicely solves the problem AND
      future-proofs such a complex API.
      
      Please welcome _flags_t APIs to cairo.h
      1fe7088a
  20. 10 Sep, 2008 1 commit
  21. 07 Aug, 2008 2 commits
  22. 26 Jun, 2008 1 commit
  23. 01 Jun, 2008 2 commits
  24. 24 May, 2008 1 commit
    • Behdad Esfahbod's avatar
      [cairo-xlib] Fix show_glyphs when failing to upload a glyph · cf473f4a
      Behdad Esfahbod authored
      Originally reported here:
      http://lists.cairographics.org/archives/cairo/2008-May/014032.html
      and analyized later in the thread.
      
      Change (font and surface) backend show_glyphs() API to take a
      int *remaining_glyphs argument.  It's used to communicate to the caller,
      by way of setting remaining_glyphs and returning INT_STATUS_UNSUPPORTED,
      that some of the glyphs were shown but not the others.  The xlib backend
      now correctly uses this to handle failure to upload a glyph to the server.
      So the large-font test passes now.
      
      An alternative approach could be to add some public value for glyphs
      indices that are not shown.  -1 perhaps (the xlib backend already uses
      that value internally).  Then instead of remaining_glyphs, a backend
      could simply set glyph indices of glyphs shown to that -1 value.
      cf473f4a
  25. 23 May, 2008 1 commit
  26. 21 May, 2008 1 commit
  27. 13 May, 2008 1 commit
  28. 09 May, 2008 2 commits
  29. 21 Apr, 2008 1 commit
  30. 14 Mar, 2008 1 commit
    • Adrian Johnson's avatar
      Don't use fill-stroke during analysis · 112bbace
      Adrian Johnson authored
      Instead ensure the fill and stroke are each analyzed separately.
      
      This fixes a bug in the PS output where if a fill-stroke with a
      translucent fill resulted in a fallback image with the stroke clipped
      to the fill path.
      112bbace
  31. 04 Mar, 2008 1 commit