Skip to content

Commit

Permalink
Remove unused config variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidokert committed Sep 17, 2024
1 parent 948d0bf commit 207678c
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 241 deletions.
37 changes: 0 additions & 37 deletions cobalt/renderer/rasterizer/skia/skia/config/SkUserConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,41 +110,6 @@
// would like these formats to match.
// Always use OpenGL byte-order (RGBA).

#if defined(STARBOARD)
const uint8_t r32_or_bendian_a32_shift =
kSbPreferredRgbaByteOrder == SB_PREFERRED_RGBA_BYTE_ORDER_BGRA ? 16 : 0;

#ifdef SK_CPU_BENDIAN
#define SK_R32_SHIFT 24
#define SK_G32_SHIFT (16 - r32_or_bendian_a32_shift)
#define SK_B32_SHIFT 8
#define SK_A32_SHIFT r32_or_bendian_a32_shift
#else
#define SK_R32_SHIFT r32_or_bendian_a32_shift
#define SK_G32_SHIFT 8
#define SK_B32_SHIFT (16 - r32_or_bendian_a32_shift)
#define SK_A32_SHIFT 24
#endif

#elif defined(STARBOARD) && \
kSbPreferredRgbaByteOrder == SB_PREFERRED_RGBA_BYTE_ORDER_BGRA
#ifdef SK_CPU_BENDIAN
#define SK_R32_SHIFT 24
#define SK_G32_SHIFT 0
#define SK_B32_SHIFT 8
#define SK_A32_SHIFT 16
#else
#define SK_R32_SHIFT 16
#define SK_G32_SHIFT 8
#define SK_B32_SHIFT 0
#define SK_A32_SHIFT 24
#endif

#else

// Default to RGBA otherwise. Skia only supports either BGRA or RGBA, so if
// kSbPreferredRgbaByteOrder is neither, we default it to RGBA and we will
// have to do color conversions at runtime.
#ifdef SK_CPU_BENDIAN
#define SK_R32_SHIFT 24
#define SK_G32_SHIFT 16
Expand All @@ -157,8 +122,6 @@ const uint8_t r32_or_bendian_a32_shift =
#define SK_A32_SHIFT 24
#endif

#endif

/* Some compilers don't support long long for 64bit integers. If yours does
not, define this to the appropriate type.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@ Platform can support partial audio frames
Whether this platform can map executable memory. This is required for platforms
that want to JIT.

### kSbDefaultMmapThreshold

Determines the threshold of allocation size that should be done with mmap (if
available), rather than allocated within the core heap.

### kSbFileAltSepChar

The current platform's alternate file path component separator character. This
is like SB_FILE_SEP_CHAR, except if your platform supports an alternate
character, then you can place that here. For example, on windows machines, the
primary separator character is probably '\', but the alternate is '/'.

### kSbFileAltSepString

The string form of SB_FILE_ALT_SEP_CHAR.

### kSbFileMaxName

The current platform's maximum length of the name of a single directory entry,
Expand All @@ -59,19 +43,10 @@ component separator character.

The string form of SB_FILE_SEP_CHAR.

### kSbHasMediaWebmVp9Support

Specifies whether this platform has webm/vp9 support. This should be set to non-
zero on platforms with webm/vp9 support.

### kSbHasThreadPrioritySupport

Whether the current platform supports thread priorities.

### kSbMallocAlignment

Determines the alignment that allocations should have on this platform.

### kSbMaxSystemPathCacheDirectorySize

The maximum size the cache directory is allowed to use in bytes.
Expand Down Expand Up @@ -102,14 +77,6 @@ The maximum audio bitrate the platform can decode. The following value equals to
The maximum video bitrate the platform can decode. The following value equals to
8M bytes per seconds which is more than enough for compressed video.

### kSbMediaVideoFrameAlignment

Specifies how video frame buffers must be aligned on this platform.

### kSbMemoryLogPath

Defines the path where memory debugging logs should be written to.

### kSbMemoryPageSize

The memory page size, which controls the size of chunks on memory that
Expand Down Expand Up @@ -142,9 +109,3 @@ path component separator character.
### kSbPathSepString

The string form of SB_PATH_SEP_CHAR.

### kSbPreferredRgbaByteOrder

Specifies the preferred byte order of color channels in a pixel. Refer to
starboard/configuration.h for the possible values. EGL/GLES platforms should
generally prefer a byte order of RGBA, regardless of endianness.
31 changes: 0 additions & 31 deletions starboard/android/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

#include "starboard/configuration_constants.h"

// Determines the threshold of allocation size that should be done with mmap
// (if available), rather than allocated within the core heap.
const size_t kSbDefaultMmapThreshold = 256 * 1024U;

// The current platform's maximum length of the name of a single directory
// entry, not including the absolute path.
const int32_t kSbFileMaxName = 64;
Expand All @@ -28,15 +24,6 @@ const int32_t kSbFileMaxName = 64;
// same time by one process.
const uint32_t kSbFileMaxOpen = 256;

// The current platform's alternate file path component separator character.
// This is like SB_FILE_SEP_CHAR, except if your platform supports an alternate
// character, then you can place that here. For example, on windows machines,
// the primary separator character is probably '\', but the alternate is '/'.
const char kSbFileAltSepChar = '/';

// The string form of SB_FILE_ALT_SEP_CHAR.
const char* kSbFileAltSepString = "/";

// The current platform's maximum length of an absolute path.
const uint32_t kSbFileMaxPath = 4096;

Expand All @@ -49,16 +36,9 @@ const char kSbFileSepChar = '/';
// The string form of SB_FILE_SEP_CHAR.
const char* kSbFileSepString = "/";

// Specifies whether this platform has webm/vp9 support. This should be set to
// non-zero on platforms with webm/vp9 support.
const bool kSbHasMediaWebmVp9Support = true;

// Whether the current platform supports thread priorities.
const bool kSbHasThreadPrioritySupport = true;

// Determines the alignment that allocations should have on this platform.
const size_t kSbMallocAlignment = 16;

// The maximum number of thread local storage keys supported by this platform.
// This comes from bionic PTHREAD_KEYS_MAX in limits.h, which we've decided
// to not include here to decrease symbol pollution.
Expand All @@ -67,9 +47,6 @@ const uint32_t kSbMaxThreadLocalKeys = 128;
// The maximum length of a name for a thread, including the NULL-terminator.
const int32_t kSbMaxThreadNameLength = 16;

// Defines the path where memory debugging logs should be written to.
const char* kSbMemoryLogPath = "/tmp/starboard";

// The maximum audio bitrate the platform can decode. The following value
// equals to 5M bytes per seconds which is more than enough for compressed
// audio.
Expand All @@ -80,9 +57,6 @@ const uint32_t kSbMediaMaxAudioBitrateInBitsPerSecond = 40 * 1024 * 1024;
// video.
const uint32_t kSbMediaMaxVideoBitrateInBitsPerSecond = 200 * 1024 * 1024;

// Specifies how video frame buffers must be aligned on this platform.
const uint32_t kSbMediaVideoFrameAlignment = 256;

// The memory page size, which controls the size of chunks on memory that
// allocators deal with, and the alignment of those chunks. This doesn't have to
// be the hardware-defined physical page size, but it should be a multiple of
Expand Down Expand Up @@ -118,11 +92,6 @@ const char kSbPathSepChar = ':';
// The string form of SB_PATH_SEP_CHAR.
const char* kSbPathSepString = ":";

// Specifies the preferred byte order of color channels in a pixel. Refer to
// starboard/configuration.h for the possible values. EGL/GLES platforms should
// generally prefer a byte order of RGBA, regardless of endianness.
const int kSbPreferredRgbaByteOrder = SB_PREFERRED_RGBA_BYTE_ORDER_RGBA;

// The maximum size the cache directory is allowed to use in bytes.
const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB

Expand Down
31 changes: 0 additions & 31 deletions starboard/configuration_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
#include "starboard/export.h"
#include "starboard/types.h"

// Determines the threshold of allocation size that should be done with mmap
// (if available), rather than allocated within the core heap.
SB_EXPORT extern const size_t kSbDefaultMmapThreshold;

// The current platform's maximum length of the name of a single directory
// entry, not including the absolute path.
SB_EXPORT extern const int32_t kSbFileMaxName;
Expand All @@ -36,15 +32,6 @@ SB_EXPORT extern const int32_t kSbFileMaxName;
// same time by one process.
SB_EXPORT extern const uint32_t kSbFileMaxOpen;

// The current platform's alternate file path component separator character.
// This is like SB_FILE_SEP_CHAR, except if your platform supports an alternate
// character, then you can place that here. For example, on windows machines,
// the primary separator character is probably '\', but the alternate is '/'.
SB_EXPORT extern const char kSbFileAltSepChar;

// The string form of SB_FILE_ALT_SEP_CHAR.
SB_EXPORT extern const char* kSbFileAltSepString;

// The current platform's maximum length of an absolute path.
SB_EXPORT extern const uint32_t kSbFileMaxPath;

Expand All @@ -57,16 +44,9 @@ SB_EXPORT extern const char kSbFileSepChar;
// The string form of SB_FILE_SEP_CHAR.
SB_EXPORT extern const char* kSbFileSepString;

// Specifies whether this platform has webm/vp9 support. This should be set to
// non-zero on platforms with webm/vp9 support.
SB_EXPORT extern const bool kSbHasMediaWebmVp9Support;

// Whether the current platform supports thread priorities.
SB_EXPORT extern const bool kSbHasThreadPrioritySupport;

// Determines the alignment that allocations should have on this platform.
SB_EXPORT extern const size_t kSbMallocAlignment;

// The maximum number of thread local storage keys supported by this platform.
// This comes from _POSIX_THREAD_KEYS_MAX. The value of PTHREAD_KEYS_MAX is
// higher, but unit tests show that the implementation doesn't support nearly
Expand All @@ -76,9 +56,6 @@ SB_EXPORT extern const uint32_t kSbMaxThreadLocalKeys;
// The maximum length of the name for a thread, including the NULL-terminator.
SB_EXPORT extern const int32_t kSbMaxThreadNameLength;

// Defines the path where memory debugging logs should be written to.
SB_EXPORT extern const char* kSbMemoryLogPath;

// The maximum audio bitrate the platform can decode. The following value
// equals to 5M bytes per seconds which is more than enough for compressed
// audio.
Expand All @@ -89,9 +66,6 @@ SB_EXPORT extern const uint32_t kSbMediaMaxAudioBitrateInBitsPerSecond;
// video.
SB_EXPORT extern const uint32_t kSbMediaMaxVideoBitrateInBitsPerSecond;

// Specifies how video frame buffers must be aligned on this platform.
SB_EXPORT extern const uint32_t kSbMediaVideoFrameAlignment;

// The memory page size, which controls the size of chunks on memory that
// allocators deal with, and the alignment of those chunks. This doesn't have to
// be the hardware-defined physical page size, but it should be a multiple of
Expand All @@ -117,11 +91,6 @@ SB_EXPORT extern const uint32_t kSbNetworkReceiveBufferSize;
// like mutexes, so we want to keep this manageable.
SB_EXPORT extern const uint32_t kSbMaxThreads;

// Specifies the preferred byte order of color channels in a pixel. Refer to
// starboard/configuration.h for the possible values. EGL/GLES platforms should
// generally prefer a byte order of RGBA, regardless of endianness.
SB_EXPORT extern const int kSbPreferredRgbaByteOrder;

// The current platform's search path component separator character. When
// specifying an ordered list of absolute paths of directories to search for a
// given reason, this is the character that appears between entries. For
Expand Down
8 changes: 0 additions & 8 deletions starboard/elf_loader/exported_symbols.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,22 @@ namespace starboard {
namespace elf_loader {

ExportedSymbols::ExportedSymbols() {
REGISTER_SYMBOL(kSbDefaultMmapThreshold);
REGISTER_SYMBOL(kSbFileAltSepChar);
REGISTER_SYMBOL(kSbFileAltSepString);
REGISTER_SYMBOL(kSbFileMaxName);
REGISTER_SYMBOL(kSbFileMaxOpen);
REGISTER_SYMBOL(kSbFileMaxPath);
REGISTER_SYMBOL(kSbFileSepChar);
REGISTER_SYMBOL(kSbFileSepString);
REGISTER_SYMBOL(kSbHasMediaWebmVp9Support);
REGISTER_SYMBOL(kSbHasThreadPrioritySupport);
REGISTER_SYMBOL(kSbMallocAlignment);
REGISTER_SYMBOL(kSbMaxSystemPathCacheDirectorySize);
REGISTER_SYMBOL(kSbMaxThreadLocalKeys);
REGISTER_SYMBOL(kSbMaxThreadNameLength);
REGISTER_SYMBOL(kSbMaxThreads);
REGISTER_SYMBOL(kSbMediaMaxAudioBitrateInBitsPerSecond);
REGISTER_SYMBOL(kSbMediaMaxVideoBitrateInBitsPerSecond);
REGISTER_SYMBOL(kSbMediaVideoFrameAlignment);
REGISTER_SYMBOL(kSbMemoryLogPath);
REGISTER_SYMBOL(kSbMemoryPageSize);
REGISTER_SYMBOL(kSbNetworkReceiveBufferSize);
REGISTER_SYMBOL(kSbPathSepChar);
REGISTER_SYMBOL(kSbPathSepString);
REGISTER_SYMBOL(kSbPreferredRgbaByteOrder);
REGISTER_SYMBOL(kSbCanMapExecutableMemory);
REGISTER_SYMBOL(kHasPartialAudioFramesSupport);
REGISTER_SYMBOL(SbAudioSinkCreate);
Expand Down
31 changes: 0 additions & 31 deletions starboard/linux/shared/configuration_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

#include "starboard/configuration_constants.h"

// Determines the threshold of allocation size that should be done with mmap
// (if available), rather than allocated within the core heap.
const size_t kSbDefaultMmapThreshold = 256 * 1024U;

// The current platform's maximum length of the name of a single directory
// entry, not including the absolute path.
const int32_t kSbFileMaxName = 64;
Expand All @@ -28,15 +24,6 @@ const int32_t kSbFileMaxName = 64;
// same time by one process.
const uint32_t kSbFileMaxOpen = 256;

// The current platform's alternate file path component separator character.
// This is like SB_FILE_SEP_CHAR, except if your platform supports an alternate
// character, then you can place that here. For example, on windows machines,
// the primary separator character is probably '\', but the alternate is '/'.
const char kSbFileAltSepChar = '/';

// The string form of SB_FILE_ALT_SEP_CHAR.
const char* kSbFileAltSepString = "/";

// The current platform's maximum length of an absolute path.
const uint32_t kSbFileMaxPath = 4096;

Expand All @@ -49,26 +36,16 @@ const char kSbFileSepChar = '/';
// The string form of SB_FILE_SEP_CHAR.
const char* kSbFileSepString = "/";

// Specifies whether this platform has webm/vp9 support. This should be set to
// non-zero on platforms with webm/vp9 support.
const bool kSbHasMediaWebmVp9Support = false;

// On default Linux desktop, you must be a superuser in order to set real time
// scheduling on threads.
const bool kSbHasThreadPrioritySupport = false;

// Determines the alignment that allocations should have on this platform.
const size_t kSbMallocAlignment = 16;

// The maximum number of thread local storage keys supported by this platform.
const uint32_t kSbMaxThreadLocalKeys = 512;

// The maximum length of a name for a thread, including the NULL-terminator.
const int32_t kSbMaxThreadNameLength = 16;

// Defines the path where memory debugging logs should be written to.
const char* kSbMemoryLogPath = "/tmp/starboard";

// The maximum audio bitrate the platform can decode. The following value
// equals to 5M bytes per seconds which is more than enough for compressed
// audio.
Expand All @@ -79,9 +56,6 @@ const uint32_t kSbMediaMaxAudioBitrateInBitsPerSecond = 40 * 1024 * 1024;
// video.
const uint32_t kSbMediaMaxVideoBitrateInBitsPerSecond = 200 * 1024 * 1024;

// Specifies how video frame buffers must be aligned on this platform.
const uint32_t kSbMediaVideoFrameAlignment = 256;

// The memory page size, which controls the size of chunks on memory that
// allocators deal with, and the alignment of those chunks. This doesn't have to
// be the hardware-defined physical page size, but it should be a multiple of
Expand Down Expand Up @@ -117,11 +91,6 @@ const char kSbPathSepChar = ':';
// The string form of SB_PATH_SEP_CHAR.
const char* kSbPathSepString = ":";

// Specifies the preferred byte order of color channels in a pixel. Refer to
// starboard/configuration.h for the possible values. EGL/GLES platforms should
// generally prefer a byte order of RGBA, regardless of endianness.
const int kSbPreferredRgbaByteOrder = SB_PREFERRED_RGBA_BYTE_ORDER_RGBA;

// The maximum size the cache directory is allowed to use in bytes.
const uint32_t kSbMaxSystemPathCacheDirectorySize = 24 << 20; // 24MiB

Expand Down
Loading

0 comments on commit 207678c

Please sign in to comment.