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

Side by Side Diff: tests/PathOpsThreadedCommon.h

Issue 23542056: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: verbose + mutex around file number access Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/PathOpsSkpTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SkRunnable.h" 11 #include "SkRunnable.h"
11 #include "SkTDArray.h" 12 #include "SkTDArray.h"
12 13
13 #define PATH_STR_SIZE 512 14 #define PATH_STR_SIZE 512
14 15
15 class PathOpsThreadedRunnable; 16 class PathOpsThreadedRunnable;
16 17
17 namespace skiatest { 18 namespace skiatest {
18 class Reporter; 19 class Reporter;
19 } 20 }
20 21
21 struct PathOpsThreadState { 22 struct PathOpsThreadState {
22 unsigned char fA; 23 unsigned char fA;
23 unsigned char fB; 24 unsigned char fB;
24 unsigned char fC; 25 unsigned char fC;
25 unsigned char fD; 26 unsigned char fD;
26 char* fPathStr; 27 char* fPathStr;
27 const char* fKey; 28 const char* fKey;
28 char fSerialNo[64]; 29 char fSerialNo[256];
29 skiatest::Reporter* fReporter; 30 skiatest::Reporter* fReporter;
30 SkBitmap* fBitmap; 31 SkBitmap* fBitmap;
31 }; 32 };
32 33
33 class PathOpsThreadedTestRunner { 34 class PathOpsThreadedTestRunner {
34 public: 35 public:
35 PathOpsThreadedTestRunner(skiatest::Reporter* reporter, int threadCount) 36 PathOpsThreadedTestRunner(skiatest::Reporter* reporter, int threadCount)
36 : fNumThreads(threadCount) 37 : fNumThreads(threadCount)
37 , fReporter(reporter) { 38 , fReporter(reporter) {
38 } 39 }
(...skipping 26 matching lines...) Expand all
65 strcpy(fState.fSerialNo, str); 66 strcpy(fState.fSerialNo, str);
66 fState.fReporter = runner->fReporter; 67 fState.fReporter = runner->fReporter;
67 fTestFun = testFun; 68 fTestFun = testFun;
68 } 69 }
69 70
70 virtual void run() SK_OVERRIDE { 71 virtual void run() SK_OVERRIDE {
71 SkBitmap bitmap; 72 SkBitmap bitmap;
72 fState.fBitmap = &bitmap; 73 fState.fBitmap = &bitmap;
73 char pathStr[PATH_STR_SIZE]; 74 char pathStr[PATH_STR_SIZE];
74 fState.fPathStr = pathStr; 75 fState.fPathStr = pathStr;
76 SkGraphics::SetTLSFontCacheLimit(1 * 1024 * 1024);
75 (*fTestFun)(&fState); 77 (*fTestFun)(&fState);
76 } 78 }
77 79
78 private: 80 private:
79 PathOpsThreadState fState; 81 PathOpsThreadState fState;
80 void (*fTestFun)(PathOpsThreadState*); 82 void (*fTestFun)(PathOpsThreadState*);
81 }; 83 };
82 84
83 #endif 85 #endif
OLDNEW
« no previous file with comments | « tests/PathOpsSkpTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698