Instead of looping over every quad for every grid cell and checking
for possible intersections, loop over the quads once and compute
the top left corner of the first intersecting grid cell. Then loop over
all the intersecting cells from that point and create the sub quads.
This new algorithm also preserves the order of the quads in the
original list.
also work around broken fbo texture clearing on fglrx
so far supports FBO/glClear and resorts to glTexSubImage2D
if the fbo cannot be created or is (in case of fglrx)
known to break, resort to glTexImage2D loading of an
argb array of zeros
BUG: 323065
FIXED-IN: 4.11.2
REVIEW: 112526
On GLES, check for OES_texture_3D extension for color correction
Remove a block of ugly hack code that was supposedly needed to build
with OpenGL ES.
Convert the lookup texture data to uint8 on OpenGL ES before sending it
via glTexImage3D, because uint16 is not supported.
Check if the shaders have been reinitialized successfuly when trying to
activate color correction, prevent black screens when there are issues
with the shaders.
BUG: 315419
REVIEW: 111225
(cherry picked from commit 68c68ee3c2b54f968c4d8275f1e8a2e0ccc90dd7)
This method returns true when glMapBufferRange() is likely to perform
worse than glBufferSubData() when updating an unused range in a buffer
object.
This is the case with the NVIDIA driver, where glMapBufferRange()
will force thread serialization. The driver tracks which ranges of
the buffer are in use, so calls to glBufferSubData() should not
cause a pipeline stall.
Assume that the default framebuffer has the same dimensions as the screen.
By not quering the dimensions of the viewport we don't risk serialization
in drivers that use threaded dispatch.
This reverts commit 23dff966437bb664a2ffdb3f7957ef39978f5fad.
Using QVector is not a win when effects such as wobbly windows are
active, due to the realloc overhead. So revert this change for now.
Eg. gtk+ alters the modality after mapping and
before unmapping the window.
Therfore the former implementation ahd a wrong idea
about the modality until the window was activated and
again had a wrong idea when the dialog closed, keeping
the main client dimmed.
Modality changes at runtime are uncommon but legal and can
happen anytime.
BUG: 321340
FIXED-IN: 4.11
REVIEW: 111154
Prevents the possiblity of using shaders modified for color correction
without valid data from KolorManager. If that happened, everthing
blacked out.
Now the color correction shaders are enabled only after successfuly
contacting KolorManager.
The issue was highlighted after ab7e228d.
BUG: 321217
it seems an animation can be triggered and the resp.
window deleted in the first event cycle (before the deleted
signal is bound) - so we add an initialization flag to ensure
the binding happens before the first animation is added
BUG: 320562
FIXED-IN: 4.11
REVIEW: 110872
Just like Opacity for transforming only the decoration opacity.
It's an ABI break as the new enum value had to be included as anonther
non-float base value.
Cross fading with previous pixmap is achieved by referencing the old
window pixmap. WindowPaintData has a cross-fade-factor which interpolates
between 0.0 (completely old pixmap) to 1.0 (completely new pixmap).
If a cross fading factor is set and a previous pixmap is valid this one
is rendered on top of the current pixmap with opacity adjusted. This
results in a smoother fading.
To simplify the setup the AnimationEffect is extended and also takes care
about correctly (un)referencing the previous window pixmap. The maximize
effect is adjusted to make use of this new capabilities.
Unfortunately this setup has a huge problem with the case that the window
decoration gets smaller (e.g. from normal to maximized state). In this
situation it can happen that the old window is rendered with parts outside
the content resulting in video garbage being shown. To prevent this a set
of new WindowQuads is generated with normalized texture coordinates in
the safe area which contains real content.
For OpenGL2Window a PreviousContentLeaf is added which is only set up in
case the crass fading factor is set.
REVIEW: 110578
This avoids the overhead of allocating each WindowQuad on the heap
when appending items to the list, and also ensures that the quads
are continuous in memory.
This reduces the size of the geometry that needs to be uploaded by
one-third, and allows kwin to take advantage of the post-transform
cache in the GPU.
Expose bindArrays(), unbindArrays() and add a draw() method that takes
an offset and a count. This makes it possible to upload geometry, call
bindArrays(), and then call draw() multiple times to draw different
subsets of the uploaded geometry.
Split WindowQuadDecoration into WindowQuadDecorationLeftRight
and WindowQuadDecorationTopBottom.
This simplifies the code in SceneOpenGL::Window::paintDecoration().
Do not schedule repaints in AnimationEffect if there are no animations
going on. If an animation is waiting for starting or kept after ending
the visual appearance is no longer changed, so no repaint is needed.
REVIEW: 110795
Unlike makeArrays() this function writes into a pre-allocated array,
and takes a matrix that's used to transform the texture coordinates.
This allows this function to handle coordinates for rectangular
textures correctly.
Note that unlike the previous commit, this doesn't fix texture coordinates
for rectangular textures. That case cannot be handled correctly without
knowing the dimensions of the texture.
This method returns a matrix that transforms normalized or un-normalized
texture coordinates, taking the texture target and y-inversion flag into
account.
KWin always updates the array buffer binding before it calls GL functions
that reference it, so there is never any need to reset it.
This should eliminate half the calls to glBindBuffer() while painting
the scene.
These methods make it possible to write directly into the buffer object
when building vertex arrays.
If the buffer object cannot be mapped, the map() method will return
a pointer to local memory which will be submitted to the buffer object
with glBufferData() when unmap() is called.
This overload makes it possible to upload data of an arbitrary size and
type into the buffer object. The intent is for this method to be used
to upload interleaved vertex data.
This commit also adds setVertexCount() and setAttribLayout().
The rationale for decoupling attribute specification from data uploading
is that the attribute formats and layout change less frequently than
the vertex data.
The vertex count is also specified using a separate function to enable
the caller to upload data for multiple draw calls at the same time.
Store the formats as an array in GLVertexBufferPrivate.
This simplifies the code for enabling the generic vertex arrays,
and also makes it easier to add new arrays.
Consolidate the code for binding and unbinding the vertex arrays into
two new methods called bindArrays() and unbindArrays() respectively.
This patch also removes the three paint implementations, since the only
difference between them is the code that sets up the arrays. The actual
painting code is moved into GLVertexBuffer::render(), which uses the
new methods to bind and unbind the arrays.
In case OpenGL ES 3 is provided by the driver we can use the GLSL 1.40
shaders as GLSL 300 ES shaders. The #version declarative is rewritten in
such a case.
REVIEW: 110590