mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
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:
@ -45,18 +45,11 @@ CoglIndexBuffer *
|
||||
cogl_index_buffer_new (CoglContext *context, size_t bytes)
|
||||
{
|
||||
CoglIndexBuffer *indices = g_slice_new (CoglIndexBuffer);
|
||||
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 (indices),
|
||||
context,
|
||||
bytes,
|
||||
use_malloc,
|
||||
COGL_BUFFER_BIND_TARGET_INDEX_BUFFER,
|
||||
COGL_BUFFER_USAGE_HINT_INDEX_BUFFER,
|
||||
COGL_BUFFER_UPDATE_HINT_STATIC);
|
||||
|
Reference in New Issue
Block a user