U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Painter Fill with Image MSC14x64 performance issue
Re: Painter Fill with Image MSC14x64 performance issue [message #47573 is a reply to message #47572] Mon, 30 January 2017 09:16 Go to previous message
Tom1
Messages: 1319
Registered: March 2007
Ultimate Contributor
As a matter of fact, this is even better:

void SpanFiller::Render(int val, int len)
{
	if(val == 0) {
		t += len;
		s += len;
		return;
	}
	
	if(alpha != 256)
		val = alpha * val >> 8;
	if(val == 256) {
		for(int i=0; i < len; i++) {
			if(s[i].a == 255)
				t[i] = s[i];
			else
				AlphaBlend(t[i], s[i]);
		}
		t += len;
		s += len;
	}
	else{
		const RGBA *e = t + len;
		while(t < e)
			AlphaBlendCover8(*t++, *s++, val);
	}
}


I.e. moving "const RGBA *e = t + len;" to the else section where it is actually needed. (A very slight but measurable speed improvement can be observed.)

Best regards,

Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Painter Text Underline/Strikeout not working
Next Topic: is it possible to attach a Ctrl to a freshly drawn item?
Goto Forum:
  


Current Time: Mon May 04 07:29:40 GMT+2 2026

Total time taken to generate the page: 0.00691 seconds