Compile Vulkan when building for the Android framework.
authordjsollen <djsollen@google.com>
Wed, 6 Jul 2016 16:17:35 +0000 (09:17 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 6 Jul 2016 16:17:36 +0000 (09:17 -0700)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2129523002

Review-Url: https://codereview.chromium.org/2129523002

gyp/common_variables.gypi
gyp/gpu.gyp
gyp/shaderc.gyp
platform_tools/android/gyp_gen/gypd_parser.py
src/gpu/vk/GrVkPipelineStateBuilder.h
src/gpu/vk/GrVkProgramDesc.cpp

index 969e4847e81a4a94de0b1e0ba040214613e61615..5163d880c3a0c1b9986a7f2cb99ea177cdce150b 100644 (file)
@@ -82,6 +82,7 @@
           'skia_chrome_utils%': 0,
           'skia_use_android_framework_defines%': 1,
           'skia_use_system_json%': 1,
+          'skia_vulkan%': 1,
         }, {
           'skia_os%': '<(skia_os)',
           'skia_chrome_utils%': 1,
index 874db5cb67c05e431d7688f3726b780dc28584f6..c17789ab7a7f3de09941a74a2a2354ebd0dcfdf2 100644 (file)
           },
         }],
         [ 'skia_vulkan', {
+          'link_settings': {
+            'libraries': [ '<(vulkan_lib_name)', ],
+          },
+          'dependencies': [
+            'shaderc.gyp:shaderc_combined',
+          ],
           'conditions': [
             [ 'skia_os == "win"', {
              'variables': {
                 'library_dirs': [ '<(vulkan_sdk_path)/lib', ],
               },
             }],
+            [ 'skia_android_framework', {
+              'include_dirs': [
+                'frameworks/native/vulkan/include',
+                '../tools/viewer/sk_app',
+                '../tools/viewer/sk_app/android',
+              ],
+              'direct_dependent_settings': {
+                'include_dirs': [
+                  'frameworks/native/vulkan/include',
+                  '../tools/viewer/sk_app',
+                  '../tools/viewer/sk_app/android',
+                ],
+              },
+              'dependencies!': [
+                'shaderc.gyp:shaderc_combined',
+              ],
+              'sources': [
+                # the gyp -> android.mk generator doesn't seem to like cpp files
+                # in directories outside of src, bench, or dm.  Until this gets fixed
+                # I just start the path in the src directory.
+                '<(skia_src_path)/../tools/viewer/sk_app/WindowContext.cpp', 
+                '<(skia_src_path)/../tools/viewer/sk_app/VulkanWindowContext.cpp',
+                '<(skia_src_path)/../tools/viewer/sk_app/android/VulkanWindowContext_android.cpp'
+              ],
+            }],
           ],
-          'dependencies': [
-            'shaderc.gyp:shaderc_combined',
-          ],
-          'include_dirs': [
-            '../third_party/externals/shaderc2/libshaderc/include',
-          ],
-          'direct_dependent_settings': {
-            'include_dirs': [
-              '../third_party/externals/shaderc2/libshaderc/include',
-            ],
-          },
-          'link_settings': {
-            'libraries': [ '<(vulkan_lib_name)', ],
-          },
         }, {
           'sources!': [
             '<@(skgpu_vk_sources)',
index 31fd897aeabfc5190b1ab0926ad2865a144012aa..4a8541172eee48aca09680f524e509340409186c 100644 (file)
         'libglslangosdependent',
         'libglslang',
       ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          '../third_party/externals/shaderc2/libshaderc/include',
+        ],
+      },
     },
     {
       'target_name': 'libshaderc',
index e992637637948a3c8d5cb4ab31c4c339882b6675..082d2645a4d364434c954544eff039f81ec01681 100644 (file)
@@ -89,7 +89,7 @@ def parse_dictionary(var_dict, d, current_target_name, dest_dir):
     var_dict.LOCAL_CPPFLAGS.add(flag)
 
   for include in d.get('include_dirs', []):
-    if include.startswith('external'):
+    if include.startswith('external') or include.startswith('frameworks'):
       # This path is relative to the Android root. Leave it alone.
       rel_include = include
     else:
index 5a4cfb82266779f0c73eb8d81e07aae731d1e1c3..2f78116830aa7a674544e048520aaacb6d2d57dc 100644 (file)
@@ -15,7 +15,6 @@
 #include "GrVkUniformHandler.h"
 #include "GrVkVaryingHandler.h"
 
-#include "shaderc/shaderc.h"
 #include "vk/GrVkDefines.h"
 
 class GrVkGpu;
index 4619bcfdedb320aa30cfc4bb4cf6e1d4a9ecb358..2154af652c7e7de3bc80854ee59b37ad9e999770 100644 (file)
@@ -17,8 +17,6 @@
 #include "glsl/GrGLSLFragmentShaderBuilder.h"
 #include "glsl/GrGLSLCaps.h"
 
-#include "shaderc/shaderc.h"
-
 static void add_texture_key(GrProcessorKeyBuilder* b, const GrProcessor& proc,
                             const GrGLSLCaps& caps) {
     int numTextures = proc.numTextures();