| 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" |
| 11 #include "SkRunnable.h" | 11 #include "Runnable.h" |
| 12 #include "SkTDArray.h" | 12 #include "SkTDArray.h" |
| 13 | 13 |
| 14 #define PATH_STR_SIZE 512 | 14 #define PATH_STR_SIZE 512 |
| 15 | 15 |
| 16 class PathOpsThreadedRunnable; | 16 class PathOpsThreadedRunnable; |
| 17 | 17 |
| 18 namespace skiatest { | 18 namespace skiatest { |
| 19 class Reporter; | 19 class Reporter; |
| 20 } | 20 } |
| 21 | 21 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 41 ~PathOpsThreadedTestRunner(); | 41 ~PathOpsThreadedTestRunner(); |
| 42 | 42 |
| 43 void render(); | 43 void render(); |
| 44 | 44 |
| 45 public: | 45 public: |
| 46 int fNumThreads; | 46 int fNumThreads; |
| 47 SkTDArray<PathOpsThreadedRunnable*> fRunnables; | 47 SkTDArray<PathOpsThreadedRunnable*> fRunnables; |
| 48 skiatest::Reporter* fReporter; | 48 skiatest::Reporter* fReporter; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class PathOpsThreadedRunnable : public SkRunnable { | 51 class PathOpsThreadedRunnable : public Runnable { |
| 52 public: | 52 public: |
| 53 PathOpsThreadedRunnable(void (*testFun)(PathOpsThreadState*), int a, int b,
int c, int d, | 53 PathOpsThreadedRunnable(void (*testFun)(PathOpsThreadState*), int a, int b,
int c, int d, |
| 54 PathOpsThreadedTestRunner* runner) { | 54 PathOpsThreadedTestRunner* runner) { |
| 55 fState.fA = a; | 55 fState.fA = a; |
| 56 fState.fB = b; | 56 fState.fB = b; |
| 57 fState.fC = c; | 57 fState.fC = c; |
| 58 fState.fD = d; | 58 fState.fD = d; |
| 59 fState.fReporter = runner->fReporter; | 59 fState.fReporter = runner->fReporter; |
| 60 fTestFun = testFun; | 60 fTestFun = testFun; |
| 61 } | 61 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 85 SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); | 85 SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); |
| 86 (*fTestFun)(&fState); | 86 (*fTestFun)(&fState); |
| 87 } | 87 } |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 PathOpsThreadState fState; | 90 PathOpsThreadState fState; |
| 91 void (*fTestFun)(PathOpsThreadState*); | 91 void (*fTestFun)(PathOpsThreadState*); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 #endif | 94 #endif |
| OLD | NEW |