AFAICT, only gm/etc1 uses third_party/etc1

The need for -Ithird_party/gif has already been
rewritten away, and we can do the same for etc1.

Change-Id: I97408652682b5ec406647108056e7a1ea6a56c29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210131
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index bee44bc..320c0c5 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -136,11 +136,6 @@
 config("skia_private") {
   visibility = [ ":*" ]
 
-  include_dirs = [
-    "third_party/etc1",
-    "third_party/gif",
-  ]
-
   defines = [ "SK_GAMMA_APPLY_TO_A8" ]
   if (skia_use_fixed_gamma_text) {
     defines += [
@@ -946,7 +941,6 @@
     "src/sfnt/SkOTTable_name.cpp",
     "src/sfnt/SkOTUtils.cpp",
     "src/utils/mac/SkStream_mac.cpp",
-    "third_party/etc1/etc1.cpp",
   ]
 
   defines = []
@@ -1614,10 +1608,17 @@
     ]
   }
 
+  test_lib("etc1") {
+    sources = [
+      "third_party/etc1/etc1.cpp",
+    ]
+  }
+
   import("gn/gm.gni")
   test_lib("gm") {
     sources = gm_sources
     deps = [
+      ":etc1",
       ":flags",
       ":skia",
       ":tool_utils",
diff --git a/gm/etc1.cpp b/gm/etc1.cpp
index 552fa28..ac8a74e 100644
--- a/gm/etc1.cpp
+++ b/gm/etc1.cpp
@@ -11,7 +11,7 @@
 #include "tools/ToolUtils.h"
 
 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_GOOGLE3)
-#include "etc1.h"
+#include "third_party/etc1/etc1.h"
 
 #include "include/gpu/GrContext.h"
 #include "include/private/GrTextureProxy.h"
diff --git a/public.bzl b/public.bzl
index 060f15c..ad9b909 100644
--- a/public.bzl
+++ b/public.bzl
@@ -273,7 +273,7 @@
             "src/codec/*Webp*.cpp",
             "src/codec/*Png*",
         ]
-    return native.glob(["src/codec/*.cpp", "third_party/etc1/*.cpp", "third_party/gif/*.cpp"], exclude = exclude)
+    return native.glob(["src/codec/*.cpp", "third_party/gif/*.cpp"], exclude = exclude)
 
 GL_SRCS_UNIX = struct(
     include = [
@@ -435,7 +435,6 @@
     "src/shaders/gradients",
     "src/sksl",
     "src/utils",
-    "third_party/etc1",
     "third_party/gif",
     "third_party/skcms",
 ]
diff --git a/third_party/etc1/etc1.cpp b/third_party/etc1/etc1.cpp
index a150081..1c12be6 100644
--- a/third_party/etc1/etc1.cpp
+++ b/third_party/etc1/etc1.cpp
@@ -20,7 +20,7 @@
 
 //////////////////////////////////////////////////////////////////////////////////////////
 
-#include "etc1.h"
+#include "third_party/etc1/etc1.h"
 
 #include <cstring>
 
diff --git a/tools/rewrite_includes.py b/tools/rewrite_includes.py
index f035c55..75f9507 100644
--- a/tools/rewrite_includes.py
+++ b/tools/rewrite_includes.py
@@ -21,6 +21,7 @@
     'samplecode',
     'src',
     'tests',
+    'third_party/etc1',
     'third_party/gif',
     'tools'
   ]