2015-06-30 14:43:14 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2015 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "VisualSKPBench.h"
|
|
|
|
|
|
|
|
VisualSKPBench::VisualSKPBench(const char* name, const SkPicture* pic)
|
|
|
|
: fPic(SkRef(pic))
|
|
|
|
, fName(name) {
|
|
|
|
fUniqueName.printf("%s", name);
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* VisualSKPBench::onGetName() {
|
|
|
|
return fName.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
const char* VisualSKPBench::onGetUniqueName() {
|
|
|
|
return fUniqueName.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool VisualSKPBench::isSuitableFor(Backend backend) {
|
|
|
|
return backend != kNonRendering_Backend;
|
|
|
|
}
|
|
|
|
|
2015-10-01 16:43:39 +00:00
|
|
|
void VisualSKPBench::onDraw(int loops, SkCanvas* canvas) {
|
2015-06-30 14:43:14 +00:00
|
|
|
for (int i = 0; i < loops; i++) {
|
|
|
|
canvas->drawPicture(fPic);
|
|
|
|
}
|
|
|
|
}
|