summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* clip: Adds cogl_clip_push_primitive APIwip/for-cairo-coglRobert Bragg2011-10-034-63/+280
| | | | | | | | | | This adds a new experimental function, cogl_clip_push_primitive, that allows you to push a CoglPrimitive onto the clip stack. The primitive should describe a flat 2D shape and the geometry shouldn't include any self intersections. When pushing a primitive you also need to tell Cogl what the bounding box of that shape is (in shape local coordinates) so that Cogl is able to efficiently update the required region of the stencil buffer.
* clip-stack: Move path flushing code to cogl-clip-stack.cRobert Bragg2011-10-013-113/+117
| | | | | | | | | | | The code that adds the silhouette of a path to the stencil buffer was living in cogl2-path.c which seemed out of place when the bulk of the work really related more to how the stencil buffer is managed and basically only one line (a call to _cogl_path_fill_nodes) really related to the path code directly. This moves the code into cogl-clip-stack.c alone with similar code that can add rectangle masks to the stencil buffer.
* path: handle slice tex fallback using clip stackRobert Bragg2011-10-011-63/+43
| | | | | | | | | | | | | | | | | If we are asked to fill a path using any sliced textures then we need to fallback to adding a mask of the path to the stencil buffer and then drawing a bounding rectangle with the source textures instead. Previously we were sharing some of the clip-stack code for adding the path mask to the stencil buffer and being careful to check that the current clip stack has been flushed already. We then made sure to dirty the clip stack to be sure the path mask would be cleared from the stencil buffer later. This patch aims to simplify how this fallback is dealt with by just using the public clipping API instead of relying on more fiddly tricks to modify the stencil buffer directly without conflicting with the clip stack.
* framebuffer: Adds experimental _finish() APIRobert Bragg2011-09-283-0/+27
| | | | | | | | | | This adds a new experimental function, cogl_framebuffer_finish(), which can be used to explicitly synchronize the CPU with the GPU. It's rare that this level of explicit synchronization is desirable but for example it can be useful during performance analysys to make sure measurements reflect the working time of the GPU not just the time to queue commands. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* examples: Adds a simple 4x msaa exampleRobert Bragg2011-09-212-1/+115
| | | | | | | This adds a very basic test of onscreen and offscreen multisample rendering with 4 samples per pixel. The test simply draws two triangles; the one on the left is rendered directly to the onscreen framebuffer and the other is first rendered offscreen before copying it onscreen.
* offscreen: Adds support for offscreen multisamplingRobert Bragg2011-09-214-234/+470
| | | | | | | | | | | | | | This adds support for multisample rendering to offscreen framebuffers. After an offscreen framebuffer is first instantiated using cogl_offscreen_new_to_texture() it is then possible to use cogl_framebuffer_set_point_samples_per_pixel() to request multisampling before the framebuffer is allocated. This also adds cogl_framebuffer_resolve_samples() for explicitly resolving point samples into pixels. Even though we currently only support the IMG_multisampled_render_to_texture extension which doesn't require an explicit resolve, the plan is to also support the EXT_framebuffer_multisample extension which uses the framebuffer_blit extension to issue an explicit resolve.
* onscreen: Support point sample based onscreen renderingRobert Bragg2011-09-215-0/+55
| | | | | | | This adds support for point sample based rendering of onscreen windows whereby multiple point samples per pixel can be requested and if the hardware supports that it typically results in reduced aliasing (especially considering the jagged edges of polygons)
* Rework how we search for winsys configsRobert Bragg2011-09-216-117/+222
| | | | | | | | | | | | | | | | | | | | | | | When creating new onscreen framebuffers we need to take the configuration in cogl terms and translate that into a configuration applicable to any given winsys, e.g. an EGLConfig or a GLXFBConfig or a PIXELFORMATDESCRIPTOR. Also when we first create a context we typically have to do a very similar thing because most OpenGL winsys APIs also associate a framebuffer config with the context and all future configs need to be compatible with that. This patch introduces an internal CoglFramebufferConfig to wrap up some of the configuration parameters that are common to CoglOnscreenTemplate and to CoglFramebuffer so we aim to re-use code when dealing with the above two problems. This patch also aims to rework the winsys code so it can be more naturally extended as we start adding more configureability to how onscreen framebuffers are created. FIXME: still need to update the wgl winsys!
* framebuffer: Add explicit buffer discard APIRobert Bragg2011-09-213-17/+153
| | | | | | | | | | | | | | | | | | | This adds cogl_framebuffer_discard_buffers API that allows applications to explicitly discard depth and stencil buffers which really helps when using a tile based GPU architexture by potentially avoiding the need to save the results of depth and stencil buffer changes to system memory between frames since these can usually be handled directly with on-chip memory instead. The semantics for cogl_framebuffer_swap_buffers and cogl_framebuffer_swap_region are now documented to include an implicit discard of all buffers, including the color buffer. We now recommend that all rendering to a CoglOffscreen framebuffer should be followed by a call like: cogl_framebuffer_discard_buffers (fb, COGL_BUFFER_BIT_DEPTH| COGL_BUFFER_BIT_STENCIL);
* arbfp: assume GL_TEXTURE_2D target for NULL textureRobert Bragg2011-09-211-2/+8
| | | | | | | | During arbfp codegen we weren't checking for NULL textures and so we would crash when trying to query a NULL texture's GL texture target. Since NULL texture targets result in ctx->default_gl_texture_2d_tex being bound we can assume that a NULL texture corresponds to a GL_TEXTURE_2D target.
* pipeline: optimize _compare_differences functionsRobert Bragg2011-09-214-118/+89
| | | | | | | | | | | | | | | | This optimizes the layer and pipeline _compare_differences functions so neither of them use the GArray api since building up the list of ancestors by appending to a shared GArray was showing quite high on profiles due to how frequently pipeline comparisons are made. Instead we now build up a transient, singly linked list by allocating GList nodes via alloca to build up the parallel lists of ancestors. This tweaked approach actually ends up being a bit more concise than before, we avoid the overhead of the GArray api and now avoid making any function calls while comparing (assuming the _get_parent() calls always inline), we avoiding needing to get the default cogl context. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* pipeline: lazily get ctx in _get_layerRobert Bragg2011-09-211-2/+3
| | | | | | | | | We only need a ctx pointer if we need to refer to the default_layer_x layers to copy as templates so only call _cogl_context_get_default() once we need to copy a template. _cogl_context_get_default() was starting to show up in profiles and this was the main cause. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* pipeline: Split more code out from cogl-pipeline.cRobert Bragg2011-09-2115-1509/+1752
| | | | | | | | | | | | | This splits out the core CoglPipelineLayer support code from cogl-pipeline.c into cogl-pipeline-layer.c; it splits out the debugging code for dumping a pipeline to a .dot file into cogl-pipeline-debug.c and it splits the CoglPipelineNode support which is shared between CoglPipeline and CoglPipelineLayer into cogl-node.c. Note: cogl-pipeline-layer.c only contains the layer code directly relating to CoglPipelineLayer objects; it does not contain any _cogl_pipeline API relating to how CoglPipeline tracks and manipulates layers.
* attributes: optimize validation of tex_coord%d_in namesRobert Bragg2011-09-211-1/+4
| | | | | | | | | | This avoids using sscanf to determine the texture_unit that a tex_coord%d_in attribute name corresponds to since that was showing high on profiles. Instead once we know we have a "tex_coord" name then we can simply use strtoul which is much cheaper and use the returned endptr we get to verify we have a "_in" suffix after the number. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* primitive: micro optimize primitive allocationsRobert Bragg2011-09-212-47/+64
| | | | | | | | | | | | | | | | | | | | We've started seeing cases where we want to allocate lots of one-shot primitives per-frame and the cost of allocating primitives becomes important in this case since it can start being noticeable in profiles. The main cost for allocating primitives was the GArray allocation and appending the attributes to the array. This updates the code to simply over allocate the primitive storage so we can embed the list of attributes directly in that allocation. If the user later sets new attributes and there isn't enough embedded space then a separate slice allocation for the new attributes is made but still this should be far less costly than using a GArray as before. Most of the time we would expect when setting new attributes there will still be the same number of attributes, so the embedded space can simple be reused. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* attributes: avoid g_strdup in cogl_attribute_newRobert Bragg2011-09-212-8/+42
| | | | | | | | | | Calling g_strdup for attribute names was starting to show up in profiles due to calling malloc for new string storage so frequently. This avoids calling g_strdup and calls g_intern_string() instead. For the really common case names we even avoid the cost of g_intern_string since we can trivially relate our internal name_id to a static string. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Add a strong CoglTexture type to replace CoglHandleRobert Bragg2011-09-2132-501/+382
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of the on going, incremental effort to purge the non type safe CoglHandle type from the Cogl API this patch tackles most of the CoglHandle uses relating to textures. We'd postponed making this change for quite a while because we wanted to have a clearer understanding of how we wanted to evolve the texture APIs towards Cogl 2.0 before exposing type safety here which would be difficult to change later since it would imply breaking APIs. The basic idea that we are steering towards now is that CoglTexture can be considered to be the most primitive interface we have for any object representing a texture. The texture interface would provide roughly these methods: cogl_texture_get_width cogl_texture_get_height cogl_texture_can_repeat cogl_texture_can_mipmap cogl_texture_generate_mipmap; cogl_texture_get_format cogl_texture_set_region cogl_texture_get_region Besides the texture interface we will then start to expose types corresponding to specific texture types: CoglTexture2D, CoglTexture3D, CoglTexture2DSliced, CoglSubTexture, CoglAtlasTexture and CoglTexturePixmapX11. We will then also expose an interface for the high-level texture types we have (such as CoglTexture2DSlice, CoglSubTexture and CoglAtlasTexture) called CoglMetaTexture. CoglMetaTexture is an additional interface that lets you iterate a virtual region of a meta texture and get mappings of primitive textures to sub-regions of that virtual region. Internally we already have this kind of abstraction for dealing with sliced texture, sub-textures and atlas textures in a consistent way, so this will just make that abstraction public. The aim here is to clarify that there is a difference between primitive textures (CoglTexture2D/3D) and some of the other high-level textures, and also enable developers to implement primitives that can support meta textures since they can only be used with the cogl_rectangle API currently. The thing that's not so clean-cut with this are the texture constructors we have currently; such as cogl_texture_new_from_file which no longer make sense when CoglTexture is considered to be an interface. These will basically just become convenient factory functions and it's just a bit unusual that they are within the cogl_texture namespace. It's worth noting here that all the texture type APIs will also have their own type specific constructors so these functions will only be used for the convenience of being able to create a texture without really wanting to know the details of what type of texture you need. Longer term for 2.0 we may come up with replacement names for these factory functions or the other thing we are considering is designing some asynchronous factory functions instead since it's so often detrimental to application performance to be blocked waiting for a texture to be uploaded to the GPU. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* mingw-fetch-dependencies: Download config.guess and explicitly run itNeil Roberts2011-09-211-1/+7
| | | | | | | | | | Previously the instructions were telling the developer to run ./build/config.guess to get the build name to pass to configure. However that file only exists after running automake so it's a bit awkward. This patch makes it download config.guess from the gitweb for automake and just explicitly run it. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* mingw-fetch-dependencies.sh: Fix a mention of ClutterNeil Roberts2011-09-211-1/+1
| | | | | | | The instructions mentioned the Clutter source tree instead of the Cogl source tree. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* mingw-fetch-dependencies.sh: Don't pass -c to wgetNeil Roberts2011-09-211-2/+7
| | | | | | | | | | | | The -c option for wget and -C - option to curl are used to make it continue the download if the file already exists. The idea was that it wouldn't waste time downloading the files again if the file already exists. However this causes problems if the remote file gets larger because the download will continue from the size of the old file so it will get corrupt. Instead let's just explicitly check if the file already exists and avoid calling wget or curl altogether. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Updated Danish translationFlemming Christensen2011-09-211-0/+35
|
* Added Hungarian translationGabor Kelemen2011-09-211-0/+36
|
* Bump development version to 1.9.1Robert Bragg2011-09-191-1/+1
|
* Post-release version bump to 1.8.1Robert Bragg2011-09-191-2/+2
|
* Release 1.8.0 (release)1.8.0Robert Bragg2011-09-191-5/+5
|
* Updates NEWS for the 1.8.0 releaseRobert Bragg2011-09-191-5/+59
|
* mingw: don't fetch mesa_wgl.h + update summary blurbRobert Bragg2011-09-191-3/+2
| | | | | | | | | | | | mesa_wgl.h can no longer be fetched from upstream and since it's no longer used anyway we don't fetch this any more. This also updates the blurb printed after fetching dependencies to show how to run ./configure so we pass --enable-wgl not --enable-stub-winsys and to also pass the -I path for the cogl-cross/include directory which has the latest gl.h we fetched so the build doesn't try and use the headers shipped with the mingw toolchain which may be out-of-date. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* Added Basque languageInaki Larranaga Murgoitio2011-09-191-0/+36
|
* README: s/draw pretty pictures/render/Robert Bragg2011-09-191-6/+6
| | | | | This tweaks the overview of Cogl to use more technical terminology instead of saying Cogl is used to "draw pretty pictures".
* doc/RELEASING: note that the conformance tests should be runRobert Bragg2011-09-191-1/+5
| | | | | This documents that `make check` should be run as part of the release process.
* Port the backface culling testNeil Roberts2011-09-193-101/+70
| | | | | | | This ports the backface culling conformance test to work without Clutter. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* test-utils: Use a power-of-two size for the FBONeil Roberts2011-09-191-2/+2
| | | | | | | | | When testing with COGL_DEBUG=disable-npot-textures all of the tests would fail because the testing infrastructure itself ends up creating a sliced texture and then trying to use it as a render target. This just modifies test-utils to use 512x512 for the size of the texture. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* cogl-primitives: Don't warn if using sliced textures without multi-texNeil Roberts2011-09-191-12/+16
| | | | | | | | | | | | cogl_rectangle has some validation code to check whether the first layer has a sliced texture. If so it will abandon the rest of the layers and print a warning. However it was even doing this pruning and displaying the warning if there is only one layer. This patch just makes it check whether the pipeline actually has more than one layer before pruning or displaying the warning but it will still fallback to the multiple quads path. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Make backface culling be part of the legacy stateNeil Roberts2011-09-1912-103/+258
| | | | | | | | | | | | | | | | | | | | This adds an internal function to set the backface culling state on a pipeline. This includes properties to set the culling mode (front, back or both) and also to set which face is considered the front (COGL_WINDING_CLOCKWISE or COGL_WINDING_COUNTER_CLOCKWISE). The actual front face flushed to GL depends on whether we are rendering to an offscreen buffer or not. This means that when changing between on- and off- screen framebuffers it now checks whether the last flushed pipeline has backface culling enabled and forces a reflush of the cull face state if so. The backface culling is now set on a pipeline as part of the legacy state. This is important because some code in Cogl assumes it can flush a temporary pipeline to revert to a known state, but previously this wouldn't disable backface culling so things such as flushing the clip stack could get confused. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* cogl-framebuffer: Force flushing the color mask when changing fbsNeil Roberts2011-09-192-37/+64
| | | | | | | | | | | | | | | | | | | | | | | | When changing between two framebuffers that have different color masks it now forces the pipeline to flush the mask by setting current_pipeline_changes_since_flush. For this to work there needs to be a common bit of code that gets called when the framebuffers are changed that has access to both the old framebuffer and the new framebuffer. _cogl_set_framebuffers_real can't be used for this because when it is called from cogl_pop_framebuffer the stack entries have already changed so it can't know the old framebuffer. This patch adds a new function called notify_buffers_changed which should get called whenever the buffers are changed and it explicitly gets passed pointers to the old and new buffers. cogl_pop_framebuffer now calls this instead of trying to use _cogl_set_framebuffers_real to force a flush. This patch also fixes the ctx->window_buffer pointer. Previously this was implemented by searching in the framebuffer stack for an onscreen framebuffer whenever the current buffers are changed. However it does this after the stack has already changed so it won't usually find the right buffer. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add a conformance test for setting the color mask on a framebufferNeil Roberts2011-09-193-0/+121
| | | | | | | | There is a currently a bug where pushing a buffer with a different color mask will not cause the color mask to be flushed. This adds a test to demonstrate that. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* pipeline-arbfp: Check for fog on the pipeline not the legacy stateNeil Roberts2011-09-193-1/+16
| | | | | | | | | | | | | The ARBfp backend can't handle fog so it tries to check for when it's enabled and bails out. However it was checking using the global legacy state value on the CoglContext but this doesn't necessarily reflect the state that will actually be used by the pipeline because Cogl may have internally pushed a different pipeline. This patch adds an internal _cogl_pipeline_get_fog_enabled which the ARBfp backend now uses. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* Add internal _cogl_push_source to optionally disable legacy stateNeil Roberts2011-09-1910-34/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some code in Cogl such as when flushing a stencil clip assumes that it can push a temporary simple pipeline to reset to a known state for internal drawing operations. However this breaks down if the application has set any legacy state because that is set globally so it will also get applied to the internal pipeline. _cogl_draw_attributes already had an internal flag to disable applying the legacy state but I think this is quite awkward to use because not all places that push a pipeline draw the attribute buffers directly so it is difficult to pass the flag down through the layers. Conceptually the legacy state is meant to be like a layer on top of the purely pipeline-based state API so I think ideally we should have an internal function to push the source without the applying the legacy state. The legacy state can't be applied as the pipeline is pushed because the global state can be modified even after it is pushed. This patch adds a _cogl_push_source() function which takes an extra boolean flag to mark whether to enable the legacy state. The value of this flag is stored alongside the pipeline in the pipeline stack. Another new internal function called _cogl_get_enable_legacy_state queries whether the top entry in the pipeline stack has legacy state enabled. cogl-primitives and the vertex array drawing code now use this to determine whether to apply the legacy state when drawing. The COGL_DRAW_SKIP_LEGACY_STATE flag is now removed. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* cogl-path: Don't apply legacy state twice when strokingNeil Roberts2011-09-191-12/+2
| | | | | | | | | | Since 12b3d21aaa cogl is using the vertex attribute API to stroke a path. However it was still manually appllying the legacy state to the pipeline. cogl_vdraw_attributes also applies the legacy state so it ends up getting applied twice. This patch just removes it from _cogl_path_stroke_nodes. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* test-utils: Use g_setenv instead of setenvNeil Roberts2011-09-191-1/+1
| | | | | | | Apparently there is no setenv function on Windows so it's more portable to use g_setenv instead. Reviewed-by: Robert Bragg <robert@linux.intel.com>
* winsys-glx: Fix synchronisation behaviour in _cogl_winsys_onscreen_swap_regionAdel Gadllah2011-09-193-2/+16
| | | | | | | | | | | | | | | | | This patch basically restores the logic from 1.6. There we assumed that glXCopySubBuffer won't tear and thus only needs to be throttled to the framerate, while glBlitFramebuffer needs to always wait to avoid tearing. With Nvidia drivers specifically we have seen that glBlitFramebuffer is not synchronized. Eventually the plan is that Cogl will actually take into consideration the underlying driver/hw vendor and driver version and we may want to only mark glBlitFramebuffer un-synchronized on Nvidia. https://bugzilla.gnome.org/show_bug.cgi?id=659360 Reviewed-by: Robert Bragg <robert@linux.intel.com>
* pipeline: mark all cogl-pipeline.h symbols experimentalRobert Bragg2011-09-191-2/+13
| | | | | | | | | All of the cogl_pipeline API is currently experimental so this makes sure the API is surrounded by #ifdef COGL_ENABLE_EXPERIMENTAL_API guards and all the symbols have a #define to give them an _EXP suffix as we do for other experimental API. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* pipeline: split out all layer state apisRobert Bragg2011-09-1910-2072/+2324
| | | | | | | | | | | | As part of an on-going effort to get cogl-pipeline.c into a more maintainable state this splits out all the apis relating just to layer state. This just leaves code relating to the core CoglPipeline and CoglPipelineLayer design left in cogl-pipeline.c. This splits out around 2k more lines from cogl-pipeline.c although we are still left with nearly 4k lines so we still have some way to go! Reviewed-by: Neil Roberts <neil@linux.intel.com>
* pipeline: split out all core state apisRobert Bragg2011-09-1910-1976/+2259
| | | | | | | | | | | | | | | | Since cogl-pipeline.c has become very unwieldy this make a start at trying to shape this code back into a manageable state. This patche moves all the API relating to core pipeline state into cogl-pipeline-state.c. This doesn't move code relating to layer state out nor does it move any of the code supporting the core design of CoglPipeline itself. This change alone factors out 2k lines of code from cogl-pipeline.c which is obviously a good start. The next step will be to factor out the layer state and then probably look at breaking all of this state code down into state-groups. Reviewed-by: Neil Roberts <neil@linux.intel.com>
* cogl: Bind the locale dir for the Cogl domainNeil Roberts2011-09-192-0/+5
| | | | | | | | | | dgettext (which Cogl is using) doesn't work unless you first tell gettext where the locale dir is for the library's domain. This just adds the necessary calls into _cogl_init. https://bugzilla.gnome.org/show_bug.cgi?id=658700 Reviewed-by: Robert Bragg <robert@linux.intel.com>
* l10n: Added Greek translation for coglIoannis Zamboukas2011-09-181-0/+35
|
* [l10n] German translationWolfgang Stöggl2011-09-181-0/+34
|
* Add simplified Chinese translation.Yinghua Wang2011-09-171-0/+33
|
* Added en_CA.poTiffany Antopolski2011-09-161-0/+35
|
* Added Serbian translationМирослав Николић2011-09-162-0/+74
|