buffer: move choice about using malloc closer to driver
This moves the decision about whether a buffer should be allocated using malloc or not into cogl-buffer.c closer to the driver since it seem there could be other driver specific factors that might also influence this choice that we don't currently consider. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit 06d46f10bf755d3009c28904e616a0adb4586cf5)
This commit is contained in:
@ -44,18 +44,11 @@ cogl_attribute_buffer_new (CoglContext *context,
|
||||
const void *data)
|
||||
{
|
||||
CoglAttributeBuffer *array = g_slice_new (CoglAttributeBuffer);
|
||||
CoglBool use_malloc;
|
||||
|
||||
if (!(context->private_feature_flags & COGL_PRIVATE_FEATURE_VBOS))
|
||||
use_malloc = TRUE;
|
||||
else
|
||||
use_malloc = FALSE;
|
||||
|
||||
/* parent's constructor */
|
||||
_cogl_buffer_initialize (COGL_BUFFER (array),
|
||||
context,
|
||||
bytes,
|
||||
use_malloc,
|
||||
COGL_BUFFER_BIND_TARGET_ATTRIBUTE_BUFFER,
|
||||
COGL_BUFFER_USAGE_HINT_ATTRIBUTE_BUFFER,
|
||||
COGL_BUFFER_UPDATE_HINT_STATIC);
|
||||
|
Reference in New Issue
Block a user