Make GMs aware of what tool they're being run in.
Add a saveLayer set of draws to convex_poly_clip and fix GPU bug where polygon clips don't account for the translation between clip and device space.
BUG=skia:2051
R=robertphillips@google.com, reed@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/148283017
git-svn-id: http://skia.googlecode.com/svn/trunk@13371 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gm.h b/gm/gm.h
index bb20c9c..4da688c 100644
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -53,6 +53,15 @@
kAsBench_Flag = 1 << 10, // Run the GM as a benchmark in the bench tool
};
+ enum Mode {
+ kGM_Mode,
+ kSample_Mode,
+ kBench_Mode,
+ };
+
+ void setMode(Mode mode) { fMode = mode; }
+ Mode getMode() const { return fMode; }
+
void draw(SkCanvas*);
void drawBackground(SkCanvas*);
void drawContent(SkCanvas*);
@@ -101,10 +110,10 @@
fCanvasIsDeferred = isDeferred;
}
- const SkMatrix& getStarterMatrix() { return fStarterMatrix; }
- void setStarterMatrix(const SkMatrix& matrix) {
- fStarterMatrix = matrix;
- }
+ const SkMatrix& getStarterMatrix() { return fStarterMatrix; }
+ void setStarterMatrix(const SkMatrix& matrix) {
+ fStarterMatrix = matrix;
+ }
protected:
static SkString gResourcePath;
@@ -118,6 +127,7 @@
virtual SkMatrix onGetInitialTransform() const { return SkMatrix::I(); }
private:
+ Mode fMode;
SkString fShortName;
SkColor fBGColor;
bool fCanvasIsDeferred; // work-around problem in srcmode.cpp