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

Side by Side Diff: bench/SkipZeroesBench.cpp

Issue 73643005: Implement a benchmark for GrResourceCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address comments Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « bench/SkBenchmark.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 "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 15 matching lines...) Expand all
26 , fFilename(filename) 26 , fFilename(filename)
27 , fStream() 27 , fStream()
28 , fSkipZeroes(skipZeroes) 28 , fSkipZeroes(skipZeroes)
29 , fValid(false) { 29 , fValid(false) {
30 fName.append(filename); 30 fName.append(filename);
31 if (skipZeroes) { 31 if (skipZeroes) {
32 fName.append("_skip_zeroes"); 32 fName.append("_skip_zeroes");
33 } else { 33 } else {
34 fName.append("_write_zeroes"); 34 fName.append("_write_zeroes");
35 } 35 }
36 fIsRendering = false; 36 }
37
38 virtual bool isSuitableFor(Backend backend) SK_OVERRIDE {
39 return backend == kNonRendering_Backend;
37 } 40 }
38 41
39 protected: 42 protected:
40 virtual const char* onGetName() SK_OVERRIDE { 43 virtual const char* onGetName() SK_OVERRIDE {
41 return fName.c_str(); 44 return fName.c_str();
42 } 45 }
43 46
44 virtual void onPreDraw() SK_OVERRIDE { 47 virtual void onPreDraw() SK_OVERRIDE {
45 const char* resPath = GetResourcePath().c_str(); 48 const char* resPath = GetResourcePath().c_str();
46 if (NULL == resPath) { 49 if (NULL == resPath) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 SkMemoryStream fStream; 107 SkMemoryStream fStream;
105 bool fSkipZeroes; 108 bool fSkipZeroes;
106 bool fValid; 109 bool fValid;
107 110
108 typedef SkBenchmark INHERITED; 111 typedef SkBenchmark INHERITED;
109 }; 112 };
110 113
111 // Enable the true version once the feature is checked in. 114 // Enable the true version once the feature is checked in.
112 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", true))); 115 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", true)));
113 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", false))); 116 DEF_BENCH( return SkNEW_ARGS(SkipZeroesBench, ("arrow.png", false)));
OLDNEW
« no previous file with comments | « bench/SkBenchmark.cpp ('k') | bench/SortBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698