Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Side by Side Diff: gm/gm.h

Issue 863243005: DM::SKPSrc::size() reports correct size. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: while Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef skiagm_DEFINED 8 #ifndef skiagm_DEFINED
9 #define skiagm_DEFINED 9 #define skiagm_DEFINED
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 kBench_Mode, 46 kBench_Mode,
47 }; 47 };
48 48
49 void setMode(Mode mode) { fMode = mode; } 49 void setMode(Mode mode) { fMode = mode; }
50 Mode getMode() const { return fMode; } 50 Mode getMode() const { return fMode; }
51 51
52 void draw(SkCanvas*); 52 void draw(SkCanvas*);
53 void drawBackground(SkCanvas*); 53 void drawBackground(SkCanvas*);
54 void drawContent(SkCanvas*); 54 void drawContent(SkCanvas*);
55 55
56 SkISize getISize() { return this->onISize(); } 56 SkISize getISize() {
57 SkISize size = this->onISize();
58 // Sanity cap on GM dimensions.
59 SkASSERT(size.width() * size.height() <= 2359296 && // 2.25 megapix els
60 size.width() <= 2048 && // Typical GPU max dimension.
61 size.height() <= 2048);
62 return size;
63 }
57 const char* getName(); 64 const char* getName();
58 65
59 virtual bool runAsBench() const { return false; } 66 virtual bool runAsBench() const { return false; }
60 67
61 SkScalar width() { 68 SkScalar width() {
62 return SkIntToScalar(this->getISize().width()); 69 return SkIntToScalar(this->getISize().width());
63 } 70 }
64 SkScalar height() { 71 SkScalar height() {
65 return SkIntToScalar(this->getISize().height()); 72 return SkIntToScalar(this->getISize().height());
66 } 73 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 SkISize onISize() SK_OVERRIDE; 130 SkISize onISize() SK_OVERRIDE;
124 SkString onShortName() SK_OVERRIDE; 131 SkString onShortName() SK_OVERRIDE;
125 private: 132 private:
126 SkString fName; 133 SkString fName;
127 void (*fDrawProc)(SkCanvas*); 134 void (*fDrawProc)(SkCanvas*);
128 SkISize fSize; 135 SkISize fSize;
129 }; 136 };
130 } 137 }
131 138
132 #endif 139 #endif
OLDNEW
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698