Allow GMs to be used as benchmarks. Make convex_poly_clip opt in.

R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/151843002

git-svn-id: http://skia.googlecode.com/svn/trunk@13279 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gyp/SampleApp.gyp b/gyp/SampleApp.gyp
index 43c5d89..5d71748 100644
--- a/gyp/SampleApp.gyp
+++ b/gyp/SampleApp.gyp
@@ -23,16 +23,6 @@
         'gmslides.gypi',
       ],
       'sources': [
-        '../src/utils/debugger/SkDrawCommand.h',
-        '../src/utils/debugger/SkDrawCommand.cpp',
-        '../src/utils/debugger/SkDebugCanvas.h',
-        '../src/utils/debugger/SkDebugCanvas.cpp',
-        '../src/utils/debugger/SkObjectParser.h',
-        '../src/utils/debugger/SkObjectParser.cpp',
-
-        '../gm/gm.cpp',
-        '../gm/gm.h',
-
         '../samplecode/GMSampleView.h',
         '../samplecode/ClockFaceView.cpp',
         '../samplecode/OverView.cpp',
diff --git a/gyp/bench.gyp b/gyp/bench.gyp
index d404000..c408d7c 100644
--- a/gyp/bench.gyp
+++ b/gyp/bench.gyp
@@ -97,6 +97,9 @@
         '../bench/SkBenchLogger.h',
         '../bench/SkBenchmark.cpp',
         '../bench/SkBenchmark.h',
+        '../bench/SkGMBench.cpp',
+        '../bench/SkGMBench.h',
+
         '../bench/benchmain.cpp',
       ],
       'conditions': [
@@ -111,6 +114,9 @@
           },
         ],
       ],
+      'includes': [
+        'gmslides.gypi',
+      ],
     },
     {
       'target_name' : 'bench_timer',
diff --git a/gyp/gm.gyp b/gyp/gm.gyp
index 971fce5..3533aa5 100644
--- a/gyp/gm.gyp
+++ b/gyp/gm.gyp
@@ -30,29 +30,19 @@
       'include_dirs' : [
         '../src/core',
         '../src/images',
-        '../src/lazy',
         '../src/effects',
         '../src/pipe/utils/',
         '../src/utils/',
-        '../src/utils/debugger',
       ],
       'includes': [
         'gmslides.gypi',
       ],
       'sources': [
-        '../gm/gm.cpp',
         '../gm/gmmain.cpp',
         '../gm/system_preferences_default.cpp',
 
         '../src/pipe/utils/SamplePipeControllers.h',
         '../src/pipe/utils/SamplePipeControllers.cpp',
-
-        '../src/utils/debugger/SkDrawCommand.h',
-        '../src/utils/debugger/SkDrawCommand.cpp',
-        '../src/utils/debugger/SkDebugCanvas.h',
-        '../src/utils/debugger/SkDebugCanvas.cpp',
-        '../src/utils/debugger/SkObjectParser.h',
-        '../src/utils/debugger/SkObjectParser.cpp',
       ],
       'dependencies': [
         'skia_lib.gyp:skia_lib',
diff --git a/gyp/gmslides.gypi b/gyp/gmslides.gypi
index 2ba0140..c6c11e3 100644
--- a/gyp/gmslides.gypi
+++ b/gyp/gmslides.gypi
@@ -1,6 +1,17 @@
 # include this gypi to include all the golden master slides.
 {
+  'include_dirs': [
+    '../gm',
+    # include dirs needed by particular GMs
+    '../src/utils/debugger',
+    '../src/images',
+    '../src/lazy',
+  ],
   'sources': [
+    # base class for GMs
+    '../gm/gm.cpp',
+    '../gm/gm.h',
+
     '../gm/aaclip.cpp',
     '../gm/aarectmodes.cpp',
     '../gm/alphagradients.cpp',
@@ -156,5 +167,14 @@
     '../gm/xfermodes.cpp',
     '../gm/xfermodes2.cpp',
     '../gm/xfermodes3.cpp',
+
+    # Files needed by particular GMs
+    '../src/utils/debugger/SkDrawCommand.h',
+    '../src/utils/debugger/SkDrawCommand.cpp',
+    '../src/utils/debugger/SkDebugCanvas.h',
+    '../src/utils/debugger/SkDebugCanvas.cpp',
+    '../src/utils/debugger/SkObjectParser.h',
+    '../src/utils/debugger/SkObjectParser.cpp',
+
   ],
 }