GOOGLE3 -> SK_BUILD_FOR_GOOGLE3
This is more consistent with our other SK_BUILD_FOR_... macros, and less likely to collide with other preprocessor logic. (Luckily, this was defined in public.bzl, so we can do this all in one CL in the Skia repo.) Change-Id: I5f232888288c9c53fad445545d983d0fb0b4add8 Reviewed-on: https://skia-review.googlesource.com/86940 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
This commit is contained in:
parent
84bfc95898
commit
6613cc5186
@ -1315,7 +1315,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
initializeEventTracingForTools();
|
||||
|
||||
#if !defined(GOOGLE3) && defined(SK_BUILD_FOR_IOS)
|
||||
#if !defined(SK_BUILD_FOR_GOOGLE3) && defined(SK_BUILD_FOR_IOS)
|
||||
cd_Documents();
|
||||
#endif
|
||||
setbuf(stdout, nullptr);
|
||||
|
@ -14,7 +14,7 @@
|
||||
* Enum describing format of encoded data.
|
||||
*/
|
||||
enum class SkEncodedImageFormat {
|
||||
#ifdef GOOGLE3
|
||||
#ifdef SK_BUILD_FOR_GOOGLE3
|
||||
kUnknown,
|
||||
#endif
|
||||
kBMP,
|
||||
|
@ -129,7 +129,7 @@
|
||||
#
|
||||
#endif
|
||||
|
||||
#if defined(GOOGLE3)
|
||||
#if defined(SK_BUILD_FOR_GOOGLE3)
|
||||
void SkDebugfForDumpStackTrace(const char* data, void* unused);
|
||||
void DumpStackTrace(int skip_count, void w(const char*, void*), void* arg);
|
||||
# define SK_DUMP_GOOGLE3_STACK() DumpStackTrace(0, SkDebugfForDumpStackTrace, nullptr)
|
||||
|
@ -124,7 +124,7 @@ private:
|
||||
#else
|
||||
class SK_API SkRefCnt : public SkRefCntBase {
|
||||
// "#include SK_REF_CNT_MIXIN_INCLUDE" doesn't work with this build system.
|
||||
#if defined(GOOGLE3)
|
||||
#if defined(SK_BUILD_FOR_GOOGLE3)
|
||||
public:
|
||||
void deref() const { this->unref(); }
|
||||
#endif
|
||||
|
@ -221,8 +221,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
#if defined(GOOGLE3)
|
||||
// Stack frame size is limited for GOOGLE3. 4k is less than the actual max, but some functions
|
||||
#if defined(SK_BUILD_FOR_GOOGLE3)
|
||||
// Stack frame size is limited for SK_BUILD_FOR_GOOGLE3. 4k is less than the actual max, but some functions
|
||||
// have multiple large stack allocations.
|
||||
static const int kMaxBytes = 4 * 1024;
|
||||
static const int kCount = kCountRequested * sizeof(T) > kMaxBytes
|
||||
@ -390,8 +390,8 @@ public:
|
||||
private:
|
||||
// Since we use uint32_t storage, we might be able to get more elements for free.
|
||||
static const size_t kCountWithPadding = SkAlign4(kCountRequested*sizeof(T)) / sizeof(T);
|
||||
#if defined(GOOGLE3)
|
||||
// Stack frame size is limited for GOOGLE3. 4k is less than the actual max, but some functions
|
||||
#if defined(SK_BUILD_FOR_GOOGLE3)
|
||||
// Stack frame size is limited for SK_BUILD_FOR_GOOGLE3. 4k is less than the actual max, but some functions
|
||||
// have multiple large stack allocations.
|
||||
static const size_t kMaxBytes = 4 * 1024;
|
||||
static const size_t kCount = kCountRequested * sizeof(T) > kMaxBytes
|
||||
|
@ -576,7 +576,7 @@ def base_defines(os_conditions):
|
||||
# Chrome DEFINES.
|
||||
"SK_USE_FREETYPE_EMBOLDEN",
|
||||
# Turn on a few Google3-specific build fixes.
|
||||
"GOOGLE3",
|
||||
"SK_BUILD_FOR_GOOGLE3",
|
||||
# Required for building dm.
|
||||
"GR_TEST_UTILS",
|
||||
# Staging flags for API changes
|
||||
|
@ -157,8 +157,8 @@ public:
|
||||
private:
|
||||
// Align up to 32 bits.
|
||||
static const size_t kSizeAlign4 = SkAlign4(kSizeRequested);
|
||||
#if defined(GOOGLE3)
|
||||
// Stack frame size is limited for GOOGLE3. 4k is less than the actual max, but some functions
|
||||
#if defined(SK_BUILD_FOR_GOOGLE3)
|
||||
// Stack frame size is limited for SK_BUILD_FOR_GOOGLE3. 4k is less than the actual max, but some functions
|
||||
// have multiple large stack allocations.
|
||||
static const size_t kMaxBytes = 4 * 1024;
|
||||
static const size_t kSize = kSizeRequested > kMaxBytes ? kMaxBytes : kSizeAlign4;
|
||||
|
@ -42,7 +42,7 @@ struct SkAntiRect {
|
||||
class SkCoverageDeltaList {
|
||||
public:
|
||||
// We can store INIT_ROW_SIZE deltas per row (i.e., per y-scanline) initially.
|
||||
#ifdef GOOGLE3
|
||||
#ifdef SK_BUILD_FOR_GOOGLE3
|
||||
static constexpr int INIT_ROW_SIZE = 8; // google3 has 16k stack limit; so we make it small
|
||||
#else
|
||||
static constexpr int INIT_ROW_SIZE = 32;
|
||||
@ -112,7 +112,7 @@ public:
|
||||
|
||||
static constexpr int SIMD_WIDTH = 8;
|
||||
static constexpr int SUITABLE_WIDTH = 32;
|
||||
#ifdef GOOGLE3
|
||||
#ifdef SK_BUILD_FOR_GOOGLE3
|
||||
static constexpr int MAX_MASK_SIZE = 1024; // G3 has 16k stack limit based on -fstack-usage
|
||||
#else
|
||||
static constexpr int MAX_MASK_SIZE = 2048;
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "SkTypes.h"
|
||||
|
||||
#if defined(GOOGLE3)
|
||||
#if defined(SK_BUILD_FOR_GOOGLE3)
|
||||
void SkDebugfForDumpStackTrace(const char* data, void* unused) {
|
||||
SkDebugf("%s", data);
|
||||
}
|
||||
|
@ -337,7 +337,7 @@ void SkScan::DAAFillPath(const SkPath& path, SkBlitter* blitter, const SkIRect&
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef GOOGLE3
|
||||
#ifdef SK_BUILD_FOR_GOOGLE3
|
||||
constexpr int STACK_SIZE = 12 << 10; // 12K stack size alloc; Google3 has 16K limit.
|
||||
#else
|
||||
constexpr int STACK_SIZE = 64 << 10; // 64k stack size to avoid heap allocation
|
||||
|
@ -656,7 +656,7 @@ SI F approx_powf(F x, F y) {
|
||||
}
|
||||
|
||||
SI F from_half(U16 h) {
|
||||
#if defined(__aarch64__) && !defined(GOOGLE3) // Temporary workaround for some Google3 builds.
|
||||
#if defined(__aarch64__) && !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds.
|
||||
return vcvt_f32_f16(h);
|
||||
|
||||
#elif defined(JUMPER_IS_HSW) || defined(JUMPER_IS_AVX512)
|
||||
@ -676,7 +676,7 @@ SI F from_half(U16 h) {
|
||||
}
|
||||
|
||||
SI U16 to_half(F f) {
|
||||
#if defined(__aarch64__) && !defined(GOOGLE3) // Temporary workaround for some Google3 builds.
|
||||
#if defined(__aarch64__) && !defined(SK_BUILD_FOR_GOOGLE3) // Temporary workaround for some Google3 builds.
|
||||
return vcvt_f16_f32(f);
|
||||
|
||||
#elif defined(JUMPER_IS_HSW) || defined(JUMPER_IS_AVX512)
|
||||
|
@ -342,8 +342,8 @@ static sk_sp<SkPDFStream> get_subset_font_stream(
|
||||
|
||||
unsigned char* subsetFont{nullptr};
|
||||
sk_sp<SkData> fontData(stream_to_data(std::move(fontAsset)));
|
||||
#if defined(GOOGLE3)
|
||||
// TODO(halcanary): update GOOGLE3 to newest version of Sfntly.
|
||||
#if defined(SK_BUILD_FOR_GOOGLE3)
|
||||
// TODO(halcanary): update SK_BUILD_FOR_GOOGLE3 to newest version of Sfntly.
|
||||
(void)ttcIndex;
|
||||
int subsetFontSize = SfntlyWrapper::SubsetFont(fontName,
|
||||
fontData->bytes(),
|
||||
|
@ -46,7 +46,7 @@
|
||||
// Flag SK_FREETYPE_DLOPEN: also try dlopen to get newer features.
|
||||
#define SK_FREETYPE_DLOPEN (0x1)
|
||||
#ifndef SK_FREETYPE_MINIMUM_RUNTIME_VERSION
|
||||
# if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) || defined (GOOGLE3)
|
||||
# if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) || defined (SK_BUILD_FOR_GOOGLE3)
|
||||
# define SK_FREETYPE_MINIMUM_RUNTIME_VERSION (((FREETYPE_MAJOR) << 24) | ((FREETYPE_MINOR) << 16) | ((FREETYPE_PATCH) << 8))
|
||||
# else
|
||||
# define SK_FREETYPE_MINIMUM_RUNTIME_VERSION ((2 << 24) | (3 << 16) | (11 << 8) | (SK_FREETYPE_DLOPEN))
|
||||
|
@ -684,8 +684,8 @@ static void test_matrix_homogeneous(skiatest::Reporter* reporter) {
|
||||
const float kRotation1 = -50.f;
|
||||
const float kScale0 = 5000.f;
|
||||
|
||||
#if defined(GOOGLE3)
|
||||
// Stack frame size is limited in GOOGLE3.
|
||||
#if defined(SK_BUILD_FOR_GOOGLE3)
|
||||
// Stack frame size is limited in SK_BUILD_FOR_GOOGLE3.
|
||||
const int kTripleCount = 100;
|
||||
const int kMatrixCount = 100;
|
||||
#else
|
||||
|
@ -146,8 +146,8 @@ void read_and_check_pixels(skiatest::Reporter* reporter, GrSurfaceContext* conte
|
||||
// conversion during read/write along with srgb/linear conversions.
|
||||
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) {
|
||||
GrContext* context = ctxInfo.grContext();
|
||||
#if defined(GOOGLE3)
|
||||
// Stack frame size is limited in GOOGLE3.
|
||||
#if defined(SK_BUILD_FOR_GOOGLE3)
|
||||
// Stack frame size is limited in SK_BUILD_FOR_GOOGLE3.
|
||||
static const int kW = 63;
|
||||
static const int kH = 63;
|
||||
#else
|
||||
|
@ -15,7 +15,7 @@
|
||||
#ifndef SK_CRASH_HANDLER
|
||||
void SetupCrashHandler() { }
|
||||
|
||||
#elif defined(GOOGLE3)
|
||||
#elif defined(SK_BUILD_FOR_GOOGLE3)
|
||||
#include "base/process_state.h"
|
||||
void SetupCrashHandler() { InstallSignalHandlers(); }
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#ifndef SkJSONCPP_DEFINED
|
||||
#define SkJSONCPP_DEFINED
|
||||
|
||||
#ifdef GOOGLE3
|
||||
#ifdef SK_BUILD_FOR_GOOGLE3
|
||||
#include "third_party/jsoncpp/reader.h"
|
||||
#include "third_party/jsoncpp/value.h"
|
||||
#include "third_party/jsoncpp/writer.h"
|
||||
|
Loading…
Reference in New Issue
Block a user