[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23559] trunk/blender: Sorry, three commits in one, became difficult to untangle..

Brecht Van Lommel brecht at blender.org
Thu Oct 1 13:51:03 CEST 2009


Hi,

On Thu, Oct 1, 2009 at 7:38 AM, Matt Ebb <matt at mke3.net> wrote:
> On Wed, Sep 30, 2009 at 5:12 AM, Brecht Van Lommel <brecht at blender.org> wrote:
>> Revision: 23559
>>          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23559
>> Author:   blendix
>> Date:     2009-09-29 21:12:12 +0200 (Tue, 29 Sep 2009)
>
>> * On systems with support for non-power of two textures, an OpenGL texture
>>  is now used instead of glDrawPixels. This avoids problems with icons get
>>  clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
>>  and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
>>  with the default setup. The glDrawPixels implementation on Mac seems to
>>  have a lot of overhread.
>
> Hi Brecht, I just realised on Win64 here (nvidia card) I now get
> blurry icons in the outliner. Most other icons (in headers etc) seem
> to be ok.
>
> http://mke3.net/blender/devel/2.5/outliner_blurry_icons.png
>
> Anything I can do to help debug?

I don't know why it happens, I would expect the offset in
UI_view2d_view_ortho to take care of this. But blenfont seems to
manage to render non-blurry somehow. It has a trick in BLF_position to
do an offset, but that code doesn't seem like it's relevant because
the remainder is never in that range. I've attached a patch with a
stupid extra offset for icons, maybe it helps. A bigger offset like
0.5 may also fix it, but that gives exactly the blurry results you get
on my computer. Tweaking the offset in UI_view2d_view_ortho may also
help.

Another possibility is to remove sizey += V2D_SCROLL_HEIGHT or add
sizex += V2D_SCROLL_WIDTH; in draw_outliner. There has to be something
the outliner does different, maybe this is it.

Brecht.
-------------- next part --------------
Index: source/blender/editors/interface/interface_icons.c
===================================================================
--- source/blender/editors/interface/interface_icons.c	(revision 23570)
+++ source/blender/editors/interface/interface_icons.c	(working copy)
@@ -836,13 +836,29 @@
 	}
 }
 
-static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy, int iw, int ih, float alpha, float *rgb)
+static void icon_draw_texture(float x, float y, float w, float h, int ix, int iy, int iw, int ih, float aspect, float alpha, float *rgb)
 {
-	float x1, x2, y1, y2;
+	float x1, x2, y1, y2, remainder;
 
 	if(rgb) glColor4f(rgb[0], rgb[1], rgb[2], alpha);
 	else glColor4f(1.0f, 1.0f, 1.0f, alpha);
 
+	remainder= x - floor(x);
+	if(remainder > 0.4 && remainder < 0.6) {
+		if(remainder < 0.5)
+			x -= 0.1 * aspect;
+		else
+			x += 0.1 * aspect;
+	}
+
+	remainder= y - floor(y);
+	if(remainder > 0.4 && remainder < 0.6) {
+		if(remainder < 0.5)
+			y -= 0.1 * aspect;
+		else
+			y += 0.1 * aspect;
+	}
+
 	x1= ix*icongltex.invw;
 	x2= (ix + ih)*icongltex.invw;
 	y1= iy*icongltex.invh;
@@ -913,7 +929,7 @@
 	} 
 	else if(di->type == ICON_TYPE_TEXTURE) {
 		icon_draw_texture(x, y, w, h, di->data.texture.x, di->data.texture.y,
-			di->data.texture.w, di->data.texture.h, alpha, rgb);
+			di->data.texture.w, di->data.texture.h, aspect, alpha, rgb);
 	}
 	else if(di->type == ICON_TYPE_BUFFER) {
 		/* it is a builtin icon */		


More information about the Bf-committers mailing list