blob: 7bc87ee82bd09d2c75d437d805b3fa7e7fa93c78 [file] [log] [blame]
reed@android.combd700c32009-01-05 03:34:50 +00001#include "SkBenchmark.h"
reed@android.com4bc19832009-01-19 20:08:35 +00002#include "SkPaint.h"
3
reed@android.comf523e252009-01-26 23:15:37 +00004template BenchRegistry* BenchRegistry::gHead;
5
reed@android.com4bc19832009-01-19 20:08:35 +00006SkBenchmark::SkBenchmark() {
7 fForceAlpha = 0xFF;
8 fForceAA = true;
9}
reed@android.combd700c32009-01-05 03:34:50 +000010
11const char* SkBenchmark::getName() {
12 return this->onGetName();
13}
14
15SkIPoint SkBenchmark::getSize() {
16 return this->onGetSize();
17}
18
19void SkBenchmark::draw(SkCanvas* canvas) {
20 this->onDraw(canvas);
21}
22
reed@android.com4bc19832009-01-19 20:08:35 +000023void SkBenchmark::setupPaint(SkPaint* paint) {
24 paint->setAlpha(fForceAlpha);
25 paint->setAntiAlias(fForceAA);
reed@android.com29348cb2009-08-04 18:17:15 +000026 paint->setFilterBitmap(fForceFilter);
reed@android.com4bc19832009-01-19 20:08:35 +000027}
28
reed@android.comf523e252009-01-26 23:15:37 +000029///////////////////////////////////////////////////////////////////////////////
reed@android.com4bc19832009-01-19 20:08:35 +000030
reed@android.comf523e252009-01-26 23:15:37 +000031SkIPoint SkBenchmark::onGetSize() {
32 return SkMakeIPoint(640, 480);
33}