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:
Mike Klein 2017-12-19 09:09:33 -05:00 committed by Skia Commit-Bot
parent 84bfc95898
commit 6613cc5186
17 changed files with 26 additions and 26 deletions

View File

@ -1315,7 +1315,7 @@ int main(int argc, char** argv) {
initializeEventTracingForTools(); initializeEventTracingForTools();
#if !defined(GOOGLE3) && defined(SK_BUILD_FOR_IOS) #if !defined(SK_BUILD_FOR_GOOGLE3) && defined(SK_BUILD_FOR_IOS)
cd_Documents(); cd_Documents();
#endif #endif
setbuf(stdout, nullptr); setbuf(stdout, nullptr);

View File

@ -14,7 +14,7 @@
* Enum describing format of encoded data. * Enum describing format of encoded data.
*/ */
enum class SkEncodedImageFormat { enum class SkEncodedImageFormat {
#ifdef GOOGLE3 #ifdef SK_BUILD_FOR_GOOGLE3
kUnknown, kUnknown,
#endif #endif
kBMP, kBMP,

View File

@ -129,7 +129,7 @@
# #
#endif #endif
#if defined(GOOGLE3) #if defined(SK_BUILD_FOR_GOOGLE3)
void SkDebugfForDumpStackTrace(const char* data, void* unused); void SkDebugfForDumpStackTrace(const char* data, void* unused);
void DumpStackTrace(int skip_count, void w(const char*, void*), void* arg); void DumpStackTrace(int skip_count, void w(const char*, void*), void* arg);
# define SK_DUMP_GOOGLE3_STACK() DumpStackTrace(0, SkDebugfForDumpStackTrace, nullptr) # define SK_DUMP_GOOGLE3_STACK() DumpStackTrace(0, SkDebugfForDumpStackTrace, nullptr)

View File

@ -124,7 +124,7 @@ private:
#else #else
class SK_API SkRefCnt : public SkRefCntBase { class SK_API SkRefCnt : public SkRefCntBase {
// "#include SK_REF_CNT_MIXIN_INCLUDE" doesn't work with this build system. // "#include SK_REF_CNT_MIXIN_INCLUDE" doesn't work with this build system.
#if defined(GOOGLE3) #if defined(SK_BUILD_FOR_GOOGLE3)
public: public:
void deref() const { this->unref(); } void deref() const { this->unref(); }
#endif #endif

View File

@ -221,8 +221,8 @@ public:
} }
private: private:
#if defined(GOOGLE3) #if defined(SK_BUILD_FOR_GOOGLE3)
// Stack frame size is limited for GOOGLE3. 4k is less than the actual max, but some functions // 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. // have multiple large stack allocations.
static const int kMaxBytes = 4 * 1024; static const int kMaxBytes = 4 * 1024;
static const int kCount = kCountRequested * sizeof(T) > kMaxBytes static const int kCount = kCountRequested * sizeof(T) > kMaxBytes
@ -390,8 +390,8 @@ public:
private: private:
// Since we use uint32_t storage, we might be able to get more elements for free. // 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); static const size_t kCountWithPadding = SkAlign4(kCountRequested*sizeof(T)) / sizeof(T);
#if defined(GOOGLE3) #if defined(SK_BUILD_FOR_GOOGLE3)
// Stack frame size is limited for GOOGLE3. 4k is less than the actual max, but some functions // 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. // have multiple large stack allocations.
static const size_t kMaxBytes = 4 * 1024; static const size_t kMaxBytes = 4 * 1024;
static const size_t kCount = kCountRequested * sizeof(T) > kMaxBytes static const size_t kCount = kCountRequested * sizeof(T) > kMaxBytes

View File

@ -576,7 +576,7 @@ def base_defines(os_conditions):
# Chrome DEFINES. # Chrome DEFINES.
"SK_USE_FREETYPE_EMBOLDEN", "SK_USE_FREETYPE_EMBOLDEN",
# Turn on a few Google3-specific build fixes. # Turn on a few Google3-specific build fixes.
"GOOGLE3", "SK_BUILD_FOR_GOOGLE3",
# Required for building dm. # Required for building dm.
"GR_TEST_UTILS", "GR_TEST_UTILS",
# Staging flags for API changes # Staging flags for API changes

View File

@ -157,8 +157,8 @@ public:
private: private:
// Align up to 32 bits. // Align up to 32 bits.
static const size_t kSizeAlign4 = SkAlign4(kSizeRequested); static const size_t kSizeAlign4 = SkAlign4(kSizeRequested);
#if defined(GOOGLE3) #if defined(SK_BUILD_FOR_GOOGLE3)
// Stack frame size is limited for GOOGLE3. 4k is less than the actual max, but some functions // 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. // have multiple large stack allocations.
static const size_t kMaxBytes = 4 * 1024; static const size_t kMaxBytes = 4 * 1024;
static const size_t kSize = kSizeRequested > kMaxBytes ? kMaxBytes : kSizeAlign4; static const size_t kSize = kSizeRequested > kMaxBytes ? kMaxBytes : kSizeAlign4;

View File

@ -42,7 +42,7 @@ struct SkAntiRect {
class SkCoverageDeltaList { class SkCoverageDeltaList {
public: public:
// We can store INIT_ROW_SIZE deltas per row (i.e., per y-scanline) initially. // 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 static constexpr int INIT_ROW_SIZE = 8; // google3 has 16k stack limit; so we make it small
#else #else
static constexpr int INIT_ROW_SIZE = 32; static constexpr int INIT_ROW_SIZE = 32;
@ -112,7 +112,7 @@ public:
static constexpr int SIMD_WIDTH = 8; static constexpr int SIMD_WIDTH = 8;
static constexpr int SUITABLE_WIDTH = 32; 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 static constexpr int MAX_MASK_SIZE = 1024; // G3 has 16k stack limit based on -fstack-usage
#else #else
static constexpr int MAX_MASK_SIZE = 2048; static constexpr int MAX_MASK_SIZE = 2048;

View File

@ -7,7 +7,7 @@
#include "SkTypes.h" #include "SkTypes.h"
#if defined(GOOGLE3) #if defined(SK_BUILD_FOR_GOOGLE3)
void SkDebugfForDumpStackTrace(const char* data, void* unused) { void SkDebugfForDumpStackTrace(const char* data, void* unused) {
SkDebugf("%s", data); SkDebugf("%s", data);
} }

View File

@ -337,7 +337,7 @@ void SkScan::DAAFillPath(const SkPath& path, SkBlitter* blitter, const SkIRect&
return; return;
} }
#ifdef GOOGLE3 #ifdef SK_BUILD_FOR_GOOGLE3
constexpr int STACK_SIZE = 12 << 10; // 12K stack size alloc; Google3 has 16K limit. constexpr int STACK_SIZE = 12 << 10; // 12K stack size alloc; Google3 has 16K limit.
#else #else
constexpr int STACK_SIZE = 64 << 10; // 64k stack size to avoid heap allocation constexpr int STACK_SIZE = 64 << 10; // 64k stack size to avoid heap allocation

View File

@ -656,7 +656,7 @@ SI F approx_powf(F x, F y) {
} }
SI F from_half(U16 h) { 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); return vcvt_f32_f16(h);
#elif defined(JUMPER_IS_HSW) || defined(JUMPER_IS_AVX512) #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) { 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); return vcvt_f16_f32(f);
#elif defined(JUMPER_IS_HSW) || defined(JUMPER_IS_AVX512) #elif defined(JUMPER_IS_HSW) || defined(JUMPER_IS_AVX512)

View File

@ -342,8 +342,8 @@ static sk_sp<SkPDFStream> get_subset_font_stream(
unsigned char* subsetFont{nullptr}; unsigned char* subsetFont{nullptr};
sk_sp<SkData> fontData(stream_to_data(std::move(fontAsset))); sk_sp<SkData> fontData(stream_to_data(std::move(fontAsset)));
#if defined(GOOGLE3) #if defined(SK_BUILD_FOR_GOOGLE3)
// TODO(halcanary): update GOOGLE3 to newest version of Sfntly. // TODO(halcanary): update SK_BUILD_FOR_GOOGLE3 to newest version of Sfntly.
(void)ttcIndex; (void)ttcIndex;
int subsetFontSize = SfntlyWrapper::SubsetFont(fontName, int subsetFontSize = SfntlyWrapper::SubsetFont(fontName,
fontData->bytes(), fontData->bytes(),

View File

@ -46,7 +46,7 @@
// Flag SK_FREETYPE_DLOPEN: also try dlopen to get newer features. // Flag SK_FREETYPE_DLOPEN: also try dlopen to get newer features.
#define SK_FREETYPE_DLOPEN (0x1) #define SK_FREETYPE_DLOPEN (0x1)
#ifndef SK_FREETYPE_MINIMUM_RUNTIME_VERSION #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)) # define SK_FREETYPE_MINIMUM_RUNTIME_VERSION (((FREETYPE_MAJOR) << 24) | ((FREETYPE_MINOR) << 16) | ((FREETYPE_PATCH) << 8))
# else # else
# define SK_FREETYPE_MINIMUM_RUNTIME_VERSION ((2 << 24) | (3 << 16) | (11 << 8) | (SK_FREETYPE_DLOPEN)) # define SK_FREETYPE_MINIMUM_RUNTIME_VERSION ((2 << 24) | (3 << 16) | (11 << 8) | (SK_FREETYPE_DLOPEN))

View File

@ -684,8 +684,8 @@ static void test_matrix_homogeneous(skiatest::Reporter* reporter) {
const float kRotation1 = -50.f; const float kRotation1 = -50.f;
const float kScale0 = 5000.f; const float kScale0 = 5000.f;
#if defined(GOOGLE3) #if defined(SK_BUILD_FOR_GOOGLE3)
// Stack frame size is limited in GOOGLE3. // Stack frame size is limited in SK_BUILD_FOR_GOOGLE3.
const int kTripleCount = 100; const int kTripleCount = 100;
const int kMatrixCount = 100; const int kMatrixCount = 100;
#else #else

View File

@ -146,8 +146,8 @@ void read_and_check_pixels(skiatest::Reporter* reporter, GrSurfaceContext* conte
// conversion during read/write along with srgb/linear conversions. // conversion during read/write along with srgb/linear conversions.
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) { DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext(); GrContext* context = ctxInfo.grContext();
#if defined(GOOGLE3) #if defined(SK_BUILD_FOR_GOOGLE3)
// Stack frame size is limited in GOOGLE3. // Stack frame size is limited in SK_BUILD_FOR_GOOGLE3.
static const int kW = 63; static const int kW = 63;
static const int kH = 63; static const int kH = 63;
#else #else

View File

@ -15,7 +15,7 @@
#ifndef SK_CRASH_HANDLER #ifndef SK_CRASH_HANDLER
void SetupCrashHandler() { } void SetupCrashHandler() { }
#elif defined(GOOGLE3) #elif defined(SK_BUILD_FOR_GOOGLE3)
#include "base/process_state.h" #include "base/process_state.h"
void SetupCrashHandler() { InstallSignalHandlers(); } void SetupCrashHandler() { InstallSignalHandlers(); }

View File

@ -10,7 +10,7 @@
#ifndef SkJSONCPP_DEFINED #ifndef SkJSONCPP_DEFINED
#define SkJSONCPP_DEFINED #define SkJSONCPP_DEFINED
#ifdef GOOGLE3 #ifdef SK_BUILD_FOR_GOOGLE3
#include "third_party/jsoncpp/reader.h" #include "third_party/jsoncpp/reader.h"
#include "third_party/jsoncpp/value.h" #include "third_party/jsoncpp/value.h"
#include "third_party/jsoncpp/writer.h" #include "third_party/jsoncpp/writer.h"