summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
df80495)
We were calling glReadBuffer(draw_buffer) before reading the GL_READ_BUFFER.
+ // GL_COLOR_ATTACHMENT0 is implied
draw_buffer = GL_COLOR_ATTACHMENT0;
}
draw_buffer = GL_COLOR_ATTACHMENT0;
}
+ if (context.ES) {
+ // XXX: Draw buffer is always FRONT for single buffer context, BACK
+ // for double buffered contexts. There is no way to know which (as
+ // GL_DOUBLEBUFFER state is also unavailable), so always assume
+ // double-buffering.
+ draw_buffer = GL_BACK;
+ } else {
glGetIntegerv(GL_DRAW_BUFFER, &draw_buffer);
if (draw_buffer == GL_NONE) {
return NULL;
}
glGetIntegerv(GL_DRAW_BUFFER, &draw_buffer);
if (draw_buffer == GL_NONE) {
return NULL;
}
- } else {
- draw_buffer = GL_COLOR_ATTACHMENT0;
}
if (!getDrawableBounds(&desc.width, &desc.height)) {
}
if (!getDrawableBounds(&desc.width, &desc.height)) {
GLint draw_buffer = GL_NONE;
if (context.ES) {
GLint draw_buffer = GL_NONE;
if (context.ES) {
+ // XXX: Draw buffer is always FRONT for single buffer context, BACK for
+ // double buffered contexts. There is no way to know which (as
+ // GL_DOUBLEBUFFER state is also unavailable), so always assume
+ // double-buffering.
draw_buffer = GL_BACK;
} else {
glGetIntegerv(GL_DRAW_BUFFER, &draw_buffer);
draw_buffer = GL_BACK;
} else {
glGetIntegerv(GL_DRAW_BUFFER, &draw_buffer);
- glReadBuffer(draw_buffer);
}
if (draw_buffer != GL_NONE) {
}
if (draw_buffer != GL_NONE) {
+ // Read from current draw buffer
GLint read_buffer = GL_NONE;
if (!context.ES) {
glGetIntegerv(GL_READ_BUFFER, &read_buffer);
GLint read_buffer = GL_NONE;
if (!context.ES) {
glGetIntegerv(GL_READ_BUFFER, &read_buffer);
+ glReadBuffer(draw_buffer);
dumpReadBufferImage(json, width, height, format);
json.endMember();
dumpReadBufferImage(json, width, height, format);
json.endMember();
+ // Restore original read buffer
if (!context.ES) {
glReadBuffer(read_buffer);
}
if (!context.ES) {
glReadBuffer(read_buffer);
}