Preheat oven to 400°F. Coat a 1-quart gratin dish or a 9-inch pie pan with cooking spray.
Spread almonds in a shallow baking pan and bake until light golden and fragrant, 4 to 6 minutes. Let cool.
Place sugar (or Splenda), flour, salt and almonds in a food processor; process until finely ground. Add egg, tofu, butter and almond extract; process until smooth.
Spread berries evenly in the prepared gratin dish. Scrape the almond mixture over the top, spreading evenly.
Bake the gratin until light golden and set, 40 to 50 minutes. Let cool for at least 20 minutes. Dust with confectioners' sugar and serve warm.