Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 1212
Registered: March 2007
Senior 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 Apr 29 16:36:33 CEST 2024

Total time taken to generate the page: 0.03693 seconds