#include "main/format_utils.h"
#include "main/glformats.h"
#include "main/image.h"
-#include "main/imports.h"
+
#include "main/macros.h"
#include "main/pack.h"
#include "main/pbo.h"
GLint x, GLint y,
GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels)
+ const GLvoid *pixels,
+ bool flip_y)
{
const GLubyte *src = (const GLubyte *)
_mesa_image_address2d(unpack, pixels, width,
GLint dstRowStride;
ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height,
- GL_MAP_WRITE_BIT, &dst, &dstRowStride);
+ GL_MAP_WRITE_BIT, &dst, &dstRowStride,
+ flip_y);
if (!dst) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
GLint x, GLint y,
GLsizei width, GLsizei height,
const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels)
+ const GLvoid *pixels,
+ bool flip_y)
{
const GLubyte *src = (const GLubyte *)
_mesa_image_address2d(unpack, pixels, width,
GLint dstRowStride;
ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height,
- GL_MAP_WRITE_BIT, &dst, &dstRowStride);
+ GL_MAP_WRITE_BIT, &dst, &dstRowStride,
+ flip_y);
if (!dst) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
GLsizei width, GLsizei height,
GLenum format, GLenum type,
const struct gl_pixelstore_attrib *unpack,
- const GLvoid *pixels)
+ const GLvoid *pixels,
+ bool flip_y)
{
const GLubyte *src = (const GLubyte *)
_mesa_image_address2d(unpack, pixels, width,
GLint dstRowStride;
ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height,
- GL_MAP_WRITE_BIT, &dst, &dstRowStride);
+ GL_MAP_WRITE_BIT, &dst, &dstRowStride,
+ flip_y);
if (!dst) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glDrawPixels");
const struct gl_pixelstore_attrib *userUnpack,
const GLvoid *pixels)
{
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0];
SWcontext *swrast = SWRAST_CONTEXT(ctx);
struct gl_pixelstore_attrib unpack;
(rb->Format == MESA_FORMAT_B8G8R8X8_UNORM ||
rb->Format == MESA_FORMAT_B8G8R8A8_UNORM)) {
fast_draw_rgb_ubyte_pixels(ctx, rb, x, y, width, height,
- &unpack, pixels);
+ &unpack, pixels, fb->FlipY);
return GL_TRUE;
}
(rb->Format == MESA_FORMAT_B8G8R8X8_UNORM ||
rb->Format == MESA_FORMAT_B8G8R8A8_UNORM)) {
fast_draw_rgba_ubyte_pixels(ctx, rb, x, y, width, height,
- &unpack, pixels);
+ &unpack, pixels, fb->FlipY);
return GL_TRUE;
}
if (_mesa_format_matches_format_and_type(rb->Format, format, type,
ctx->Unpack.SwapBytes, NULL)) {
fast_draw_generic_pixels(ctx, rb, x, y, width, height,
- format, type, &unpack, pixels);
+ format, type, &unpack, pixels,
+ fb->FlipY);
return GL_TRUE;
}
return;
}
}
-
+
depthRb = ctx->ReadBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
stencilRb = ctx->ReadBuffer->Attachment[BUFFER_STENCIL].Renderbuffer;
assert(depthRb);