a90c680386
- Rename TileGrid -> Quilt to avoid the name overload. - Tag all failing GMs with kSkipTiled_Flag. You may be wondering, do any GMs pass? Yes, some do! And that trends towards all of them as we increase --quiltTile. Two GMs only fail in --quilt mode in 565. Otherwise all GMs which fail are skipped, and those which don't fail aren't. (The 8888 variants of those two GMs are skipped even though they pass.) BUG=skia:2477 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/256373002 git-svn-id: http://skia.googlecode.com/svn/trunk@14457 2bbb7eff-a529-9590-31e7-b0007b416f81
68 lines
1.5 KiB
C++
68 lines
1.5 KiB
C++
/*
|
|
* Copyright 2013 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#include "gm.h"
|
|
#include "SkCanvas.h"
|
|
#include "SkLerpXfermode.h"
|
|
|
|
static void show_circlelayers(SkCanvas* canvas, SkXfermode* mode) {
|
|
SkPaint paint;
|
|
paint.setAntiAlias(true);
|
|
SkRect r, bounds = { 10, 10, 110, 110 };
|
|
|
|
r = bounds;
|
|
r.fRight = bounds.centerX();
|
|
canvas->drawRect(r, paint);
|
|
|
|
canvas->saveLayer(&bounds, NULL);
|
|
|
|
paint.setColor(0x80FF0000);
|
|
r = bounds;
|
|
r.inset(20, 0);
|
|
canvas->drawOval(r, paint);
|
|
|
|
paint.setColor(0x800000FF);
|
|
r = bounds;
|
|
r.inset(0, 20);
|
|
paint.setXfermode(mode);
|
|
canvas->drawOval(r, paint);
|
|
|
|
canvas->restore();
|
|
}
|
|
|
|
class LerpXfermodeGM : public skiagm::GM {
|
|
public:
|
|
LerpXfermodeGM() {}
|
|
|
|
protected:
|
|
virtual uint32_t onGetFlags() const SK_OVERRIDE {
|
|
return kSkipTiled_Flag;
|
|
}
|
|
|
|
virtual SkString onShortName() SK_OVERRIDE {
|
|
return SkString("lerpmode");
|
|
}
|
|
|
|
virtual SkISize onISize() SK_OVERRIDE {
|
|
return SkISize::Make(240, 120);
|
|
}
|
|
|
|
virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
|
|
show_circlelayers(canvas, NULL);
|
|
canvas->translate(150, 0);
|
|
SkAutoTUnref<SkXfermode> mode(SkLerpXfermode::Create(0.5f));
|
|
show_circlelayers(canvas, mode.get());
|
|
}
|
|
|
|
private:
|
|
typedef skiagm::GM INHERITED;
|
|
};
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
DEF_GM( return SkNEW(LerpXfermodeGM); )
|