| 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 | 7 |
| 8 | 8 |
| 9 #include "SkDeviceProfile.h" | 9 #include "SkDeviceProfile.h" |
| 10 #include "SkThread.h" | 10 #include "SkThread.h" |
| 11 | 11 |
| 12 SK_DEFINE_INST_COUNT(SkDeviceProfile) | |
| 13 | |
| 14 #define DEFAULT_GAMMAEXP 2.2f | 12 #define DEFAULT_GAMMAEXP 2.2f |
| 15 #define DEFAULT_CONTRASTSCALE 0.5f | 13 #define DEFAULT_CONTRASTSCALE 0.5f |
| 16 #define DEFAULT_LCDCONFIG SkDeviceProfile::kNone_LCDConfig | 14 #define DEFAULT_LCDCONFIG SkDeviceProfile::kNone_LCDConfig |
| 17 #define DEFAULT_FONTHINTLEVEL SkDeviceProfile::kSlight_FontHintLevel | 15 #define DEFAULT_FONTHINTLEVEL SkDeviceProfile::kSlight_FontHintLevel |
| 18 | 16 |
| 19 static float pin(float value, float min, float max) { | 17 static float pin(float value, float min, float max) { |
| 20 if (value < min) { | 18 if (value < min) { |
| 21 value = min; | 19 value = min; |
| 22 } else if (value > max) { | 20 } else if (value > max) { |
| 23 value = max; | 21 value = max; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 68 } |
| 71 gGlobalProfile->ref(); | 69 gGlobalProfile->ref(); |
| 72 return gGlobalProfile; | 70 return gGlobalProfile; |
| 73 } | 71 } |
| 74 | 72 |
| 75 void SkDeviceProfile::SetGlobal(SkDeviceProfile* profile) { | 73 void SkDeviceProfile::SetGlobal(SkDeviceProfile* profile) { |
| 76 SkAutoMutexAcquire amc(gMutex); | 74 SkAutoMutexAcquire amc(gMutex); |
| 77 | 75 |
| 78 SkRefCnt_SafeAssign(gGlobalProfile, profile); | 76 SkRefCnt_SafeAssign(gGlobalProfile, profile); |
| 79 } | 77 } |
| OLD | NEW |