2011-07-28 14:26:00 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2014-06-10 02:52:07 +00:00
|
|
|
|
2014-06-19 19:32:29 +00:00
|
|
|
#include "Benchmark.h"
|
2009-01-26 23:15:37 +00:00
|
|
|
#include "SkBitmap.h"
|
|
|
|
#include "SkCanvas.h"
|
|
|
|
#include "SkColorPriv.h"
|
2014-06-19 19:32:29 +00:00
|
|
|
#include "SkPaint.h"
|
2009-01-26 23:15:37 +00:00
|
|
|
#include "SkRandom.h"
|
|
|
|
#include "SkString.h"
|
2014-06-10 02:52:07 +00:00
|
|
|
#include "sk_tool_utils.h"
|
2009-01-26 23:15:37 +00:00
|
|
|
|
|
|
|
static int conv6ToByte(int x) {
|
|
|
|
return x * 0xFF / 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int convByteTo6(int x) {
|
|
|
|
return x * 5 / 255;
|
|
|
|
}
|
|
|
|
|
|
|
|
static uint8_t compute666Index(SkPMColor c) {
|
|
|
|
int r = SkGetPackedR32(c);
|
|
|
|
int g = SkGetPackedG32(c);
|
|
|
|
int b = SkGetPackedB32(c);
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2009-01-26 23:15:37 +00:00
|
|
|
return convByteTo6(r) * 36 + convByteTo6(g) * 6 + convByteTo6(b);
|
|
|
|
}
|
|
|
|
|
2014-06-10 02:52:07 +00:00
|
|
|
static void convertToIndex666(const SkBitmap& src, SkBitmap* dst, SkAlphaType aType) {
|
2013-10-10 14:44:56 +00:00
|
|
|
SkPMColor storage[216];
|
|
|
|
SkPMColor* colors = storage;
|
2009-01-26 23:15:37 +00:00
|
|
|
// rrr ggg bbb
|
|
|
|
for (int r = 0; r < 6; r++) {
|
|
|
|
int rr = conv6ToByte(r);
|
|
|
|
for (int g = 0; g < 6; g++) {
|
|
|
|
int gg = conv6ToByte(g);
|
|
|
|
for (int b = 0; b < 6; b++) {
|
|
|
|
int bb = conv6ToByte(b);
|
|
|
|
*colors++ = SkPreMultiplyARGB(0xFF, rr, gg, bb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-04-01 17:21:42 +00:00
|
|
|
SkColorTable* ctable = new SkColorTable(storage, 216);
|
2014-06-10 02:52:07 +00:00
|
|
|
dst->allocPixels(SkImageInfo::Make(src.width(), src.height(), kIndex_8_SkColorType, aType),
|
2017-04-01 17:21:42 +00:00
|
|
|
nullptr, ctable);
|
|
|
|
ctable->unref();
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2009-01-26 23:15:37 +00:00
|
|
|
SkAutoLockPixels alps(src);
|
|
|
|
SkAutoLockPixels alpd(*dst);
|
|
|
|
|
|
|
|
for (int y = 0; y < src.height(); y++) {
|
|
|
|
const SkPMColor* srcP = src.getAddr32(0, y);
|
|
|
|
uint8_t* dstP = dst->getAddr8(0, y);
|
|
|
|
for (int x = src.width() - 1; x >= 0; --x) {
|
|
|
|
*dstP++ = compute666Index(*srcP++);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Variants for bitmaps
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2009-01-26 23:15:37 +00:00
|
|
|
- src depth (32 w+w/o alpha), 565, 4444, index, a8
|
|
|
|
- paint options: filtering, dither, alpha
|
|
|
|
- matrix options: translate, scale, rotate, persp
|
|
|
|
- tiling: none, repeat, mirror, clamp
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2009-01-26 23:15:37 +00:00
|
|
|
*/
|
|
|
|
|
2014-06-19 19:32:29 +00:00
|
|
|
class BitmapBench : public Benchmark {
|
2014-06-10 02:52:07 +00:00
|
|
|
const SkColorType fColorType;
|
|
|
|
const SkAlphaType fAlphaType;
|
|
|
|
const bool fForceUpdate; //bitmap marked as dirty before each draw. forces bitmap to be updated on device cache
|
|
|
|
const bool fIsVolatile;
|
2014-10-23 21:35:01 +00:00
|
|
|
const bool fDoScale;
|
2014-06-10 02:52:07 +00:00
|
|
|
|
|
|
|
SkBitmap fBitmap;
|
|
|
|
SkPaint fPaint;
|
|
|
|
SkString fName;
|
|
|
|
|
2013-04-09 18:06:06 +00:00
|
|
|
enum { W = 128 };
|
|
|
|
enum { H = 128 };
|
2009-01-26 23:15:37 +00:00
|
|
|
public:
|
2014-10-23 21:35:01 +00:00
|
|
|
BitmapBench(SkColorType ct, SkAlphaType at, bool forceUpdate, bool isVolatile, bool doScale)
|
2014-06-10 02:52:07 +00:00
|
|
|
: fColorType(ct)
|
|
|
|
, fAlphaType(at)
|
2013-04-09 18:06:06 +00:00
|
|
|
, fForceUpdate(forceUpdate)
|
2014-06-10 02:52:07 +00:00
|
|
|
, fIsVolatile(isVolatile)
|
2014-10-23 21:35:01 +00:00
|
|
|
, fDoScale(doScale)
|
2014-06-10 02:52:07 +00:00
|
|
|
{}
|
2009-01-26 23:15:37 +00:00
|
|
|
|
|
|
|
protected:
|
2015-07-13 13:18:39 +00:00
|
|
|
const char* onGetName() override {
|
2009-01-26 23:15:37 +00:00
|
|
|
fName.set("bitmap");
|
2014-06-10 02:52:07 +00:00
|
|
|
fName.appendf("_%s%s", sk_tool_utils::colortype_name(fColorType),
|
|
|
|
kOpaque_SkAlphaType == fAlphaType ? "" : "_A");
|
2014-10-23 21:35:01 +00:00
|
|
|
if (fDoScale) {
|
|
|
|
fName.append("_scale");
|
|
|
|
}
|
|
|
|
if (fForceUpdate) {
|
2011-06-30 17:30:49 +00:00
|
|
|
fName.append("_update");
|
2014-10-23 21:35:01 +00:00
|
|
|
}
|
|
|
|
if (fIsVolatile) {
|
2011-06-30 17:30:49 +00:00
|
|
|
fName.append("_volatile");
|
2014-10-23 21:35:01 +00:00
|
|
|
}
|
2011-06-30 17:30:49 +00:00
|
|
|
|
2009-01-26 23:15:37 +00:00
|
|
|
return fName.c_str();
|
|
|
|
}
|
|
|
|
|
2015-09-30 19:11:07 +00:00
|
|
|
void onDelayedSetup() override {
|
2013-04-09 18:06:06 +00:00
|
|
|
SkBitmap bm;
|
|
|
|
|
2014-06-10 02:52:07 +00:00
|
|
|
if (kIndex_8_SkColorType == fColorType) {
|
2014-06-28 21:26:35 +00:00
|
|
|
bm.allocPixels(SkImageInfo::MakeN32(W, H, fAlphaType));
|
2013-04-09 18:06:06 +00:00
|
|
|
} else {
|
2014-06-28 21:26:35 +00:00
|
|
|
bm.allocPixels(SkImageInfo::Make(W, H, fColorType, fAlphaType));
|
2013-04-09 18:06:06 +00:00
|
|
|
}
|
2014-06-10 02:52:07 +00:00
|
|
|
bm.eraseColor(kOpaque_SkAlphaType == fAlphaType ? SK_ColorBLACK : 0);
|
2013-04-09 18:06:06 +00:00
|
|
|
|
2015-07-13 13:18:39 +00:00
|
|
|
this->onDrawIntoBitmap(bm);
|
2013-04-09 18:06:06 +00:00
|
|
|
|
2014-06-10 02:52:07 +00:00
|
|
|
if (kIndex_8_SkColorType == fColorType) {
|
|
|
|
convertToIndex666(bm, &fBitmap, fAlphaType);
|
2013-04-09 18:06:06 +00:00
|
|
|
} else {
|
|
|
|
fBitmap = bm;
|
|
|
|
}
|
|
|
|
|
|
|
|
fBitmap.setIsVolatile(fIsVolatile);
|
|
|
|
}
|
|
|
|
|
2015-10-01 16:43:39 +00:00
|
|
|
void onDraw(int loops, SkCanvas* canvas) override {
|
2014-10-23 21:35:01 +00:00
|
|
|
if (fDoScale) {
|
|
|
|
canvas->scale(.99f, .99f);
|
|
|
|
}
|
2009-01-26 23:15:37 +00:00
|
|
|
SkIPoint dim = this->getSize();
|
2013-09-09 20:09:12 +00:00
|
|
|
SkRandom rand;
|
2009-01-26 23:15:37 +00:00
|
|
|
|
|
|
|
SkPaint paint(fPaint);
|
|
|
|
this->setupPaint(&paint);
|
|
|
|
|
|
|
|
const SkBitmap& bitmap = fBitmap;
|
|
|
|
const SkScalar x0 = SkIntToScalar(-bitmap.width() / 2);
|
|
|
|
const SkScalar y0 = SkIntToScalar(-bitmap.height() / 2);
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2013-12-03 18:17:16 +00:00
|
|
|
for (int i = 0; i < loops; i++) {
|
2009-01-26 23:15:37 +00:00
|
|
|
SkScalar x = x0 + rand.nextUScalar1() * dim.fX;
|
|
|
|
SkScalar y = y0 + rand.nextUScalar1() * dim.fY;
|
2011-06-30 17:30:49 +00:00
|
|
|
|
|
|
|
if (fForceUpdate)
|
|
|
|
bitmap.notifyPixelsChanged();
|
|
|
|
|
2009-01-26 23:15:37 +00:00
|
|
|
canvas->drawBitmap(bitmap, x, y, &paint);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-13 13:18:39 +00:00
|
|
|
virtual void onDrawIntoBitmap(const SkBitmap& bm) {
|
2013-04-09 18:06:06 +00:00
|
|
|
const int w = bm.width();
|
|
|
|
const int h = bm.height();
|
|
|
|
|
|
|
|
SkCanvas canvas(bm);
|
|
|
|
SkPaint p;
|
|
|
|
p.setAntiAlias(true);
|
|
|
|
p.setColor(SK_ColorRED);
|
|
|
|
canvas.drawCircle(SkIntToScalar(w)/2, SkIntToScalar(h)/2,
|
|
|
|
SkIntToScalar(SkMin32(w, h))*3/8, p);
|
|
|
|
|
|
|
|
SkRect r;
|
|
|
|
r.set(0, 0, SkIntToScalar(w), SkIntToScalar(h));
|
|
|
|
p.setStyle(SkPaint::kStroke_Style);
|
|
|
|
p.setStrokeWidth(SkIntToScalar(4));
|
|
|
|
p.setColor(SK_ColorBLUE);
|
|
|
|
canvas.drawRect(r, p);
|
|
|
|
}
|
|
|
|
|
2009-01-26 23:15:37 +00:00
|
|
|
private:
|
2014-06-19 19:32:29 +00:00
|
|
|
typedef Benchmark INHERITED;
|
2009-01-26 23:15:37 +00:00
|
|
|
};
|
|
|
|
|
2012-05-15 20:09:33 +00:00
|
|
|
/** Explicitly invoke some filter types to improve coverage of acceleration
|
|
|
|
procs. */
|
|
|
|
|
2013-05-29 15:39:54 +00:00
|
|
|
enum Flags {
|
|
|
|
kScale_Flag = 1 << 0,
|
|
|
|
kRotate_Flag = 1 << 1,
|
|
|
|
kBilerp_Flag = 1 << 2,
|
|
|
|
kBicubic_Flag = 1 << 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
static bool isBilerp(uint32_t flags) {
|
|
|
|
return (flags & (kBilerp_Flag | kBicubic_Flag)) == (kBilerp_Flag);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool isBicubic(uint32_t flags) {
|
|
|
|
return (flags & (kBilerp_Flag | kBicubic_Flag)) == (kBilerp_Flag | kBicubic_Flag);
|
|
|
|
}
|
|
|
|
|
2012-05-15 20:09:33 +00:00
|
|
|
class FilterBitmapBench : public BitmapBench {
|
2013-05-29 15:39:54 +00:00
|
|
|
uint32_t fFlags;
|
2012-05-15 20:09:33 +00:00
|
|
|
SkString fFullName;
|
|
|
|
public:
|
2014-06-10 02:52:07 +00:00
|
|
|
FilterBitmapBench(SkColorType ct, SkAlphaType at,
|
2013-05-29 15:39:54 +00:00
|
|
|
bool forceUpdate, bool isVolitile, uint32_t flags)
|
2014-10-23 21:35:01 +00:00
|
|
|
: INHERITED(ct, at, forceUpdate, isVolitile, false)
|
2013-05-29 15:39:54 +00:00
|
|
|
, fFlags(flags) {
|
2012-05-15 20:09:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2015-07-13 13:18:39 +00:00
|
|
|
const char* onGetName() override {
|
2012-05-15 20:09:33 +00:00
|
|
|
fFullName.set(INHERITED::onGetName());
|
2013-05-29 15:39:54 +00:00
|
|
|
if (fFlags & kScale_Flag) {
|
2012-05-15 20:09:33 +00:00
|
|
|
fFullName.append("_scale");
|
2013-05-29 15:39:54 +00:00
|
|
|
}
|
|
|
|
if (fFlags & kRotate_Flag) {
|
2012-05-15 20:09:33 +00:00
|
|
|
fFullName.append("_rotate");
|
2013-05-29 15:39:54 +00:00
|
|
|
}
|
|
|
|
if (isBilerp(fFlags)) {
|
|
|
|
fFullName.append("_bilerp");
|
|
|
|
} else if (isBicubic(fFlags)) {
|
|
|
|
fFullName.append("_bicubic");
|
|
|
|
}
|
2012-05-15 20:09:33 +00:00
|
|
|
|
|
|
|
return fFullName.c_str();
|
|
|
|
}
|
|
|
|
|
2015-10-01 16:43:39 +00:00
|
|
|
void onDraw(int loops, SkCanvas* canvas) override {
|
2017-02-22 18:21:42 +00:00
|
|
|
SkISize dim = canvas->getBaseLayerSize();
|
2013-05-29 15:39:54 +00:00
|
|
|
if (fFlags & kScale_Flag) {
|
2012-05-15 20:09:33 +00:00
|
|
|
const SkScalar x = SkIntToScalar(dim.fWidth) / 2;
|
|
|
|
const SkScalar y = SkIntToScalar(dim.fHeight) / 2;
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2012-05-15 20:09:33 +00:00
|
|
|
canvas->translate(x, y);
|
|
|
|
// just enough so we can't take the sprite case
|
|
|
|
canvas->scale(SK_Scalar1 * 99/100, SK_Scalar1 * 99/100);
|
|
|
|
canvas->translate(-x, -y);
|
|
|
|
}
|
2013-05-29 15:39:54 +00:00
|
|
|
if (fFlags & kRotate_Flag) {
|
2012-05-15 20:09:33 +00:00
|
|
|
const SkScalar x = SkIntToScalar(dim.fWidth) / 2;
|
|
|
|
const SkScalar y = SkIntToScalar(dim.fHeight) / 2;
|
2016-07-12 22:01:19 +00:00
|
|
|
canvas->rotate(SkIntToScalar(35), x, y);
|
2012-05-15 20:09:33 +00:00
|
|
|
}
|
2013-12-03 18:17:16 +00:00
|
|
|
INHERITED::onDraw(loops, canvas);
|
2013-07-22 17:18:18 +00:00
|
|
|
}
|
2012-05-15 20:09:33 +00:00
|
|
|
|
2015-03-26 01:17:31 +00:00
|
|
|
void setupPaint(SkPaint* paint) override {
|
2013-07-22 17:18:18 +00:00
|
|
|
this->INHERITED::setupPaint(paint);
|
|
|
|
|
|
|
|
int index = 0;
|
2013-05-29 15:39:54 +00:00
|
|
|
if (fFlags & kBilerp_Flag) {
|
2013-07-22 17:18:18 +00:00
|
|
|
index |= 1;
|
2013-05-29 15:39:54 +00:00
|
|
|
}
|
|
|
|
if (fFlags & kBicubic_Flag) {
|
2013-07-22 17:18:18 +00:00
|
|
|
index |= 2;
|
2013-05-29 15:39:54 +00:00
|
|
|
}
|
2015-03-16 17:08:34 +00:00
|
|
|
static const SkFilterQuality gQualitys[] = {
|
|
|
|
kNone_SkFilterQuality,
|
|
|
|
kLow_SkFilterQuality,
|
|
|
|
kMedium_SkFilterQuality,
|
|
|
|
kHigh_SkFilterQuality
|
2013-07-22 17:18:18 +00:00
|
|
|
};
|
2015-03-16 17:08:34 +00:00
|
|
|
paint->setFilterQuality(gQualitys[index]);
|
2013-07-22 17:18:18 +00:00
|
|
|
}
|
2012-05-15 20:09:33 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef BitmapBench INHERITED;
|
|
|
|
};
|
|
|
|
|
2013-04-09 18:06:06 +00:00
|
|
|
/** Verify optimizations that test source alpha values. */
|
|
|
|
|
|
|
|
class SourceAlphaBitmapBench : public BitmapBench {
|
|
|
|
public:
|
|
|
|
enum SourceAlpha { kOpaque_SourceAlpha, kTransparent_SourceAlpha,
|
|
|
|
kTwoStripes_SourceAlpha, kThreeStripes_SourceAlpha};
|
|
|
|
private:
|
|
|
|
SkString fFullName;
|
|
|
|
SourceAlpha fSourceAlpha;
|
|
|
|
public:
|
2014-06-10 02:52:07 +00:00
|
|
|
SourceAlphaBitmapBench(SourceAlpha alpha, SkColorType ct,
|
2013-05-29 15:39:54 +00:00
|
|
|
bool forceUpdate = false, bool bitmapVolatile = false)
|
2014-10-23 21:35:01 +00:00
|
|
|
: INHERITED(ct, kPremul_SkAlphaType, forceUpdate, bitmapVolatile, false)
|
2013-04-09 18:06:06 +00:00
|
|
|
, fSourceAlpha(alpha) {
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2015-07-13 13:18:39 +00:00
|
|
|
const char* onGetName() override {
|
2013-04-09 18:06:06 +00:00
|
|
|
fFullName.set(INHERITED::onGetName());
|
|
|
|
|
|
|
|
if (fSourceAlpha == kOpaque_SourceAlpha) {
|
|
|
|
fFullName.append("_source_opaque");
|
|
|
|
} else if (fSourceAlpha == kTransparent_SourceAlpha) {
|
|
|
|
fFullName.append("_source_transparent");
|
|
|
|
} else if (fSourceAlpha == kTwoStripes_SourceAlpha) {
|
|
|
|
fFullName.append("_source_stripes_two");
|
|
|
|
} else if (fSourceAlpha == kThreeStripes_SourceAlpha) {
|
|
|
|
fFullName.append("_source_stripes_three");
|
|
|
|
}
|
|
|
|
|
|
|
|
return fFullName.c_str();
|
|
|
|
}
|
|
|
|
|
2015-03-26 01:17:31 +00:00
|
|
|
void onDrawIntoBitmap(const SkBitmap& bm) override {
|
2013-04-09 18:06:06 +00:00
|
|
|
const int w = bm.width();
|
|
|
|
const int h = bm.height();
|
|
|
|
|
|
|
|
if (kOpaque_SourceAlpha == fSourceAlpha) {
|
|
|
|
bm.eraseColor(SK_ColorBLACK);
|
|
|
|
} else if (kTransparent_SourceAlpha == fSourceAlpha) {
|
|
|
|
bm.eraseColor(0);
|
|
|
|
} else if (kTwoStripes_SourceAlpha == fSourceAlpha) {
|
|
|
|
bm.eraseColor(0);
|
|
|
|
|
|
|
|
SkCanvas canvas(bm);
|
|
|
|
SkPaint p;
|
|
|
|
p.setAntiAlias(false);
|
|
|
|
p.setStyle(SkPaint::kFill_Style);
|
|
|
|
p.setColor(SK_ColorRED);
|
|
|
|
|
|
|
|
// Draw red vertical stripes on transparent background
|
|
|
|
SkRect r;
|
|
|
|
for (int x = 0; x < w; x+=2)
|
|
|
|
{
|
|
|
|
r.set(SkIntToScalar(x), 0, SkIntToScalar(x+1), SkIntToScalar(h));
|
|
|
|
canvas.drawRect(r, p);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (kThreeStripes_SourceAlpha == fSourceAlpha) {
|
|
|
|
bm.eraseColor(0);
|
|
|
|
|
|
|
|
SkCanvas canvas(bm);
|
|
|
|
SkPaint p;
|
|
|
|
p.setAntiAlias(false);
|
|
|
|
p.setStyle(SkPaint::kFill_Style);
|
|
|
|
|
|
|
|
// Draw vertical stripes on transparent background with a pattern
|
|
|
|
// where the first pixel is fully transparent, the next is semi-transparent
|
|
|
|
// and the third is fully opaque.
|
|
|
|
SkRect r;
|
|
|
|
for (int x = 0; x < w; x++)
|
|
|
|
{
|
|
|
|
if (x % 3 == 0) {
|
|
|
|
continue; // Keep transparent
|
|
|
|
} else if (x % 3 == 1) {
|
|
|
|
p.setColor(SkColorSetARGB(127, 127, 127, 127)); // Semi-transparent
|
|
|
|
} else if (x % 3 == 2) {
|
|
|
|
p.setColor(SK_ColorRED); // Opaque
|
|
|
|
}
|
|
|
|
r.set(SkIntToScalar(x), 0, SkIntToScalar(x+1), SkIntToScalar(h));
|
|
|
|
canvas.drawRect(r, p);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef BitmapBench INHERITED;
|
|
|
|
};
|
2013-05-28 20:48:14 +00:00
|
|
|
|
2014-10-23 21:35:01 +00:00
|
|
|
DEF_BENCH( return new BitmapBench(kN32_SkColorType, kPremul_SkAlphaType, false, false, false); )
|
|
|
|
DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, false, false, false); )
|
|
|
|
DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, false, false, true); )
|
|
|
|
DEF_BENCH( return new BitmapBench(kRGB_565_SkColorType, kOpaque_SkAlphaType, false, false, false); )
|
|
|
|
DEF_BENCH( return new BitmapBench(kIndex_8_SkColorType, kPremul_SkAlphaType, false, false, false); )
|
|
|
|
DEF_BENCH( return new BitmapBench(kIndex_8_SkColorType, kOpaque_SkAlphaType, false, false, false); )
|
|
|
|
DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, true, false); )
|
|
|
|
DEF_BENCH( return new BitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, false, false); )
|
2009-01-26 23:15:37 +00:00
|
|
|
|
2012-08-23 18:09:54 +00:00
|
|
|
// scale filter -> S32_opaque_D32_filter_DX_{SSE2,SSSE3} and Fact9 is also for S32_D16_filter_DX_SSE2
|
2014-06-10 02:52:07 +00:00
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, false, false, kScale_Flag | kBilerp_Flag); )
|
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, false, false, kScale_Flag | kBilerp_Flag); )
|
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, true, kScale_Flag | kBilerp_Flag); )
|
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, false, kScale_Flag | kBilerp_Flag); )
|
2012-05-15 20:09:33 +00:00
|
|
|
|
|
|
|
// scale rotate filter -> S32_opaque_D32_filter_DXDY_{SSE2,SSSE3}
|
2014-06-10 02:52:07 +00:00
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, false, false, kScale_Flag | kRotate_Flag | kBilerp_Flag); )
|
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, false, false, kScale_Flag | kRotate_Flag | kBilerp_Flag); )
|
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, true, kScale_Flag | kRotate_Flag | kBilerp_Flag); )
|
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kOpaque_SkAlphaType, true, false, kScale_Flag | kRotate_Flag | kBilerp_Flag); )
|
2013-05-29 15:39:54 +00:00
|
|
|
|
2014-06-10 02:52:07 +00:00
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, false, false, kScale_Flag | kBilerp_Flag | kBicubic_Flag); )
|
|
|
|
DEF_BENCH( return new FilterBitmapBench(kN32_SkColorType, kPremul_SkAlphaType, false, false, kScale_Flag | kRotate_Flag | kBilerp_Flag | kBicubic_Flag); )
|
2012-05-15 20:09:33 +00:00
|
|
|
|
2013-04-09 18:06:06 +00:00
|
|
|
// source alpha tests -> S32A_Opaque_BlitRow32_{arm,neon}
|
2014-06-10 02:52:07 +00:00
|
|
|
DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kOpaque_SourceAlpha, kN32_SkColorType); )
|
|
|
|
DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTransparent_SourceAlpha, kN32_SkColorType); )
|
|
|
|
DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kTwoStripes_SourceAlpha, kN32_SkColorType); )
|
|
|
|
DEF_BENCH( return new SourceAlphaBitmapBench(SourceAlphaBitmapBench::kThreeStripes_SourceAlpha, kN32_SkColorType); )
|