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

Side by Side Diff: bench/PictureNestingBench.cpp

Issue 1379853003: Fix for nexus 5 crashing in GL benches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 2 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 | « bench/PathBench.cpp ('k') | bench/PicturePlaybackBench.cpp » ('j') | 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 2014 Google Inc. 2 * Copyright 2014 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 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 private: 132 private:
133 typedef PictureNesting INHERITED; 133 typedef PictureNesting INHERITED;
134 }; 134 };
135 135
136 class PictureNestingPlayback : public PictureNesting { 136 class PictureNestingPlayback : public PictureNesting {
137 public: 137 public:
138 PictureNestingPlayback(int maxLevel, int maxPictureLevel) 138 PictureNestingPlayback(int maxLevel, int maxPictureLevel)
139 : INHERITED("playback", maxLevel, maxPictureLevel) { 139 : INHERITED("playback", maxLevel, maxPictureLevel) {
140 } 140 }
141 protected: 141 protected:
142 void onPreDraw() override { 142 void onDelayedSetup() override {
143 this->INHERITED::onPreDraw(); 143 this->INHERITED::onDelayedSetup();
144 144
145 SkIPoint canvasSize = onGetSize(); 145 SkIPoint canvasSize = onGetSize();
146 SkPictureRecorder recorder; 146 SkPictureRecorder recorder;
147 SkCanvas* c = recorder.beginRecording(SkIntToScalar(canvasSize.x()), 147 SkCanvas* c = recorder.beginRecording(SkIntToScalar(canvasSize.x()),
148 SkIntToScalar(canvasSize.y())); 148 SkIntToScalar(canvasSize.y()));
149 149
150 this->doDraw(c); 150 this->doDraw(c);
151 fPicture.reset(recorder.endRecording()); 151 fPicture.reset(recorder.endRecording());
152 } 152 }
153 153
(...skipping 21 matching lines...) Expand all
175 175
176 DEF_BENCH( return new PictureNestingPlayback(8, 0); ) 176 DEF_BENCH( return new PictureNestingPlayback(8, 0); )
177 DEF_BENCH( return new PictureNestingPlayback(8, 1); ) 177 DEF_BENCH( return new PictureNestingPlayback(8, 1); )
178 DEF_BENCH( return new PictureNestingPlayback(8, 2); ) 178 DEF_BENCH( return new PictureNestingPlayback(8, 2); )
179 DEF_BENCH( return new PictureNestingPlayback(8, 3); ) 179 DEF_BENCH( return new PictureNestingPlayback(8, 3); )
180 DEF_BENCH( return new PictureNestingPlayback(8, 4); ) 180 DEF_BENCH( return new PictureNestingPlayback(8, 4); )
181 DEF_BENCH( return new PictureNestingPlayback(8, 5); ) 181 DEF_BENCH( return new PictureNestingPlayback(8, 5); )
182 DEF_BENCH( return new PictureNestingPlayback(8, 6); ) 182 DEF_BENCH( return new PictureNestingPlayback(8, 6); )
183 DEF_BENCH( return new PictureNestingPlayback(8, 7); ) 183 DEF_BENCH( return new PictureNestingPlayback(8, 7); )
184 DEF_BENCH( return new PictureNestingPlayback(8, 8); ) 184 DEF_BENCH( return new PictureNestingPlayback(8, 8); )
OLDNEW
« no previous file with comments | « bench/PathBench.cpp ('k') | bench/PicturePlaybackBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698