summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/rendering/renderer_rd/renderer_scene_render_rd.cpp6
-rw-r--r--servers/rendering/renderer_rd/renderer_storage_rd.cpp21
2 files changed, 4 insertions, 23 deletions
diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
index 7af4f0e849..77843ceee5 100644
--- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp
@@ -545,11 +545,7 @@ Ref<Image> RendererSceneRenderRD::environment_bake_panorama(RID p_env, bool p_ba
Ref<Image> panorama;
panorama.instantiate();
panorama->create(p_size.width, p_size.height, false, Image::FORMAT_RGBAF);
- for (int x = 0; x < p_size.width; x++) {
- for (int y = 0; y < p_size.height; y++) {
- panorama->set_pixel(x, y, panorama_color);
- }
- }
+ panorama->fill(panorama_color);
return panorama;
}
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
index 5507f206b5..932cdcaea8 100644
--- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
@@ -971,12 +971,7 @@ void RendererStorageRD::texture_2d_placeholder_initialize(RID p_texture) {
Ref<Image> image;
image.instantiate();
image->create(4, 4, false, Image::FORMAT_RGBA8);
-
- for (int i = 0; i < 4; i++) {
- for (int j = 0; j < 4; j++) {
- image->set_pixel(i, j, Color(1, 0, 1, 1));
- }
- }
+ image->fill(Color(1, 0, 1, 1));
texture_2d_initialize(p_texture, image);
}
@@ -987,12 +982,7 @@ void RendererStorageRD::texture_2d_layered_placeholder_initialize(RID p_texture,
Ref<Image> image;
image.instantiate();
image->create(4, 4, false, Image::FORMAT_RGBA8);
-
- for (int i = 0; i < 4; i++) {
- for (int j = 0; j < 4; j++) {
- image->set_pixel(i, j, Color(1, 0, 1, 1));
- }
- }
+ image->fill(Color(1, 0, 1, 1));
Vector<Ref<Image>> images;
if (p_layered_type == RS::TEXTURE_LAYERED_2D_ARRAY) {
@@ -1013,12 +1003,7 @@ void RendererStorageRD::texture_3d_placeholder_initialize(RID p_texture) {
Ref<Image> image;
image.instantiate();
image->create(4, 4, false, Image::FORMAT_RGBA8);
-
- for (int i = 0; i < 4; i++) {
- for (int j = 0; j < 4; j++) {
- image->set_pixel(i, j, Color(1, 0, 1, 1));
- }
- }
+ image->fill(Color(1, 0, 1, 1));
Vector<Ref<Image>> images;
//cube