OLD | NEW |
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 Loading... |
46 kSkipPipe_Flag = 1 << 2, | 46 kSkipPipe_Flag = 1 << 2, |
47 kSkipPipeCrossProcess_Flag = 1 << 3, | 47 kSkipPipeCrossProcess_Flag = 1 << 3, |
48 kSkipTiled_Flag = 1 << 4, | 48 kSkipTiled_Flag = 1 << 4, |
49 kSkip565_Flag = 1 << 5, | 49 kSkip565_Flag = 1 << 5, |
50 kSkipScaledReplay_Flag = 1 << 6, | 50 kSkipScaledReplay_Flag = 1 << 6, |
51 kSkipGPU_Flag = 1 << 7, | 51 kSkipGPU_Flag = 1 << 7, |
52 kSkipPDFRasterization_Flag = 1 << 8, | 52 kSkipPDFRasterization_Flag = 1 << 8, |
53 | 53 |
54 kGPUOnly_Flag = 1 << 9, | 54 kGPUOnly_Flag = 1 << 9, |
55 | 55 |
56 kAsBench_Flag = 1 << 10, // Run the GM as a benchmark
in the bench tool | |
57 | |
58 kNoBBH_Flag = 1 << 11, // May draw wrong using a bou
nding-box hierarchy | 56 kNoBBH_Flag = 1 << 11, // May draw wrong using a bou
nding-box hierarchy |
59 }; | 57 }; |
60 | 58 |
61 enum Mode { | 59 enum Mode { |
62 kGM_Mode, | 60 kGM_Mode, |
63 kSample_Mode, | 61 kSample_Mode, |
64 kBench_Mode, | 62 kBench_Mode, |
65 }; | 63 }; |
66 | 64 |
67 void setMode(Mode mode) { fMode = mode; } | 65 void setMode(Mode mode) { fMode = mode; } |
68 Mode getMode() const { return fMode; } | 66 Mode getMode() const { return fMode; } |
69 | 67 |
70 void draw(SkCanvas*); | 68 void draw(SkCanvas*); |
71 void drawBackground(SkCanvas*); | 69 void drawBackground(SkCanvas*); |
72 void drawContent(SkCanvas*); | 70 void drawContent(SkCanvas*); |
73 | 71 |
74 SkISize getISize() { return this->onISize(); } | 72 SkISize getISize() { return this->onISize(); } |
75 const char* getName(); | 73 const char* getName(); |
76 | 74 |
| 75 virtual bool runAsBench() const { return false; } |
| 76 |
77 uint32_t getFlags() const { | 77 uint32_t getFlags() const { |
78 return this->onGetFlags(); | 78 return this->onGetFlags(); |
79 } | 79 } |
80 | 80 |
81 SkScalar width() { | 81 SkScalar width() { |
82 return SkIntToScalar(this->getISize().width()); | 82 return SkIntToScalar(this->getISize().width()); |
83 } | 83 } |
84 SkScalar height() { | 84 SkScalar height() { |
85 return SkIntToScalar(this->getISize().height()); | 85 return SkIntToScalar(this->getISize().height()); |
86 } | 86 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 SkISize onISize() SK_OVERRIDE; | 143 SkISize onISize() SK_OVERRIDE; |
144 SkString onShortName() SK_OVERRIDE; | 144 SkString onShortName() SK_OVERRIDE; |
145 private: | 145 private: |
146 SkString fName; | 146 SkString fName; |
147 void (*fDrawProc)(SkCanvas*); | 147 void (*fDrawProc)(SkCanvas*); |
148 SkISize fSize; | 148 SkISize fSize; |
149 }; | 149 }; |
150 } | 150 } |
151 | 151 |
152 #endif | 152 #endif |
OLD | NEW |