summaryrefslogtreecommitdiff
path: root/cogl/cogl-clip-state.h
Commit message (Collapse)AuthorAgeFilesLines
* cogl-clip-state: Adapt to experimental cogl2 API.Jasper St. Pierre2011-03-101-21/+18
| | | | | | | | | The current clip state implementation couldn't be used in conjunction with the CoglPath experimental API. http://bugzilla.clutter-project.org/show_bug.cgi?id=2594 Signed-off-by: Neil Roberts <neil@linux.intel.com>
* clip: rename get_clip_stack + add framebuffer_get_stackRobert Bragg2011-01-211-18/+3
| | | | | | | | | | | | Instead of having _cogl_get/set_clip stack which reference the global CoglContext this instead makes those into CoglClipState method functions named _cogl_clip_state_get/set_stack that take an explicit pointer to a CoglClipState. This also adds _cogl_framebuffer_get/set_clip_stack convenience functions that avoid having to first get the ClipState from a framebuffer then the stack from that - so we can maintain the convenience of _cogl_get_clip_stack.
* build: cogl-clip-state.h depends on cogl-clip-stack.hRobert Bragg2010-11-191-0/+2
| | | | | This adds a #include "cogl-clip-stack.h" to cogl-clip-state.h which depends on the CoglClipStack typedef.
* cogl: Move the clip stack dirtiness to the context rather than the FBNeil Roberts2010-11-041-6/+0
| | | | | | | | | | | | | | | | | | Previously we tracked whether the clip stack needs flushing as part of the CoglClipState which is part of the CoglFramebuffer state. This is a bit odd because most of the clipping state (such as the clip planes and the scissor) are part of the GL context's state rather than the framebuffer. We were marking the clip state on the framebuffer dirty every time we change the framebuffer anyway so it seems to make more sense to have the dirtiness be part of the global context. Instead of a just a single boolean to record whether the state needs flushing, the CoglContext now holds a reference to the clip stack that was flushed. That way we can flush arbitrary stack states and if it happens to be the same as the state already flushed then Cogl will do nothing. This will be useful if we log the clip stack in the journal because then we will need to flush unrelated clip stack states for each batch.
* cogl-clip-stack: Don't allocate a separate struct for CoglClipStackNeil Roberts2010-11-041-13/+7
| | | | | | | | | | | | | | | | Instead of having a separate CoglHandle for CoglClipStack the code is now expected to directly hold a pointer to the top entry on the stack. The empty stack is then the NULL pointer. This saves an allocation when we want to copy the stack because we can just take a reference on a stack entry. The idea is that this will make it possible to store the clip stack in the journal without any extra allocations. The _cogl_get_clip_stack and set functions now take a CoglClipStack pointer instead of a handle so it would no longer make sense to make them public. However I think the only reason we would have wanted that in the first place would be to save the clip state between switching FBOs and that is no longer necessary.
* cogl: Implement retained clip stacksNeil Roberts2010-04-151-0/+28
| | | | | | | | | | | | | | | | | | | | | This adds three new internal API functions which can be used to retain the clip stack state and restore it later: _cogl_get_clip_stack _cogl_set_clip_stack _cogl_clip_stack_copy The functions are currently internal and not yet used but we may want to make them public in future to replace the cogl_clip_stack_save() and cogl_clip_stack_restore() APIs. The get function just returns the handle to the clip stack at the top of the stack of stacks and the set function just replaces it. The copy function makes a cheap copy of an existing stack by taking a reference to the top stack entry. This ends up working like a deep copy because there is no way to modify entries of a stack but it doesn't actually copy the data.
* Separate out CoglClipStackState from cogl-clip-stack.cNeil Roberts2010-04-151-0/+50
CoglClipStackState has now been renamed to CoglClipState and is moved to a separate file. CoglClipStack now just maintains a stack and doesn't worry about the rest of the state. CoglClipStack sill contains the code to flush the stack to GL.