Commit graph

10716 commits

Author SHA1 Message Date
Chris Wilson
146da77d85 script: Attempt to decompress images in place
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-08 15:01:37 +00:00
Chris Wilson
5f2e89660d image: Call pixman without a mask for opaque regions of inplace_spans
Speedups
========
firefox-paintball  59462.09 -> 40928.76:  1.45x speedup
 firefox-fishtank  43687.33 -> 34627.78:  1.26x speedup
     firefox-tron  52526.00 -> 45754.73:  1.15x speedup

However in order to avoid a regression with firefox-talos-svg we need to
prevent splitting up the scanline when using a gradient source.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-07 17:58:02 +00:00
Chris Wilson
a73e7ff018 xlib: Simplify source creation by use of map-to-image
We were open-coding the functionality of map-to-image inside the source
creation routines. so refactor to actually use map-to-image instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-06 11:30:02 +00:00
Chris Wilson
4f142f3a7b xlib/shm: Only mark the shm pixmap as active if we upload into it
Be more strict with when we mark the pixmap as active so that we only
wait for the actual XCopyArea involving the pixmap to complete.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-06 10:32:25 +00:00
Chris Wilson
45a4b42a36 script: Recompress strings using LZO whilst binding traces
Try using the lighter-weight LZO decompressor in an effort to speed up
replays (at the cost of making the bound traces slightly larger).
Presuming that with the slight increase in file size (from -1% to +10%),
the file data remains in the readahead buffer cache, replays see a
performance improvement of between 5-10%.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-05 21:10:35 +00:00
Martin Robinson
9194904fa8 gl: Better handling of clear surfaces
When clearing a GL surface, set is_clear to true, and when mapping to an
image, handle is_clear like surfaces without modification. Additionally,
explicitly clear surfaces created via cairo_surface_create_similar.
2013-01-04 16:31:01 -08:00
Martin Robinson
9bff450844 boilerplate/glx: Add a target with multisampling and stencil support
Add a gl-window target that supports multisampling. This is useful for
testing the MSAA backend on the default framebuffer.
2013-01-04 16:29:51 -08:00
Chris Wilson
8cd604e18a gobject: Fix my typo s/TEST/TEXT/ in the previous commit
Again reported by Kouhei Sutou, who I am grateful for his deligence.
2013-01-04 14:03:40 +00:00
Kouhei Sutou
a4f221498c gobject: Fix "text_cluster_flags_get_type" typo
The macro missed the text from the name, rendering it useless.
2013-01-04 12:18:29 +00:00
Henry Song
9dde964553 gl/msaa: Only clear parts of the stencil buffer we will use
Writing to the stencil buffer can be expensive, so when using the
stencil buffer for clipping only clear the clip extent. When using the
stencil buffer to prevent overlapping rendering during stroking, only
clear the approximate stroke extents.
2013-01-03 16:37:18 -08:00
Alejandro G. Castro
5e9083f882 gl/msaa: Avoid the stencil buffer when possible during masking
In this case we can draw the clip path and avoid the stencil buffer,
which can be expensive.
2013-01-03 16:37:18 -08:00
Henry Song
dd850583a7 gl/msaa: Add full support for masking with the SOURCE operator
Since OpenGL does not have a means to represent a masking SOURCE
operation in one step, we use two steps combined with the ADD
operator.
2013-01-03 15:58:19 -08:00
Chuanbo Weng
c743e93451 gl: Support the GL_IMG_texture_npot extension
This extension, used by older PowerVR drivers, is functionally
equivalent to the GL_OES_TEXTURE_NPOT extension.
2013-01-03 11:40:36 -08:00
Chris Wilson
ae1724ced9 Add missing local slim proto for cairo_recording_surface_create
Dependency introduced in 749ef6be4d

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 15:07:18 +00:00
Chris Wilson
872a92b874 scaled-font: Mention ownership of returned object from get_font_face()
As suggested by Simon Sapin.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 15:07:18 +00:00
Chris Wilson
734a541dc3 xlib: Avoid copying the source twice if it is an image
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 15:07:18 +00:00
Kouhei Sutou
ecc8c28b24 gobject: Add the correct macro name for the hint-metrics type
s/CAIRO_GOBJECT_TYPE_HNT_METRICS/CAIRO_GOBJECT_TYPE_HINT_METRICS/

However, as we have already released the broken headers, we need to
preserve that mistake in case applications are already using. Since it
is just a #define, there is little associated cost with carrying both
the incorrect spelling and the corrected define.
2013-01-03 15:07:18 +00:00
Chris Wilson
5bc1b1f6aa stroke: Make the incremental trapezoid stroker optionally available again
Whilst it cannot handle self-intersecting strokes (which includes the
antialias region of neighbouring lines and joints), it is about 3x
faster to use than the more robust algorithm. As some backends delegate
the rendering, the quality may still be preserved and so they should be
responsible for choosing the appropriate method for generation of the
stroke geometry.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 15:07:18 +00:00
Chris Wilson
74941f8220 xlib: Use SHM transport for ordinary image uploads
In theory this should just save a single copy, however PutImage will
break up requests into a series of scanlines requests which is less
efficient than the single-shot transfer provided by ShmPutImage.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 12:28:33 +00:00
Chris Wilson
bf2a04c5ab xlib/shm: Fix typo in creation of a SHM image
Pass along the size the caller requests, not the size of the related
drawable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-01-03 12:27:34 +00:00
Chris Wilson
c29ab389fb gl: Provide a fast emitter for solid spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-30 12:54:26 +00:00
Chris Wilson
d3848521c4 gl: Provide a fast emitter for solid glyphs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-30 12:47:02 +00:00
Chris Wilson
127dd46669 gl: Use vfunc for vertex emission
In order to overload the emitters in future to provide specialised
routines for the common types of operands, begin by switching the
current users over to a vfunc interface.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-30 12:21:11 +00:00
Chris Wilson
9558cb62c6 perf/chart: Contract the default output filenames
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-29 18:51:54 +00:00
Chris Wilson
fbd4864995 perf/chart: Show the geometric average as an extra column
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-29 18:30:48 +00:00
Chris Wilson
71028865fa Revert "xlib/shm: Do not trigger a surplus event from XShmPutImage"
This reverts commit c97f2d4acd.

Testing suggests that keeping that event is a win; so do so.
2012-12-29 15:05:53 +00:00
Chris Wilson
c97f2d4acd xlib/shm: Do not trigger a surplus event from XShmPutImage
As our lazy event mechanism is sufficient for tracking when to reuse shm
memory, and the events are not necessary for ShmPut/ShmGetImage paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-29 14:56:24 +00:00
Chris Wilson
0c84a5474d xlib/shm: Rate-limit events and only use as necessary
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-29 14:55:17 +00:00
Martin Robinson
21db1c9910 gl: Cleanup selection of multisampling mode
Fold the choice of multisampling mode into the cairo_gl_composite_t
structure itself. This makes it more similar to other settings.
2012-12-28 14:29:24 -08:00
Chris Wilson
7d02e2d62d xlib/shm: Populate send_event and serial
Hopefully this random choice is more meaningful than random junk.

Bugzilla; https://bugs.freedesktop.org/show_bug.cgi?id=58672
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-23 11:19:16 +00:00
Adrian Johnson
e748c12243 doc: Add CAIRO_MIME_TYPE_UNIQUE_ID to list of supported mime types 2012-12-22 18:34:43 +10:30
David Maxwell
4e751fcb03 type1-subset: always include subroutine 4 (hint replacement idiom)
http://lists.cairographics.org/archives/cairo/2012-December/023846.html
2012-12-22 14:36:38 +10:30
Behdad Esfahbod
b94a519aad [ft] Fix resizing of bitmap fonts
Say, you were asking cairo for a font at 200px.  For bitmap-only fonts,
cairo was finding the closes strike size and using it.  If the strike
was at 20px, well, that's what you were getting.  We now scale that 20px
strike by a factor of 10 to get the correct size rendering.

Note that by itself this patch doesn't change much on the Linux desktop.
The reason is that the size you are interested in (eg. 200px) is lost by
fontconfig.  When you request a font at 200px, fontconfig returns a font
pattern that says 20px, and so the next layers thing you want a font at
20px.  To address that, one also needs a piece of fontconfig config that
puts the 200 back into the pixelsize.  Something like this:

<match target="font">
  <test name="scalable" mode="eq">
    <bool>false</bool>
  </test>
  <edit name="pixelsize" mode="assign">
    <times>
      <name>size</name>
      <name>dpi</name>
      <double>0.0138888888888</double> <!--1/72.-->
    </times>
  </edit>
</match>

I'm going to try to upstream this config so it will be enabled by
default.  The config can be a bit smarter.  For example, if
metricshinting is enabled and the size difference is small, we may as
well not scale.

The nice thing about this is that the configuration of whether and when
to scale bitmaps will be done in fontconfig, not cairo / Qt / ... code.
2012-12-21 18:47:16 -05:00
Behdad Esfahbod
1404ed9692 [ft] Remove ancient check for FT_Bitmap_Size.y_ppem
That member is available in the version of FreeType we require.
2012-12-21 18:47:10 -05:00
Behdad Esfahbod
867c876b0e [Minor] Improve logging 2012-12-21 18:46:56 -05:00
Adam Jackson
5d21c9e224 xlib/shm: Fix memory leak
Despite subclassing image surfaces, we never called down to the image
surface destructor, so we leaked a pixman_image_t every time.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=882976
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-12-18 20:27:19 +00:00
Uli Schlachter
51435eeb0c xcb: Fix xcb-huge-subimage
This teaches the xcb backend how to split up a PutImage request for a subimage
into multiple requests. The backend already does the same for "normal" PutImage
where it doesn't have to assemble the image from various rows.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 18:37:10 +01:00
Uli Schlachter
5fb364287f test: Add xcb-huge-subimage
This creates an image surface with a non-natural stride and paints it to a
similar surface.

In the xcb backend, this causes a call to _cairo_xcb_connection_put_subimage()
which tries to send a huge PutImage request. As a result, xcb kills the X11
connection.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 18:37:10 +01:00
Uli Schlachter
749ef6be4d context: Use recording surfaces for unbounded groups
The old code uses an uninitialized variable for the extents of the group that is
created. This patch makes it use an unbounded recording surface instead.

This has the implicit assumption that everything that is unbounded smells like a
recording surface. Let's see when this assumption breaks. :-)

http://lists.cairographics.org/archives/cairo/2012-October/023585.html

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 18:37:09 +01:00
Martin Robinson
433a5829d7 Revert "gl/msaa: Share the depth/stencil buffer among all surfaces"
This was pushed mistakenly. Sorry.

This reverts commit a7d684e6fe.
2012-12-17 17:56:19 +01:00
Uli Schlachter
000a137a65 boilerplate-xcb: Ignore MappingNotify events
The boilerplate code makes sure that our tests didn't cause any X11 errors or
X11 events, because those might confuse API users.

However, when the keyboard layout changes, every connection gets a MappingNotify
event. This means that the test and performance test suites failed when the
keyboard layout was changed while they are running.

Fix this by ignoring MappingNotifies.

Reported by Arthur Huillet on IRC.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-12-17 17:12:59 +01:00
Martin Robinson
9d9aa04b60 gl: Add BGRA download support for GLES2
Some OpenGLES2 drivers support downloading BGRA data. On little-endian
systems BGRA and GL_UNSIGNED_BYTe is equivalent to the typical
cairo_image_t format, so this can prevent CPU bit swizzling for
operations that involve images.
2012-12-10 10:18:15 +01:00
Martin Robinson
a7d684e6fe gl/msaa: Share the depth/stencil buffer among all surfaces
Instead of allocating a depth/stencil buffer for all surfaces, share a
common buffer that's the size of the largest surface. This reduces
video memory usage when there are many GL surfaces.
2012-12-08 13:31:13 +01:00
Chuanbo Weng
ba4a4eae05 gl/msaa: Use GL_IMG_multisampled_render_to_texture when available
Some OpenGLES platforms support GL_IMG_multisampled_render_to_texture
instead of GL_EXT_multisampled_render_to_texture.
2012-12-05 16:17:10 -08:00
Henry Song
3bedff0c00 gl: Properly disable ctx->spans when necessary
When compositing starts, if we are not using the spans compositor, we
should set the spans member of the context to false.
2012-12-05 15:56:35 -08:00
Henry Song
18e7234c7e gl/msaa: Also setmsaa_active to true for non-texture surfaces
This is important because there are places in the code where msaa_active
is used to decide whether or not to complete an operation with
multisampling or not.
2012-12-05 15:30:28 -08:00
Henry Song
9f43f096b2 gl: Flush context upon evicting a gradient
As the random selection of a gradient can possible destroy the currently
active gradient, we need to flush the context in order to flush any
references to the texture before deletion.
2012-12-01 17:08:56 +00:00
Chris Wilson
a0fb139131 mempool: Reduce the assertion into an alignment adjustment for the base
Instead of asserting that the caller passed in a chunk-aligned base
pointer, just perform the fixup whilst initialising the mempool. This
means that the caller (xcb!) cannot assume that the mempool->base is
then the same base pointer as passed in and so needs to store it
separately for use in computing SHM offsets.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-12-01 09:23:37 +00:00
Chris Wilson
153b11612f script: Fix map-to-image/unmap stack manipulations
The idiom (and expectation) for surface operators is that it leaves the
surface on the stack for the next operation. Also we need to hold onto a
surface reference for objects put onto the stack, yet for the
map-to-image return we did not own one.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-28 09:57:29 +00:00
Chris Wilson
dfbf80a57d trace: Do not forcibly add surfaces to the dictionary
Adjust the stack manipulation to avoid moving an unknown surface to
the dictionary.

Reported-by: Dongyeon Kim <dy5.kim@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-28 09:36:59 +00:00