From 4812a2af115ce81c0ad1dec8680fdf9ea7dd4fc4 Mon Sep 17 00:00:00 2001 From: liyuqian Date: Mon, 4 Feb 2019 13:31:21 -0800 Subject: [PATCH] DCHECK that clip layer's behavior isn't none (#7659) This will further guard that the framework won't forget to set the clip behavior. This has been tested with the flutter/flutter framework `flutter test --local-engine=host_debug_unopt` to ensure a successful engine roll. --- flow/layers/clip_path_layer.cc | 4 +++- flow/layers/clip_rect_layer.cc | 4 +++- flow/layers/clip_rrect_layer.cc | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/flow/layers/clip_path_layer.cc b/flow/layers/clip_path_layer.cc index c6259de22aa..a8b23ee4903 100644 --- a/flow/layers/clip_path_layer.cc +++ b/flow/layers/clip_path_layer.cc @@ -13,7 +13,9 @@ namespace flow { ClipPathLayer::ClipPathLayer(Clip clip_behavior) - : clip_behavior_(clip_behavior) {} + : clip_behavior_(clip_behavior) { + FML_DCHECK(clip_behavior != Clip::none); +} ClipPathLayer::~ClipPathLayer() = default; diff --git a/flow/layers/clip_rect_layer.cc b/flow/layers/clip_rect_layer.cc index 3f39daca244..9e4d06df8b1 100644 --- a/flow/layers/clip_rect_layer.cc +++ b/flow/layers/clip_rect_layer.cc @@ -7,7 +7,9 @@ namespace flow { ClipRectLayer::ClipRectLayer(Clip clip_behavior) - : clip_behavior_(clip_behavior) {} + : clip_behavior_(clip_behavior) { + FML_DCHECK(clip_behavior != Clip::none); +} ClipRectLayer::~ClipRectLayer() = default; diff --git a/flow/layers/clip_rrect_layer.cc b/flow/layers/clip_rrect_layer.cc index 896ec1ae27f..b4b968bb396 100644 --- a/flow/layers/clip_rrect_layer.cc +++ b/flow/layers/clip_rrect_layer.cc @@ -7,7 +7,9 @@ namespace flow { ClipRRectLayer::ClipRRectLayer(Clip clip_behavior) - : clip_behavior_(clip_behavior) {} + : clip_behavior_(clip_behavior) { + FML_DCHECK(clip_behavior != Clip::none); +} ClipRRectLayer::~ClipRRectLayer() = default;