[canvaskit] Fix primitive_shaper build

The problem was we didn't have a way to not build with
SkParagraph, which we can't use when we are using the
primitive shaper.

Change-Id: Iafe070d6f5c01aaa7a42225793d5ad873f144798
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254968
Reviewed-by: Kevin Lubick <kjlubick@google.com>
diff --git a/modules/canvaskit/CHANGELOG.md b/modules/canvaskit/CHANGELOG.md
index 949f3b7..086d6c2 100644
--- a/modules/canvaskit/CHANGELOG.md
+++ b/modules/canvaskit/CHANGELOG.md
@@ -30,6 +30,7 @@
 ### Fixed
  - null dereference when sometimes falling back to CPU.
  - Actually ask WebGL for a stencil buffer.
+ - Can opt out of Paragraph API with no_paragraph passed into compile.sh or when using primitive_shaper.
 
 ## [0.8.0] - 2019-10-21
 
diff --git a/modules/canvaskit/compile.sh b/modules/canvaskit/compile.sh
index 7e306b5..f817396 100755
--- a/modules/canvaskit/compile.sh
+++ b/modules/canvaskit/compile.sh
@@ -143,6 +143,14 @@
 PARAGRAPH_BINDINGS="-DSK_INCLUDE_PARAGRAPH=1 \
   $BASE_DIR/paragraph_bindings.cpp"
 
+if [[ $@ == *no_paragraph* ]] || [[ $@ == *primitive_shaper* ]]; then
+  echo "Omitting paragraph (must also have non-primitive shaper)"
+  PARAGRAPH_JS=""
+  PARAGRAPH_LIB=""
+  PARAGRAPH_BINDINGS=""
+fi
+
+
 # Turn off exiting while we check for ninja (which may not be on PATH)
 set +e
 NINJA=`which ninja`