Commit graph

5233 commits

Author SHA1 Message Date
Benjamin Otte
1c15510c3d Call cairo_surface_flush() before setting finished
With the current code, the surface will never be flushed as the flush
function checks if the surface is finished, and if so, doesn't call the
vfunc. Ooops.
2010-06-07 13:37:48 +02:00
Benjamin Otte
467d5e7f90 gl: Flush properly in set_destination 2010-06-07 13:37:48 +02:00
Benjamin Otte
e15348d8d0 gl: Don't reset vertex size 2010-06-07 13:37:48 +02:00
Benjamin Otte
a8d6ac1efc gl: Remove check if we're between begin/end
This will be useless soon, because we will keep the current state alive as
long as possible.
2010-06-07 13:37:48 +02:00
Benjamin Otte
8f675fb801 gl: Stop disabling the vertex array and the array buffer 2010-06-07 13:37:48 +02:00
Benjamin Otte
bef0b54149 gl: Do not reset shaders on _end()
Instead, keep the shader around until cairo_device_flush() is called.
2010-06-07 13:37:48 +02:00
Benjamin Otte
534c147299 region: clarify docs of cairo_region_equal() 2010-06-07 13:37:48 +02:00
Benjamin Otte
0fc6f08981 gl: Make _shader_by_type() a getter
And refactor code to do the current_shader assigning itself.
2010-06-07 13:37:48 +02:00
Benjamin Otte
2971ca0498 gl: bind all shader variables at the same place
Avoids the need to bind the shader when creating it.
2010-06-07 13:37:48 +02:00
Benjamin Otte
e11d8370e0 gl: Set GL_BLEND and GL_SCISSOR_TEST globally
Note that we do set them unconditionally in _begin() because a flush
might have cleared them.
2010-06-07 13:37:48 +02:00
Benjamin Otte
7747f6d914 gl: Introduce flush functions
The flush functions will clear the state that will in the future be kep
unconditionally.
2010-06-07 13:37:48 +02:00
Benjamin Otte
5c74beaaa5 docs: fix typo 2010-06-07 13:37:48 +02:00
Benjamin Otte
92d7b1eee9 device: Make flush vfunc return a cairo_status_t
Mirror the behavior of the surface flush vfunc: Make it return a status
and if it's an error set it on the device.
2010-06-07 13:37:48 +02:00
Benjamin Otte
63e3cf3888 gl: Move unsetting the state into the operand destroy function 2010-06-07 13:37:48 +02:00
Benjamin Otte
b9b85dbf37 gl: get rid of the operand's pattern variable
Now someone just needs to teach cairo-gl to not use
cairo_pattern_acquire_surface() and we could avoid the nasty hack in
cairo_gl_operand_destroy().
2010-06-07 13:37:47 +02:00
Benjamin Otte
ae9517a39f gl: Check mask's attributes for component alpha
... and don't duplicate that information into the cairo_gl_composite_t
2010-06-07 13:37:47 +02:00
Benjamin Otte
f72afc09d0 gl: Merge fixed function setup into general texture setup 2010-06-07 13:37:47 +02:00
Benjamin Otte
dd1faaf02e gl: Move function
I wanna use it elsewhere and keep the diff small.
2010-06-07 13:37:47 +02:00
Benjamin Otte
d038003136 gl: Simplify mask operand setup code
Component alpha just has one different value
2010-06-07 13:37:47 +02:00
Benjamin Otte
e20261ddda gl: Get rid of operand argument to emit functions 2010-06-07 13:37:47 +02:00
Benjamin Otte
8062fb352e gl: Add an enum for tex units
Instead of hardcoding 0 for source and 1 for mask, use an enum. It's
also clearer when functions take a cairo_gl_tex_t argument instead of a
GLuint.
2010-06-07 13:37:47 +02:00
Benjamin Otte
5db362dd67 gl: Keep a copy of the current operand in the context
Note that they are currently only valid as long as the
cairo_gl_composite_t exists, but that will be changed soon.
2010-06-07 13:37:47 +02:00
Benjamin Otte
a05f062c80 gl: Move struct definitions in header 2010-06-07 13:37:47 +02:00
Benjamin Otte
85d4c6c55b gl: operand->texture.surface cannot be NULL 2010-06-07 13:37:47 +02:00
Benjamin Otte
9486ad5fbd gl: Remove composite_t argument from _flush() function 2010-06-07 13:37:47 +02:00
Benjamin Otte
16e420b4dc gl: Remove dependency on composite_t in draw function 2010-06-07 13:37:47 +02:00
Benjamin Otte
e46215ec6b gl: Remove unneeded and broken workaround
We now ensure the values are properly zeroed when setting the operator.
2010-06-07 13:37:47 +02:00
Benjamin Otte
b2d709b5c7 gl: Switch src alpha handling to a tiny on/off function
Instead of doing setup every time, we just set this one flag. Much
nicer.
2010-06-07 13:37:47 +02:00
Benjamin Otte
53fd451f85 gl: Avoid redundant mask setup
The mask doesn't change, so no need to set it up twice
2010-06-07 13:37:47 +02:00
Benjamin Otte
1b3675fc4b gl: Split fixed-function operand setup into own function 2010-06-07 13:37:47 +02:00
Benjamin Otte
02da871050 gl: Unify fixed function setup code 2010-06-07 13:37:47 +02:00
Benjamin Otte
74f9094162 gl: switch OPERAND0 and OPERAND1 in the fixed function path
This should not change anything as we multiply the values.
But it allows unifying parts of the code, which will happen in another
patch.
2010-06-07 13:37:47 +02:00
Benjamin Otte
c6aac5d013 gl: Move the pre shader to the context, too
It's required when flushing, too.
2010-06-07 13:37:47 +02:00
Benjamin Otte
61bc3067ca gl: Store the clip region in the context
This is necessary because we want to get rid of keeping the composite
stuff around.
2010-06-07 13:37:47 +02:00
Benjamin Otte
db79880d9a gl: Make gl_composite_begin() acquire the context
Also remove the previous places for context acquisition. This completes
fixing the potential ABBA deadlock I talked about a few commits ago.
2010-06-07 13:37:47 +02:00
Benjamin Otte
1320a168fa gl: Remove unused code
We don't need to acquire/release the context, we're not using it.
2010-06-07 13:37:47 +02:00
Benjamin Otte
8f5c3b706b gl: Make composite_set_clip_region not require the context 2010-06-07 13:37:46 +02:00
Benjamin Otte
ac6abcbac7 gl: Make composite_set_source/mask/mask_spans not require a context 2010-06-07 13:37:46 +02:00
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
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