[gtk+/wip/otte/vulkan: 19/21] inspector: Pass the drawing context into the recorder
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/vulkan: 19/21] inspector: Pass the drawing context into the recorder
- Date: Sat, 3 Dec 2016 13:57:22 +0000 (UTC)
commit d31797333f40b530e4aeb66f273a8affcb24e4e9
Author: Benjamin Otte <otte redhat com>
Date: Wed Nov 30 18:55:45 2016 +0100
inspector: Pass the drawing context into the recorder
That way we can capture both the actual changes (clip region) and the
area that was redrawn (render region), which in OpenGL might not be
identical.
Nothing shows the render region yet though...
gtk/gtkwidget.c | 7 ++++++-
gtk/inspector/recorder.c | 2 ++
gtk/inspector/recorder.h | 1 +
gtk/inspector/renderrecording.c | 17 +++++++++++++----
gtk/inspector/renderrecording.h | 8 ++++++--
gtk/inspector/window.c | 2 ++
gtk/inspector/window.h | 1 +
7 files changed, 31 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8e0dcf5..da35775 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -15649,7 +15649,12 @@ gtk_widget_render (GtkWidget *widget,
root = gtk_snapshot_finish (&snapshot);
if (root != NULL)
{
- gtk_inspector_record_render (widget, renderer, window, region, root);
+ gtk_inspector_record_render (widget,
+ renderer,
+ window,
+ region,
+ context,
+ root);
gsk_renderer_render (renderer, root, context);
gsk_render_node_unref (root);
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index 07d2fb4..6641fce 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -490,6 +490,7 @@ gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder,
GskRenderer *renderer,
GdkWindow *window,
const cairo_region_t *region,
+ GdkDrawingContext *context,
GskRenderNode *node)
{
GtkInspectorRecording *recording;
@@ -506,6 +507,7 @@ gtk_inspector_recorder_record_render (GtkInspectorRecorder *recorder,
gdk_window_get_width (window),
gdk_window_get_height (window) },
region,
+ gdk_drawing_context_get_clip (context),
node);
gtk_inspector_recorder_add_recording (recorder, recording);
g_object_unref (recording);
diff --git a/gtk/inspector/recorder.h b/gtk/inspector/recorder.h
index 676f3f1..d15431d 100644
--- a/gtk/inspector/recorder.h
+++ b/gtk/inspector/recorder.h
@@ -53,6 +53,7 @@ void gtk_inspector_recorder_record_render (GtkInspectorRec
GskRenderer *renderer,
GdkWindow *window,
const cairo_region_t *region,
+ GdkDrawingContext *context,
GskRenderNode *node);
G_END_DECLS
diff --git a/gtk/inspector/renderrecording.c b/gtk/inspector/renderrecording.c
index f3bb0d1..48fd341 100644
--- a/gtk/inspector/renderrecording.c
+++ b/gtk/inspector/renderrecording.c
@@ -27,7 +27,8 @@ gtk_inspector_render_recording_finalize (GObject *object)
{
GtkInspectorRenderRecording *recording = GTK_INSPECTOR_RENDER_RECORDING (object);
- g_clear_pointer (&recording->clip, cairo_region_destroy);
+ g_clear_pointer (&recording->clip_region, cairo_region_destroy);
+ g_clear_pointer (&recording->render_region, cairo_region_destroy);
g_clear_pointer (&recording->node, gsk_render_node_unref);
g_clear_pointer (&recording->profiler_info, g_free);
@@ -63,7 +64,8 @@ GtkInspectorRecording *
gtk_inspector_render_recording_new (gint64 timestamp,
GskProfiler *profiler,
const GdkRectangle *area,
- const cairo_region_t *clip,
+ const cairo_region_t *clip_region,
+ const cairo_region_t *render_region,
GskRenderNode *node)
{
GtkInspectorRenderRecording *recording;
@@ -74,7 +76,8 @@ gtk_inspector_render_recording_new (gint64 timestamp,
collect_profiler_info (recording, profiler);
recording->area = *area;
- recording->clip = cairo_region_copy (clip);
+ recording->clip_region = cairo_region_copy (clip_region);
+ recording->render_region = cairo_region_copy (render_region);
recording->node = gsk_render_node_ref (node);
return GTK_INSPECTOR_RECORDING (recording);
@@ -89,7 +92,13 @@ gtk_inspector_render_recording_get_node (GtkInspectorRenderRecording *recording)
const cairo_region_t *
gtk_inspector_render_recording_get_clip_region (GtkInspectorRenderRecording *recording)
{
- return recording->clip;
+ return recording->clip_region;
+}
+
+const cairo_region_t *
+gtk_inspector_render_recording_get_render_region (GtkInspectorRenderRecording *recording)
+{
+ return recording->render_region;
}
const cairo_rectangle_int_t *
diff --git a/gtk/inspector/renderrecording.h b/gtk/inspector/renderrecording.h
index f84a87e..e17ae9d 100644
--- a/gtk/inspector/renderrecording.h
+++ b/gtk/inspector/renderrecording.h
@@ -41,7 +41,8 @@ typedef struct _GtkInspectorRenderRecording
GtkInspectorRecording parent;
GdkRectangle area;
- cairo_region_t *clip;
+ cairo_region_t *clip_region;
+ cairo_region_t *render_region;
GskRenderNode *node;
char *profiler_info;
} GtkInspectorRenderRecording;
@@ -57,12 +58,15 @@ GtkInspectorRecording *
gtk_inspector_render_recording_new (gint64 timestamp,
GskProfiler *profiler,
const GdkRectangle *area,
- const cairo_region_t *clip,
+ const cairo_region_t *clip_region,
+ const cairo_region_t
*render_region,
GskRenderNode *node);
GskRenderNode * gtk_inspector_render_recording_get_node (GtkInspectorRenderRecording *recording);
const cairo_region_t *
gtk_inspector_render_recording_get_clip_region (GtkInspectorRenderRecording *recording);
+const cairo_region_t *
+ gtk_inspector_render_recording_get_render_region (GtkInspectorRenderRecording
*recording);
const cairo_rectangle_int_t *
gtk_inspector_render_recording_get_area (GtkInspectorRenderRecording *recording);
const char * gtk_inspector_render_recording_get_profiler_info
diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c
index b21f5c9..fb3231e 100644
--- a/gtk/inspector/window.c
+++ b/gtk/inspector/window.c
@@ -346,6 +346,7 @@ gtk_inspector_record_render (GtkWidget *widget,
GskRenderer *renderer,
GdkWindow *window,
const cairo_region_t *region,
+ GdkDrawingContext *context,
GskRenderNode *node)
{
GtkInspectorWindow *iw;
@@ -363,6 +364,7 @@ gtk_inspector_record_render (GtkWidget *widget,
renderer,
window,
region,
+ context,
node);
}
diff --git a/gtk/inspector/window.h b/gtk/inspector/window.h
index 671e759..3f330d7 100644
--- a/gtk/inspector/window.h
+++ b/gtk/inspector/window.h
@@ -110,6 +110,7 @@ void gtk_inspector_record_render (GtkWidget *widget,
GskRenderer *renderer,
GdkWindow *window,
const cairo_region_t *region,
+ GdkDrawingContext *context,
GskRenderNode *node);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]