[gtk] rendernode: Fix serializing



commit 353ad30b12e75bb56403ab524f18832e74aa94e2
Author: Benjamin Otte <otte redhat com>
Date:   Mon Mar 26 19:41:38 2018 +0200

    rendernode: Fix serializing
    
    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          | 6 +++---
 gsk/gskrendernodeimpl.c | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gsk/gskenums.h b/gsk/gskenums.h
index 9835774152..11def6bd8e 100644
--- a/gsk/gskenums.h
+++ b/gsk/gskenums.h
@@ -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;
 
 /**
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 347a4e1333..3a3a7d783c 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -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 *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]