Exemplo n.º 1
0
static CoglBool
validate_layer_cb (CoglPipelineLayer *layer, void *user_data)
{
  CoglBool *needs_fallback = user_data;
  CoglTexture *texture = _cogl_pipeline_layer_get_texture (layer);

  /* If any of the layers of the current pipeline contain sliced
   * textures or textures with waste then it won't work to draw the
   * path directly. Instead we fallback to pushing the path as a clip
   * on the clip-stack and drawing the path's bounding rectangle
   * instead.
   */

  if (texture != NULL && (cogl_texture_is_sliced (texture) ||
                          !_cogl_texture_can_hardware_repeat (texture)))
    *needs_fallback = TRUE;

  return !*needs_fallback;
}
Exemplo n.º 2
0
/* Whenever the underlying GL texture storage of a CoglTexture is
 * changed (e.g. due to migration out of a texture atlas) then we are
 * notified. This lets us ensure that we reflush that texture's state
 * if it is reused again with the same texture unit.
 */
void
_cogl_pipeline_texture_storage_change_notify (CoglTexture *texture)
{
  int i;

  _COGL_GET_CONTEXT (ctx, NO_RETVAL);

  for (i = 0; i < ctx->texture_units->len; i++)
    {
      CoglTextureUnit *unit =
        &g_array_index (ctx->texture_units, CoglTextureUnit, i);

      if (unit->layer &&
          _cogl_pipeline_layer_get_texture (unit->layer) == texture)
        unit->texture_storage_changed = TRUE;

      /* NB: the texture may be bound to multiple texture units so
       * we continue to check the rest */
    }
}