Add performance benchmark before landing perf improvements that remove sk_bezero in SkMatrix44
BUG=skia:1558 R=jvanverth@google.com Review URL: https://codereview.chromium.org/22872015 git-svn-id: http://skia.googlecode.com/svn/trunk@10967 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
7687578d3a
commit
63bf68df05
@ -58,6 +58,27 @@ private:
|
||||
typedef Matrix44Bench INHERITED;
|
||||
};
|
||||
|
||||
class SetIdentityMatrix44Bench : public Matrix44Bench {
|
||||
public:
|
||||
SetIdentityMatrix44Bench(void* param) : INHERITED(param, "setidentity") {
|
||||
double rowMajor[16] =
|
||||
{ 1, 2, 3, 4,
|
||||
5, 6, 7, 8,
|
||||
9, 10, 11, 12,
|
||||
13, 14, 15, 16};
|
||||
mat.setRowMajord(rowMajor);
|
||||
}
|
||||
protected:
|
||||
virtual void performTest() {
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
mat.setIdentity();
|
||||
}
|
||||
}
|
||||
private:
|
||||
SkMatrix44 mat;
|
||||
typedef Matrix44Bench INHERITED;
|
||||
};
|
||||
|
||||
class PreScaleMatrix44Bench : public Matrix44Bench {
|
||||
public:
|
||||
PreScaleMatrix44Bench(void* param) : INHERITED(param, "prescale") {
|
||||
@ -232,6 +253,7 @@ private:
|
||||
typedef Matrix44Bench INHERITED;
|
||||
};
|
||||
|
||||
DEF_BENCH( return new SetIdentityMatrix44Bench(p); )
|
||||
DEF_BENCH( return new EqualsMatrix44Bench(p); )
|
||||
DEF_BENCH( return new PreScaleMatrix44Bench(p); )
|
||||
DEF_BENCH( return new PostScaleMatrix44Bench(p); )
|
||||
|
Loading…
Reference in New Issue
Block a user