# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//flutter/impeller/tools/impeller.gni")
import("//flutter/testing/testing.gni")

impeller_shaders("shader_fixtures") {
  name = "fixtures"

  # Not analyzing because they are not performance critical, and mipmap uses
  # textureLod, which uses an extension that malioc does not support.
  analyze = false
  shaders = [
    "array.frag",
    "array.vert",
    "box_fade.frag",
    "box_fade.vert",
    "colors.vert",
    "colors.frag",
    "impeller.frag",
    "impeller.vert",
    "inactive_uniforms.frag",
    "inactive_uniforms.vert",
    "instanced_draw.frag",
    "instanced_draw.vert",
    "mipmaps.frag",
    "mipmaps.vert",
    "sample.comp",
    "stage1.comp",
    "stage2.comp",
    "simple.vert",
    "test_texture.frag",
    "test_texture.vert",
    "half.frag",
  ]

  if (impeller_enable_opengles) {
    gles_exclusions = [
      "sample.comp",
      "stage1.comp",
      "stage2.comp",
      "half.frag",
    ]
  }
}

scenec("scene_fixtures") {
  geometry = [
    "flutter_logo_baked.glb",
    "two_triangles.glb",
  ]
  type = "gltf"
}

impellerc("runtime_stages") {
  shaders = [
    "ink_sparkle.frag",
    "runtime_stage_example.frag",
  ]
  sl_file_extension = "iplr"
  shader_target_flag = "--runtime-stage-metal"
  iplr = true
}

test_fixtures("file_fixtures") {
  fixtures = [
    "//flutter/third_party/txt/third_party/fonts/HomemadeApple.ttf",
    "//flutter/third_party/txt/third_party/fonts/NotoColorEmoji.ttf",
    "//flutter/third_party/txt/third_party/fonts/Roboto-Regular.ttf",
    "airplane.jpg",
    "bay_bridge.jpg",
    "blend_mode_dst.png",
    "blend_mode_src.png",
    "blue_noise.png",
    "boston.jpg",
    "embarcadero.jpg",
    "flutter_logo_baked.glb",
    "kalimba.jpg",
    "multiple_stages.hlsl",
    "resources_limit.vert",
    "sample.comp",
    "sample.frag",
    "sample.tesc",
    "sample.tese",
    "sample.vert",
    "sample_with_binding.vert",
    "simple.vert.hlsl",
    "sa%m#ple.vert",
    "stage1.comp",
    "stage2.comp",
    "struct_def_bug.vert",
    "table_mountain_nx.png",
    "table_mountain_ny.png",
    "table_mountain_nz.png",
    "table_mountain_px.png",
    "table_mountain_py.png",
    "table_mountain_pz.png",
    "test_texture.frag",
    "two_triangles.glb",
    "types.h",
    "wtf.otf",
  ]
  if (host_os == "mac") {
    fixtures += [ "/System/Library/Fonts/Apple Color Emoji.ttc" ]
  }
  fixtures +=
      filter_include(get_target_outputs(":runtime_stages"), [ "*.iplr" ]) +
      filter_include(get_target_outputs(":scene_fixtures"), [ "*.ipscene" ])
  deps = [
    ":runtime_stages",
    ":scene_fixtures",
  ]
}

group("fixtures") {
  testonly = true

  public_deps = [
    ":file_fixtures",
    ":scene_fixtures",
    ":shader_fixtures",
  ]
}
