From 6312be1f1508cfdbe25f64521ec6ffcc2d0dd060 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 2 Dec 2016 14:18:11 -0800 Subject: [PATCH] Use initialized memory for composited bounds (flutter/engine#3291) SkRect objects need to be manually initialized. Previously, we were using unintialized memory in our bounds calculations. --- engine/src/flutter/flow/layers/container_layer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/flow/layers/container_layer.cc b/engine/src/flutter/flow/layers/container_layer.cc index 27507e9ed79..c320e6896ff 100644 --- a/engine/src/flutter/flow/layers/container_layer.cc +++ b/engine/src/flutter/flow/layers/container_layer.cc @@ -25,9 +25,10 @@ void ContainerLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { void ContainerLayer::PrerollChildren(PrerollContext* context, const SkMatrix& matrix) { - SkRect child_paint_bounds; + SkRect child_paint_bounds = SkRect::MakeEmpty(); for (auto& layer : layers_) { PrerollContext child_context = *context; + FTL_DCHECK(child_context.child_paint_bounds.isEmpty()); layer->Preroll(&child_context, matrix); if (layer->needs_system_composite()) set_needs_system_composite(true);