Add a GM and images to test SkEncodedOrigin

Bug: skia:7138
Change-Id: I4800bcffc6a397cb688e63a505dd36145e423fa2
Reviewed-on: https://skia-review.googlesource.com/95083
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
diff --git a/gm/orientation.cpp b/gm/orientation.cpp
new file mode 100644
index 0000000..183ec09
--- /dev/null
+++ b/gm/orientation.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "gm.h"
+
+#include "SkCanvas.h"
+#include "SkColor.h"
+#include "SkImage.h"
+#include "Resources.h"
+
+// This gm draws 8 images that are mostly the same when respecting the
+// EXIF orientation tag. Each one has four quadrants (red, blue, green,
+// yellow), and labels on the left, top, right and bottom. The only
+// visual difference is a number in the middle corresponding to the
+// EXIF tag for that image's jpg file.
+DEF_SIMPLE_GM(orientation, canvas, 400, 320) {
+    canvas->save();
+    for (char i = '1'; i <= '8'; i++) {
+        SkString path = SkStringPrintf("images/orientation/%c.jpg", i);
+        auto image = GetResourceAsImage(path.c_str());
+        canvas->drawImage(image, 0, 0);
+        if ('4' == i) {
+            canvas->restore();
+            canvas->translate(0, image->height());
+        } else {
+            canvas->translate(image->width(), 0);
+        }
+    }
+}
diff --git a/gn/gm.gni b/gn/gm.gni
index 418957f..38aaff3 100644
--- a/gn/gm.gni
+++ b/gn/gm.gni
@@ -219,6 +219,7 @@
   "$_gm/nonclosedpaths.cpp",
   "$_gm/occludedrrectblur.cpp",
   "$_gm/offsetimagefilter.cpp",
+  "$_gm/orientation.cpp",
   "$_gm/ovals.cpp",
   "$_gm/overdrawcolorfilter.cpp",
   "$_gm/OverStroke.cpp",
diff --git a/resources/images/orientation/1.jpg b/resources/images/orientation/1.jpg
new file mode 100644
index 0000000..c56afd2
--- /dev/null
+++ b/resources/images/orientation/1.jpg
Binary files differ
diff --git a/resources/images/orientation/2.jpg b/resources/images/orientation/2.jpg
new file mode 100644
index 0000000..56e13bf
--- /dev/null
+++ b/resources/images/orientation/2.jpg
Binary files differ
diff --git a/resources/images/orientation/3.jpg b/resources/images/orientation/3.jpg
new file mode 100644
index 0000000..f3d15cb
--- /dev/null
+++ b/resources/images/orientation/3.jpg
Binary files differ
diff --git a/resources/images/orientation/4.jpg b/resources/images/orientation/4.jpg
new file mode 100644
index 0000000..53d0afe
--- /dev/null
+++ b/resources/images/orientation/4.jpg
Binary files differ
diff --git a/resources/images/orientation/5.jpg b/resources/images/orientation/5.jpg
new file mode 100644
index 0000000..cb8a5b0
--- /dev/null
+++ b/resources/images/orientation/5.jpg
Binary files differ
diff --git a/resources/images/orientation/6.jpg b/resources/images/orientation/6.jpg
new file mode 100644
index 0000000..5dc7f0a
--- /dev/null
+++ b/resources/images/orientation/6.jpg
Binary files differ
diff --git a/resources/images/orientation/7.jpg b/resources/images/orientation/7.jpg
new file mode 100644
index 0000000..63f1744
--- /dev/null
+++ b/resources/images/orientation/7.jpg
Binary files differ
diff --git a/resources/images/orientation/8.jpg b/resources/images/orientation/8.jpg
new file mode 100644
index 0000000..43f296c
--- /dev/null
+++ b/resources/images/orientation/8.jpg
Binary files differ