Merge lp:~smspillaz/compiz-core/compiz-core.fix_911530 into lp:compiz-core/0.9.5
Proposed by
Sam Spilsbury
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Sam Spilsbury | ||||
Approved revision: | 2899 | ||||
Merged at revision: | 2934 | ||||
Proposed branch: | lp:~smspillaz/compiz-core/compiz-core.fix_911530 | ||||
Merge into: | lp:compiz-core/0.9.5 | ||||
Diff against target: |
95 lines (+22/-14) 1 file modified
plugins/opengl/src/paint.cpp (+22/-14) |
||||
To merge this branch: | bzr merge lp:~smspillaz/compiz-core/compiz-core.fix_911530 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Griffiths | Approve | ||
Daniel van Vugt | Needs Information | ||
Review via email:
|
Description of the change
PrivateGLScreen
fix the vertex array pointer to use the beginning of the vertex data
rather than (data + 2). Fix data allocation so only the necessary number
of vertices is allocated. Disable the unspecified texture coordinate
array in this case, since leaving it enabled may cause the GL driver to
segfault when attempting to dereference it.
To post a comment you must log in.
Duplicating the data allocation in 2 places not only makes the code bigger, but makes it harder to maintain (and potentially more buggy) in future. I suggest it should look more like:
bool bgEmpty = backgroundTextu res.empty ();
int dataLen = nBox * (bgEmpty ? 8 : 16);
data = new GLfloat [dataLen];
if (!data)
return;
d = data;
n = nBox;
if (bgEmpty)
This should make the entire diff much smaller.