Extract //gpu:gles2 into a separate component

This makes //gpu not depend on GLES2 details and will help reuse for
RasterDecoder and, later, Vulkan things.

Bug: 795884
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I4b223e7bbd2a1596ae83feb8f7ab1f1ce2a186aa
Reviewed-on: https://chromium-review.googlesource.com/851446
Commit-Queue: Antoine Labour <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Dan Sanders <[email protected]>
Reviewed-by: Sadrul Chowdhury <[email protected]>
Reviewed-by: Victor Miura <[email protected]>
Cr-Commit-Position: refs/heads/master@{#528240}
diff --git a/gpu/gpu_gles2_export.h b/gpu/gpu_gles2_export.h
new file mode 100644
index 0000000..cf7d3b4
--- /dev/null
+++ b/gpu/gpu_gles2_export.h
@@ -0,0 +1,29 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_GPU_GLES2_EXPORT_H_
+#define GPU_GPU_GLES2_EXPORT_H_
+
+#if defined(COMPONENT_BUILD) && !defined(NACL_WIN64)
+#if defined(WIN32)
+
+#if defined(GPU_GLES2_IMPLEMENTATION)
+#define GPU_GLES2_EXPORT __declspec(dllexport)
+#else
+#define GPU_GLES2_EXPORT __declspec(dllimport)
+#endif  // defined(GPU_GLES2_IMPLEMENTATION)
+
+#else  // defined(WIN32)
+#if defined(GPU_GLES2_IMPLEMENTATION)
+#define GPU_GLES2_EXPORT __attribute__((visibility("default")))
+#else
+#define GPU_GLES2_EXPORT
+#endif
+#endif
+
+#else  // defined(COMPONENT_BUILD)
+#define GPU_GLES2_EXPORT
+#endif
+
+#endif  // GPU_GPU_GLES2_EXPORT_H_