aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-11 20:25:53 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-06-11 20:25:53 +0000
commit2fef6d2bda33b348133843e22c1009504c6fc209 (patch)
treeb59921d083d7a337b3d9eb578a8d5a47a293410a /bench
parent5065cbe689655656b3206f031a08aa234b8602a6 (diff)
move measureText to be the only thing in the inner loop
BUG= Review URL: https://codereview.chromium.org/15682016 git-svn-id: http://skia.googlecode.com/svn/trunk@9518 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench')
-rw-r--r--bench/FontCacheBench.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/bench/FontCacheBench.cpp b/bench/FontCacheBench.cpp
index 12b46e9564..c154e8c42c 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
}
}