[clutter/wip/pango-share-atlas: 2/13] cogl-pango-display-list: Don't use VBOs if the texture can't handle it



commit a836209c207bd3abcacd890ce8c2f2058ce05da4
Author: Neil Roberts <neil linux intel com>
Date:   Thu Feb 18 15:04:06 2010 +0000

    cogl-pango-display-list: Don't use VBOs if the texture can't handle it
    
    If the texture can't be hardware repeated (ie, if it is sliced or it
    has waste) then Cogl will reject the layer when rendering with a
    VBO. In this case we should always fall back to rendering with
    cogl_rectangle.

 clutter/cogl/pango/cogl-pango-display-list.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/clutter/cogl/pango/cogl-pango-display-list.c b/clutter/cogl/pango/cogl-pango-display-list.c
index 6226a81..7749058 100644
--- a/clutter/cogl/pango/cogl-pango-display-list.c
+++ b/clutter/cogl/pango/cogl-pango-display-list.c
@@ -27,6 +27,7 @@
 
 #include <glib.h>
 #include <cogl/cogl.h>
+#include <cogl/cogl-texture-private.h>
 #include <string.h>
 
 #include "cogl-pango-display-list.h"
@@ -325,7 +326,10 @@ _cogl_pango_display_list_render_texture (CoglMaterial *material,
    * with other geometry. */
   /* FIXME: 100 is a number I plucked out of thin air; it would be good
    * to determine this empirically! */
-  if (node->d.texture.verts->len < 100)
+  if (node->d.texture.verts->len < 100 ||
+      /* We can't use a VBO if the texture can't be hardware repeated
+         because Cogl will reject it */
+      !_cogl_texture_can_hardware_repeat (node->d.texture.texture))
     emit_rectangles_through_journal (node);
   else
     emit_vertex_buffer_geometry (node);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]