Revert "Move text logic from jni to hwui level"

This reverts commit a7f6bba1a3565c19715e878dfe7f0e01022944ff.

Change-Id: If4f36f87a85411b6128fd92d391313803ccaf9dd
diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk
index 26b4c4e..ca07738 100644
--- a/libs/hwui/Android.mk
+++ b/libs/hwui/Android.mk
@@ -12,11 +12,6 @@
 hwui_src_files := \
     font/CacheTexture.cpp \
     font/Font.cpp \
-    hwui/Canvas.cpp \
-    hwui/MinikinSkia.cpp \
-    hwui/MinikinUtils.cpp \
-    hwui/PaintImpl.cpp \
-    hwui/TypefaceImpl.cpp \
     renderstate/Blend.cpp \
     renderstate/MeshState.cpp \
     renderstate/OffscreenBufferPool.cpp \
@@ -46,6 +41,7 @@
     AnimatorManager.cpp \
     AssetAtlas.cpp \
     Caches.cpp \
+    Canvas.cpp \
     CanvasState.cpp \
     ClipArea.cpp \
     DamageAccumulator.cpp \
@@ -147,9 +143,7 @@
 
 hwui_c_includes += \
     external/skia/include/private \
-    external/skia/src/core \
-    external/harfbuzz_ng/src \
-    external/freetype/include
+    external/skia/src/core
 
 ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
     hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
diff --git a/libs/hwui/Canvas.cpp b/libs/hwui/Canvas.cpp
new file mode 100644
index 0000000..11ae1a1
--- /dev/null
+++ b/libs/hwui/Canvas.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Canvas.h"
+
+#include "DisplayListCanvas.h"
+#include "RecordingCanvas.h"
+#include <SkDrawFilter.h>
+
+namespace android {
+
+Canvas* Canvas::create_recording_canvas(int width, int height) {
+#if HWUI_NEW_OPS
+    return new uirenderer::RecordingCanvas(width, height);
+#else
+    return new uirenderer::DisplayListCanvas(width, height);
+#endif
+}
+
+void Canvas::drawTextDecorations(float x, float y, float length, const SkPaint& paint) {
+    uint32_t flags;
+    SkDrawFilter* drawFilter = getDrawFilter();
+    if (drawFilter) {
+        SkPaint paintCopy(paint);
+        drawFilter->filter(&paintCopy, SkDrawFilter::kText_Type);
+        flags = paintCopy.getFlags();
+    } else {
+        flags = paint.getFlags();
+    }
+    if (flags & (SkPaint::kUnderlineText_Flag | SkPaint::kStrikeThruText_Flag)) {
+        // Same values used by Skia
+        const float kStdStrikeThru_Offset   = (-6.0f / 21.0f);
+        const float kStdUnderline_Offset    = (1.0f / 9.0f);
+        const float kStdUnderline_Thickness = (1.0f / 18.0f);
+
+        SkScalar left = x;
+        SkScalar right = x + length;
+        float textSize = paint.getTextSize();
+        float strokeWidth = fmax(textSize * kStdUnderline_Thickness, 1.0f);
+        if (flags & SkPaint::kUnderlineText_Flag) {
+            SkScalar top = y + textSize * kStdUnderline_Offset - 0.5f * strokeWidth;
+            SkScalar bottom = y + textSize * kStdUnderline_Offset + 0.5f * strokeWidth;
+            drawRect(left, top, right, bottom, paint);
+        }
+        if (flags & SkPaint::kStrikeThruText_Flag) {
+            SkScalar top = y + textSize * kStdStrikeThru_Offset - 0.5f * strokeWidth;
+            SkScalar bottom = y + textSize * kStdStrikeThru_Offset + 0.5f * strokeWidth;
+            drawRect(left, top, right, bottom, paint);
+        }
+    }
+}
+
+} // namespace android
diff --git a/libs/hwui/hwui/Canvas.h b/libs/hwui/Canvas.h
similarity index 92%
rename from libs/hwui/hwui/Canvas.h
rename to libs/hwui/Canvas.h
index 5a05cf0..27facdf 100644
--- a/libs/hwui/hwui/Canvas.h
+++ b/libs/hwui/Canvas.h
@@ -59,9 +59,6 @@
 };
 typedef uirenderer::VectorDrawable::Tree VectorDrawableRoot;
 
-class Paint;
-struct TypefaceImpl;
-
 class ANDROID_API Canvas {
 public:
     virtual ~Canvas() {};
@@ -210,12 +207,12 @@
      * drawText: count is of glyphs
      * totalAdvance: used to define width of text decorations (underlines, strikethroughs).
      */
-    virtual void drawGlyphs(const uint16_t* glyphs, const float* positions, int count,
+    virtual void drawText(const uint16_t* glyphs, const float* positions, int count,
             const SkPaint& paint, float x, float y,
             float boundsLeft, float boundsTop, float boundsRight, float boundsBottom,
             float totalAdvance) = 0;
     /** drawTextOnPath: count is of glyphs */
-    virtual void drawGlyphsOnPath(const uint16_t* glyphs, int count, const SkPath& path,
+    virtual void drawTextOnPath(const uint16_t* glyphs, int count, const SkPath& path,
             float hOffset, float vOffset, const SkPaint& paint) = 0;
 
     /**
@@ -232,17 +229,6 @@
      */
     virtual void drawVectorDrawable(VectorDrawableRoot* tree);
 
-    /**
-     * Converts utf16 text to glyphs, calculating position and boundary,
-     * and delegating the final draw to virtual drawGlyphs method.
-     */
-    void drawText(const uint16_t* text, int start, int count, int contextCount,
-                 float x, float y, int bidiFlags, const Paint& origPaint, TypefaceImpl* typeface);
-
-    void drawTextOnPath(const uint16_t* text, int count, int bidiFlags,
-                               const SkPath& path, float hOffset, float vOffset,
-                               const Paint& paint, TypefaceImpl* typeface);
-
 protected:
     void drawTextDecorations(float x, float y, float length, const SkPaint& paint);
 };
diff --git a/libs/hwui/CanvasState.cpp b/libs/hwui/CanvasState.cpp
index e2149d1..43ff33f 100644
--- a/libs/hwui/CanvasState.cpp
+++ b/libs/hwui/CanvasState.cpp
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
+#include "Canvas.h"
 #include "CanvasState.h"
-#include "hwui/Canvas.h"
 #include "utils/MathUtils.h"
 
 namespace android {
diff --git a/libs/hwui/DisplayListCanvas.cpp b/libs/hwui/DisplayListCanvas.cpp
index 2dccf32..a14bdc4 100644
--- a/libs/hwui/DisplayListCanvas.cpp
+++ b/libs/hwui/DisplayListCanvas.cpp
@@ -418,7 +418,7 @@
     addDrawOp(new (alloc()) DrawVectorDrawableOp(tree));
 }
 
-void DisplayListCanvas::drawGlyphsOnPath(const uint16_t* glyphs, int count,
+void DisplayListCanvas::drawTextOnPath(const uint16_t* glyphs, int count,
         const SkPath& path, float hOffset, float vOffset, const SkPaint& paint) {
     if (!glyphs || count <= 0) return;
 
@@ -429,7 +429,7 @@
     addDrawOp(op);
 }
 
-void DisplayListCanvas::drawGlyphs(const uint16_t* glyphs, const float* positions,
+void DisplayListCanvas::drawText(const uint16_t* glyphs, const float* positions,
         int count, const SkPaint& paint, float x, float y,
         float boundsLeft, float boundsTop, float boundsRight, float boundsBottom,
         float totalAdvance) {
diff --git a/libs/hwui/DisplayListCanvas.h b/libs/hwui/DisplayListCanvas.h
index d6a5794..a703e22 100644
--- a/libs/hwui/DisplayListCanvas.h
+++ b/libs/hwui/DisplayListCanvas.h
@@ -17,12 +17,12 @@
 #ifndef ANDROID_HWUI_DISPLAY_LIST_RENDERER_H
 #define ANDROID_HWUI_DISPLAY_LIST_RENDERER_H
 
+#include "Canvas.h"
 #include "CanvasState.h"
 #include "DisplayList.h"
 #include "RenderNode.h"
 #include "ResourceCache.h"
 #include "SkiaCanvasProxy.h"
-#include "hwui/Canvas.h"
 #include "utils/Macros.h"
 
 #include <SkDrawFilter.h>
@@ -209,10 +209,10 @@
     virtual void drawVectorDrawable(VectorDrawableRoot* tree) override;
 
     // Text
-    virtual void drawGlyphs(const uint16_t* glyphs, const float* positions, int count,
+    virtual void drawText(const uint16_t* glyphs, const float* positions, int count,
             const SkPaint& paint, float x, float y, float boundsLeft, float boundsTop,
             float boundsRight, float boundsBottom, float totalAdvance) override;
-    virtual void drawGlyphsOnPath(const uint16_t* glyphs, int count, const SkPath& path,
+    virtual void drawTextOnPath(const uint16_t* glyphs, int count, const SkPath& path,
             float hOffset, float vOffset, const SkPaint& paint) override;
     virtual bool drawTextAbsolutePos() const override { return false; }
 
diff --git a/libs/hwui/FrameBuilder.cpp b/libs/hwui/FrameBuilder.cpp
index 51e1e40..fd5856a 100644
--- a/libs/hwui/FrameBuilder.cpp
+++ b/libs/hwui/FrameBuilder.cpp
@@ -16,11 +16,11 @@
 
 #include "FrameBuilder.h"
 
+#include "Canvas.h"
 #include "LayerUpdateQueue.h"
 #include "RenderNode.h"
 #include "VectorDrawable.h"
 #include "renderstate/OffscreenBufferPool.h"
-#include "hwui/Canvas.h"
 #include "utils/FatVector.h"
 #include "utils/PaintUtils.h"
 #include "utils/TraceUtils.h"
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index c099427..7693fdc 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -17,6 +17,7 @@
 #include <GpuMemoryTracker.h>
 #include "OpenGLRenderer.h"
 
+#include "Canvas.h"
 #include "DeferredDisplayList.h"
 #include "GammaFontRenderer.h"
 #include "Glop.h"
@@ -31,7 +32,6 @@
 #include "SkiaShader.h"
 #include "Vector.h"
 #include "VertexBuffer.h"
-#include "hwui/Canvas.h"
 #include "utils/GLUtils.h"
 #include "utils/PaintUtils.h"
 #include "utils/TraceUtils.h"
diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp
index 7865a54..11eb825 100644
--- a/libs/hwui/RecordingCanvas.cpp
+++ b/libs/hwui/RecordingCanvas.cpp
@@ -524,7 +524,7 @@
 }
 
 // Text
-void RecordingCanvas::drawGlyphs(const uint16_t* glyphs, const float* positions, int glyphCount,
+void RecordingCanvas::drawText(const uint16_t* glyphs, const float* positions, int glyphCount,
             const SkPaint& paint, float x, float y, float boundsLeft, float boundsTop,
             float boundsRight, float boundsBottom, float totalAdvance) {
     if (!glyphs || !positions || glyphCount <= 0 || PaintUtils::paintWillNotDrawText(paint)) return;
@@ -540,7 +540,7 @@
     drawTextDecorations(x, y, totalAdvance, paint);
 }
 
-void RecordingCanvas::drawGlyphsOnPath(const uint16_t* glyphs, int glyphCount, const SkPath& path,
+void RecordingCanvas::drawTextOnPath(const uint16_t* glyphs, int glyphCount, const SkPath& path,
             float hOffset, float vOffset, const SkPaint& paint) {
     if (!glyphs || glyphCount <= 0 || PaintUtils::paintWillNotDrawText(paint)) return;
     glyphs = refBuffer<glyph_t>(glyphs, glyphCount);
diff --git a/libs/hwui/RecordingCanvas.h b/libs/hwui/RecordingCanvas.h
index 1eb4fa0..719872d 100644
--- a/libs/hwui/RecordingCanvas.h
+++ b/libs/hwui/RecordingCanvas.h
@@ -17,12 +17,12 @@
 #ifndef ANDROID_HWUI_RECORDING_CANVAS_H
 #define ANDROID_HWUI_RECORDING_CANVAS_H
 
+#include "Canvas.h"
 #include "CanvasState.h"
 #include "DisplayList.h"
 #include "ResourceCache.h"
 #include "SkiaCanvasProxy.h"
 #include "Snapshot.h"
-#include "hwui/Canvas.h"
 #include "utils/LinearAllocator.h"
 #include "utils/Macros.h"
 #include "utils/NinePatch.h"
@@ -191,10 +191,10 @@
             const SkPaint* paint) override;
 
     // Text
-    virtual void drawGlyphs(const uint16_t* glyphs, const float* positions, int glyphCount,
+    virtual void drawText(const uint16_t* glyphs, const float* positions, int glyphCount,
             const SkPaint& paint, float x, float y, float boundsLeft, float boundsTop,
             float boundsRight, float boundsBottom, float totalAdvance) override;
-    virtual void drawGlyphsOnPath(const uint16_t* glyphs, int glyphCount, const SkPath& path,
+    virtual void drawTextOnPath(const uint16_t* glyphs, int glyphCount, const SkPath& path,
             float hOffset, float vOffset, const SkPaint& paint) override;
     virtual bool drawTextAbsolutePos() const override { return false; }
 
diff --git a/libs/hwui/RenderProperties.cpp b/libs/hwui/RenderProperties.cpp
index f577785..0b0f0fa 100644
--- a/libs/hwui/RenderProperties.cpp
+++ b/libs/hwui/RenderProperties.cpp
@@ -23,9 +23,9 @@
 #include <SkPath.h>
 #include <SkPathOps.h>
 
+#include "Canvas.h"
 #include "Matrix.h"
 #include "OpenGLRenderer.h"
-#include "hwui/Canvas.h"
 #include "utils/MathUtils.h"
 
 namespace android {
diff --git a/libs/hwui/SkiaCanvas.cpp b/libs/hwui/SkiaCanvas.cpp
index b1ecb71..bd4442d 100644
--- a/libs/hwui/SkiaCanvas.cpp
+++ b/libs/hwui/SkiaCanvas.cpp
@@ -14,10 +14,10 @@
  * limitations under the License.
  */
 
+#include "Canvas.h"
 #include "CanvasProperty.h"
 #include "Layer.h"
 #include "RenderNode.h"
-#include "hwui/Canvas.h"
 
 #include <SkCanvas.h>
 #include <SkClipStack.h>
@@ -147,11 +147,11 @@
             float dstLeft, float dstTop, float dstRight, float dstBottom,
             const SkPaint* paint) override;
 
-    virtual void drawGlyphs(const uint16_t* text, const float* positions, int count,
+    virtual void drawText(const uint16_t* text, const float* positions, int count,
             const SkPaint& paint, float x, float y,
             float boundsLeft, float boundsTop, float boundsRight, float boundsBottom,
             float totalAdvance) override;
-    virtual void drawGlyphsOnPath(const uint16_t* glyphs, int count, const SkPath& path,
+    virtual void drawTextOnPath(const uint16_t* glyphs, int count, const SkPath& path,
             float hOffset, float vOffset, const SkPaint& paint) override;
 
     virtual bool drawTextAbsolutePos() const  override { return true; }
@@ -757,7 +757,7 @@
 // Canvas draw operations: Text
 // ----------------------------------------------------------------------------
 
-void SkiaCanvas::drawGlyphs(const uint16_t* text, const float* positions, int count,
+void SkiaCanvas::drawText(const uint16_t* text, const float* positions, int count,
         const SkPaint& paint, float x, float y,
         float boundsLeft, float boundsTop, float boundsRight, float boundsBottom,
         float totalAdvance) {
@@ -772,7 +772,7 @@
     drawTextDecorations(x, y, totalAdvance, paint);
 }
 
-void SkiaCanvas::drawGlyphsOnPath(const uint16_t* glyphs, int count, const SkPath& path,
+void SkiaCanvas::drawTextOnPath(const uint16_t* glyphs, int count, const SkPath& path,
         float hOffset, float vOffset, const SkPaint& paint) {
     mCanvas->drawTextOnPathHV(glyphs, count << 1, path, hOffset, vOffset, paint);
 }
diff --git a/libs/hwui/SkiaCanvasProxy.cpp b/libs/hwui/SkiaCanvasProxy.cpp
index c612480..6530d4ed8 100644
--- a/libs/hwui/SkiaCanvasProxy.cpp
+++ b/libs/hwui/SkiaCanvasProxy.cpp
@@ -290,7 +290,7 @@
     }
 
     static_assert(sizeof(SkPoint) == sizeof(float)*2, "SkPoint is no longer two floats");
-    mCanvas->drawGlyphs(glyphs.glyphIDs, &pointStorage[0].fX, glyphs.count, glyphs.paint,
+    mCanvas->drawText(glyphs.glyphIDs, &pointStorage[0].fX, glyphs.count, glyphs.paint,
                       x, y, bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom, 0);
 }
 
@@ -326,7 +326,7 @@
     bounds.offset(x, y);
 
     static_assert(sizeof(SkPoint) == sizeof(float)*2, "SkPoint is no longer two floats");
-    mCanvas->drawGlyphs(glyphs.glyphIDs, &posArray[0].fX, glyphs.count, glyphs.paint, x, y,
+    mCanvas->drawText(glyphs.glyphIDs, &posArray[0].fX, glyphs.count, glyphs.paint, x, y,
                       bounds.fLeft, bounds.fTop, bounds.fRight, bounds.fBottom, 0);
 }
 
@@ -344,7 +344,7 @@
         const SkMatrix* matrix, const SkPaint& origPaint) {
     // convert to glyphIDs if necessary
     GlyphIDConverter glyphs(text, byteLength, origPaint);
-    mCanvas->drawGlyphsOnPath(glyphs.glyphIDs, glyphs.count, path, 0, 0, glyphs.paint);
+    mCanvas->drawTextOnPath(glyphs.glyphIDs, glyphs.count, path, 0, 0, glyphs.paint);
 }
 
 void SkiaCanvasProxy::onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
diff --git a/libs/hwui/SkiaCanvasProxy.h b/libs/hwui/SkiaCanvasProxy.h
index 973c55f..e342d19 100644
--- a/libs/hwui/SkiaCanvasProxy.h
+++ b/libs/hwui/SkiaCanvasProxy.h
@@ -20,7 +20,7 @@
 #include <cutils/compiler.h>
 #include <SkCanvas.h>
 
-#include "hwui/Canvas.h"
+#include "Canvas.h"
 
 namespace android {
 namespace uirenderer {
diff --git a/libs/hwui/Snapshot.cpp b/libs/hwui/Snapshot.cpp
index d784280..cf5e69a 100644
--- a/libs/hwui/Snapshot.cpp
+++ b/libs/hwui/Snapshot.cpp
@@ -16,7 +16,7 @@
 
 #include "Snapshot.h"
 
-#include "hwui/Canvas.h"
+#include "Canvas.h"
 
 namespace android {
 namespace uirenderer {
diff --git a/libs/hwui/VectorDrawable.h b/libs/hwui/VectorDrawable.h
index 7a45bf5..4d2fed0 100644
--- a/libs/hwui/VectorDrawable.h
+++ b/libs/hwui/VectorDrawable.h
@@ -17,7 +17,7 @@
 #ifndef ANDROID_HWUI_VPATH_H
 #define ANDROID_HWUI_VPATH_H
 
-#include "hwui/Canvas.h"
+#include "Canvas.h"
 
 #include <SkBitmap.h>
 #include <SkColor.h>
diff --git a/libs/hwui/hwui/Canvas.cpp b/libs/hwui/hwui/Canvas.cpp
deleted file mode 100644
index 04e3af6..0000000
--- a/libs/hwui/hwui/Canvas.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Canvas.h"
-
-#include "DisplayListCanvas.h"
-#include "RecordingCanvas.h"
-#include "MinikinUtils.h"
-#include "Paint.h"
-#include "TypefaceImpl.h"
-
-#include <SkDrawFilter.h>
-
-namespace android {
-
-Canvas* Canvas::create_recording_canvas(int width, int height) {
-#if HWUI_NEW_OPS
-    return new uirenderer::RecordingCanvas(width, height);
-#else
-    return new uirenderer::DisplayListCanvas(width, height);
-#endif
-}
-
-void Canvas::drawTextDecorations(float x, float y, float length, const SkPaint& paint) {
-    uint32_t flags;
-    SkDrawFilter* drawFilter = getDrawFilter();
-    if (drawFilter) {
-        SkPaint paintCopy(paint);
-        drawFilter->filter(&paintCopy, SkDrawFilter::kText_Type);
-        flags = paintCopy.getFlags();
-    } else {
-        flags = paint.getFlags();
-    }
-    if (flags & (SkPaint::kUnderlineText_Flag | SkPaint::kStrikeThruText_Flag)) {
-        // Same values used by Skia
-        const float kStdStrikeThru_Offset   = (-6.0f / 21.0f);
-        const float kStdUnderline_Offset    = (1.0f / 9.0f);
-        const float kStdUnderline_Thickness = (1.0f / 18.0f);
-
-        SkScalar left = x;
-        SkScalar right = x + length;
-        float textSize = paint.getTextSize();
-        float strokeWidth = fmax(textSize * kStdUnderline_Thickness, 1.0f);
-        if (flags & SkPaint::kUnderlineText_Flag) {
-            SkScalar top = y + textSize * kStdUnderline_Offset - 0.5f * strokeWidth;
-            SkScalar bottom = y + textSize * kStdUnderline_Offset + 0.5f * strokeWidth;
-            drawRect(left, top, right, bottom, paint);
-        }
-        if (flags & SkPaint::kStrikeThruText_Flag) {
-            SkScalar top = y + textSize * kStdStrikeThru_Offset - 0.5f * strokeWidth;
-            SkScalar bottom = y + textSize * kStdStrikeThru_Offset + 0.5f * strokeWidth;
-            drawRect(left, top, right, bottom, paint);
-        }
-    }
-}
-
-static void simplifyPaint(int color, SkPaint* paint) {
-    paint->setColor(color);
-    paint->setShader(nullptr);
-    paint->setColorFilter(nullptr);
-    paint->setLooper(nullptr);
-    paint->setStrokeWidth(4 + 0.04 * paint->getTextSize());
-    paint->setStrokeJoin(SkPaint::kRound_Join);
-    paint->setLooper(nullptr);
-}
-
-class DrawTextFunctor {
-public:
-    DrawTextFunctor(const Layout& layout, Canvas* canvas, uint16_t* glyphs, float* pos,
-            const SkPaint& paint, float x, float y, MinikinRect& bounds, float totalAdvance)
-        : layout(layout)
-        , canvas(canvas)
-        , glyphs(glyphs)
-        , pos(pos)
-        , paint(paint)
-        , x(x)
-        , y(y)
-        , bounds(bounds)
-        , totalAdvance(totalAdvance) {
-    }
-
-    void operator()(size_t start, size_t end) {
-        if (canvas->drawTextAbsolutePos()) {
-            for (size_t i = start; i < end; i++) {
-                glyphs[i] = layout.getGlyphId(i);
-                pos[2 * i] = x + layout.getX(i);
-                pos[2 * i + 1] = y + layout.getY(i);
-            }
-        } else {
-            for (size_t i = start; i < end; i++) {
-                glyphs[i] = layout.getGlyphId(i);
-                pos[2 * i] = layout.getX(i);
-                pos[2 * i + 1] = layout.getY(i);
-            }
-        }
-
-        size_t glyphCount = end - start;
-
-        if (CC_UNLIKELY(canvas->isHighContrastText() && paint.getAlpha() != 0)) {
-            // high contrast draw path
-            int color = paint.getColor();
-            int channelSum = SkColorGetR(color) + SkColorGetG(color) + SkColorGetB(color);
-            bool darken = channelSum < (128 * 3);
-
-            // outline
-            SkPaint outlinePaint(paint);
-            simplifyPaint(darken ? SK_ColorWHITE : SK_ColorBLACK, &outlinePaint);
-            outlinePaint.setStyle(SkPaint::kStrokeAndFill_Style);
-            canvas->drawGlyphs(glyphs + start, pos + (2 * start), glyphCount, outlinePaint, x, y,
-                    bounds.mLeft, bounds.mTop, bounds.mRight, bounds.mBottom, totalAdvance);
-
-            // inner
-            SkPaint innerPaint(paint);
-            simplifyPaint(darken ? SK_ColorBLACK : SK_ColorWHITE, &innerPaint);
-            innerPaint.setStyle(SkPaint::kFill_Style);
-            canvas->drawGlyphs(glyphs + start, pos + (2 * start), glyphCount, innerPaint, x, y,
-                    bounds.mLeft, bounds.mTop, bounds.mRight, bounds.mBottom, totalAdvance);
-        } else {
-            // standard draw path
-            canvas->drawGlyphs(glyphs + start, pos + (2 * start), glyphCount, paint, x, y,
-                    bounds.mLeft, bounds.mTop, bounds.mRight, bounds.mBottom, totalAdvance);
-        }
-    }
-private:
-    const Layout& layout;
-    Canvas* canvas;
-    uint16_t* glyphs;
-    float* pos;
-    const SkPaint& paint;
-    float x;
-    float y;
-    MinikinRect& bounds;
-    float totalAdvance;
-};
-
-void Canvas::drawText(const uint16_t* text, int start, int count, int contextCount,
-        float x, float y, int bidiFlags, const Paint& origPaint, TypefaceImpl* typeface) {
-    // minikin may modify the original paint
-    Paint paint(origPaint);
-
-    Layout layout;
-    MinikinUtils::doLayout(&layout, &paint, bidiFlags, typeface, text, start, count, contextCount);
-
-    size_t nGlyphs = layout.nGlyphs();
-    std::unique_ptr<uint16_t[]> glyphs(new uint16_t[nGlyphs]);
-    std::unique_ptr<float[]> pos(new float[nGlyphs * 2]);
-
-    x += MinikinUtils::xOffsetForTextAlign(&paint, layout);
-
-    MinikinRect bounds;
-    layout.getBounds(&bounds);
-    if (!drawTextAbsolutePos()) {
-        bounds.offset(x, y);
-    }
-
-    DrawTextFunctor f(layout, this, glyphs.get(), pos.get(),
-            paint, x, y, bounds, layout.getAdvance());
-    MinikinUtils::forFontRun(layout, &paint, f);
-}
-
-class DrawTextOnPathFunctor {
-public:
-    DrawTextOnPathFunctor(const Layout& layout, Canvas* canvas, float hOffset,
-            float vOffset, const Paint& paint, const SkPath& path)
-        : layout(layout)
-        , canvas(canvas)
-        , hOffset(hOffset)
-        , vOffset(vOffset)
-        , paint(paint)
-        , path(path) {
-    }
-
-    void operator()(size_t start, size_t end) {
-        uint16_t glyphs[1];
-        for (size_t i = start; i < end; i++) {
-            glyphs[0] = layout.getGlyphId(i);
-            float x = hOffset + layout.getX(i);
-            float y = vOffset + layout.getY(i);
-            canvas->drawGlyphsOnPath(glyphs, 1, path, x, y, paint);
-        }
-    }
-private:
-    const Layout& layout;
-    Canvas* canvas;
-    float hOffset;
-    float vOffset;
-    const Paint& paint;
-    const SkPath& path;
-};
-
-void Canvas::drawTextOnPath(const uint16_t* text, int count, int bidiFlags, const SkPath& path,
-        float hOffset, float vOffset, const Paint& paint, TypefaceImpl* typeface) {
-    Paint paintCopy(paint);
-    Layout layout;
-    MinikinUtils::doLayout(&layout, &paintCopy, bidiFlags, typeface, text, 0, count, count);
-    hOffset += MinikinUtils::hOffsetForTextAlign(&paintCopy, layout, path);
-
-    // Set align to left for drawing, as we don't want individual
-    // glyphs centered or right-aligned; the offset above takes
-    // care of all alignment.
-    paintCopy.setTextAlign(Paint::kLeft_Align);
-
-    DrawTextOnPathFunctor f(layout, this, hOffset, vOffset, paintCopy, path);
-    MinikinUtils::forFontRun(layout, &paintCopy, f);
-}
-
-} // namespace android
diff --git a/libs/hwui/hwui/MinikinSkia.cpp b/libs/hwui/hwui/MinikinSkia.cpp
deleted file mode 100644
index b9e3358..0000000
--- a/libs/hwui/hwui/MinikinSkia.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "MinikinSkia.h"
-
-#include <SkPaint.h>
-#include <SkTypeface.h>
-#include <cutils/log.h>
-
-namespace android {
-
-MinikinFontSkia::MinikinFontSkia(SkTypeface *typeface) :
-    mTypeface(typeface) {
-}
-
-MinikinFontSkia::~MinikinFontSkia() {
-    SkSafeUnref(mTypeface);
-}
-
-static void MinikinFontSkia_SetSkiaPaint(const MinikinFont* font, SkPaint* skPaint, const MinikinPaint& paint) {
-    skPaint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-    skPaint->setTextSize(paint.size);
-    skPaint->setTextScaleX(paint.scaleX);
-    skPaint->setTextSkewX(paint.skewX);
-    MinikinFontSkia::unpackPaintFlags(skPaint, paint.paintFlags);
-    // Apply font fakery on top of user-supplied flags.
-    MinikinFontSkia::populateSkPaint(skPaint, font, paint.fakery);
-}
-
-float MinikinFontSkia::GetHorizontalAdvance(uint32_t glyph_id,
-    const MinikinPaint &paint) const {
-    SkPaint skPaint;
-    uint16_t glyph16 = glyph_id;
-    SkScalar skWidth;
-    MinikinFontSkia_SetSkiaPaint(this, &skPaint, paint);
-    skPaint.getTextWidths(&glyph16, sizeof(glyph16), &skWidth, NULL);
-#ifdef VERBOSE
-    ALOGD("width for typeface %d glyph %d = %f", mTypeface->uniqueID(), glyph_id, skWidth);
-#endif
-    return skWidth;
-}
-
-void MinikinFontSkia::GetBounds(MinikinRect* bounds, uint32_t glyph_id,
-    const MinikinPaint& paint) const {
-    SkPaint skPaint;
-    uint16_t glyph16 = glyph_id;
-    SkRect skBounds;
-    MinikinFontSkia_SetSkiaPaint(this, &skPaint, paint);
-    skPaint.getTextWidths(&glyph16, sizeof(glyph16), NULL, &skBounds);
-    bounds->mLeft = skBounds.fLeft;
-    bounds->mTop = skBounds.fTop;
-    bounds->mRight = skBounds.fRight;
-    bounds->mBottom = skBounds.fBottom;
-}
-
-bool MinikinFontSkia::GetTable(uint32_t tag, uint8_t *buf, size_t *size) {
-    if (buf == NULL) {
-        const size_t tableSize = mTypeface->getTableSize(tag);
-        *size = tableSize;
-        return tableSize != 0;
-    } else {
-        const size_t actualSize = mTypeface->getTableData(tag, 0, *size, buf);
-        *size = actualSize;
-        return actualSize != 0;
-    }
-}
-
-SkTypeface *MinikinFontSkia::GetSkTypeface() const {
-    return mTypeface;
-}
-
-int32_t MinikinFontSkia::GetUniqueId() const {
-    return mTypeface->uniqueID();
-}
-
-uint32_t MinikinFontSkia::packPaintFlags(const SkPaint* paint) {
-    uint32_t flags = paint->getFlags();
-    SkPaint::Hinting hinting = paint->getHinting();
-    // select only flags that might affect text layout
-    flags &= (SkPaint::kAntiAlias_Flag | SkPaint::kFakeBoldText_Flag | SkPaint::kLinearText_Flag |
-            SkPaint::kSubpixelText_Flag | SkPaint::kDevKernText_Flag |
-            SkPaint::kEmbeddedBitmapText_Flag | SkPaint::kAutoHinting_Flag |
-            SkPaint::kVerticalText_Flag);
-    flags |= (hinting << 16);
-    return flags;
-}
-
-void MinikinFontSkia::unpackPaintFlags(SkPaint* paint, uint32_t paintFlags) {
-    paint->setFlags(paintFlags & SkPaint::kAllFlags);
-    paint->setHinting(static_cast<SkPaint::Hinting>(paintFlags >> 16));
-}
-
-void MinikinFontSkia::populateSkPaint(SkPaint* paint, const MinikinFont* font, FontFakery fakery) {
-    paint->setTypeface(reinterpret_cast<const MinikinFontSkia*>(font)->GetSkTypeface());
-    paint->setFakeBoldText(paint->isFakeBoldText() || fakery.isFakeBold());
-    if (fakery.isFakeItalic()) {
-        paint->setTextSkewX(paint->getTextSkewX() - 0.25f);
-    }
-}
-
-}
diff --git a/libs/hwui/hwui/MinikinSkia.h b/libs/hwui/hwui/MinikinSkia.h
deleted file mode 100644
index 1d50168..0000000
--- a/libs/hwui/hwui/MinikinSkia.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _ANDROID_GRAPHICS_MINIKIN_SKIA_H_
-#define _ANDROID_GRAPHICS_MINIKIN_SKIA_H_
-
-#include <cutils/compiler.h>
-#include <minikin/MinikinFont.h>
-
-class SkPaint;
-class SkTypeface;
-
-namespace android {
-
-class ANDROID_API MinikinFontSkia : public MinikinFont {
-public:
-    // Note: this takes ownership of the reference (will unref on dtor)
-    explicit MinikinFontSkia(SkTypeface *typeface);
-
-    ~MinikinFontSkia();
-
-    float GetHorizontalAdvance(uint32_t glyph_id,
-        const MinikinPaint &paint) const;
-
-    void GetBounds(MinikinRect* bounds, uint32_t glyph_id,
-        const MinikinPaint &paint) const;
-
-    // If buf is NULL, just update size
-    bool GetTable(uint32_t tag, uint8_t *buf, size_t *size);
-
-    int32_t GetUniqueId() const;
-
-    SkTypeface* GetSkTypeface() const;
-
-    static uint32_t packPaintFlags(const SkPaint* paint);
-    static void unpackPaintFlags(SkPaint* paint, uint32_t paintFlags);
-
-    // set typeface and fake bold/italic parameters
-    static void populateSkPaint(SkPaint* paint, const MinikinFont* font, FontFakery fakery);
-private:
-    SkTypeface *mTypeface;
-};
-
-}  // namespace android
-
-#endif  // _ANDROID_GRAPHICS_MINIKIN_SKIA_H_
diff --git a/libs/hwui/hwui/MinikinUtils.cpp b/libs/hwui/hwui/MinikinUtils.cpp
deleted file mode 100644
index f4feee2..0000000
--- a/libs/hwui/hwui/MinikinUtils.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "MinikinUtils.h"
-
-#include "Paint.h"
-#include "SkPathMeasure.h"
-#include "TypefaceImpl.h"
-
-#include <cutils/log.h>
-#include <string>
-
-namespace android {
-
-FontStyle MinikinUtils::prepareMinikinPaint(MinikinPaint* minikinPaint, FontCollection** pFont,
-        const Paint* paint, TypefaceImpl* typeface) {
-    const TypefaceImpl* resolvedFace = TypefaceImpl_resolveDefault(typeface);
-    *pFont = resolvedFace->fFontCollection;
-    FontStyle resolved = resolvedFace->fStyle;
-
-    /* Prepare minikin FontStyle */
-    FontVariant minikinVariant = (paint->getFontVariant() == VARIANT_ELEGANT) ? VARIANT_ELEGANT
-            : VARIANT_COMPACT;
-    const uint32_t langListId = paint->getMinikinLangListId();
-    FontStyle minikinStyle(langListId, minikinVariant, resolved.getWeight(), resolved.getItalic());
-
-    /* Prepare minikin Paint */
-    // Note: it would be nice to handle fractional size values (it would improve smooth zoom
-    // behavior), but historically size has been treated as an int.
-    // TODO: explore whether to enable fractional sizes, possibly when linear text flag is set.
-    minikinPaint->size = (int)paint->getTextSize();
-    minikinPaint->scaleX = paint->getTextScaleX();
-    minikinPaint->skewX = paint->getTextSkewX();
-    minikinPaint->letterSpacing = paint->getLetterSpacing();
-    minikinPaint->paintFlags = MinikinFontSkia::packPaintFlags(paint);
-    minikinPaint->fontFeatureSettings = paint->getFontFeatureSettings();
-    minikinPaint->hyphenEdit = HyphenEdit(paint->getHyphenEdit());
-    return minikinStyle;
-}
-
-void MinikinUtils::doLayout(Layout* layout, const Paint* paint, int bidiFlags,
-        TypefaceImpl* typeface, const uint16_t* buf, size_t start, size_t count,
-        size_t bufSize) {
-    FontCollection *font;
-    MinikinPaint minikinPaint;
-    FontStyle minikinStyle = prepareMinikinPaint(&minikinPaint, &font, paint, typeface);
-    layout->setFontCollection(font);
-    layout->doLayout(buf, start, count, bufSize, bidiFlags, minikinStyle, minikinPaint);
-}
-
-float MinikinUtils::measureText(const Paint* paint, int bidiFlags, TypefaceImpl* typeface,
-        const uint16_t* buf, size_t start, size_t count, size_t bufSize, float *advances) {
-    FontCollection *font;
-    MinikinPaint minikinPaint;
-    FontStyle minikinStyle = prepareMinikinPaint(&minikinPaint, &font, paint, typeface);
-    return Layout::measureText(buf, start, count, bufSize, bidiFlags, minikinStyle, minikinPaint,
-            font, advances);
-}
-
-bool MinikinUtils::hasVariationSelector(TypefaceImpl* typeface, uint32_t codepoint, uint32_t vs) {
-    const TypefaceImpl* resolvedFace = TypefaceImpl_resolveDefault(typeface);
-    return resolvedFace->fFontCollection->hasVariationSelector(codepoint, vs);
-}
-
-float MinikinUtils::xOffsetForTextAlign(Paint* paint, const Layout& layout) {
-    switch (paint->getTextAlign()) {
-        case Paint::kCenter_Align:
-            return layout.getAdvance() * -0.5f;
-            break;
-        case Paint::kRight_Align:
-            return -layout.getAdvance();
-            break;
-        default:
-            break;
-    }
-    return 0;
-}
-
-float MinikinUtils::hOffsetForTextAlign(Paint* paint, const Layout& layout, const SkPath& path) {
-    float align = 0;
-    switch (paint->getTextAlign()) {
-        case Paint::kCenter_Align:
-            align = -0.5f;
-            break;
-        case Paint::kRight_Align:
-            align = -1;
-            break;
-        default:
-            return 0;
-    }
-    SkPathMeasure measure(path, false);
-    return align * (layout.getAdvance() - measure.getLength());
-}
-
-}
diff --git a/libs/hwui/hwui/MinikinUtils.h b/libs/hwui/hwui/MinikinUtils.h
deleted file mode 100644
index 4a49581..0000000
--- a/libs/hwui/hwui/MinikinUtils.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * Utilities for making Minikin work, especially from existing objects like
- * Paint and so on.
- **/
-
- // TODO: does this really need to be separate from MinikinSkia?
-
-#ifndef _ANDROID_GRAPHICS_MINIKIN_UTILS_H_
-#define _ANDROID_GRAPHICS_MINIKIN_UTILS_H_
-
-#include <cutils/compiler.h>
-#include <minikin/Layout.h>
-#include "Paint.h"
-#include "MinikinSkia.h"
-#include "TypefaceImpl.h"
-
-namespace android {
-
-class MinikinUtils {
-public:
-    ANDROID_API static FontStyle prepareMinikinPaint(MinikinPaint* minikinPaint, FontCollection** pFont,
-            const Paint* paint, TypefaceImpl* typeface);
-
-    ANDROID_API static void doLayout(Layout* layout, const Paint* paint, int bidiFlags,
-            TypefaceImpl* typeface, const uint16_t* buf, size_t start, size_t count,
-            size_t bufSize);
-
-    ANDROID_API static float measureText(const Paint* paint, int bidiFlags, TypefaceImpl* typeface,
-            const uint16_t* buf, size_t start, size_t count, size_t bufSize, float *advances);
-
-    ANDROID_API static bool hasVariationSelector(TypefaceImpl* typeface, uint32_t codepoint, uint32_t vs);
-
-    ANDROID_API static float xOffsetForTextAlign(Paint* paint, const Layout& layout);
-
-    ANDROID_API static float hOffsetForTextAlign(Paint* paint, const Layout& layout, const SkPath& path);
-    // f is a functor of type void f(size_t start, size_t end);
-    template <typename F>
-    ANDROID_API static void forFontRun(const Layout& layout, Paint* paint, F& f) {
-        float saveSkewX = paint->getTextSkewX();
-        bool savefakeBold = paint->isFakeBoldText();
-        MinikinFont* curFont = NULL;
-        size_t start = 0;
-        size_t nGlyphs = layout.nGlyphs();
-        for (size_t i = 0; i < nGlyphs; i++) {
-            MinikinFont* nextFont = layout.getFont(i);
-            if (i > 0 && nextFont != curFont) {
-                MinikinFontSkia::populateSkPaint(paint, curFont, layout.getFakery(start));
-                f(start, i);
-                paint->setTextSkewX(saveSkewX);
-                paint->setFakeBoldText(savefakeBold);
-                start = i;
-            }
-            curFont = nextFont;
-        }
-        if (nGlyphs > start) {
-            MinikinFontSkia::populateSkPaint(paint, curFont, layout.getFakery(start));
-            f(start, nGlyphs);
-            paint->setTextSkewX(saveSkewX);
-            paint->setFakeBoldText(savefakeBold);
-        }
-    }
-};
-
-}  // namespace android
-
-#endif  // _ANDROID_GRAPHICS_MINIKIN_UTILS_H_
diff --git a/libs/hwui/hwui/Paint.h b/libs/hwui/hwui/Paint.h
deleted file mode 100644
index 69c321c..0000000
--- a/libs/hwui/hwui/Paint.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef ANDROID_GRAPHICS_PAINT_H_
-#define ANDROID_GRAPHICS_PAINT_H_
-
-#include <cutils/compiler.h>
-
-#include <SkPaint.h>
-#include <string>
-
-#include <minikin/FontFamily.h>
-
-namespace android {
-
-class ANDROID_API Paint : public SkPaint {
-public:
-    Paint();
-    Paint(const Paint& paint);
-    ~Paint();
-
-    Paint& operator=(const Paint& other);
-
-    friend bool operator==(const Paint& a, const Paint& b);
-    friend bool operator!=(const Paint& a, const Paint& b) {
-        return !(a == b);
-    }
-
-    void setLetterSpacing(float letterSpacing) {
-        mLetterSpacing = letterSpacing;
-    }
-
-    float getLetterSpacing() const {
-        return mLetterSpacing;
-    }
-
-    void setFontFeatureSettings(const std::string& fontFeatureSettings) {
-        mFontFeatureSettings = fontFeatureSettings;
-    }
-
-    std::string getFontFeatureSettings() const {
-        return mFontFeatureSettings;
-    }
-
-    void setMinikinLangListId(uint32_t minikinLangListId) {
-        mMinikinLangListId = minikinLangListId;
-    }
-
-    uint32_t getMinikinLangListId() const {
-        return mMinikinLangListId;
-    }
-
-    void setFontVariant(FontVariant variant) {
-        mFontVariant = variant;
-    }
-
-    FontVariant getFontVariant() const {
-        return mFontVariant;
-    }
-
-    void setHyphenEdit(uint32_t hyphen) {
-        mHyphenEdit = hyphen;
-    }
-
-    uint32_t getHyphenEdit() const {
-        return mHyphenEdit;
-    }
-
-private:
-    float mLetterSpacing = 0;
-    std::string mFontFeatureSettings;
-    uint32_t mMinikinLangListId;
-    FontVariant mFontVariant;
-    uint32_t mHyphenEdit = 0;
-};
-
-}  // namespace android
-
-#endif // ANDROID_GRAPHICS_PAINT_H_
diff --git a/libs/hwui/hwui/PaintImpl.cpp b/libs/hwui/hwui/PaintImpl.cpp
deleted file mode 100644
index 1172a0e..0000000
--- a/libs/hwui/hwui/PaintImpl.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Paint.h"
-
-namespace android {
-
-Paint::Paint() :
-        SkPaint(), mLetterSpacing(0), mFontFeatureSettings(), mMinikinLangListId(0),
-        mFontVariant(VARIANT_DEFAULT) {
-}
-
-Paint::Paint(const Paint& paint) : SkPaint(paint),
-        mLetterSpacing(paint.mLetterSpacing), mFontFeatureSettings(paint.mFontFeatureSettings),
-        mMinikinLangListId(paint.mMinikinLangListId), mFontVariant(paint.mFontVariant),
-        mHyphenEdit(paint.mHyphenEdit) {
-}
-
-Paint::~Paint() {
-}
-
-Paint& Paint::operator=(const Paint& other) {
-    SkPaint::operator=(other);
-    mLetterSpacing = other.mLetterSpacing;
-    mFontFeatureSettings = other.mFontFeatureSettings;
-    mMinikinLangListId = other.mMinikinLangListId;
-    mFontVariant = other.mFontVariant;
-    mHyphenEdit = other.mHyphenEdit;
-    return *this;
-}
-
-bool operator==(const Paint& a, const Paint& b) {
-    return static_cast<const SkPaint&>(a) == static_cast<const SkPaint&>(b)
-            && a.mLetterSpacing == b.mLetterSpacing
-            && a.mFontFeatureSettings == b.mFontFeatureSettings
-            && a.mMinikinLangListId == b.mMinikinLangListId
-            && a.mFontVariant == b.mFontVariant
-            && a.mHyphenEdit == b.mHyphenEdit;
-}
-
-}
diff --git a/libs/hwui/hwui/TypefaceImpl.cpp b/libs/hwui/hwui/TypefaceImpl.cpp
deleted file mode 100644
index f14381b..0000000
--- a/libs/hwui/hwui/TypefaceImpl.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * This is the implementation of the Typeface object. Historically, it has
- * just been SkTypeface, but we are migrating to Minikin. For the time
- * being, that choice is hidden under the USE_MINIKIN compile-time flag.
- */
-
-#include "TypefaceImpl.h"
-
-#include "MinikinSkia.h"
-#include "SkTypeface.h"
-#include "SkPaint.h"
-
-#include <minikin/FontCollection.h>
-#include <minikin/FontFamily.h>
-#include <minikin/Layout.h>
-#include <utils/Log.h>
-
-namespace android {
-
-// Resolve the 1..9 weight based on base weight and bold flag
-static void resolveStyle(TypefaceImpl* typeface) {
-    int weight = typeface->fBaseWeight / 100;
-    if (typeface->fSkiaStyle & SkTypeface::kBold) {
-        weight += 3;
-    }
-    if (weight > 9) {
-        weight = 9;
-    }
-    bool italic = (typeface->fSkiaStyle & SkTypeface::kItalic) != 0;
-    typeface->fStyle = FontStyle(weight, italic);
-}
-
-TypefaceImpl* gDefaultTypeface = NULL;
-pthread_once_t gDefaultTypefaceOnce = PTHREAD_ONCE_INIT;
-
-// This installs a default typeface (from a hardcoded path) that allows
-// layouts to work (not crash on null pointer) before the default
-// typeface is set.
-// TODO: investigate why layouts are being created before Typeface.java
-// class initialization.
-static FontCollection *makeFontCollection() {
-    std::vector<FontFamily *>typefaces;
-    const char *fns[] = {
-        "/system/fonts/Roboto-Regular.ttf",
-    };
-
-    FontFamily *family = new FontFamily();
-    for (size_t i = 0; i < sizeof(fns)/sizeof(fns[0]); i++) {
-        const char *fn = fns[i];
-        ALOGD("makeFontCollection adding %s", fn);
-        SkTypeface *skFace = SkTypeface::CreateFromFile(fn);
-        if (skFace != NULL) {
-            MinikinFont *font = new MinikinFontSkia(skFace);
-            family->addFont(font);
-            font->Unref();
-        } else {
-            ALOGE("failed to create font %s", fn);
-        }
-    }
-    typefaces.push_back(family);
-
-    FontCollection *result = new FontCollection(typefaces);
-    family->Unref();
-    return result;
-}
-
-static void getDefaultTypefaceOnce() {
-    Layout::init();
-    if (gDefaultTypeface == NULL) {
-        // We expect the client to set a default typeface, but provide a
-        // default so we can make progress before that happens.
-        gDefaultTypeface = new TypefaceImpl;
-        gDefaultTypeface->fFontCollection = makeFontCollection();
-        gDefaultTypeface->fSkiaStyle = SkTypeface::kNormal;
-        gDefaultTypeface->fBaseWeight = 400;
-        resolveStyle(gDefaultTypeface);
-    }
-}
-
-TypefaceImpl* TypefaceImpl_resolveDefault(TypefaceImpl* src) {
-    if (src == NULL) {
-        pthread_once(&gDefaultTypefaceOnce, getDefaultTypefaceOnce);
-        return gDefaultTypeface;
-    } else {
-        return src;
-    }
-}
-
-TypefaceImpl* TypefaceImpl_createFromTypeface(TypefaceImpl* src, SkTypeface::Style style) {
-    TypefaceImpl* resolvedFace = TypefaceImpl_resolveDefault(src);
-    TypefaceImpl* result = new TypefaceImpl;
-    if (result != 0) {
-        result->fFontCollection = resolvedFace->fFontCollection;
-        result->fFontCollection->Ref();
-        result->fSkiaStyle = style;
-        result->fBaseWeight = resolvedFace->fBaseWeight;
-        resolveStyle(result);
-    }
-    return result;
-}
-
-TypefaceImpl* TypefaceImpl_createWeightAlias(TypefaceImpl* src, int weight) {
-    TypefaceImpl* resolvedFace = TypefaceImpl_resolveDefault(src);
-    TypefaceImpl* result = new TypefaceImpl;
-    if (result != 0) {
-        result->fFontCollection = resolvedFace->fFontCollection;
-        result->fFontCollection->Ref();
-        result->fSkiaStyle = resolvedFace->fSkiaStyle;
-        result->fBaseWeight = weight;
-        resolveStyle(result);
-    }
-    return result;
-}
-
-TypefaceImpl* TypefaceImpl_createFromFamilies(const std::vector<FontFamily*>& families) {
-    TypefaceImpl* result = new TypefaceImpl;
-    result->fFontCollection = new FontCollection(families);
-    if (families.empty()) {
-        ALOGW("createFromFamilies creating empty collection");
-        result->fSkiaStyle = SkTypeface::kNormal;
-    } else {
-        const FontStyle defaultStyle;
-        FontFamily* firstFamily = reinterpret_cast<FontFamily*>(families[0]);
-        MinikinFont* mf = firstFamily->getClosestMatch(defaultStyle).font;
-        if (mf != NULL) {
-            SkTypeface* skTypeface = reinterpret_cast<MinikinFontSkia*>(mf)->GetSkTypeface();
-            // TODO: probably better to query more precise style from family, will be important
-            // when we open up API to access 100..900 weights
-            result->fSkiaStyle = skTypeface->style();
-        } else {
-            result->fSkiaStyle = SkTypeface::kNormal;
-        }
-    }
-    result->fBaseWeight = 400;
-    resolveStyle(result);
-    return result;
-}
-
-void TypefaceImpl_unref(TypefaceImpl* face) {
-    if (face != NULL) {
-        face->fFontCollection->Unref();
-    }
-    delete face;
-}
-
-int TypefaceImpl_getStyle(TypefaceImpl* face) {
-    return face->fSkiaStyle;
-}
-
-void TypefaceImpl_setDefault(TypefaceImpl* face) {
-    gDefaultTypeface = face;
-}
-
-}
diff --git a/libs/hwui/hwui/TypefaceImpl.h b/libs/hwui/hwui/TypefaceImpl.h
deleted file mode 100644
index 01f1e83..0000000
--- a/libs/hwui/hwui/TypefaceImpl.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2013 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef _ANDROID_GRAPHICS_TYPEFACE_IMPL_H_
-#define _ANDROID_GRAPHICS_TYPEFACE_IMPL_H_
-
-#include "SkTypeface.h"
-
-#include <cutils/compiler.h>
-#include <minikin/FontCollection.h>
-#include <vector>
-
-namespace android {
-
-struct ANDROID_API TypefaceImpl {
-    FontCollection *fFontCollection;
-
-    // style used for constructing and querying Typeface objects
-    SkTypeface::Style fSkiaStyle;
-    // base weight in CSS-style units, 100..900
-    int fBaseWeight;
-
-    // resolved style actually used for rendering
-    FontStyle fStyle;
-};
-
-// Note: it would be cleaner if the following functions were member
-// functions (static or otherwise) of the TypefaceImpl class. However,
-// that can't be easily accommodated in the case where TypefaceImpl
-// is just a pointer to SkTypeface, in the non-USE_MINIKIN case.
-// TODO: when #ifdef USE_MINIKIN is removed, move to member functions.
-
-ANDROID_API TypefaceImpl* TypefaceImpl_resolveDefault(TypefaceImpl* src);
-
-ANDROID_API TypefaceImpl* TypefaceImpl_createFromTypeface(TypefaceImpl* src, SkTypeface::Style style);
-
-ANDROID_API TypefaceImpl* TypefaceImpl_createWeightAlias(TypefaceImpl* src, int baseweight);
-
-ANDROID_API TypefaceImpl* TypefaceImpl_createFromFamilies(const std::vector<FontFamily*>& families);
-
-ANDROID_API void TypefaceImpl_unref(TypefaceImpl* face);
-
-ANDROID_API int TypefaceImpl_getStyle(TypefaceImpl* face);
-
-ANDROID_API void TypefaceImpl_setDefault(TypefaceImpl* face);
-
-}
-
-#endif  // _ANDROID_GRAPHICS_TYPEFACE_IMPL_H_
diff --git a/libs/hwui/hwui_static_deps.mk b/libs/hwui/hwui_static_deps.mk
index 47bbd66..7d4ef0f 100644
--- a/libs/hwui/hwui_static_deps.mk
+++ b/libs/hwui/hwui_static_deps.mk
@@ -21,10 +21,7 @@
     libskia \
     libui \
     libgui \
-    libprotobuf-cpp-lite \
-    libharfbuzz_ng \
-    libft2 \
-    libminikin
+    libprotobuf-cpp-lite
 
 ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
     LOCAL_SHARED_LIBRARIES += libRS libRScpp
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index e348a8c..a496b49 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -19,6 +19,7 @@
 
 #include "AnimationContext.h"
 #include "Caches.h"
+#include "Canvas.h"
 #include "DeferredLayerUpdater.h"
 #include "EglManager.h"
 #include "LayerUpdateQueue.h"
@@ -26,7 +27,6 @@
 #include "OpenGLRenderer.h"
 #include "Properties.h"
 #include "RenderThread.h"
-#include "hwui/Canvas.h"
 #include "renderstate/RenderState.h"
 #include "renderstate/Stencil.h"
 #include "protos/hwui.pb.h"
diff --git a/libs/hwui/tests/common/TestUtils.cpp b/libs/hwui/tests/common/TestUtils.cpp
index a4aee61..c809ff4 100644
--- a/libs/hwui/tests/common/TestUtils.cpp
+++ b/libs/hwui/tests/common/TestUtils.cpp
@@ -87,7 +87,7 @@
     *outTotalAdvance = totalAdvance;
 }
 
-void TestUtils::drawUtf8ToCanvas(TestCanvas* canvas, const char* text,
+void TestUtils::drawTextToCanvas(TestCanvas* canvas, const char* text,
         const SkPaint& paint, float x, float y) {
     // drawing text requires GlyphID TextEncoding (which JNI layer would have done)
     LOG_ALWAYS_FATAL_IF(paint.getTextEncoding() != SkPaint::kGlyphID_TextEncoding,
@@ -113,11 +113,11 @@
     // Force left alignment, since alignment offset is already baked in
     SkPaint alignPaintCopy(paint);
     alignPaintCopy.setTextAlign(SkPaint::kLeft_Align);
-    canvas->drawGlyphs(glyphs.data(), positions.data(), glyphs.size(), alignPaintCopy, x, y,
+    canvas->drawText(glyphs.data(), positions.data(), glyphs.size(), alignPaintCopy, x, y,
                 bounds.left, bounds.top, bounds.right, bounds.bottom, totalAdvance);
 }
 
-void TestUtils::drawUtf8ToCanvas(TestCanvas* canvas, const char* text,
+void TestUtils::drawTextToCanvas(TestCanvas* canvas, const char* text,
         const SkPaint& paint, const SkPath& path) {
     // drawing text requires GlyphID TextEncoding (which JNI layer would have done)
     LOG_ALWAYS_FATAL_IF(paint.getTextEncoding() != SkPaint::kGlyphID_TextEncoding,
@@ -130,7 +130,7 @@
         SkUnichar unichar = SkUTF8_NextUnichar(&text);
         glyphs.push_back(autoCache.getCache()->unicharToGlyph(unichar));
     }
-    canvas->drawGlyphsOnPath(glyphs.data(), glyphs.size(), path, 0, 0, paint);
+    canvas->drawTextOnPath(glyphs.data(), glyphs.size(), path, 0, 0, paint);
 }
 
 void TestUtils::TestTask::run() {
@@ -143,13 +143,5 @@
     renderState.onGLContextDestroyed();
 }
 
-std::unique_ptr<uint16_t[]> TestUtils::utf8ToUtf16(const char* str) {
-    const size_t strLen = strlen(str);
-    const ssize_t utf16Len = utf8_to_utf16_length((uint8_t*) str, strLen);
-    std::unique_ptr<uint16_t[]> dst(new uint16_t[utf16Len + 1]);
-    utf8_to_utf16((uint8_t*) str, strLen, (char16_t*) dst.get());
-    return dst;
-}
-
 } /* namespace uirenderer */
 } /* namespace android */
diff --git a/libs/hwui/tests/common/TestUtils.h b/libs/hwui/tests/common/TestUtils.h
index a5e7a5f..28ac116 100644
--- a/libs/hwui/tests/common/TestUtils.h
+++ b/libs/hwui/tests/common/TestUtils.h
@@ -207,14 +207,12 @@
             std::vector<glyph_t>* outGlyphs, std::vector<float>* outPositions,
             float* outTotalAdvance, Rect* outBounds);
 
-    static void drawUtf8ToCanvas(TestCanvas* canvas, const char* text,
+    static void drawTextToCanvas(TestCanvas* canvas, const char* text,
             const SkPaint& paint, float x, float y);
 
-    static void drawUtf8ToCanvas(TestCanvas* canvas, const char* text,
+    static void drawTextToCanvas(TestCanvas* canvas, const char* text,
             const SkPaint& paint, const SkPath& path);
 
-    static std::unique_ptr<uint16_t[]> utf8ToUtf16(const char* str);
-
 private:
     static void syncHierarchyPropertiesAndDisplayListImpl(RenderNode* node) {
         node->syncProperties();
diff --git a/libs/hwui/tests/common/scenes/ListViewAnimation.cpp b/libs/hwui/tests/common/scenes/ListViewAnimation.cpp
index ab368c05..43e247e 100644
--- a/libs/hwui/tests/common/scenes/ListViewAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/ListViewAnimation.cpp
@@ -136,9 +136,9 @@
             textPaint.setAntiAlias(true);
             char buf[256];
             snprintf(buf, sizeof(buf), "This card is #%d", cardId);
-            TestUtils::drawUtf8ToCanvas(&canvas, buf, textPaint, cardHeight, dp(25));
+            TestUtils::drawTextToCanvas(&canvas, buf, textPaint, cardHeight, dp(25));
             textPaint.setTextSize(dp(15));
-            TestUtils::drawUtf8ToCanvas(&canvas, "This is some more text on the card", textPaint,
+            TestUtils::drawTextToCanvas(&canvas, "This is some more text on the card", textPaint,
                     cardHeight, dp(45));
 
             canvas.drawBitmap(createRandomCharIcon(), dp(10), dp(10), nullptr);
diff --git a/libs/hwui/tests/common/scenes/TextAnimation.cpp b/libs/hwui/tests/common/scenes/TextAnimation.cpp
index be8f48b..1823db2 100644
--- a/libs/hwui/tests/common/scenes/TextAnimation.cpp
+++ b/libs/hwui/tests/common/scenes/TextAnimation.cpp
@@ -39,14 +39,14 @@
 
             paint.setColor(Color::Black);
             for (int i = 0; i < 10; i++) {
-                TestUtils::drawUtf8ToCanvas(&canvas, "Test string", paint, 400, i * 100);
+                TestUtils::drawTextToCanvas(&canvas, "Test string", paint, 400, i * 100);
             }
 
             SkPath path;
             path.addOval(SkRect::MakeLTRB(100, 100, 300, 300));
 
             paint.setColor(Color::Blue_500);
-            TestUtils::drawUtf8ToCanvas(&canvas, "This is a neat circle of text!", paint, path);
+            TestUtils::drawTextToCanvas(&canvas, "This is a neat circle of text!", paint, path);
         });
         canvas.drawRenderNode(card.get());
     }
diff --git a/libs/hwui/tests/unit/CanvasStateTests.cpp b/libs/hwui/tests/unit/CanvasStateTests.cpp
index 0afabd8..68d74ee 100644
--- a/libs/hwui/tests/unit/CanvasStateTests.cpp
+++ b/libs/hwui/tests/unit/CanvasStateTests.cpp
@@ -16,9 +16,9 @@
 
 #include "CanvasState.h"
 
+#include "Canvas.h"
 #include "Matrix.h"
 #include "Rect.h"
-#include "hwui/Canvas.h"
 #include "utils/LinearAllocator.h"
 
 #include <gtest/gtest.h>
diff --git a/libs/hwui/tests/unit/FrameBuilderTests.cpp b/libs/hwui/tests/unit/FrameBuilderTests.cpp
index d496f59..f147fd4 100644
--- a/libs/hwui/tests/unit/FrameBuilderTests.cpp
+++ b/libs/hwui/tests/unit/FrameBuilderTests.cpp
@@ -274,8 +274,8 @@
         paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
         paint.setAntiAlias(true);
         paint.setTextSize(50);
-        TestUtils::drawUtf8ToCanvas(&canvas, "Test string1", paint, 100, 0); // will be top clipped
-        TestUtils::drawUtf8ToCanvas(&canvas, "Test string1", paint, 100, 100); // not clipped
+        TestUtils::drawTextToCanvas(&canvas, "Test string1", paint, 100, 0); // will be top clipped
+        TestUtils::drawTextToCanvas(&canvas, "Test string1", paint, 100, 100); // not clipped
     });
     FrameBuilder frameBuilder(sEmptyLayerUpdateQueue, SkRect::MakeWH(400, 400), 400, 400,
             TestUtils::createSyncedNodeList(node), sLightGeometry, nullptr);
@@ -305,7 +305,7 @@
         textPaint.setStrikeThruText(true);
         textPaint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
         for (int i = 0; i < LOOPS; i++) {
-            TestUtils::drawUtf8ToCanvas(&canvas, "test text", textPaint, 10, 100 * (i + 1));
+            TestUtils::drawTextToCanvas(&canvas, "test text", textPaint, 10, 100 * (i + 1));
         }
     });
     FrameBuilder frameBuilder(sEmptyLayerUpdateQueue, SkRect::MakeWH(200, 2000), 200, 2000,
diff --git a/libs/hwui/tests/unit/RecordingCanvasTests.cpp b/libs/hwui/tests/unit/RecordingCanvasTests.cpp
index d38f2a4..5e613fd 100644
--- a/libs/hwui/tests/unit/RecordingCanvasTests.cpp
+++ b/libs/hwui/tests/unit/RecordingCanvasTests.cpp
@@ -18,8 +18,6 @@
 
 #include <RecordedOp.h>
 #include <RecordingCanvas.h>
-#include <hwui/Paint.h>
-#include <minikin/Layout.h>
 #include <tests/common/TestUtils.h>
 #include <utils/Color.h>
 
@@ -133,13 +131,13 @@
         << "Non-rounded rects should be converted";
 }
 
-TEST(RecordingCanvas, drawGlyphs) {
+TEST(RecordingCanvas, drawText) {
     auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
         SkPaint paint;
         paint.setAntiAlias(true);
         paint.setTextSize(20);
         paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-        TestUtils::drawUtf8ToCanvas(&canvas, "test text", paint, 25, 25);
+        TestUtils::drawTextToCanvas(&canvas, "test text", paint, 25, 25);
     });
 
     int count = 0;
@@ -154,7 +152,7 @@
     ASSERT_EQ(1, count);
 }
 
-TEST(RecordingCanvas, drawGlyphs_strikeThruAndUnderline) {
+TEST(RecordingCanvas, drawText_strikeThruAndUnderline) {
     auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
         SkPaint paint;
         paint.setAntiAlias(true);
@@ -164,7 +162,7 @@
             for (int j = 0; j < 2; j++) {
                 paint.setUnderlineText(i != 0);
                 paint.setStrikeThruText(j != 0);
-                TestUtils::drawUtf8ToCanvas(&canvas, "test text", paint, 25, 25);
+                TestUtils::drawTextToCanvas(&canvas, "test text", paint, 25, 25);
             }
         }
     });
@@ -186,18 +184,18 @@
     EXPECT_EQ(RecordedOpId::RectOp, ops[index++]->opId); // strikethrough
 }
 
-TEST(RecordingCanvas, drawGlyphs_forceAlignLeft) {
+TEST(RecordingCanvas, drawText_forceAlignLeft) {
     auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
         SkPaint paint;
         paint.setAntiAlias(true);
         paint.setTextSize(20);
         paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
         paint.setTextAlign(SkPaint::kLeft_Align);
-        TestUtils::drawUtf8ToCanvas(&canvas, "test text", paint, 25, 25);
+        TestUtils::drawTextToCanvas(&canvas, "test text", paint, 25, 25);
         paint.setTextAlign(SkPaint::kCenter_Align);
-        TestUtils::drawUtf8ToCanvas(&canvas, "test text", paint, 25, 25);
+        TestUtils::drawTextToCanvas(&canvas, "test text", paint, 25, 25);
         paint.setTextAlign(SkPaint::kRight_Align);
-        TestUtils::drawUtf8ToCanvas(&canvas, "test text", paint, 25, 25);
+        TestUtils::drawTextToCanvas(&canvas, "test text", paint, 25, 25);
     });
 
     int count = 0;
@@ -579,7 +577,7 @@
         canvas.drawRect(0, 0, 200, 10, paint);
         SkPaint paintCopy(paint);
         canvas.drawRect(0, 10, 200, 20, paintCopy);
-        TestUtils::drawUtf8ToCanvas(&canvas, "helloworld", paint, 50, 25);
+        TestUtils::drawTextToCanvas(&canvas, "helloworld", paint, 50, 25);
 
         // only here do we use different paint ptr
         paint.setColor(SK_ColorRED);
@@ -600,54 +598,5 @@
     EXPECT_NE(&paint, ops[3]->paint);
 }
 
-TEST(RecordingCanvas, drawText) {
-    auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
-        Paint paint;
-        paint.setAntiAlias(true);
-        paint.setTextSize(20);
-        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-        std::unique_ptr<uint16_t[]> dst = TestUtils::utf8ToUtf16("HELLO");
-        canvas.drawText(dst.get(), 0, 5, 5, 25, 25, kBidi_Force_LTR, paint, NULL);
-    });
-
-    int count = 0;
-    playbackOps(*dl, [&count](const RecordedOp& op) {
-        count++;
-        ASSERT_EQ(RecordedOpId::TextOp, op.opId);
-        EXPECT_EQ(nullptr, op.localClip);
-        EXPECT_TRUE(op.localMatrix.isIdentity());
-        EXPECT_TRUE(op.unmappedBounds.getHeight() >= 10);
-        EXPECT_TRUE(op.unmappedBounds.getWidth() >= 25);
-    });
-    ASSERT_EQ(1, count);
-}
-
-TEST(RecordingCanvas, drawTextInHighContrast) {
-    auto dl = TestUtils::createDisplayList<RecordingCanvas>(200, 200, [](RecordingCanvas& canvas) {
-        canvas.setHighContrastText(true);
-        Paint paint;
-        paint.setColor(SK_ColorWHITE);
-        paint.setAntiAlias(true);
-        paint.setTextSize(20);
-        paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
-        std::unique_ptr<uint16_t[]> dst = TestUtils::utf8ToUtf16("HELLO");
-        canvas.drawText(dst.get(), 0, 5, 5, 25, 25, kBidi_Force_LTR, paint, NULL);
-    });
-
-    int count = 0;
-    playbackOps(*dl, [&count](const RecordedOp& op) {
-        ASSERT_EQ(RecordedOpId::TextOp, op.opId);
-        if (count++ == 0) {
-            EXPECT_EQ(SK_ColorBLACK, op.paint->getColor());
-            EXPECT_EQ(SkPaint::kStrokeAndFill_Style, op.paint->getStyle());
-        } else {
-            EXPECT_EQ(SK_ColorWHITE, op.paint->getColor());
-            EXPECT_EQ(SkPaint::kFill_Style, op.paint->getStyle());
-        }
-
-    });
-    ASSERT_EQ(2, count);
-}
-
 } // namespace uirenderer
 } // namespace android