Compile deqp_gles2 on Android

Add some missing functions,
modify preprocessor conditions and build files
to include some other missing functions when building for Android.

BUG=angleproject:1471

Change-Id: Iadc0a0b9fed2444b8bc9a894ee65c8b66ea7f3c9
Reviewed-on: https://chromium-review.googlesource.com/368982
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/tests/BUILD.gn b/src/tests/BUILD.gn
index 7f3846f..d4899da 100644
--- a/src/tests/BUILD.gn
+++ b/src/tests/BUILD.gn
@@ -172,13 +172,17 @@
     defines = deqp_gypi.deqp_defines
     defines += [ "_MBCS" ]
 
+    # Ask the system headers to expose all the regular function otherwise
+    # dEQP doesn't compile and produces warnings about implicitly defined
+    # functions.
     if (is_linux) {
-      # Ask the system headers to expose all the regular function otherwise
-      # dEQP doesn't compile and produces warnings about implicitly defined
-      # functions.
       # This has to be GNU_SOURCE as on Linux dEQP uses syscall()
       defines += [ "_GNU_SOURCE" ]
     }
+    if (is_android) {
+      # _XOPEN_SOURCE=600 is what is used in deqp/src/Android.mk
+      defines += [ "_XOPEN_SOURCE=600" ]
+    }
   }
 
   deqp_undefine_configs = [
@@ -194,7 +198,7 @@
     ]
   }
 
-  if (is_linux) {
+  if (is_linux || is_android) {
     deqp_undefine_configs += [ "//build/config/gcc:no_exceptions" ]
   }
 
@@ -230,10 +234,13 @@
     if (is_win) {
       sources += rebase_path(deqp_gypi.deqp_libtester_sources_win, ".", "../..")
     }
-    if (is_linux) {
+    if (is_linux || is_android) {
       sources +=
           rebase_path(deqp_gypi.deqp_libtester_sources_unix, ".", "../..")
     }
+    if (is_android) {
+      libs = [ "log" ]
+    }
   }
 
   config("angle_deqp_gtest_support_config") {
@@ -331,6 +338,10 @@
         # Set rpath to find *.so files even in a non-component build.
         configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
       }
+
+      if (is_android) {
+        use_native_activity = true
+      }
     }
   }
 }
diff --git a/src/tests/deqp_support/angle_deqp_libtester_main.cpp b/src/tests/deqp_support/angle_deqp_libtester_main.cpp
index a8c6416..056d9dc 100644
--- a/src/tests/deqp_support/angle_deqp_libtester_main.cpp
+++ b/src/tests/deqp_support/angle_deqp_libtester_main.cpp
@@ -27,6 +27,8 @@
 #include <sys/unistd.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#elif (DE_OS == DE_OS_ANDROID)
+#include <sys/stat.h>
 #endif
 
 tcu::Platform *createPlatform();
@@ -68,7 +70,7 @@
 
     return false;
 }
-#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX)
+#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_ANDROID)
 deBool deIsDir(const char *filename)
 {
     struct stat st;
diff --git a/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp b/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp
index ef53f8b..a7432b4 100644
--- a/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp
+++ b/src/tests/deqp_support/tcuANGLENativeDisplayFactory.cpp
@@ -32,15 +32,17 @@
 #include "OSWindow.h"
 #include "tcuTexture.hpp"
 
+// clang-format off
 #if (DE_OS == DE_OS_WIN32)
     #define ANGLE_EGL_LIBRARY_NAME "libEGL.dll"
-#elif (DE_OS == DE_OS_UNIX)
+#elif (DE_OS == DE_OS_UNIX) || (DE_OS == DE_OS_ANDROID)
     #define ANGLE_EGL_LIBRARY_NAME "libEGL.so"
 #elif (DE_OS == DE_OS_OSX)
     #define ANGLE_EGL_LIBRARY_NAME "libEGL.dylib"
 #else
     #error "Unsupported platform"
 #endif
+// clang-format on
 
 namespace tcu
 {
diff --git a/src/tests/third_party/gpu_test_expectations/angle-mods.patch b/src/tests/third_party/gpu_test_expectations/angle-mods.patch
index 88af876..c00efc0 100644
--- a/src/tests/third_party/gpu_test_expectations/angle-mods.patch
+++ b/src/tests/third_party/gpu_test_expectations/angle-mods.patch
@@ -1,37 +1,7 @@
-diff --git a/src/tests/third_party/gpu_test_expectations/HowToMakeChanges.md b/src/tests/third_party/gpu_test_expectations/HowToMakeChanges.md
-new file mode 100644
-index 0000000..7817d0a
---- /dev/null
-+++ b/src/tests/third_party/gpu_test_expectations/HowToMakeChanges.md
-@@ -0,0 +1,22 @@
-+Because the ```gpu_test_expectations``` directory is based on parts of Chromium's ```gpu/config``
-+directory, we want to keep a patch of the changes added to make it compile with ANGLE. This
-+will allow us to merge Chromium changes easily in our ```gpu_test_expectations```.
-+
-+In order to make a change to this directory, do the following:
-+
-+ * copy the directory somewhere like in ```gpu_test_expectations_reverted```
-+ * in ```gpu_test_expectations_reverted``` run ```patch -p 1 -R < angle-mods.patch```
-+ * do your changes in ```gpu_test_expectations```
-+ * delete angle-mods.patch in both directories
-+ * run ```diff -rupN gpu_test_expectations_reverted gpu_test_expectations > angle-mods.patch```
-+ * copy ```angle-mods.patch``` in ```gpu_test_expectations```
-+
-+How to update from Chromium:
-+
-+ * ```git apply -R angle-mods.patch```, ```git add . -u```, ```git commit```
-+ * Copy over Chromium files, ```git add . -u```, ```git commit```
-+ * ```git revert HEAD~```
-+ * ```rm angle-mods.patch```
-+ * ```git diff HEAD~ (`)ls(`) > angle-mods.patch```,```git add angle-mods.patch```, ```git commit --amend```
-+ * ```git rebase -i``` to squash the three patches into one.
-+
-diff --git a/src/tests/third_party/gpu_test_expectations/angle_config.h b/src/tests/third_party/gpu_test_expectations/angle_config.h
-new file mode 100644
-index 0000000..3d7b20c
---- /dev/null
-+++ b/src/tests/third_party/gpu_test_expectations/angle_config.h
-@@ -0,0 +1,62 @@
+diff -rupN gpu_test_expectations_reverted/angle_config.h gpu_test_expectations/angle_config.h
+--- gpu_test_expectations_reverted/angle_config.h	1969-12-31 19:00:00.000000000 -0500
++++ gpu_test_expectations/angle_config.h	2016-08-22 16:13:08.739352282 -0400
+@@ -0,0 +1,66 @@
 +//
 +// Copyright 2015 The ANGLE Project Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
@@ -83,8 +53,11 @@
 +}
 +
 +// TODO(jmadill): other platforms
++// clang-format off
 +#if defined(_WIN32) || defined(_WIN64)
 +#    define OS_WIN
++#elif defined(ANDROID)
++#    define OS_ANDROID
 +#elif defined(__linux__)
 +#    define OS_LINUX
 +#elif defined(__APPLE__)
@@ -92,12 +65,12 @@
 +#else
 +#    error "Unsupported platform"
 +#endif
++// clang-format on
 +
 +#endif
-diff --git a/src/tests/third_party/gpu_test_expectations/gpu_info.cc b/src/tests/third_party/gpu_test_expectations/gpu_info.cc
-index 23d5216..4f279a4 100644
---- a/src/tests/third_party/gpu_test_expectations/gpu_info.cc
-+++ b/src/tests/third_party/gpu_test_expectations/gpu_info.cc
+diff -rupN gpu_test_expectations_reverted/gpu_info.cc gpu_test_expectations/gpu_info.cc
+--- gpu_test_expectations_reverted/gpu_info.cc	2016-08-12 21:23:54.884132405 -0400
++++ gpu_test_expectations/gpu_info.cc	2015-11-30 21:54:30.239267635 -0500
 @@ -2,7 +2,7 @@
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
@@ -107,7 +80,7 @@
  
  namespace {
  
-@@ -17,31 +17,6 @@ void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice& device,
+@@ -17,31 +17,6 @@ void EnumerateGPUDevice(const gpu::GPUIn
    enumerator->EndGPUDevice();
  }
  
@@ -161,7 +134,7 @@
      GPUDevice gpu;
      std::vector<GPUDevice> secondary_gpus;
      uint64 adapter_luid;
-@@ -110,14 +80,6 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
+@@ -110,14 +80,6 @@ void GPUInfo::EnumerateFields(Enumerator
      bool in_process_gpu;
      CollectInfoResult basic_info_state;
      CollectInfoResult context_info_state;
@@ -176,7 +149,7 @@
      bool jpeg_decode_accelerator_supported;
    };
  
-@@ -136,15 +98,9 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
+@@ -136,15 +98,9 @@ void GPUInfo::EnumerateFields(Enumerator
      EnumerateGPUDevice(secondary_gpu, enumerator);
  
    enumerator->BeginAuxAttributes();
@@ -192,7 +165,7 @@
    enumerator->AddInt64("adapterLuid", adapter_luid);
    enumerator->AddString("driverVendor", driver_vendor);
    enumerator->AddString("driverVersion", driver_version);
-@@ -171,14 +127,7 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
+@@ -171,14 +127,7 @@ void GPUInfo::EnumerateFields(Enumerator
    enumerator->AddBool("inProcessGpu", in_process_gpu);
    enumerator->AddInt("basicInfoState", basic_info_state);
    enumerator->AddInt("contextInfoState", context_info_state);
@@ -207,10 +180,9 @@
    enumerator->AddBool("jpegDecodeAcceleratorSupported",
        jpeg_decode_accelerator_supported);
    enumerator->EndAuxAttributes();
-diff --git a/src/tests/third_party/gpu_test_expectations/gpu_info.h b/src/tests/third_party/gpu_test_expectations/gpu_info.h
-index d6f61fd..0a7f9aa 100644
---- a/src/tests/third_party/gpu_test_expectations/gpu_info.h
-+++ b/src/tests/third_party/gpu_test_expectations/gpu_info.h
+diff -rupN gpu_test_expectations_reverted/gpu_info.h gpu_test_expectations/gpu_info.h
+--- gpu_test_expectations_reverted/gpu_info.h	2016-08-12 21:23:54.884132405 -0400
++++ gpu_test_expectations/gpu_info.h	2015-11-30 21:54:30.239267635 -0500
 @@ -11,13 +11,7 @@
  #include <string>
  #include <vector>
@@ -280,11 +252,11 @@
    CollectInfoResult context_info_state;
 -#if defined(OS_WIN)
 -  CollectInfoResult dx_diagnostics_info_state;
--
+ 
 -  // The information returned by the DirectX Diagnostics Tool.
 -  DxDiagNode dx_diagnostics;
 -#endif
- 
+-
 -  VideoDecodeAcceleratorSupportedProfiles
 -      video_decode_accelerator_supported_profiles;
 -  VideoEncodeAcceleratorSupportedProfiles
@@ -301,11 +273,10 @@
  
      // Markers indicating that a GPUDevice is being described.
      virtual void BeginGPUDevice() = 0;
-diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc b/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc
-index a7cc4b4..f8571d4 100644
---- a/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc
-+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc
-@@ -2,18 +2,193 @@
+diff -rupN gpu_test_expectations_reverted/gpu_test_config.cc gpu_test_expectations/gpu_test_config.cc
+--- gpu_test_expectations_reverted/gpu_test_config.cc	2016-08-12 21:23:54.884132405 -0400
++++ gpu_test_expectations/gpu_test_config.cc	2016-08-22 16:09:09.972124940 -0400
+@@ -2,20 +2,205 @@
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  
@@ -331,8 +302,8 @@
 -#elif defined(OS_WIN)
 -#include "base/win/windows_version.h"
 +#include "gpu_test_config_mac.h"
-+#endif
-+
+ #endif
+ 
 +using namespace gpu;
 +
 +#if defined(OS_WIN)
@@ -505,10 +476,22 @@
 +  return kCollectInfoNonFatalFailure;
 +}
 +
- #endif
- 
++#endif
++
++#if defined(OS_ANDROID)
++CollectInfoResult CollectGpuID(uint32 *vendor_id, uint32 *device_id)
++{
++    DCHECK(vendor_id && device_id);
++    *vendor_id = 0;
++    *device_id = 0;
++    return kCollectInfoNonFatalFailure;
++}
++#endif  // defined(OS_ANDROID)
++
  namespace gpu {
-@@ -295,21 +470,5 @@ bool GPUTestBotConfig::CurrentConfigMatches(
+ 
+ namespace {
+@@ -295,21 +480,5 @@ bool GPUTestBotConfig::CurrentConfigMatc
    return false;
  }
  
@@ -530,10 +513,9 @@
 -
  }  // namespace gpu
  
-diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_config.h b/src/tests/third_party/gpu_test_expectations/gpu_test_config.h
-index b5431e6..4cbc2c0 100644
---- a/src/tests/third_party/gpu_test_expectations/gpu_test_config.h
-+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_config.h
+diff -rupN gpu_test_expectations_reverted/gpu_test_config.h gpu_test_expectations/gpu_test_config.h
+--- gpu_test_expectations_reverted/gpu_test_config.h	2016-08-12 21:23:54.884132405 -0400
++++ gpu_test_expectations/gpu_test_config.h	2015-11-30 21:54:30.239267635 -0500
 @@ -8,9 +8,7 @@
  #include <string>
  #include <vector>
@@ -545,7 +527,7 @@
  
  namespace gpu {
  
-@@ -134,9 +132,6 @@ class GPU_EXPORT GPUTestBotConfig : public GPUTestConfig {
+@@ -134,9 +132,6 @@ class GPU_EXPORT GPUTestBotConfig : publ
    // Check if this bot's config matches |config_data| or any of the |configs|.
    static bool CurrentConfigMatches(const std::string& config_data);
    static bool CurrentConfigMatches(const std::vector<std::string>& configs);
@@ -555,11 +537,9 @@
  };
  
  }  // namespace gpu
-diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_config_mac.h b/src/tests/third_party/gpu_test_expectations/gpu_test_config_mac.h
-new file mode 100644
-index 0000000..da22bd6
---- /dev/null
-+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_config_mac.h
+diff -rupN gpu_test_expectations_reverted/gpu_test_config_mac.h gpu_test_expectations/gpu_test_config_mac.h
+--- gpu_test_expectations_reverted/gpu_test_config_mac.h	1969-12-31 19:00:00.000000000 -0500
++++ gpu_test_expectations/gpu_test_config_mac.h	2015-11-30 21:54:30.239267635 -0500
 @@ -0,0 +1,28 @@
 +//
 +// Copyright 2015 The ANGLE Project Authors. All rights reserved.
@@ -589,11 +569,9 @@
 +gpu::GPUInfo::GPUDevice GetActiveGPU();
 +
 +#endif // GPU_TEST_EXPECTATIONS_GPU_TEST_CONFIG_MAC_H_
-diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_config_mac.mm b/src/tests/third_party/gpu_test_expectations/gpu_test_config_mac.mm
-new file mode 100644
-index 0000000..8cbd498
---- /dev/null
-+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_config_mac.mm
+diff -rupN gpu_test_expectations_reverted/gpu_test_config_mac.mm gpu_test_expectations/gpu_test_config_mac.mm
+--- gpu_test_expectations_reverted/gpu_test_config_mac.mm	1969-12-31 19:00:00.000000000 -0500
++++ gpu_test_expectations/gpu_test_config_mac.mm	2015-11-30 21:54:30.239267635 -0500
 @@ -0,0 +1,67 @@
 +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
@@ -662,10 +640,9 @@
 +  return gpu;
 +}
 +
-diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc
-index 6dac74e..23c4d8c 100644
---- a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc
-+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.cc
+diff -rupN gpu_test_expectations_reverted/gpu_test_expectations_parser.cc gpu_test_expectations/gpu_test_expectations_parser.cc
+--- gpu_test_expectations_reverted/gpu_test_expectations_parser.cc	2016-08-12 21:23:54.884132405 -0400
++++ gpu_test_expectations/gpu_test_expectations_parser.cc	2015-11-30 21:54:30.239267635 -0500
 @@ -2,14 +2,43 @@
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
@@ -729,7 +706,7 @@
      return kConfigGPUDeviceID;
  
    for (int32 i = 0; i < kNumberOfExactMatchTokens; ++i) {
-@@ -176,10 +205,10 @@ bool NamesMatching(const std::string& ref, const std::string& test_name) {
+@@ -176,10 +205,10 @@ bool NamesMatching(const std::string& re
  
  GPUTestExpectationsParser::GPUTestExpectationsParser() {
    // Some sanity check.
@@ -744,7 +721,7 @@
  }
  
  GPUTestExpectationsParser::~GPUTestExpectationsParser() {
-@@ -204,8 +233,8 @@ bool GPUTestExpectationsParser::LoadTestExpectations(const std::string& data) {
+@@ -204,8 +233,8 @@ bool GPUTestExpectationsParser::LoadTest
    return rt;
  }
  
@@ -755,7 +732,7 @@
    entries_.clear();
    error_messages_.clear();
  
-@@ -399,7 +428,7 @@ bool GPUTestExpectationsParser::ParseLine(
+@@ -399,7 +428,7 @@ bool GPUTestExpectationsParser::ParseLin
            stage++;
          break;
        default:
@@ -764,7 +741,7 @@
          break;
      }
    }
-@@ -488,7 +517,7 @@ bool GPUTestExpectationsParser::UpdateTestConfig(
+@@ -488,7 +517,7 @@ bool GPUTestExpectationsParser::UpdateTe
        config->set_api(config->api() | kTokenData[token].flag);
        break;
      default:
@@ -773,10 +750,9 @@
        break;
    }
    return true;
-diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h
-index a69f7e9..a112700 100644
---- a/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h
-+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_expectations_parser.h
+diff -rupN gpu_test_expectations_reverted/gpu_test_expectations_parser.h gpu_test_expectations/gpu_test_expectations_parser.h
+--- gpu_test_expectations_reverted/gpu_test_expectations_parser.h	2016-08-12 21:23:54.884132405 -0400
++++ gpu_test_expectations/gpu_test_expectations_parser.h	2015-11-30 21:54:30.239267635 -0500
 @@ -8,10 +8,8 @@
  #include <string>
  #include <vector>
@@ -790,7 +766,7 @@
  
  namespace gpu {
  
-@@ -32,7 +30,7 @@ class GPU_EXPORT GPUTestExpectationsParser {
+@@ -32,7 +30,7 @@ class GPU_EXPORT GPUTestExpectationsPars
    // save all the entries. Otherwise, generate error messages.
    // Return true if parsing succeeds.
    bool LoadTestExpectations(const std::string& data);
@@ -799,3 +775,29 @@
  
    // Query error messages from the last LoadTestExpectations() call.
    const std::vector<std::string>& GetErrorMessages() const;
+diff -rupN gpu_test_expectations_reverted/HowToMakeChanges.md gpu_test_expectations/HowToMakeChanges.md
+--- gpu_test_expectations_reverted/HowToMakeChanges.md	1969-12-31 19:00:00.000000000 -0500
++++ gpu_test_expectations/HowToMakeChanges.md	2016-08-22 15:52:38.098728514 -0400
+@@ -0,0 +1,22 @@
++Because the ```gpu_test_expectations``` directory is based on parts of Chromium's ```gpu/config``
++directory, we want to keep a patch of the changes added to make it compile with ANGLE. This
++will allow us to merge Chromium changes easily in our ```gpu_test_expectations```.
++
++In order to make a change to this directory, do the following:
++
++ * copy the directory somewhere like in ```gpu_test_expectations_reverted```
++ * in ```gpu_test_expectations_reverted``` run ```patch -p 1 -R < angle-mods.patch```
++ * do your changes in ```gpu_test_expectations```
++ * delete angle-mods.patch in both directories
++ * run ```diff -rupN gpu_test_expectations_reverted gpu_test_expectations > angle-mods.patch```
++ * copy ```angle-mods.patch``` in ```gpu_test_expectations```
++
++How to update from Chromium:
++
++ * ```git apply -R angle-mods.patch```, ```git add . -u```, ```git commit```
++ * Copy over Chromium files, ```git add . -u```, ```git commit```
++ * ```git revert HEAD~```
++ * ```rm angle-mods.patch```
++ * ```git diff HEAD~ (`)ls(`) > angle-mods.patch```,```git add angle-mods.patch```, ```git commit --amend```
++ * ```git rebase -i``` to squash the three patches into one.
++
diff --git a/src/tests/third_party/gpu_test_expectations/angle_config.h b/src/tests/third_party/gpu_test_expectations/angle_config.h
index 3d7b20c..4e46f98 100644
--- a/src/tests/third_party/gpu_test_expectations/angle_config.h
+++ b/src/tests/third_party/gpu_test_expectations/angle_config.h
@@ -49,8 +49,11 @@
 }
 
 // TODO(jmadill): other platforms
+// clang-format off
 #if defined(_WIN32) || defined(_WIN64)
 #    define OS_WIN
+#elif defined(ANDROID)
+#    define OS_ANDROID
 #elif defined(__linux__)
 #    define OS_LINUX
 #elif defined(__APPLE__)
@@ -58,5 +61,6 @@
 #else
 #    error "Unsupported platform"
 #endif
+// clang-format on
 
 #endif
diff --git a/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc b/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc
index f8571d4..84558e3 100644
--- a/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc
+++ b/src/tests/third_party/gpu_test_expectations/gpu_test_config.cc
@@ -191,6 +191,16 @@
 
 #endif
 
+#if defined(OS_ANDROID)
+CollectInfoResult CollectGpuID(uint32 *vendor_id, uint32 *device_id)
+{
+    DCHECK(vendor_id && device_id);
+    *vendor_id = 0;
+    *device_id = 0;
+    return kCollectInfoNonFatalFailure;
+}
+#endif  // defined(OS_ANDROID)
+
 namespace gpu {
 
 namespace {
diff --git a/util/android/AndroidPixmap.cpp b/util/android/AndroidPixmap.cpp
new file mode 100644
index 0000000..077ebb5
--- /dev/null
+++ b/util/android/AndroidPixmap.cpp
@@ -0,0 +1,14 @@
+//
+// Copyright (c) 2016 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+// AndroidPixmap.cpp: Implementation of OSPixmap for Android
+
+#include "OSPixmap.h"
+
+OSPixmap *CreateOSPixmap()
+{
+    return nullptr;
+}
diff --git a/util/util.gyp b/util/util.gyp
index 8f225f6..3eb2988 100644
--- a/util/util.gyp
+++ b/util/util.gyp
@@ -85,6 +85,7 @@
         ],
         'util_android_sources':
         [
+            'android/AndroidPixmap.cpp',
             'android/AndroidWindow.cpp',
             'android/AndroidWindow.h',
             'android/third_party/android_native_app_glue.c',