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

Side by Side Diff: bench/SkGlyphCacheBench.cpp

Issue 1379923005: Remove const from `const int loops`. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: n too 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/Sk4fBench.cpp ('k') | bench/SkipZeroesBench.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 2015 Google Inc. 2 * Copyright 2015 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 8
9 #include "SkGlyphCache.h" 9 #include "SkGlyphCache.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 protected: 43 protected:
44 const char* onGetName() override { 44 const char* onGetName() override {
45 fName.printf("SkGlyphCacheBasic%dK", (int)(fCacheSize >> 10)); 45 fName.printf("SkGlyphCacheBasic%dK", (int)(fCacheSize >> 10));
46 return fName.c_str(); 46 return fName.c_str();
47 } 47 }
48 48
49 bool isSuitableFor(Backend backend) override { 49 bool isSuitableFor(Backend backend) override {
50 return backend == kNonRendering_Backend; 50 return backend == kNonRendering_Backend;
51 } 51 }
52 52
53 void onDraw(const int loops, SkCanvas*) override { 53 void onDraw(int loops, SkCanvas*) override {
54 size_t oldCacheLimitSize = SkGraphics::GetFontCacheLimit(); 54 size_t oldCacheLimitSize = SkGraphics::GetFontCacheLimit();
55 SkGraphics::SetFontCacheLimit(fCacheSize); 55 SkGraphics::SetFontCacheLimit(fCacheSize);
56 SkTypeface* typeface = sk_tool_utils::create_portable_typeface( 56 SkTypeface* typeface = sk_tool_utils::create_portable_typeface(
57 "serif", SkTypeface::kItalic); 57 "serif", SkTypeface::kItalic);
58 SkPaint paint; 58 SkPaint paint;
59 paint.setAntiAlias(true); 59 paint.setAntiAlias(true);
60 paint.setSubpixelText(true); 60 paint.setSubpixelText(true);
61 paint.setTypeface(typeface); 61 paint.setTypeface(typeface);
62 62
63 for (int work = 0; work < loops; work++) { 63 for (int work = 0; work < loops; work++) {
(...skipping 16 matching lines...) Expand all
80 protected: 80 protected:
81 const char* onGetName() override { 81 const char* onGetName() override {
82 fName.printf("SkGlyphCacheStressTest%dK", (int)(fCacheSize >> 10)); 82 fName.printf("SkGlyphCacheStressTest%dK", (int)(fCacheSize >> 10));
83 return fName.c_str(); 83 return fName.c_str();
84 } 84 }
85 85
86 bool isSuitableFor(Backend backend) override { 86 bool isSuitableFor(Backend backend) override {
87 return backend == kNonRendering_Backend; 87 return backend == kNonRendering_Backend;
88 } 88 }
89 89
90 void onDraw(const int loops, SkCanvas*) override { 90 void onDraw(int loops, SkCanvas*) override {
91 size_t oldCacheLimitSize = SkGraphics::GetFontCacheLimit(); 91 size_t oldCacheLimitSize = SkGraphics::GetFontCacheLimit();
92 SkGraphics::SetFontCacheLimit(fCacheSize); 92 SkGraphics::SetFontCacheLimit(fCacheSize);
93 SkTypeface* typefaces[] = 93 SkTypeface* typefaces[] =
94 {sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItali c), 94 {sk_tool_utils::create_portable_typeface("serif", SkTypeface::kItali c),
95 sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::k Italic)}; 95 sk_tool_utils::create_portable_typeface("sans-serif", SkTypeface::k Italic)};
96 96
97 for (int work = 0; work < loops; work++) { 97 for (int work = 0; work < loops; work++) {
98 sk_parallel_for(16, [&](int threadIndex) { 98 sk_parallel_for(16, [&](int threadIndex) {
99 SkPaint paint; 99 SkPaint paint;
100 paint.setAntiAlias(true); 100 paint.setAntiAlias(true);
(...skipping 10 matching lines...) Expand all
111 private: 111 private:
112 typedef Benchmark INHERITED; 112 typedef Benchmark INHERITED;
113 const size_t fCacheSize; 113 const size_t fCacheSize;
114 SkString fName; 114 SkString fName;
115 }; 115 };
116 116
117 DEF_BENCH( return new SkGlyphCacheBasic(256 * 1024); ) 117 DEF_BENCH( return new SkGlyphCacheBasic(256 * 1024); )
118 DEF_BENCH( return new SkGlyphCacheBasic(32 * 1024 * 1024); ) 118 DEF_BENCH( return new SkGlyphCacheBasic(32 * 1024 * 1024); )
119 DEF_BENCH( return new SkGlyphCacheStressTest(256 * 1024); ) 119 DEF_BENCH( return new SkGlyphCacheStressTest(256 * 1024); )
120 DEF_BENCH( return new SkGlyphCacheStressTest(32 * 1024 * 1024); ) 120 DEF_BENCH( return new SkGlyphCacheStressTest(32 * 1024 * 1024); )
OLDNEW
« no previous file with comments | « bench/Sk4fBench.cpp ('k') | bench/SkipZeroesBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698