OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 | 7 |
8 #include "SkAdvancedTypefaceMetrics.h" | 8 #include "SkAdvancedTypefaceMetrics.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 SkTestFont::~SkTestFont() { | 36 SkTestFont::~SkTestFont() { |
37 for (unsigned index = 0; index < fCharCodesCount; ++index) { | 37 for (unsigned index = 0; index < fCharCodesCount; ++index) { |
38 SkDELETE(fPaths[index]); | 38 SkDELETE(fPaths[index]); |
39 } | 39 } |
40 SkDELETE_ARRAY(fPaths); | 40 SkDELETE_ARRAY(fPaths); |
41 } | 41 } |
42 | 42 |
43 #ifdef SK_DEBUG | 43 #ifdef SK_DEBUG |
44 | 44 |
45 #include "SkMutex.h" | 45 #include "SkThread.h" |
46 SK_DECLARE_STATIC_MUTEX(gUsedCharsMutex); | 46 SK_DECLARE_STATIC_MUTEX(gUsedCharsMutex); |
47 | 47 |
48 #endif | 48 #endif |
49 | 49 |
50 int SkTestFont::codeToIndex(SkUnichar charCode) const { | 50 int SkTestFont::codeToIndex(SkUnichar charCode) const { |
51 #ifdef SK_DEBUG // detect missing test font data | 51 #ifdef SK_DEBUG // detect missing test font data |
52 { | 52 { |
53 SkAutoMutexAcquire ac(gUsedCharsMutex); | 53 SkAutoMutexAcquire ac(gUsedCharsMutex); |
54 if (charCode >= ' ' && charCode <= '~') { | 54 if (charCode >= ' ' && charCode <= '~') { |
55 int bitOffset = charCode - ' '; | 55 int bitOffset = charCode - ' '; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 285 } |
286 | 286 |
287 private: | 287 private: |
288 SkTestTypeface* fFace; | 288 SkTestTypeface* fFace; |
289 SkMatrix fMatrix; | 289 SkMatrix fMatrix; |
290 }; | 290 }; |
291 | 291 |
292 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { | 292 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { |
293 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); | 293 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); |
294 } | 294 } |
OLD | NEW |