gpu: Move renderpass handling into the nodeprocessor

There's no need for the frame to do this.
This commit is contained in:
Benjamin Otte
2024-07-07 19:17:03 +02:00
parent b14a115fc0
commit df3c85ea7f
2 changed files with 19 additions and 34 deletions

View File

@@ -10,7 +10,6 @@
#include "gskgpunodeprocessorprivate.h"
#include "gskgpuopprivate.h"
#include "gskgpurendererprivate.h"
#include "gskgpurenderpassopprivate.h"
#include "gskgpuuploadopprivate.h"
#include "gskdebugprivate.h"
@@ -559,29 +558,6 @@ copy_texture (gpointer user_data,
*target = g_object_ref (texture);
}
static void
gsk_gpu_frame_record_rect (GskGpuFrame *self,
GskGpuImage *target,
const cairo_rectangle_int_t *clip,
GskRenderNode *node,
const graphene_rect_t *viewport)
{
gsk_gpu_render_pass_begin_op (self,
target,
clip,
GSK_RENDER_PASS_PRESENT);
gsk_gpu_node_processor_process (self,
target,
clip,
node,
viewport);
gsk_gpu_render_pass_end_op (self,
target,
GSK_RENDER_PASS_PRESENT);
}
static void
gsk_gpu_frame_record (GskGpuFrame *self,
gint64 timestamp,
@@ -604,20 +580,20 @@ gsk_gpu_frame_record (GskGpuFrame *self,
cairo_rectangle_int_t rect;
cairo_region_get_rectangle (clip, i, &rect);
gsk_gpu_frame_record_rect (self, target, &rect, node, viewport);
gsk_gpu_node_processor_process (self, target, &rect, node, viewport);
}
}
else
{
gsk_gpu_frame_record_rect (self,
target,
&(cairo_rectangle_int_t) {
0, 0,
gsk_gpu_image_get_width (target),
gsk_gpu_image_get_height (target)
},
node,
viewport);
gsk_gpu_node_processor_process (self,
target,
&(cairo_rectangle_int_t) {
0, 0,
gsk_gpu_image_get_width (target),
gsk_gpu_image_get_height (target)
},
node,
viewport);
}
if (texture)

View File

@@ -378,8 +378,17 @@ gsk_gpu_node_processor_process (GskGpuFrame *frame,
clip,
viewport);
gsk_gpu_render_pass_begin_op (frame,
target,
clip,
GSK_RENDER_PASS_PRESENT);
gsk_gpu_node_processor_add_node (&self, node);
gsk_gpu_render_pass_end_op (frame,
target,
GSK_RENDER_PASS_PRESENT);
gsk_gpu_node_processor_finish (&self);
}