rendernode: Fix serializing
authorBenjamin Otte <otte@redhat.com>
Mon, 26 Mar 2018 17:41:38 +0000 (19:41 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 26 Mar 2018 17:43:06 +0000 (19:43 +0200)
Adding the offset node broke serialization in 2 ways:

1. We store the enum value in the node, so make sure to not change it
   for existing values
2. The offset node was missing in the deserialization lookup table

gsk/gskenums.h
gsk/gskrendernodeimpl.c

index 9835774152ff1f06fc682473437334acfec7901b..11def6bd8e0efb1458cd2b31ba74de6824e29c6c 100644 (file)
@@ -35,7 +35,6 @@
  * @GSK_INSET_SHADOW_NODE: A node drawing an inset shadow
  * @GSK_OUTSET_SHADOW_NODE: A node drawing an outset shadow
  * @GSK_TRANSFORM_NODE: A node that renders its child after applying a matrix transform
- * @GSK_OFFSET_NODE: A node that renders its child after applying a 2D translation
  * @GSK_OPACITY_NODE: A node that changes the opacity of its child
  * @GSK_COLOR_MATRIX_NODE: A node that applies a color matrix to every pixel
  * @GSK_REPEAT_NODE: A node that repeats the child's contents
@@ -46,6 +45,7 @@
  * @GSK_CROSS_FADE_NODE: A node that cross-fades between two children
  * @GSK_TEXT_NODE: A node containing a glyph string
  * @GSK_BLUR_NODE: A node that applies a blur
+ * @GSK_OFFSET_NODE: A node that renders its child after applying a 2D translation
  *
  * The type of a node determines what the node is rendering.
  *
@@ -63,7 +63,6 @@ typedef enum {
   GSK_INSET_SHADOW_NODE,
   GSK_OUTSET_SHADOW_NODE,
   GSK_TRANSFORM_NODE,
-  GSK_OFFSET_NODE,
   GSK_OPACITY_NODE,
   GSK_COLOR_MATRIX_NODE,
   GSK_REPEAT_NODE,
@@ -73,7 +72,8 @@ typedef enum {
   GSK_BLEND_NODE,
   GSK_CROSS_FADE_NODE,
   GSK_TEXT_NODE,
-  GSK_BLUR_NODE
+  GSK_BLUR_NODE,
+  GSK_OFFSET_NODE
 } GskRenderNodeType;
 
 /**
index 347a4e133328b275a476e6802ff6d9810719d86e..3a3a7d783ca252e13a4582622aa6d997142419c9 100644 (file)
@@ -4583,7 +4583,8 @@ static const GskRenderNodeClass *klasses[] = {
   [GSK_BLEND_NODE] = &GSK_BLEND_NODE_CLASS,
   [GSK_CROSS_FADE_NODE] = &GSK_CROSS_FADE_NODE_CLASS,
   [GSK_TEXT_NODE] = &GSK_TEXT_NODE_CLASS,
-  [GSK_BLUR_NODE] = &GSK_BLUR_NODE_CLASS
+  [GSK_BLUR_NODE] = &GSK_BLUR_NODE_CLASS,
+  [GSK_OFFSET_NODE] = &GSK_OFFSET_NODE_CLASS
 };
 
 GskRenderNode *