summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Update cogl.symbolsmsvc-supportChun-wei Fan2011-11-181-0/+7
| | | | | | Due to API additions in commits: 4553ca06 (cogl-pipeline: Add support for setting uniform values) d2fd1683 (cogl-matrix: Add a public cogl_matrix_transpose())
* Merge branch 'master' into msvc-supportChun-wei Fan2011-11-1835-519/+2890
|\ | | | | | | | | | | Conflicts: cogl/cogl-debug.h cogl/cogl-util.h
| * Updated Spanish translationJorge González2011-11-171-12/+12
| |
| * cogl-pipeline: Use a hash table for faster uniform name lookupNeil Roberts2011-11-164-19/+26
| | | | | | | | | | | | | | | | The uniform names are now stored in a GPtrArray instead of a linked list. There is also a hash table to speed up converting names to locations. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-pipeline: Store the uniform overrides in an array instead of listNeil Roberts2011-11-164-112/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the uniform overrides were stored in a linked list. Now they are stored in a g_malloc'd array. The values are still tightly packed so that there is only a value for each uniform that has a corresponding bit in override_mask. The allocated size of the array always exactly corresponds to the number of bits set in the override_mask. This means that when a new uniform value is set on a pipeline it will have to grow the array and copy the old values in. The assumption is that setting a value for a new uniform is much less frequent then setting a value for an existing uniform so it makes more sense to optimise the latter. The advantage of using an array is that we can quickly jump to right boxed value given a uniform location by doing a population count in the bitmask for the number of bits less than the given uniform location. This can be done in O(1) time whereas the old approach using a list would scale by the number of bits set. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-bitmask: Add _cogl_bitmask_popcountNeil Roberts2011-11-163-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This returns a population count of all the bits that are set in the bitmask. There is now also a _cogl_bitmask_popcount_upto which counts the number of bits set up to but not including the given bit index. This will be useful to determine the number of uniform overrides to skip if we tightly pack the values in an array. The test-bitmask test has been modified to check these two functions. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * Add a conformance test for setting uniforms on a pipelineNeil Roberts2011-11-163-0/+430
| | | | | | | | | | | | | | | | The tests tries all of the various combinations of setting uniform values on a pipeline and verifies the expected results with a some example shaders. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-pipeline: Add support for setting uniform valuesNeil Roberts2011-11-1610-4/+880
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the following new public experimental functions to set uniform values on a CoglPipeline: void cogl_pipeline_set_uniform_1f (CoglPipeline *pipeline, int uniform_location, float value); void cogl_pipeline_set_uniform_1i (CoglPipeline *pipeline, int uniform_location, int value); void cogl_pipeline_set_uniform_float (CoglPipeline *pipeline, int uniform_location, int n_components, int count, const float *value); void cogl_pipeline_set_uniform_int (CoglPipeline *pipeline, int uniform_location, int n_components, int count, const int *value); void cogl_pipeline_set_uniform_matrix (CoglPipeline *pipeline, int uniform_location, int dimensions, int count, gboolean transpose, const float *value); These are similar to the old functions used to set uniforms on a CoglProgram. To get a value to pass in as the uniform_location there is also: int cogl_pipeline_get_uniform_location (CoglPipeline *pipeline, const char *uniform_name); Conceptually the uniform locations are tied to the pipeline so that whenever setting a value for a new pipeline the application is expected to call this function. However in practice the uniform locations are global to the CoglContext. The names are stored in a linked list where the position in the list is the uniform location. The global indices are used so that each pipeline can store a mask of which uniforms it overrides. That way it is quicker to detect which uniforms are different from the last pipeline that used the same CoglProgramState so it can avoid flushing uniforms that haven't changed. Currently the values are not actually compared which means that it will only avoid flushing a uniform if there is a common ancestor that sets the value (or if the same pipeline is being flushed again - in which case the pipeline and its common ancestor are the same thing). The uniform values are stored in the big state of the pipeline as a sparse linked list. A bitmask stores which values have been overridden and only overridden values are stored in the linked list. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-bitmask: Add _cogl_bitmask_set_flagsNeil Roberts2011-11-162-1/+32
| | | | | | | | | | | | | | | | | | This adds a _cogl_bitmask_set_flags function which can be used to copy the values from a CoglBitmask to an array of unsigned longs which can be used with the COGL_FLAGS_* macros. The values are or'd in so that in can be used multiple times to combine multiple bitmasks. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-matrix: Add a public cogl_matrix_transpose()Neil Roberts2011-11-164-2/+29
| | | | | | | | | | | | | | This function takes a single matrix argument and replaces the matrix with its transpose. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * Move POPCOUNTL to cogl-utilNeil Roberts2011-11-163-20/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | This moves the POPCOUNTL macro from cogl-winsys-glx to cogl-util and renames it to _cogl_util_popcountl so that it can be used in more places. The fallback function for when the GCC builtin is not available has been replaced with an 8-bit lookup table because the HAKMEM implementation doesn't look like it would work when longs are 64-bit so it's not suitable for a general purpose function on 64-bit architectures. Some of the pages regarding population counts seem to suggest that using a lookup table is the fastest method anyway. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-boxed-value: Add _cogl_boxed_value_copyNeil Roberts2011-11-162-0/+45
| | | | | | | | | | | | | | | | This adds a function to copy one boxed value to another. It is assumed that the destination boxed value is totally initialised (so it won't try to free any memory in it). Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-boxed-value: Wrap the GL calls in the GE() macroNeil Roberts2011-11-161-14/+30
| | | | | | | | | | | | | | This wraps all of the calls to glUniform* in the GE() macro so that it will detect GL errors in the right place. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-program: Move the code for CoglBoxedValue to its own fileNeil Roberts2011-11-166-192/+455
| | | | | | | | | | | | | | | | | | The code for manipulating CoglBoxedValues is now separated from cogl-program.c into its own file. That way when we add support for setting uniform values on a CoglPipeline the code for storing the values can be shared. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-flags: Add some macros to help iterate the bitsNeil Roberts2011-11-163-25/+48
| | | | | | | | | | | | | | | | | | | | | | This adds some macros to iterate over all the bits set in an array of flags. The macros are a bit awkward because it tries to avoid using a callback pointer so that the code is inlined. cogl_bitmask is now using these macros as well so that the logic can be shared. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-bitmask: Add a return value for the foreach callbackNeil Roberts2011-11-164-11/+16
| | | | | | | | | | | | The foreach callback can now return FALSE to stop the iteration. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-flags: Use longs instead of intsNeil Roberts2011-11-164-47/+60
| | | | | | | | | | | | | | | | | | | | | | Previously cogl-flags was using an array of ints to store the flags. There was a comment saying that it would be nice to use longs but this is awkward because g_parse_debug_flags can only work in ints. This is a silly reason not to use longs because we can just parse multiple sets of flags per long. This patch therefore changes cogl-flags to use longs and tweaks the debug key parsing code. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-bitmask: Use ffsl to speedup bitmask iterationNeil Roberts2011-11-164-9/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of testing each bit when iterating a bitmask, we can use ffsl to skip over unset bits in single instruction. That way it will scale by the number of bits set, not the total number of bits. ffsl is a non-standard function which glibc only provides by defining GNUC_SOURCE. However if we are compiling with GCC we can avoid that mess and just use the equivalent builtin. When not compiling for GCC it will fall back to _cogl_util_ffs if the size of ints and longs are the same (which is the case on i686). Otherwise it fallbacks to a slow function implementation. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-fixed: Move the GType defs from cogl-util.c to cogl-fixed.cNeil Roberts2011-11-162-160/+147
| | | | | | | | | | | | | | | | | | | | The boilerplate for defining a GType for CoglFixed lived in cogl-util.c but this didn't seem to make much sense seeing as nothing in the cogl-util.h header file relates to CoglFixed and there is already a separate C file for CoglFixed code. This also removes some redundant header includes from cogl-util.c Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * Add a conformance test for CoglBitmaskNeil Roberts2011-11-163-2/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a test which tries manipulating some bits on a CoglBitmask and verifies that it gets the expected result. This test is fairly unusual in that it is directly testing some internal Cogl code that isn't exposed through the public API. To make this work it directly includes the source for CoglBitmask. CoglBitmask does some somewhat dodgy things with converting longs to pointers and back so it makes sense to have a test case to verify that this is working on all platforms. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-bitmask: Use longs instead of intsNeil Roberts2011-11-162-55/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of storing only 31 bits in the pointer for a CoglBitmask, it now assumes it can store a whole unsigned long minus the one bit used to mark whether it has been converted to a GArray or not. This works on the assumption that we can cast an unsigned long to a pointer and back without losing information which I think should be true for any platforms that Cogl is interested in. This has the advantage that on 64-bit architectures we can store 63 bits before we have to resort to using a GArray at no extra cost. The values in the GArray are now stored as unsigned longs as well on the assumption that it is more efficient to load and store data in chunks of longs rather than ints. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * [l10n]Updated Turkish translationMuhammet Kara2011-11-161-6/+308
| |
* | Merge branch 'master' into msvc-supportChun-wei Fan2011-11-161-0/+3
|\ \ | |/
| * examples: Query the size of the framebufferRob Bradford2011-11-141-0/+3
| | | | | | | | | | | | | | | | The size of the framebuffer may not be the size of the framebuffer that we requested - we should use the actual size of the framebuffer in the calculations to position the crate in the center. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* | Update cogl.symbolsChun-wei Fan2011-11-151-0/+4
| | | | | | | | | | Due to commit 5369b3c6 (pipeline: Make the backface culling experimental public)
* | Merge branch 'master' into msvc-supportChun-wei Fan2011-11-1512-142/+270
|\ \ | |/
| * Don't take a reference to the last used onscreen framebufferNeil Roberts2011-11-143-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Cogl keeps a pointer to the last used onscreen framebuffer from the context to implement the deprecated cogl_set_draw_buffer function which can take COGL_WINDOW_BUFFER as the target to use the last onscreen buffer. Previously this would also take a reference to that pointer. However that was causing a circular reference between the framebuffer and the context which makes it impossible to clean up resources properly when onscreen buffers are used. This patch instead changes it to just store the pointer and then clear the pointer during _cogl_onscreen_free as a kind of cheap weak reference. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * test-backface-culling: Use the experimental pipeline APINeil Roberts2011-11-141-88/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tweaks the backface culling test to use the experimental pipeline API as well as the legacy API. All of the primitives are now rendered with all 16 combinations of front winding, cull face mode and legacy state. The test to 'draw a regular rectangle' has been removed. I think this initially existed because their were different functions to draw a rectangle with and without texturing. This is no longer the case so it is no longer useful and it's awkward to implement because it need a separate pipeline to disable the texturing. https://bugzilla.gnome.org/show_bug.cgi?id=663628 Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * pipeline: Make the backface culling experimental publicNeil Roberts2011-11-148-38/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds two new experimental public functions to replace the old internal _cogl_pipeline_set_cull_face_state function: void cogl_pipeline_set_cull_face_mode (CoglPipeline *pipeline, CoglPipelineCullFaceMode cull_face_mode); void cogl_pipeline_set_front_face_winding (CoglPipeline *pipeline, CoglWinding front_winding); There are also the corresponding getters. https://bugzilla.gnome.org/show_bug.cgi?id=663628 Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-utils: Include cogl-defines.hNeil Roberts2011-11-141-0/+1
| | | | | | | | | | | | | | | | | | | | cogl-utils.h needs to include cogl-defines.h so that it knows whether COGL_HAS_GLIB_SUPPORT is defined. https://bugzilla.gnome.org/show_bug.cgi?id=663578 Reviewed-by: Robert Bragg <robert@linux.intel.com> Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
| * cogl-renderer.c: Fix includesChun-wei Fan2011-11-141-0/+3
| | | | | | | | | | | | Only include cogl-xlib-renderer.h when XLIB support is available Reviewed-by: Robert Bragg <robert@linux.intel.com>
* | Merge branch 'master' into msvc-supportChun-wei Fan2011-11-142-25/+330
|\ \ | |/
| * l10n: Updated Greek translation for coglSimos Xenitellis2011-11-131-8/+311
| |
| * Updated Galician translationsFran Diéguez2011-11-101-17/+19
| |
* | Add VS projects for msaa and info examplesChun-wei Fan2011-11-0911-1/+735
| | | | | | | | | | | | Added Visual C++ 2008 and 2010 projects to build the cogl-msaa and cogl-info example programs, which is also added into the main solution files and "installed"
* | Update VS supportChun-wei Fan2011-11-093-2/+5
| | | | | | | | | | | | | | -Revert changes in VS property sheets regarding COGL_ENABLE_EXPERIMENTAL_API, as that is supposed to be in config.h during compilation. -Update config.h.win32.in accordingly as a result.
* | Update cogl.symbolsChun-wei Fan2011-11-091-5/+3
| | | | | | | | | | | | | | -Some cogl_primitives_* functions are now decorated with the _EXP suffix. -Certain _cogl_texture* functions are replaced by experimentally public functions
* | cogl-renderer.c: Fix includesChun-wei Fan2011-11-091-0/+3
| | | | | | | | Only include cogl-xlib-renderer.h when XLIB support is available
* | Update VS property sheetsChun-wei Fan2011-11-092-2/+5
| | | | | | | | | | -Force definition of COGL_ENABLE_EXPERIMENTAL_API for all COGL builds -Fix copying of crate.jpg (create destination folder first)
* | Merge branch 'master' into msvc-supportChun-wei Fan2011-11-0711-181/+416
|\ \ | |/
| * Updated Spanish translationJorge González2011-11-061-20/+24
| |
| * cogl-context: Destroy texture units later onNeil Roberts2011-11-041-2/+2
| | | | | | | | | | | | | | | | | | | | This patch moves the call to _cogl_destroy_texture_units() from _cogl_context_free() to later on. When destroying a GL texture the texture units are checked. This would end up accessing invalid memory so we need to try to destroy the texture units only after everything that might be referencing a texture has been destroyed. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * Updated Galician translationsFran Diéguez2011-11-041-9/+312
| |
| * tests: Port test-path conformance test from ClutterLuca Bruno2011-11-033-65/+38
| | | | | | | | Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * cogl-program: Don't ignore the transpose property of matrix uniformsNeil Roberts2011-11-031-0/+1
| | | | | | | | | | | | | | When setting a matrix uniform value the transpose property was getting lost and left uninitialized. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * Skip clip flush in _texture_2d_copy_from_framebufferRobert Bragg2011-11-031-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although there was a comment in cogl_texture_2d_copy_from_framebuffer explaining that we shouldn't flush the clip state, the comment was a bit miss-leading implying we were going to explicitly set a NULL clip. Also we weren't actually avoiding flushing the clip state since we were passing 0 for the CoglDrawFlags. We now pass COGL_FRAMEBUFFER_FLUSH_SKIP_CLIP_STATE in to the flags when flushing the framebuffer state and the comment has be updated to explain that clipping won't affect reading from the framebuffer so we don't need to flush it. Reviewed-by: Neil Roberts <neil@linux.intel.com>
| * clip: make cogl_clip_ensure a NOPRobert Bragg2011-11-031-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This api is deprecated and documented to be a NOP which wasn't actually true. This patch actually updates the function to be a NOP. Its nice that this gets rid of a point where we flush framebuffer state because we are looking to add a new VirtualFramebuffer interface which will need special consideration at each of the points we flush framebuffer state. It was a mistake that this API was ever published, we don't believe anyone is using the api but until we break api we have to keep the symbol. The documented semantics are vague enough that a NOP is ok since we never explicitly documented how the state would be flushed to GL so there would be no way to reliably use that state anyway. Reviewed-by: Neil Roberts <neil@linux.intel.com>
| * wayland: Port to current WaylandRob Bradford2011-11-031-52/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is one logical update to update the Wayland support. This comprises of the following parts: * Binding to both the shell and compositor global objects - necessary since the API for setting top level status moved to the wl_shell interface * The Wayland visual API went away and instead you setup the EGL surface appropriately * The message handling was refined to reflect the current behaviour - now obsolete comments were removed and new comments updated Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * wayland: Remove unused functionRob Bradford2011-11-031-18/+0
| | | | | | | | | | | | | | The function force_roundtrip was unused and required API that was removed from Wayland. Reviewed-by: Robert Bragg <robert@linux.intel.com>
| * glx: remove miss leading commentRobert Bragg2011-11-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | There was a comment implying that if a rgba config has been requested but no suitable config was found then we would automatically fall back to an rgb config instead. Actually if no rgba visual is found we simply fail without any automatic fall back because Cogl is not in a good position to judge if automatic fall backs are acceptable for higher level apis such as clutter. Reviewed-by: Neil Roberts <neil@linux.intel.com>