Commit Graph

1761 Commits

Author SHA1 Message Date
Neil Roberts
f6ec6e2d0e pipeline-arbfp: Check for fog on the pipeline not the legacy state
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>
2011-09-19 16:40:06 +01:00
Neil Roberts
2059ae3ac8 Add internal _cogl_push_source to optionally disable legacy state
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>
2011-09-19 16:40:06 +01:00
Neil Roberts
acc7d25188 cogl-path: Don't apply legacy state twice when stroking
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>
2011-09-19 16:40:06 +01:00
Neil Roberts
f7b24d88f4 test-utils: Use g_setenv instead of setenv
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>
2011-09-19 16:40:06 +01:00
Adel Gadllah
671a4dfb34 winsys-glx: Fix synchronisation behaviour in _cogl_winsys_onscreen_swap_region
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>
2011-09-19 16:40:06 +01:00
Robert Bragg
3c82fd056c pipeline: mark all cogl-pipeline.h symbols experimental
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>
2011-09-19 16:40:06 +01:00
Robert Bragg
db6c452aaa pipeline: split out all layer state apis
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>
2011-09-19 16:40:00 +01:00
Robert Bragg
9b58b6f472 pipeline: split out all core state apis
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>
2011-09-19 16:35:59 +01:00
Neil Roberts
c7969a33af cogl: Bind the locale dir for the Cogl domain
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>
2011-09-19 12:53:58 +01:00
Ioannis Zamboukas
85ef60b62d l10n: Added Greek translation for cogl 2011-09-18 21:54:31 +03:00
Wolfgang Stöggl
88748d2321 [l10n] German translation 2011-09-18 15:06:26 +02:00
Yinghua Wang
9d9dd40b6b Add simplified Chinese translation. 2011-09-17 15:23:51 +00:00
Tiffany Antopolski
85548f7c4b Added en_CA.po 2011-09-16 19:16:05 -04:00
Мирослав Николић
6ba1e578a0 Added Serbian translation 2011-09-16 23:58:53 +02:00
Laura Balbastre
42852cbe6b [l10n]Added Catalan translation 2011-09-16 01:47:25 +02:00
Ihar Hrachyshka
ff0dd09a62 Added Belarusian translation. 2011-09-15 19:45:46 +03:00
Yuri Myasoedov
eb11e396b1 Added Russian translation 2011-09-14 21:18:40 +04:00
Neil Roberts
e81c1f3e9a cogl-journal: Fix software clipping for non-intersecting rectangles
When the clip contains two rectangles which do not intersect it was
generating a clip bounds where the bottom-right corner was above or to
the left of the top-left corner. This would end up allowing the pixels
between the two rectangles instead of clipping everything like it
should. To fix this there is now an extra check which detects this
situation and just clears the clip bounds to all zeroes in a similar
way to what cogl-clip-stack does.

https://bugzilla.gnome.org/show_bug.cgi?id=659029

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-14 16:30:16 +01:00
I Felix
17449423fa Updated Tamil Translations 2011-09-13 14:29:51 +05:30
Neil Roberts
9082dd0d71 cogl-path: Clear the stroke attribute buffer when modifying the path
Commit 12b3d21a changed cogl-path so that it will use the vertex
attribute API to stroke the path in a similar way to how it was using
the API to fill the path. However it wasn't clearing the stroke buffer
when the path is modified so it would continue to use the unmodified
stroke.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-12 18:54:16 +01:00
Rudolfs Mazurs
cb31c6eeec Added Latvian translation. 2011-09-12 00:50:46 +03:00
Xandru Armesto
6b88524c3c Updated asturian translation 2011-09-11 18:53:07 +02:00
Duarte Loreto
9b6847011e Updated Portuguese translation 2011-09-11 00:52:35 +01:00
Muhammet Kara
35ff4a562d [l10n]Added Turkish translation 2011-09-10 19:22:08 +03:00
Robert Bragg
f1c2d7e965 2.0: Add cogl2-experimental.h + don't pollute .pc CFLAGS
Instead of adding -DCOGL_ENABLE_EXPERIMENTAL_2_0_API to the
cogl-2.0-experimental.pc file we now install a cogl2-experimental.h
that #defines COGL_ENABLE_EXPERIMENTAL_2_0_API before including
cogl.h.

The problem with having the define in the .pc file is that you might
develop a library that depends on the experimental 2.0 api internally
and then you might want to use that library with Clutter which still
uses the 1.0 API but the .pc file for your library will indirectly,
automatically enable the 2.0 api which can cause conflicts.
2011-09-09 15:06:31 +01:00
Robert Bragg
d43505db22 arbfp: remove redundant unit_state re-initialization
When we are about to start arbfp codegen we call shader_state_new() to
allocate new state structures used to build up the code and that
function makes sure to zero the newly allocated structures.

Right after calling shader_state_new() we were then also explicitly
iterating though the newly allocated unit_state structures and zeroing
the .sampled and .dirty_combine_constant members as well as resetting
shader_state->next_constant_id = 0. This patch removes that redundant
re-initialization of state.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-09-09 14:40:48 +01:00
Robert Bragg
b6cea6bed6 arbfp: track which layers have combine constants
We weren't actually tracking which layers have been allocated param
space for combine constants; all layers just had a default constant_id
of 0 that indexes into the program.local[] params array and a dirty flag
to say when the constant needs updating. There are times though when we
say to update everything by-passing the dirty flag and because we
weren't actually tracking which layers needed constants we would always
write a constant to program.local[0] for every layer. The upshot was
that we could end up clobbering a real constant that was actually
allocated the constant_id = 0 slot.

This patch adds a new UnitState bitfield to track if the layer has a
corresponding constant that may need flushing and we only ever write the
constant with glProgramLocalParameter4fv if that's set.

https://bugzilla.gnome.org/show_bug.cgi?id=658092

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-09-09 14:40:48 +01:00
Bruce Cowan
5888e0c65f Updated British English translation 2011-09-09 13:14:02 +01:00
Manoj Kumar Giri
57b8f4c6ce Updated Oriya Translation 2011-09-09 11:11:42 +05:30
Robert Bragg
b5a7657076 Starts porting Cogl conformance tests from Clutter
This makes a start on porting the Cogl conformance tests that currently
still live in the Clutter repository to be standalone Cogl tests that no
longer require a ClutterStage.

The main thing is that this commit brings in is the basic testing
infrastructure we need, so now we can port more and more tests
incrementally.

Since the test suite wants a way to synchronize X requests/replies and
we can't simply call XSynchronize in the test-utils code before we know
if we are really running on X this adds a check for an environment
variable named "COGL_X11_SYNC" in cogl-xlib-renderer.c and if it's set
it forces XSynchronize (dpy, TRUE) to be called.

By default the conformance tests are run off screen. This makes the
tests run much faster and they also don't interfere with other work you
may want to do by constantly stealing focus. CoglOnscreen framebuffers
obviously don't get tested this way so it's important that the tests
also get run on screen every once in a while, especially if changes are
being made to CoglFramebuffer related code.  On screen testing can be
enabled by setting COGL_TEST_ONSCREEN=1 in your environment.
2011-09-08 15:48:07 +01:00
Matej Urbančič
40848e72dc Updated Slovenian translation 2011-09-07 21:05:26 +02:00
Matej Urbančič
181e000adb Added Slovenian translation 2011-09-07 21:01:21 +02:00
Luca Ferretti
fdfb143106 Added Italian translation 2011-09-07 00:36:01 +02:00
Chun-wei Fan
a1d869384e Fix typo in cogl/cogl-display.h
The line "#define cogl_display_get_rendrer cogl_display_get_rendrer_EXP"
should read
"#define cogl_display_get_renderer cogl_display_get_renderer_EXP"...

https://bugzilla.gnome.org/show_bug.cgi?id=658333

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-06 11:19:20 +01:00
Andika Triwidada
81486b1681 Added Indonesian translation 2011-09-06 14:06:52 +07:00
Arash Mousavi
a4d0d606ef Added persian translation 2011-09-06 11:32:23 +04:30
Wouter Bolsterlee
b3c133f1d2 New Dutch translation by Wouter Bolsterlee 2011-09-06 01:00:25 +02:00
Abdalrahim G. Fakhouri
6d6e291e44 Added Arabic translation 2011-09-05 21:12:57 +01:00
Emmanuele Bassi
e1c2b9335f docs: Update the Bugzilla URL in the README
https://bugzilla.gnome.org/show_bug.cgi?id=656442

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-05 20:59:00 +01:00
Robert Bragg
e4ef536c7a build: fix make release-message find the sha256 file
the sha256 file for the release should be found under the build/
directory not at the top of the repo.
2011-09-05 20:59:00 +01:00
Robert Bragg
ad4cfaf270 Post-release version bump to 1.7.9 2011-09-05 20:19:03 +01:00
Robert Bragg
99c25f34ef Release 1.7.8 (snapshot) 2011-09-05 19:26:20 +01:00
Robert Bragg
40281e608b Updates NEWS for the 1.7.8 release 2011-09-05 19:06:02 +01:00
Emmanuele Bassi
69b0db4cdb build: Require gobject-2.0 and gmodule-no-export-2.0
Cogl requires gobject and gmodule API, so we need to check for these and
add them to the pkg-config files as dependencies, otherwise building
Cogl with --as-needed (like modern distributions now do) will cause
build errors.

https://bugzilla.gnome.org/show_bug.cgi?id=656809

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-05 19:05:27 +01:00
Robert Bragg
191d915671 framebuffer: Add a getter for the framebuffer format
This adds a new function, cogl_framebuffer_get_color_format() to be able
to query the common pixel format for any color buffers attached to a
given CoglFramebuffer. For example an offscreen framebuffer created
using cogl_offscreen_new_to_texture() would have a format matching the
texture.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-09-05 19:02:05 +01:00
Robert Bragg
476ff37fa6 display: always ensure we have an onscreen_template
If the user doesn't explicitly pass an onscreen template then instead of
leaving display->onscreen_template as NULL we now instantiate a template
ourselves. This simplifies winsys code that might want to refer to the
template since it needn't first check for a NULL pointer.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-09-05 19:02:05 +01:00
Robert Bragg
21e87a9bf0 texture-2d: move #defines before gtk-doc
All our experimental Cogl symbols have a corresponding #define to add
"_EXP" to the end of the symbol name, but those defines are often
positioned right after the corresponding gtk-doc comment and before
the symbol definition which means the generated documentation ends up
refering to the define and not the real definition. This tidies up
cogl-texture-2d.h and moves all the defines to be be before the gtk-doc
comments.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
2011-09-05 19:02:05 +01:00
Emmanuele Bassi
fcd6a45b98 Update the COPYING file
The FSF changed address, so we need to update the license file to match
the upstream one.

https://bugzilla.gnome.org/show_bug.cgi?id=656587

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-05 19:02:05 +01:00
Neil Roberts
e7f374d799 cogl-pipeline-fragend-glsl: Cache the results of texture lookups
Whenever a texture lookup is performed for a layer the result is now
stored in a variable and used repeatedly instead of generating the
code for the lookup every time it is accessed. This means for example
when using the INTERPOLATE function with a texture lookup for the
third parameter it will only generate one texture lookup instead of
two.

https://bugzilla.gnome.org/show_bug.cgi?id=656426

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-05 19:02:04 +01:00
Neil Roberts
769c8472dd fragend-glsl: Don't generate code for ignored layers
This patch changes it so that code for each layer is generated on
demand instead of directly in the add_layer implementation. The
pipeline only explicitly generates code for the last layer. If this
layer references the result from any other layers, these will also be
recursively generated. This means that if a layer is using 'REPLACE'
then it won't redundantly generate the code for the previous
layers.

The result for each layer is generated into a variable called layer%i
where %i is the layer index (not the unit index). Therefore to get the
result from layer n we just have to refer to the varible layern.

https://bugzilla.gnome.org/show_bug.cgi?id=656426

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-09-05 19:02:04 +01:00