2 * Copyright 2014 Google Inc.
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
10 SKPBench::SKPBench(const char* name, const SkPicture* pic, const SkIRect& clip, SkScalar scale)
15 fUniqueName.printf("%s_%.2g", name, scale); // Scale makes this unqiue for skiaperf.com traces.
18 const char* SKPBench::onGetName() {
22 const char* SKPBench::onGetUniqueName() {
23 return fUniqueName.c_str();
26 bool SKPBench::isSuitableFor(Backend backend) {
27 return backend != kNonRendering_Backend;
30 SkIPoint SKPBench::onGetSize() {
31 return SkIPoint::Make(fClip.width(), fClip.height());
34 void SKPBench::onDraw(const int loops, SkCanvas* canvas) {
36 canvas->scale(fScale, fScale);
37 for (int i = 0; i < loops; i++) {
38 fPic->playback(canvas);