aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDeviceProfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkDeviceProfile.cpp')
-rw-r--r--src/core/SkDeviceProfile.cpp77
1 files changed, 0 insertions, 77 deletions
diff --git a/src/core/SkDeviceProfile.cpp b/src/core/SkDeviceProfile.cpp
deleted file mode 100644
index e1c10c87d7..0000000000
--- a/src/core/SkDeviceProfile.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-
-#include "SkDeviceProfile.h"
-#include "SkMutex.h"
-
-#define DEFAULT_GAMMAEXP 2.2f
-#define DEFAULT_CONTRASTSCALE 0.5f
-#define DEFAULT_LCDCONFIG SkDeviceProfile::kNone_LCDConfig
-#define DEFAULT_FONTHINTLEVEL SkDeviceProfile::kSlight_FontHintLevel
-
-static float pin(float value, float min, float max) {
- if (value < min) {
- value = min;
- } else if (value > max) {
- value = max;
- }
- return value;
-}
-
-SkDeviceProfile::SkDeviceProfile(float gammaExp, float contrast,
- LCDConfig config, FontHintLevel level) {
- fGammaExponent = pin(gammaExp, 0, 10);
- fContrastScale = pin(contrast, 0, 1);
- fLCDConfig = config;
- fFontHintLevel = level;
-}
-
-void SkDeviceProfile::generateTableForLuminanceByte(U8CPU lumByte,
- uint8_t table[256]) const {
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-SkDeviceProfile* SkDeviceProfile::Create(float gammaExp,
- float contrast,
- LCDConfig config,
- FontHintLevel level) {
- return new SkDeviceProfile(gammaExp, contrast, config, level);
-}
-
-SK_DECLARE_STATIC_MUTEX(gMutex);
-static SkDeviceProfile* gDefaultProfile;
-static SkDeviceProfile* gGlobalProfile;
-
-SkDeviceProfile* SkDeviceProfile::GetDefault() {
- SkAutoMutexAcquire amc(gMutex);
-
- if (nullptr == gDefaultProfile) {
- gDefaultProfile = SkDeviceProfile::Create(DEFAULT_GAMMAEXP,
- DEFAULT_CONTRASTSCALE,
- DEFAULT_LCDCONFIG,
- DEFAULT_FONTHINTLEVEL);
- }
- return gDefaultProfile;
-}
-
-SkDeviceProfile* SkDeviceProfile::RefGlobal() {
- SkAutoMutexAcquire amc(gMutex);
-
- if (nullptr == gGlobalProfile) {
- gGlobalProfile = SkDeviceProfile::GetDefault();
- }
- gGlobalProfile->ref();
- return gGlobalProfile;
-}
-
-void SkDeviceProfile::SetGlobal(SkDeviceProfile* profile) {
- SkAutoMutexAcquire amc(gMutex);
-
- SkRefCnt_SafeAssign(gGlobalProfile, profile);
-}