1 /* 2 * Copyright 2021 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef MSKPBench_DEFINED 9 #define MSKPBench_DEFINED 10 11 #include "bench/Benchmark.h" 12 13 class MSKPPlayer; 14 15 class MSKPBench : public Benchmark { 16 public: 17 MSKPBench(SkString name, std::unique_ptr<MSKPPlayer> player); 18 ~MSKPBench() override; 19 20 protected: onDraw(int loops,SkCanvas *)21 void onDraw(int loops, SkCanvas*) override { SkASSERT(false); } 22 void onDrawFrame(int loops, SkCanvas*, std::function<void()> submitFrame) override; 23 const char* onGetName() override; 24 SkISize onGetSize() override; 25 void onPreDraw(SkCanvas*) override; 26 void onPostDraw(SkCanvas*) override; 27 28 private: submitsInternalFrames()29 bool submitsInternalFrames() override { return true; } 30 31 SkString fName; 32 std::unique_ptr<MSKPPlayer> fPlayer; 33 }; 34 35 #endif 36