1 // Copyright 2013 The Flutter Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "flutter/runtime/skia_concurrent_executor.h" 6 7 #include "flutter/fml/trace_event.h" 8 9 namespace flutter { 10 SkiaConcurrentExecutor(OnWorkCallback on_work)11SkiaConcurrentExecutor::SkiaConcurrentExecutor(OnWorkCallback on_work) 12 : on_work_(on_work) {} 13 14 SkiaConcurrentExecutor::~SkiaConcurrentExecutor() = default; 15 add(fml::closure work)16void SkiaConcurrentExecutor::add(fml::closure work) { 17 if (!work) { 18 return; 19 } 20 on_work_([work]() { 21 TRACE_EVENT0("flutter", "SkiaExecutor"); 22 work(); 23 }); 24 } 25 26 } // namespace flutter 27