# 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("../../../tools/impeller.gni")

config("gles_config") {
  # Generic GL/GLES/EGL/Vulkan headers. Any will do. We just pick one from Angle
  # because they are there.
  include_dirs = [ "//third_party/angle/include" ]
}

impeller_component("gles") {
  public_configs = []

  sources = [
    "allocator_gles.cc",
    "allocator_gles.h",
    "blit_command_gles.cc",
    "blit_command_gles.h",
    "blit_pass_gles.cc",
    "blit_pass_gles.h",
    "buffer_bindings_gles.cc",
    "buffer_bindings_gles.h",
    "capabilities_gles.cc",
    "capabilities_gles.h",
    "command_buffer_gles.cc",
    "command_buffer_gles.h",
    "context_gles.cc",
    "context_gles.h",
    "description_gles.cc",
    "description_gles.h",
    "device_buffer_gles.cc",
    "device_buffer_gles.h",
    "formats_gles.cc",
    "formats_gles.h",
    "gles.h",
    "handle_gles.cc",
    "handle_gles.h",
    "pipeline_gles.cc",
    "pipeline_gles.h",
    "pipeline_library_gles.cc",
    "pipeline_library_gles.h",
    "proc_table_gles.cc",
    "proc_table_gles.h",
    "reactor_gles.cc",
    "reactor_gles.h",
    "render_pass_gles.cc",
    "render_pass_gles.h",
    "sampler_gles.cc",
    "sampler_gles.h",
    "sampler_library_gles.cc",
    "sampler_library_gles.h",
    "shader_function_gles.cc",
    "shader_function_gles.h",
    "shader_library_gles.cc",
    "shader_library_gles.h",
    "surface_gles.cc",
    "surface_gles.h",
    "texture_gles.cc",
    "texture_gles.h",
  ]

  if (!is_android && !is_fuchsia) {
    public_configs = [ ":gles_config" ]
    sources += [
      "//third_party/angle/include/GLES2/gl2ext.h",

      # The GLES3 API is a superset of GLES2. Although we target GLES2, we use
      # some GLES3 features if the driver supports them.
      "//third_party/angle/include/GLES3/gl3.h",
    ]
  }

  public_deps = [
    "../../:renderer",
    "../../../blobcat:blobcat_lib",
    "//flutter/fml",
  ]
}
