зеркало из https://github.com/mozilla/moz-skia.git
add getFlags() to gm baseclass
skip PDF for hairmodes for now, since it crashes git-svn-id: http://skia.googlecode.com/svn/trunk@2282 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
Родитель
ab9739777c
Коммит
fbc2117288
10
gm/gm.h
10
gm/gm.h
|
@ -30,6 +30,11 @@ namespace skiagm {
|
|||
GM();
|
||||
virtual ~GM();
|
||||
|
||||
enum Flags {
|
||||
kSkipPDF_Flag = 1 << 0,
|
||||
kSkipPicture_Flag = 1 << 1
|
||||
};
|
||||
|
||||
void draw(SkCanvas*);
|
||||
SkISize getISize() { return this->onISize(); }
|
||||
const char* shortName() {
|
||||
|
@ -39,12 +44,15 @@ namespace skiagm {
|
|||
return fShortName.c_str();
|
||||
}
|
||||
|
||||
virtual bool validForPicture() const { return true; }
|
||||
uint32_t getFlags() const {
|
||||
return this->onGetFlags();
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void onDraw(SkCanvas*) = 0;
|
||||
virtual SkISize onISize() = 0;
|
||||
virtual SkString onShortName() = 0;
|
||||
virtual uint32_t onGetFlags() const { return 0; }
|
||||
|
||||
private:
|
||||
SkString fShortName;
|
||||
|
|
|
@ -435,10 +435,6 @@ static bool test_picture_playback(GM* gm,
|
|||
const SkBitmap& comparisonBitmap,
|
||||
const char readPath [],
|
||||
const char diffPath []) {
|
||||
if (!gm->validForPicture()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
SkPicture* pict = generate_new_picture(gm);
|
||||
SkAutoUnref aur(pict);
|
||||
|
||||
|
@ -607,7 +603,10 @@ int main(int argc, char * const argv[]) {
|
|||
SkBitmap forwardRenderedBitmap;
|
||||
|
||||
for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); i++) {
|
||||
if ((kPDF_Backend == gRec[i].fBackend) && !doPDF) {
|
||||
uint32_t gmFlags = gm->getFlags();
|
||||
|
||||
if ((kPDF_Backend == gRec[i].fBackend) && !doPDF ||
|
||||
(gmFlags & GM::kSkipPDF_Flag)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -616,7 +615,7 @@ int main(int argc, char * const argv[]) {
|
|||
rt, &forwardRenderedBitmap);
|
||||
overallSuccess &= testSuccess;
|
||||
|
||||
if (doReplay && testSuccess) {
|
||||
if (doReplay && testSuccess && !(gmFlags & GM::kSkipPicture_Flag)) {
|
||||
testSuccess = test_picture_playback(gm, gRec[i],
|
||||
forwardRenderedBitmap,
|
||||
readPath, diffPath);
|
||||
|
|
|
@ -138,6 +138,10 @@ namespace skiagm {
|
|||
canvas->translate(W * 5 / 4, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// disable pdf for now, since it crashes on mac
|
||||
virtual uint32_t onGetFlags() const { return kSkipPDF_Flag; }
|
||||
|
||||
private:
|
||||
typedef GM INHERITED;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче