OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #ifndef PathOpsThreadedCommon_DEFINED | 7 #ifndef PathOpsThreadedCommon_DEFINED |
8 #define PathOpsThreadedCommon_DEFINED | 8 #define PathOpsThreadedCommon_DEFINED |
9 | 9 |
10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 PathOpsThreadedRunnable(void (*testFun)(PathOpsThreadState*), const char* st
r, | 63 PathOpsThreadedRunnable(void (*testFun)(PathOpsThreadState*), const char* st
r, |
64 PathOpsThreadedTestRunner* runner) { | 64 PathOpsThreadedTestRunner* runner) { |
65 SkASSERT(strlen(str) < sizeof(fState.fSerialNo) - 1); | 65 SkASSERT(strlen(str) < sizeof(fState.fSerialNo) - 1); |
66 strcpy(fState.fSerialNo, str); | 66 strcpy(fState.fSerialNo, str); |
67 fState.fReporter = runner->fReporter; | 67 fState.fReporter = runner->fReporter; |
68 fTestFun = testFun; | 68 fTestFun = testFun; |
69 } | 69 } |
70 | 70 |
| 71 PathOpsThreadedRunnable(void (*testFun)(PathOpsThreadState*), int dirNo, con
st char* str, |
| 72 PathOpsThreadedTestRunner* runner) { |
| 73 SkASSERT(strlen(str) < sizeof(fState.fSerialNo) - 1); |
| 74 fState.fA = dirNo; |
| 75 strcpy(fState.fSerialNo, str); |
| 76 fState.fReporter = runner->fReporter; |
| 77 fTestFun = testFun; |
| 78 } |
| 79 |
71 virtual void run() SK_OVERRIDE { | 80 virtual void run() SK_OVERRIDE { |
72 SkBitmap bitmap; | 81 SkBitmap bitmap; |
73 fState.fBitmap = &bitmap; | 82 fState.fBitmap = &bitmap; |
74 char pathStr[PATH_STR_SIZE]; | 83 char pathStr[PATH_STR_SIZE]; |
75 fState.fPathStr = pathStr; | 84 fState.fPathStr = pathStr; |
76 SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); | 85 SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); |
77 (*fTestFun)(&fState); | 86 (*fTestFun)(&fState); |
78 } | 87 } |
79 | 88 |
80 private: | 89 private: |
81 PathOpsThreadState fState; | 90 PathOpsThreadState fState; |
82 void (*fTestFun)(PathOpsThreadState*); | 91 void (*fTestFun)(PathOpsThreadState*); |
83 }; | 92 }; |
84 | 93 |
85 #endif | 94 #endif |
OLD | NEW |