#include "main/state.h"
#include "main/texobj.h"
#include "main/context.h"
+#include "main/fbobject.h"
#include "swrast/swrast.h"
#include "drivers/common/meta.h"
return NULL;
}
- buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_UNPACK_BUFFER_EXT,
- GL_READ_ONLY_ARB,
- unpack->BufferObj);
+ buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, unpack->BufferObj->Size,
+ GL_MAP_READ_BIT,
+ unpack->BufferObj);
if (!buf) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glBitmap(PBO is mapped)");
return NULL;
return ADD_POINTERS(buf, bitmap);
}
-static GLboolean test_bit( const GLubyte *src, GLuint bit )
+static bool test_bit( const GLubyte *src, GLuint bit )
{
return (src[bit/8] & (1<<(bit % 8))) ? 1 : 0;
}
GLuint w, GLuint h,
GLubyte *dest,
GLuint row_align,
- GLboolean invert)
+ bool invert)
{
GLuint src_offset = (x + unpack->SkipPixels) & 0x7;
GLuint mask = unpack->LsbFirst ? 0 : 7;
static INLINE int
y_flip(struct gl_framebuffer *fb, int y, int height)
{
- if (fb->Name != 0)
+ if (_mesa_is_user_fbo(fb))
return y;
else
return fb->Height - y - height;
/*
* Render a bitmap.
*/
-static GLboolean
+static bool
do_blit_bitmap( struct gl_context *ctx,
GLint dstx, GLint dsty,
GLsizei width, GLsizei height,
* It seems the blit Z coord is always 1.0 (the far plane) so fragments
* will likely be obscured by other, closer geometry.
*/
- return GL_FALSE;
+ return false;
}
intel_prepare_render(intel);
dst = intel_drawbuf_region(intel);
if (!dst)
- return GL_FALSE;
+ return false;
if (_mesa_is_bufferobj(unpack->BufferObj)) {
bitmap = map_pbo(ctx, width, height, unpack, bitmap);
if (bitmap == NULL)
- return GL_TRUE; /* even though this is an error, we're done */
+ return true; /* even though this is an error, we're done */
}
COPY_4V(tmpColor, ctx->Current.RasterColor);
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
if (!intel_check_blit_fragment_ops(ctx, tmpColor[3] == 1.0F))
- return GL_FALSE;
+ return false;
/* Clip to buffer bounds and scissor. */
if (!_mesa_clip_to_region(fb->_Xmin, fb->_Ymin,
* Have to translate destination coordinates back into source
* coordinates.
*/
- if (get_bitmap_rect(bitmap_width, bitmap_height, unpack,
- bitmap,
- -orig_dstx + (dstx + px),
- -orig_dsty + y_flip(fb, dsty + py, h),
- w, h,
- (GLubyte *)stipple,
- 8,
- fb->Name == 0 ? GL_TRUE : GL_FALSE) == 0)
+ int count = get_bitmap_rect(bitmap_width, bitmap_height, unpack,
+ bitmap,
+ -orig_dstx + (dstx + px),
+ -orig_dsty + y_flip(fb, dsty + py, h),
+ w, h,
+ (GLubyte *)stipple,
+ 8,
+ _mesa_is_winsys_fbo(fb));
+ if (count == 0)
continue;
if (!intelEmitImmediateColorExpandBlit(intel,
sz,
color,
dst->pitch,
- dst->buffer,
+ dst->bo,
0,
dst->tiling,
dstx + px,
dsty + py,
w, h,
logic_op)) {
- return GL_FALSE;
+ return false;
}
+
+ if (ctx->Query.CurrentOcclusionObject)
+ ctx->Query.CurrentOcclusionObject->Result += count;
}
}
out:
intel_check_front_buffer_rendering(intel);
- return GL_TRUE;
+ return true;
}
const struct gl_pixelstore_attrib *unpack,
const GLubyte * pixels)
{
- struct intel_context *intel = intel_context(ctx);
-
if (!_mesa_check_conditional_render(ctx))
return;
unpack, pixels))
return;
- /* FIXME */
- if (intel->gen == 6)
- return _swrast_Bitmap(ctx, x, y, width, height, unpack, pixels);
-
_mesa_meta_Bitmap(ctx, x, y, width, height, unpack, pixels);
}