This improves the OpenGL ES support to extend it to version 3.0.
A number of new features are available in glesv3 including creation of
multi-sampled renderbuffers. These renderbuffers can be blitted to
single sample textures (but not the other way around). Other features
such as PBO for image uploading, are left as followon work.
For this preliminary implementation, glesv3 backends always create
renderbuffers, which can be set as single sample or multisample. The
renderbuffer's content is blitted to the texture only when used as a
source or a mask.
Images uploaded to a texture stay there until the surface is used as a
rendering target, at which point its painted to the renderbuffer.
This patch is heavily based off of Henry Song's initial GLESv3 patch
6f7f3795 from his cairogles fork of Cairo, and incorporates subsequent
fixes and pertinent refactorings from his trunk and review feedback from
Uli.
This implements the *functional* support for glesv3, excluding the
various optimization work to utilize its features. Rendering and
performance should not be expected to improve notably from pure glesv2.
As the GL backend for Cairo remains "experimental", these changes should
likewise be considered as such.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
As the random selection of a gradient can possible destroy the currently
active gradient, we need to flush the context in order to flush any
references to the texture before deletion.
In order to generate the correct left-hand border color, we need to
fudge the offsets of the color stops if multiple stops are defined at 0.
The reason is that pixman will generate our color ramp by using the
right-most color stop for the pixel centre, but in order to provide the
sample colour outside of the gradient we need pixel 0 to be have the
left-most color.
Reported by Henry Song.
If the gradient contains a step function, we need an infinitely sharp
texture to emulate the correct output. Failing that, lets just use as
large a texture as can be reasonably handled by the hardware
The gradient is relatively small and any differences between upload
methods should be hidden by the caching. As it stands, using pbo with
the gradient fails with fglrx. As the workaround to use a simple
TexImage2D is inconsequential (may even be a minute win) and simplifies
the code, just do it.
Let there be textures!
Unbreak the setup of surface operands after my lazy convertion to the
new compositor interface. This is still only the first step, but it gets
the essentials up and running again, enough to keep me happy whilst
sitting in the airport.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
GLES2 doesn't support Pixel Buffer Objects. Use conventional texture upload
for GLES2 (using client-side memory).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
1D textures are not available in GLES2. We use 2D textures with height 1
instead, which are equivalent to 1D textures and exist across all GL flavors.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Previously, the code returned a status and required the caller to mangle
this status with his own status. Now, the function takes the previous
status ass an argument and does the mangling itself.
Also contains fixes for all the callers to actually check the return
value - which is now rather trivial as it just requires passing through
the status variable.
For firefox-planet-gnome, 19135 times a gradient gets rendered using
only 10 different gradients. So we get a 100% hit rate in the cache.
Unfortunately, texture upload is not the biggest problem of this test,
as the performance increase is only moderate - at least on i965:
34.3s => 33.5s