/*
 * Copyright 2017 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
  #include <android/log.h>
  #include "include/gpu/graphite/LogPriority.h"

  #define SK_BUILD_FOR_ANDROID_FRAMEWORK
  #define SK_DEFAULT_FONT_CACHE_LIMIT   (768 * 1024)
  #define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (512 * 1024)
  #define SK_PRINT_CODEC_MESSAGES
  #define SK_USE_FREETYPE_EMBOLDEN

  // Disable these Ganesh features
  #define SK_DISABLE_REDUCE_OPLIST_SPLITTING
  // Check error is expensive. HWUI historically also doesn't check its allocations
  #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 0

  // Disable these Vulkan features until debugged
  // b/439531864
  #define SK_DISABLE_GRAPHICS_PIPELINE_LIBRARY

  // Graphite features
  #define SK_TRACE_GRAPHITE_PIPELINE_USE

  // Staging flags
  #define SK_SUPPORT_LEGACY_RRECT_TRANSFORM
  #define SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
  #define SK_SUPPORT_UNSPANNED_APIS

  // Logging settings
  #define SKGPU_GRAPHITE_LOWEST_ACTIVE_LOG_PRIORITY skgpu::graphite::LogPriority::kWarning
  #define SK_ABORT(fmt, ...) __android_log_assert(nullptr, "skia", "[skia] \"" fmt "\" in {%s}",  \
                                                  ##__VA_ARGS__, __PRETTY_FUNCTION__)

  // TODO (b/239048372): Remove this flag when we can safely migrate apps to the
  // new behavior.
  #define SK_SUPPORT_LEGACY_ALPHA_BITMAP_AS_COVERAGE

  #define SK_DNG_VERSION 0x01070100

#if defined(__APPLE__) && !defined(SK_R32_SHIFT)
  // Set macOS to use BGRA format to match Linux and Windows
  #define SK_R32_SHIFT 16
#endif
#endif // SkUserConfigManual_DEFINED
