Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Add Image::fill_rect method #52457

Merged
merged 2 commits into from
Nov 24, 2021
Merged

Conversation

kleonc
Copy link
Member

@kleonc kleonc commented Sep 7, 2021

3.x version of #52456.

@kleonc kleonc requested a review from a team as a code owner September 7, 2021 08:42
@kleonc kleonc requested a review from a team as a code owner September 7, 2021 09:21
@YeldhamDev YeldhamDev added this to the 3.4 milestone Sep 7, 2021
@kleonc kleonc force-pushed the image-fill-rect-3x branch 2 times, most recently from c5bf566 to 8a622c0 Compare September 8, 2021 10:33
@AaronRecord
Copy link
Contributor

AaronRecord commented Sep 8, 2021

Did some basic profiling for fun using the CI builds, depending on the situation the new fill method is about ~7-11 times faster than the current 3.x one.

script used
extends TextureRect


var image := Image.new()


func _ready() -> void:
	image.create(1000, 1000, false, Image.FORMAT_RGBA8)


func _process(delta: float) -> void:
	var start := OS.get_ticks_msec()
	for i in 1000:
		image.fill(Color(rand_range(0, 1), rand_range(0, 1), rand_range(0, 1)))
	print(OS.get_ticks_msec() - start)

@kleonc kleonc force-pushed the image-fill-rect-3x branch 2 times, most recently from 2957b65 to d9166f7 Compare September 8, 2021 19:13
@akien-mga akien-mga modified the milestones: 3.4, 3.5 Nov 8, 2021
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use a rebase to be safe.

@akien-mga akien-mga merged commit 888f8ce into godotengine:3.x Nov 24, 2021
@akien-mga
Copy link
Member

Thanks!

@kleonc kleonc deleted the image-fill-rect-3x branch November 24, 2021 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants