aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/gm.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-01-28 13:59:42 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-28 13:59:42 -0800
commitd4dd58e43ca4551531ad6a9f54bfc5632ea45a80 (patch)
tree49546ba35c85859a00025d1d7d72874fde184b93 /gm/gm.h
parent40dab98de1bdb803035304077f43410d1f86f2d2 (diff)
DM::SKPSrc::size() reports correct size.
Also, DM::GPUSink and DM::RasterSink crop DM::Src::size() to 2048x2048. Motivation: Improve PDF testing by printing the entire SKP. Source: http://crrev.com/863243004 BUG=skia:3365 Committed: https://skia.googlesource.com/skia/+/441b10eac09a1f44983e35da827a6b438a409e63 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Release-Trybot Review URL: https://codereview.chromium.org/863243005
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; }