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