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

Side by Side Diff: bench/SkipZeroesBench.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/RepeatTileBench.cpp ('k') | bench/SortBench.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 2013 Google Inc. 2 * Copyright 2013 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 "Resources.h" 9 #include "Resources.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 27 matching lines...) Expand all
38 38
39 bool isSuitableFor(Backend backend) override { 39 bool isSuitableFor(Backend backend) override {
40 return backend == kNonRendering_Backend; 40 return backend == kNonRendering_Backend;
41 } 41 }
42 42
43 protected: 43 protected:
44 const char* onGetName() override { 44 const char* onGetName() override {
45 return fName.c_str(); 45 return fName.c_str();
46 } 46 }
47 47
48 void onPreDraw() override { 48 void onDelayedSetup() override {
49 SkString resourcePath = GetResourcePath(); 49 SkString resourcePath = GetResourcePath();
50 if (resourcePath.isEmpty()) { 50 if (resourcePath.isEmpty()) {
51 fValid = false; 51 fValid = false;
52 return; 52 return;
53 } 53 }
54 54
55 SkString fullPath = SkOSPath::Join(resourcePath.c_str(), fFilename.c_str ()); 55 SkString fullPath = SkOSPath::Join(resourcePath.c_str(), fFilename.c_str ());
56 SkFILEStream fileStream(fullPath.c_str()); 56 SkFILEStream fileStream(fullPath.c_str());
57 fValid = fileStream.isValid() && fileStream.getLength() > 0; 57 fValid = fileStream.isValid() && fileStream.getLength() > 0;
58 if (fValid) { 58 if (fValid) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 SkMemoryStream fStream; 108 SkMemoryStream fStream;
109 bool fSkipZeroes; 109 bool fSkipZeroes;
110 bool fValid; 110 bool fValid;
111 111
112 typedef Benchmark INHERITED; 112 typedef Benchmark INHERITED;
113 }; 113 };
114 114
115 // Enable the true version once the feature is checked in. 115 // Enable the true version once the feature is checked in.
116 DEF_BENCH(return new SkipZeroesBench("arrow.png", true)); 116 DEF_BENCH(return new SkipZeroesBench("arrow.png", true));
117 DEF_BENCH(return new SkipZeroesBench("arrow.png", false)); 117 DEF_BENCH(return new SkipZeroesBench("arrow.png", false));
OLDNEW
« no previous file with comments | « bench/RepeatTileBench.cpp ('k') | bench/SortBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698