Commit graph

8436 commits

Author SHA1 Message Date
Benjamin Otte
88a70d66fc gl: Add API for querying if we need GL_TEXTURE_RECTANGLE_EXT
We need to do that querying outside of taking the lock, so we want to be
able to query the device, not the context.
2010-06-07 13:37:46 +02:00
Benjamin Otte
9c6e1338a1 gl: Make cairo_gl_composite_t not require a gl context anymore
First patch in a series.

The idea is to make all gl operations in Cairo work like this:
1) prepare cairo_gl_composite_t
2) acquire device
3) begin composite operation
4) emit vertexes
5) end operation
6) release device
7) cleanup composite operation

This both reduces the time required with the device locked, cleans the
API and more importantly avoids ABBA deadlocks, as we currently call
acquire_pattern() with the device lock held.
2010-06-07 13:37:46 +02:00
Benjamin Otte
60f0cb9c60 gl: Flush surface at the right times 2010-06-07 13:37:46 +02:00
Chris Wilson
ffeeae462e Revert "gstate: reduce a couple more operators"
This reverts commit a85c6c1e36.

Soeren found that this introduced a regression when displaying pages in
evince, and since I'm not overly enthralled at the added complexity here
for very little gain, remove the reduction and leave it clear for a more
complete solution in the future.
2010-06-06 16:53:46 +01:00
Makoto Kato
44e628a6f4 openvg: fix build break 2010-06-02 23:00:01 +02:00
Chris Wilson
cc080a1e27 gl: Unmap the vertex buffer prior to using in DaawArrays()
"It is an INVALID_OPERTION error to source data from a buffer object
that is currently mapped."

mesa is currently lax in this regard, but the Nvidia libGL conforms to
the spec and thus was causing failures.
2010-05-27 20:51:55 +01:00
Chris Wilson
b3e15bd5c3 gl: _cairo_set_shader_by_type() cannot return UNSUPPORTED
So remove the superfuous test.
2010-05-27 18:43:03 +01:00
Chris Wilson
59bd34e6a3 gl: Check for an error device when creating surfaces. 2010-05-27 18:35:40 +01:00
Chris Wilson
53f0861059 gl: Make _cairo_gl_shader_(init|compile) static
Only used within _cairo_gl_shaders.c, so remove the private symbol.
2010-05-27 18:28:52 +01:00
Chris Wilson
dd0866cdc8 boilerplate: Exercise RENDER capable windows.
Ensure that the drivers actually work when rendering to a normal window.
2010-05-27 17:53:30 +01:00
Chris Wilson
2dc42af942 script: Update csi-exec to match new interface. 2010-05-27 17:53:30 +01:00
Chris Wilson
2f0f4ed0e2 freed-pool: Don't access beyond the end of the array.
Argh. This bug has been here for quite some time and only showed itself
with a corrupt pointer on ppc32. Since the erroneous write is inside the
block, it remained undetected by valgrind.
2010-05-20 21:57:58 +01:00
Chris Wilson
97b4aeba44 atomic: Add memory barriers if required for intel primitives 2010-05-20 21:57:58 +01:00
Benjamin Otte
24e684c267 gl: spans need the dummy texture
Thanks Eric. That took me half a day.
2010-05-20 22:37:18 +02:00
Benjamin Otte
d7a564d8ee gl: Don't set is_clear
1) It's wrong.
2) The core functions set the flag correctly already.
2010-05-20 22:10:06 +02:00
Benjamin Otte
f9cf07b126 gl: Fix coverage passing for spans not being endian safe. 2010-05-20 16:08:38 +02:00
Benjamin Otte
2a0f34c6da gl: Allow NONE and SPANS sampler for source, too 2010-05-20 13:54:02 +02:00
Benjamin Otte
1586f7740a gl: Refactor fixed function setup code
In particular get rid of the _cairo_gl_set_tex_combine_constant_color()
function by inlining it and move common glTexEnv calls out of the
switch statement.
2010-05-20 13:18:15 +02:00
Benjamin Otte
4889090c76 gl: set the active texture before fiddling with with glTexEnv
fixes the fixed function pipeline
2010-05-20 12:13:43 +02:00
Benjamin Otte
3cff2da912 gl: Remove unused variables 2010-05-20 12:11:41 +02:00
Benjamin Otte
4c7dd1be45 gl: Move vertex array setup code into the texture setup code 2010-05-20 11:02:49 +02:00
Benjamin Otte
d9d5976bdf gl: Add an assertion that a context cannot call _begin() twice
Evert _begin() call must be followed by an _end() call to avoid any
nastiness. Just like GL. :)
2010-05-20 11:02:49 +02:00
Benjamin Otte
5b8b1fe1cb gl: Move vertex buffer handling from setup into context
We can only emit one vertex buffer at a time anyway.
2010-05-20 11:02:49 +02:00
Benjamin Otte
0d5f2eab77 gl: Actuall do fall back to fixed function paths.
Previously we were just returning UNSUPPORTED all the time. I guess that
explains why my code got so slow...
2010-05-20 11:02:49 +02:00
Benjamin Otte
bb7ca71c1a gl: Don't store the shader in the composite_t anymore
Now that we have ctx->current_shader, there's no need to keep it in the
composite setup code.
2010-05-20 11:02:49 +02:00
Benjamin Otte
6c477b4a94 gl: Move shader checking in the TexEnv setup code
As the previously generic setup code only contains non-shader code now,
we can check in advance that no shader is in use and do all the other
stuff without checks.
2010-05-20 11:02:49 +02:00
Benjamin Otte
73262edd82 gl: Move texture setup code into its own file
This ensures textures don't need to be (re)set when doing component
alpha and running 2 shaders.
2010-05-20 11:02:49 +02:00
Benjamin Otte
970c879dd8 gl: Binding variables only works for the current shader
So make the code reflect that.
2010-05-20 11:02:49 +02:00
Benjamin Otte
065969d78f gl: Separate binding to shaders from setting operands
That way we only need to bind to shaders when creating them, but not
everytime we switch shaders on text output.
2010-05-20 11:02:49 +02:00
Benjamin Otte
c53f7778bc gl: Use the mask, not the source
Not that we'd ever have constant color component-alpha masks, but that's
an entirely different topic.
2010-05-20 11:02:49 +02:00
Benjamin Otte
26e8e506b6 gl: Add _cairo_gl_surface_is_texture()
It's more explicit then just checking surface->fb != 0
Also, it makes improving that check easier.
2010-05-20 11:02:49 +02:00
Benjamin Otte
e4cb46b500 gl: Implement texture upload to window with composite()
Instead of custom code that does basically the same thing, use
a temporary surface and _cairo_gl_surface_composite() to upload images.
2010-05-20 11:02:49 +02:00
Benjamin Otte
7c8759e279 gl: cache the current shader in the context 2010-05-20 11:02:49 +02:00
Benjamin Otte
6864ca6c25 gl: Move _cairo_gl_set_operator() to the file it's used in
Also make it a private function.
2010-05-20 11:02:48 +02:00
Benjamin Otte
0d2d4c5902 gl: Detect color-pattern clears of surfaces
... and use glClear() there.

The common case here is a solid color and OPERATOR_OVER.
2010-05-20 11:02:48 +02:00
Benjamin Otte
b70eb275c4 gl: detect image uploads and fast-path them 2010-05-20 11:02:48 +02:00
Benjamin Otte
8adbf3aa19 gl: Use _cairo_gl_surface_draw_image() when caching glyphs 2010-05-20 11:02:46 +02:00
Benjamin Otte
915aa64ef0 gl: Actually check errors for _cairo_gl_composite_begin() 2010-05-20 11:01:21 +02:00
Benjamin Otte
0222cc7d76 gl: Get rid of _cairo_gl_composite_set_mask_texture()
Now that the glyph cache contains real surfaces, there's no longer a
need to have a special function for it.
2010-05-20 11:01:19 +02:00
Benjamin Otte
208d9f2a7e gl: Make glyph cache a real surface
This has the huge advantage that we can use real surface functions on
it.
2010-05-20 11:00:50 +02:00
Benjamin Otte
0501179963 surface: Add _cairo_surface_release_device_reference() API
See the API documentation for that function about its intended purpose.
2010-05-18 13:43:27 +02:00
Benjamin Otte
c489f67d1d gl: Make a bunch of functions static
They are no longer used outside of cairo_gl_composite_t.
2010-05-18 13:43:27 +02:00
Benjamin Otte
c8008e118a gl: Don't name the union in cairo_gl_operand_t
Gets rid of ultra-long variable names.
2010-05-18 13:43:27 +02:00
Andrea Canciani
53260148ea quartz: fix repeating radial gradients on 64 bits
Quartz API uses the type CGFloat, which is double on 64 bits,
float on 32 bits architectures
2010-05-17 22:12:36 +02:00
Andrea Canciani
0104976dc8 quartz: silence compiler warnings
All the possible enum values have to be explicitly handled in switch statements.
2010-05-17 22:12:36 +02:00
Andrea Canciani
ac94a00a4d quartz: fallback for A1 images on little endian archs
Quartz uses a bit ordering that is consistent with cairo on big
endian architectures, but isn't on little endian architectures.

Fixes a1-mask and large-source-roi (on little endian)
2010-05-17 22:09:06 +02:00
Andrea Canciani
f40e3b09a1 quartz-font: Silence 0x0 CGContext warning
Silence Quartz complaints about operations on empty contexts:
<Error>: CGContextSetFont: invalid context 0x0
<Error>: CGContextSetFontSize: invalid context 0x0
<Error>: CGContextSetTextMatrix: invalid context 0x0
<Error>: CGContextSetAlpha: invalid context 0x0
<Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
2010-05-17 22:01:50 +02:00
Andrea Canciani
1687e61694 quartz-font: Conform context and antialias handling to quartz-surface
A8 surfaces are now kAlphaOnly surfaces in quartz-font too.
Subpixel font smoothing can be enabled.
2010-05-17 21:34:38 +02:00
Benjamin Otte
d68bbc0fe5 gl: Add missing NULL-check in non-shader code 2010-05-17 20:57:08 +02:00
Benjamin Otte
7f22372edf gl: Get rid of src and mask argument to composite_init()
This was thought of as a way to detect self-painting, but it's better to
check that later in _begin() - when we check it.
2010-05-17 18:54:31 +02:00