Merge "Hide ColorSpace.Renderer" into oc-dev
diff --git a/api/current.txt b/api/current.txt
index cfcdb7d..f47a478 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -12821,7 +12821,6 @@
     method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace, android.graphics.ColorSpace, android.graphics.ColorSpace.RenderIntent);
     method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace);
     method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace, android.graphics.ColorSpace.RenderIntent);
-    method public static android.graphics.ColorSpace.Renderer createRenderer();
     method public float[] fromXyz(float, float, float);
     method public abstract float[] fromXyz(float[]);
     method public static android.graphics.ColorSpace get(android.graphics.ColorSpace.Named);
@@ -12905,16 +12904,6 @@
     enum_constant public static final android.graphics.ColorSpace.RenderIntent SATURATION;
   }
 
-  public static class ColorSpace.Renderer {
-    method public android.graphics.ColorSpace.Renderer add(android.graphics.ColorSpace, int);
-    method public android.graphics.ColorSpace.Renderer add(android.graphics.ColorSpace, float, float, float, int);
-    method public android.graphics.ColorSpace.Renderer clip(boolean);
-    method public android.graphics.Bitmap render();
-    method public android.graphics.ColorSpace.Renderer showWhitePoint(boolean);
-    method public android.graphics.ColorSpace.Renderer size(int);
-    method public android.graphics.ColorSpace.Renderer uniformChromaticityScale(boolean);
-  }
-
   public static class ColorSpace.Rgb extends android.graphics.ColorSpace {
     ctor public ColorSpace.Rgb(java.lang.String, float[], java.util.function.DoubleUnaryOperator, java.util.function.DoubleUnaryOperator);
     ctor public ColorSpace.Rgb(java.lang.String, float[], float[], java.util.function.DoubleUnaryOperator, java.util.function.DoubleUnaryOperator, float, float);
diff --git a/api/system-current.txt b/api/system-current.txt
index df8d49a..1a40d6a 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -13584,7 +13584,6 @@
     method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace, android.graphics.ColorSpace, android.graphics.ColorSpace.RenderIntent);
     method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace);
     method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace, android.graphics.ColorSpace.RenderIntent);
-    method public static android.graphics.ColorSpace.Renderer createRenderer();
     method public float[] fromXyz(float, float, float);
     method public abstract float[] fromXyz(float[]);
     method public static android.graphics.ColorSpace get(android.graphics.ColorSpace.Named);
@@ -13668,16 +13667,6 @@
     enum_constant public static final android.graphics.ColorSpace.RenderIntent SATURATION;
   }
 
-  public static class ColorSpace.Renderer {
-    method public android.graphics.ColorSpace.Renderer add(android.graphics.ColorSpace, int);
-    method public android.graphics.ColorSpace.Renderer add(android.graphics.ColorSpace, float, float, float, int);
-    method public android.graphics.ColorSpace.Renderer clip(boolean);
-    method public android.graphics.Bitmap render();
-    method public android.graphics.ColorSpace.Renderer showWhitePoint(boolean);
-    method public android.graphics.ColorSpace.Renderer size(int);
-    method public android.graphics.ColorSpace.Renderer uniformChromaticityScale(boolean);
-  }
-
   public static class ColorSpace.Rgb extends android.graphics.ColorSpace {
     ctor public ColorSpace.Rgb(java.lang.String, float[], java.util.function.DoubleUnaryOperator, java.util.function.DoubleUnaryOperator);
     ctor public ColorSpace.Rgb(java.lang.String, float[], float[], java.util.function.DoubleUnaryOperator, java.util.function.DoubleUnaryOperator, float, float);
diff --git a/api/test-current.txt b/api/test-current.txt
index a8060d8..42e3bd6 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -12871,7 +12871,6 @@
     method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace, android.graphics.ColorSpace, android.graphics.ColorSpace.RenderIntent);
     method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace);
     method public static android.graphics.ColorSpace.Connector connect(android.graphics.ColorSpace, android.graphics.ColorSpace.RenderIntent);
-    method public static android.graphics.ColorSpace.Renderer createRenderer();
     method public float[] fromXyz(float, float, float);
     method public abstract float[] fromXyz(float[]);
     method public static android.graphics.ColorSpace get(android.graphics.ColorSpace.Named);
@@ -12955,16 +12954,6 @@
     enum_constant public static final android.graphics.ColorSpace.RenderIntent SATURATION;
   }
 
-  public static class ColorSpace.Renderer {
-    method public android.graphics.ColorSpace.Renderer add(android.graphics.ColorSpace, int);
-    method public android.graphics.ColorSpace.Renderer add(android.graphics.ColorSpace, float, float, float, int);
-    method public android.graphics.ColorSpace.Renderer clip(boolean);
-    method public android.graphics.Bitmap render();
-    method public android.graphics.ColorSpace.Renderer showWhitePoint(boolean);
-    method public android.graphics.ColorSpace.Renderer size(int);
-    method public android.graphics.ColorSpace.Renderer uniformChromaticityScale(boolean);
-  }
-
   public static class ColorSpace.Rgb extends android.graphics.ColorSpace {
     ctor public ColorSpace.Rgb(java.lang.String, float[], java.util.function.DoubleUnaryOperator, java.util.function.DoubleUnaryOperator);
     ctor public ColorSpace.Rgb(java.lang.String, float[], float[], java.util.function.DoubleUnaryOperator, java.util.function.DoubleUnaryOperator, float, float);
diff --git a/graphics/java/android/graphics/ColorSpace.java b/graphics/java/android/graphics/ColorSpace.java
index e61d467..4fc63ea 100644
--- a/graphics/java/android/graphics/ColorSpace.java
+++ b/graphics/java/android/graphics/ColorSpace.java
@@ -123,39 +123,11 @@
  * and {@link #connect(ColorSpace, ColorSpace)}, are also guaranteed to be
  * thread-safe.</p>
  *
- * <h3>Visualization and debugging</h3>
- *
- * <p>To visualize and debug color spaces, you can call {@link #createRenderer()}.
- * The {@link Renderer} created by calling this method can be used to compare
- * color spaces and locate specific colors on a CIE 1931 or CIE 1976 UCS
- * chromaticity diagram.</p>
- *
- * <p>The following code snippet shows how to render a bitmap that compares
- * the color gamuts and white points of {@link Named#DCI_P3} and
- * {@link Named#PRO_PHOTO_RGB}:</p>
- *
- * <pre class="prettyprint">
- * Bitmap bitmap = ColorSpace.createRenderer()
- *     .size(768)
- *     .clip(true)
- *     .add(ColorSpace.get(ColorSpace.Named.DCI_P3), 0xffffc845)
- *     .add(ColorSpace.get(ColorSpace.Named.PRO_PHOTO_RGB), 0xff097ae9)
- *     .render();
- * </pre>
- * <p>
- *     <img style="display: block; margin: 0 auto;" src="{@docRoot}reference/android/images/graphics/colorspace_renderer.png" />
- *     <figcaption style="text-align: center;">DCI-P3 vs ProPhoto RGB</figcaption>
- * </p>
- *
- * <p>Please refer to the documentation of the {@link Renderer} class for more
- * information about its options and capabilities.</p>
- *
  * @see #get(Named)
  * @see Named
  * @see Model
  * @see Connector
  * @see Adaptation
- * @see Renderer
  */
 @AnyThread
 @SuppressWarnings("StaticInitializerReferencesSubClass")
@@ -1417,6 +1389,8 @@
      * @return A new non-null {@link Renderer} instance
      *
      * @see Renderer
+     *
+     * @hide
      */
     @NonNull
     public static Renderer createRenderer() {
@@ -3712,6 +3686,8 @@
      * See {@link #add(ColorSpace, float, float, float, int)} for more information.</p>
      *
      * @see ColorSpace#createRenderer()
+     *
+     * @hide
      */
     public static class Renderer {
         private static final int NATIVE_SIZE = 1440;
@@ -4054,7 +4030,7 @@
          */
         @NonNull
         @Size(6)
-        private static float[] getPrimaries(@NonNull Rgb rgb,
+        private static void getPrimaries(@NonNull Rgb rgb,
                 @NonNull @Size(6) float[] primaries, boolean asUcs) {
             // TODO: We should find a better way to handle these cases
             if (rgb.equals(ColorSpace.get(Named.EXTENDED_SRGB)) ||
@@ -4069,7 +4045,6 @@
                 rgb.getPrimaries(primaries);
             }
             if (asUcs) xyYToUv(primaries);
-            return primaries;
         }
 
         /**