Preheat the oven to 200°C (180°C fan/400°F) and line a large baking sheet with parchment paper.
In a medium bowl, whisk together the sugar and cornflour. Add the berries and toss to coat, then stir in the vanilla extract.
On a lightly floured surface, roll the dough into a rough circle, about 0.3 cm (⅛ in) thick.
Spread an even layer of the frangipane onto the prepared crust, leaving a 5-7 cm (2-3 in) border around the edges. You probably won't need all of the frangipane (see notes for what to do with leftovers).
Scatter about ¾ of the berries over the frangipane. Fold the edges of the dough up and over the filling. Pile the remaining berries into the exposed centre.
Brush the pastry with egg wash, sprinkle generously with coarse sugar, and scatter flaked almonds on top, pressing them lightly into the pastry so they stick.
Bake on the middle rack for 35-45 minutes until the pastry is golden brown and the filling is bubbling up. The frangipane will puff up as it bakes, and will settle back down as it cools. Let stand for 10 minutes before slicing. Serve with vanilla ice cream, crème fraîche, or a dollop of cream.