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

Unified Diff: bench/FontCacheBench.cpp

Issue 15682016: move measureText to be the only thing in the inner loop (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/FontCacheBench.cpp
diff --git a/bench/FontCacheBench.cpp b/bench/FontCacheBench.cpp
index 12b46e9564641c3cd798a5e34ec45fac26ed4400..c154e8c42c3308f9aa492a9e93546904c6a03cd4 100644
--- a/bench/FontCacheBench.cpp
+++ b/bench/FontCacheBench.cpp
@@ -15,7 +15,7 @@
#include "gUniqueGlyphIDs.h"
class FontCacheBench : public SkBenchmark {
- enum { N = SkBENCHLOOP(40) };
+ enum { N = SkBENCHLOOP(50) };
public:
FontCacheBench(void* param) : INHERITED(param) {
}
@@ -30,16 +30,16 @@ protected:
this->setupPaint(&paint);
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
- for (int i = 0; i < N; ++i) {
- const uint16_t* array = gUniqueGlyphIDs;
- while (*array != 0xFFFF) {
- const uint16_t* end = array + 1;
- while (*end != 0xFFFF) {
- end += 1;
- }
+ const uint16_t* array = gUniqueGlyphIDs;
+ while (*array != 0xFFFF) {
+ const uint16_t* end = array + 1;
+ while (*end != 0xFFFF) {
+ end += 1;
+ }
+ for (int i = 0; i < N; ++i) {
paint.measureText(array, end - array);
- array = end + 1; // skip the sentinel
}
+ array = end + 1; // skip the sentinel
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698