| 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 15 matching lines...) Expand all Loading... |
| 26 unsigned char fD; | 26 unsigned char fD; |
| 27 char* fPathStr; | 27 char* fPathStr; |
| 28 const char* fKey; | 28 const char* fKey; |
| 29 char fSerialNo[256]; | 29 char fSerialNo[256]; |
| 30 skiatest::Reporter* fReporter; | 30 skiatest::Reporter* fReporter; |
| 31 SkBitmap* fBitmap; | 31 SkBitmap* fBitmap; |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 class PathOpsThreadedTestRunner { | 34 class PathOpsThreadedTestRunner { |
| 35 public: | 35 public: |
| 36 PathOpsThreadedTestRunner(skiatest::Reporter* reporter) : fReporter(reporter
) {} | 36 PathOpsThreadedTestRunner(skiatest::Reporter* reporter, int threadCount) |
| 37 : fNumThreads(threadCount) |
| 38 , fReporter(reporter) { |
| 39 } |
| 37 | 40 |
| 38 ~PathOpsThreadedTestRunner(); | 41 ~PathOpsThreadedTestRunner(); |
| 39 | 42 |
| 40 void render(); | 43 void render(); |
| 41 | 44 |
| 42 public: | 45 public: |
| 46 int fNumThreads; |
| 43 SkTDArray<PathOpsThreadedRunnable*> fRunnables; | 47 SkTDArray<PathOpsThreadedRunnable*> fRunnables; |
| 44 skiatest::Reporter* fReporter; | 48 skiatest::Reporter* fReporter; |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 class PathOpsThreadedRunnable : public SkRunnable { | 51 class PathOpsThreadedRunnable : public SkRunnable { |
| 48 public: | 52 public: |
| 49 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, |
| 50 PathOpsThreadedTestRunner* runner) { | 54 PathOpsThreadedTestRunner* runner) { |
| 51 fState.fA = a; | 55 fState.fA = a; |
| 52 fState.fB = b; | 56 fState.fB = b; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 81 SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); | 85 SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024); |
| 82 (*fTestFun)(&fState); | 86 (*fTestFun)(&fState); |
| 83 } | 87 } |
| 84 | 88 |
| 85 private: | 89 private: |
| 86 PathOpsThreadState fState; | 90 PathOpsThreadState fState; |
| 87 void (*fTestFun)(PathOpsThreadState*); | 91 void (*fTestFun)(PathOpsThreadState*); |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 #endif | 94 #endif |
| OLD | NEW |