aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/gm.h
diff options
context:
space:
mode:
Diffstat (limited to 'gm/gm.h')
-rw-r--r--gm/gm.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/gm/gm.h b/gm/gm.h
index b474729366..0de9875896 100644
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -53,7 +53,14 @@ namespace skiagm {
void drawBackground(SkCanvas*);
void drawContent(SkCanvas*);
- SkISize getISize() { return this->onISize(); }
+ SkISize getISize() {
+ SkISize size = this->onISize();
+ // Sanity cap on GM dimensions.
+ SkASSERT(size.width() * size.height() <= 2359296 && // 2.25 megapixels
+ size.width() <= 2048 && // Typical GPU max dimension.
+ size.height() <= 2048);
+ return size;
+ }
const char* getName();
virtual bool runAsBench() const { return false; }