Add android.Paint that inherits SkPaint

The idea is that extra paint parameters that only affect text layout
(not rendering) will go in android.Paint instead of going into
SkPaintOptionsAndroid.  We will eventually move those out of SkPaint
too.

This is currently implemented in PaintImpl.cpp.  Will be renamed when
current Paint.cpp that has JNI bits is moved to android_graphics_Paint.cpp.

Change-Id: Iba66c34dea5da503a13b9c864cb9f2211ac4ba7d
diff --git a/core/jni/Android.mk b/core/jni/Android.mk
index f65aab5..7b5395b 100644
--- a/core/jni/Android.mk
+++ b/core/jni/Android.mk
@@ -113,6 +113,7 @@
 	android/graphics/NinePatchImpl.cpp \
 	android/graphics/NinePatchPeeker.cpp \
 	android/graphics/Paint.cpp \
+	android/graphics/PaintImpl.cpp \
 	android/graphics/Path.cpp \
 	android/graphics/PathMeasure.cpp \
 	android/graphics/PathEffect.cpp \
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index 53aca3d..c0f7b4d 100644
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -1,3 +1,4 @@
+#include "Paint.h"
 #include "SkBitmap.h"
 #include "SkPixelRef.h"
 #include "SkImageEncoder.h"
@@ -676,7 +677,7 @@
                                    jlong srcHandle, jlong paintHandle,
                                    jintArray offsetXY) {
     const SkBitmap* src = reinterpret_cast<SkBitmap*>(srcHandle);
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const android::Paint* paint = reinterpret_cast<android::Paint*>(paintHandle);
     SkIPoint  offset;
     SkBitmap* dst = new SkBitmap;
     JavaPixelAllocator allocator(env);
diff --git a/core/jni/android/graphics/Canvas.h b/core/jni/android/graphics/Canvas.h
index fde22ee..317f69d 100644
--- a/core/jni/android/graphics/Canvas.h
+++ b/core/jni/android/graphics/Canvas.h
@@ -25,6 +25,7 @@
 
 // TODO: move this further up the stack so that all interaction with minikin
 //       happens prior to calling into this interface
+class Paint;
 class TypefaceImpl;
 
 class Canvas {
@@ -60,7 +61,7 @@
     virtual void restoreToCount(int saveCount) = 0;
 
     virtual int saveLayer(float left, float top, float right, float bottom,
-                const SkPaint* paint, SkCanvas::SaveFlags flags) = 0;
+                const Paint* paint, SkCanvas::SaveFlags flags) = 0;
     virtual int saveLayerAlpha(float left, float top, float right, float bottom,
             int alpha, SkCanvas::SaveFlags flags) = 0;
 
@@ -90,47 +91,47 @@
 // Canvas draw operations
 // ----------------------------------------------------------------------------
     virtual void drawColor(int color, SkXfermode::Mode mode) = 0;
-    virtual void drawPaint(const SkPaint& paint) = 0;
+    virtual void drawPaint(const Paint& paint) = 0;
 
     // Geometry
-    virtual void drawPoint(float x, float y, const SkPaint& paint) = 0;
-    virtual void drawPoints(const float* points, int count, const SkPaint& paint) = 0;
+    virtual void drawPoint(float x, float y, const Paint& paint) = 0;
+    virtual void drawPoints(const float* points, int count, const Paint& paint) = 0;
     virtual void drawLine(float startX, float startY, float stopX, float stopY,
-                const SkPaint& paint) = 0;
-    virtual void drawLines(const float* points, int count, const SkPaint& paint) = 0;
+                const Paint& paint) = 0;
+    virtual void drawLines(const float* points, int count, const Paint& paint) = 0;
     virtual void drawRect(float left, float top, float right, float bottom,
-            const SkPaint& paint) = 0;
+            const Paint& paint) = 0;
     virtual void drawRoundRect(float left, float top, float right, float bottom,
-            float rx, float ry, const SkPaint& paint) = 0;
-    virtual void drawCircle(float x, float y, float radius, const SkPaint& paint) = 0;
+            float rx, float ry, const Paint& paint) = 0;
+    virtual void drawCircle(float x, float y, float radius, const Paint& paint) = 0;
     virtual void drawOval(float left, float top, float right, float bottom,
-            const SkPaint& paint) = 0;
+            const Paint& paint) = 0;
     virtual void drawArc(float left, float top, float right, float bottom,
-            float startAngle, float sweepAngle, bool useCenter, const SkPaint& paint) = 0;
-    virtual void drawPath(const SkPath& path, const SkPaint& paint) = 0;
+            float startAngle, float sweepAngle, bool useCenter, const Paint& paint) = 0;
+    virtual void drawPath(const SkPath& path, const Paint& paint) = 0;
     virtual void drawVertices(SkCanvas::VertexMode vertexMode, int vertexCount,
                               const float* verts, const float* tex, const int* colors,
-                              const uint16_t* indices, int indexCount, const SkPaint& paint) = 0;
+                              const uint16_t* indices, int indexCount, const Paint& paint) = 0;
 
     // Bitmap-based
     virtual void drawBitmap(const SkBitmap& bitmap, float left, float top,
-            const SkPaint* paint) = 0;
+            const Paint* paint) = 0;
     virtual void drawBitmap(const SkBitmap& bitmap, const SkMatrix& matrix,
-            const SkPaint* paint) = 0;
+            const Paint* paint) = 0;
     virtual void drawBitmap(const SkBitmap& bitmap, float srcLeft, float srcTop,
             float srcRight, float srcBottom, float dstLeft, float dstTop,
-            float dstRight, float dstBottom, const SkPaint* paint) = 0;
+            float dstRight, float dstBottom, const Paint* paint) = 0;
     virtual void drawBitmapMesh(const SkBitmap& bitmap, int meshWidth, int meshHeight,
-            const float* vertices, const int* colors, const SkPaint* paint) = 0;
+            const float* vertices, const int* colors, const Paint* paint) = 0;
 
     // Text
     virtual void drawText(const uint16_t* text, int start, int count, int contextCount,
-            float x, float y, int bidiFlags, const SkPaint& paint,
+            float x, float y, int bidiFlags, const Paint& paint,
             TypefaceImpl* typeface) = 0;
     virtual void drawPosText(const uint16_t* text, const float* positions, int count,
-            int posCount, const SkPaint& paint) = 0;
+            int posCount, const Paint& paint) = 0;
     virtual void drawTextOnPath(const uint16_t* glyphs, int count, const SkPath& path,
-            float hOffset, float vOffset, const SkPaint& paint) = 0;
+            float hOffset, float vOffset, const Paint& paint) = 0;
 };
 
 }; // namespace android
diff --git a/core/jni/android/graphics/CanvasProperty.cpp b/core/jni/android/graphics/CanvasProperty.cpp
index cfa9cd8..e63c5fa 100644
--- a/core/jni/android/graphics/CanvasProperty.cpp
+++ b/core/jni/android/graphics/CanvasProperty.cpp
@@ -16,6 +16,7 @@
 
 #include "jni.h"
 #include "GraphicsJNI.h"
+#include "Paint.h"
 #include <android_runtime/AndroidRuntime.h>
 
 #include <utils/RefBase.h>
@@ -32,7 +33,7 @@
 }
 
 static jlong createPaint(JNIEnv* env, jobject clazz, jlong paintPtr) {
-    const SkPaint* paint = reinterpret_cast<const SkPaint*>(paintPtr);
+    const Paint* paint = reinterpret_cast<const Paint*>(paintPtr);
     return reinterpret_cast<jlong>(new CanvasPropertyPaint(*paint));
 }
 
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp
index 320c259..7c41c2e 100644
--- a/core/jni/android/graphics/Graphics.cpp
+++ b/core/jni/android/graphics/Graphics.cpp
@@ -370,12 +370,12 @@
     return c;
 }
 
-SkPaint* GraphicsJNI::getNativePaint(JNIEnv* env, jobject paint) {
+android::Paint* GraphicsJNI::getNativePaint(JNIEnv* env, jobject paint) {
     SkASSERT(env);
     SkASSERT(paint);
     SkASSERT(env->IsInstanceOf(paint, gPaint_class));
     jlong paintHandle = env->GetLongField(paint, gPaint_nativeInstanceID);
-    SkPaint* p = reinterpret_cast<SkPaint*>(paintHandle);
+    android::Paint* p = reinterpret_cast<android::Paint*>(paintHandle);
     SkASSERT(p);
     return p;
 }
diff --git a/core/jni/android/graphics/GraphicsJNI.h b/core/jni/android/graphics/GraphicsJNI.h
index 28a6edb..dcc97e5 100644
--- a/core/jni/android/graphics/GraphicsJNI.h
+++ b/core/jni/android/graphics/GraphicsJNI.h
@@ -12,9 +12,9 @@
 
 class SkBitmapRegionDecoder;
 class SkCanvas;
-class SkPaint;
 
 namespace android {
+class Paint;
 class TypefaceImpl;
 }
 
@@ -48,7 +48,7 @@
     static void point_to_jpointf(const SkPoint& point, JNIEnv*, jobject jpointf);
 
     static SkCanvas* getNativeCanvas(JNIEnv*, jobject canvas);
-    static SkPaint*  getNativePaint(JNIEnv*, jobject paint);
+    static android::Paint*  getNativePaint(JNIEnv*, jobject paint);
     static android::TypefaceImpl* getNativeTypeface(JNIEnv*, jobject paint);
     static SkBitmap* getNativeBitmap(JNIEnv*, jobject bitmap);
     static SkRegion* getNativeRegion(JNIEnv*, jobject region);
diff --git a/core/jni/android/graphics/MinikinUtils.cpp b/core/jni/android/graphics/MinikinUtils.cpp
index f02f118..c66437a 100644
--- a/core/jni/android/graphics/MinikinUtils.cpp
+++ b/core/jni/android/graphics/MinikinUtils.cpp
@@ -18,9 +18,9 @@
 #include <cutils/log.h>
 #include <string>
 
-#include "SkPaint.h"
 #include "SkPathMeasure.h"
 #include "minikin/Layout.h"
+#include "Paint.h"
 #include "TypefaceImpl.h"
 #include "MinikinSkia.h"
 
@@ -38,7 +38,7 @@
     return off + n;
 }
 
-std::string MinikinUtils::setLayoutProperties(Layout* layout, const SkPaint* paint, int bidiFlags,
+std::string MinikinUtils::setLayoutProperties(Layout* layout, const Paint* paint, int bidiFlags,
         TypefaceImpl* typeface) {
     TypefaceImpl* resolvedFace = TypefaceImpl_resolveDefault(typeface);
     layout->setFontCollection(resolvedFace->fFontCollection);
@@ -62,12 +62,12 @@
     return std::string(css);
 }
 
-float MinikinUtils::xOffsetForTextAlign(SkPaint* paint, const Layout& layout) {
+float MinikinUtils::xOffsetForTextAlign(Paint* paint, const Layout& layout) {
     switch (paint->getTextAlign()) {
-        case SkPaint::kCenter_Align:
+        case Paint::kCenter_Align:
             return layout.getAdvance() * -0.5f;
             break;
-        case SkPaint::kRight_Align:
+        case Paint::kRight_Align:
             return -layout.getAdvance();
             break;
         default:
@@ -76,13 +76,13 @@
     return 0;
 }
 
-float MinikinUtils::hOffsetForTextAlign(SkPaint* paint, const Layout& layout, const SkPath& path) {
+float MinikinUtils::hOffsetForTextAlign(Paint* paint, const Layout& layout, const SkPath& path) {
     float align = 0;
     switch (paint->getTextAlign()) {
-        case SkPaint::kCenter_Align:
+        case Paint::kCenter_Align:
             align = -0.5f;
             break;
-        case SkPaint::kRight_Align:
+        case Paint::kRight_Align:
             align = -1;
             break;
         default:
diff --git a/core/jni/android/graphics/MinikinUtils.h b/core/jni/android/graphics/MinikinUtils.h
index 1663860..0562c3b1 100644
--- a/core/jni/android/graphics/MinikinUtils.h
+++ b/core/jni/android/graphics/MinikinUtils.h
@@ -16,7 +16,7 @@
 
 /**
  * Utilities for making Minikin work, especially from existing objects like
- * SkPaint and so on.
+ * Paint and so on.
  **/
 
  // TODO: does this really need to be separate from MinikinSkia?
@@ -24,6 +24,8 @@
 #ifndef ANDROID_MINIKIN_UTILS_H
 #define ANDROID_MINIKIN_UTILS_H
 
+#include "Paint.h"
+
 namespace android {
 
 // TODO: these should be defined in Minikin's Layout.h
@@ -43,15 +45,15 @@
 
 class MinikinUtils {
 public:
-    static std::string setLayoutProperties(Layout* layout, const SkPaint* paint, int bidiFlags,
+    static std::string setLayoutProperties(Layout* layout, const Paint* paint, int bidiFlags,
             TypefaceImpl* typeface);
 
-    static float xOffsetForTextAlign(SkPaint* paint, const Layout& layout);
+    static float xOffsetForTextAlign(Paint* paint, const Layout& layout);
 
-    static float hOffsetForTextAlign(SkPaint* paint, const Layout& layout, const SkPath& path);
+    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>
-    static void forFontRun(const Layout& layout, SkPaint* paint, F& f) {
+    static void forFontRun(const Layout& layout, Paint* paint, F& f) {
         float saveSkewX = paint->getTextSkewX();
         bool savefakeBold = paint->isFakeBoldText();
         MinikinFont* curFont = NULL;
diff --git a/core/jni/android/graphics/Movie.cpp b/core/jni/android/graphics/Movie.cpp
index 5f9a9b7..226f83e 100644
--- a/core/jni/android/graphics/Movie.cpp
+++ b/core/jni/android/graphics/Movie.cpp
@@ -7,6 +7,7 @@
 #include "SkUtils.h"
 #include "Utils.h"
 #include "CreateJavaOutputStreamAdaptor.h"
+#include "Paint.h"
 
 #include <androidfw/Asset.h>
 #include <androidfw/ResourceTypes.h>
diff --git a/core/jni/android/graphics/NinePatch.cpp b/core/jni/android/graphics/NinePatch.cpp
index e82e8a6..cf23771 100644
--- a/core/jni/android/graphics/NinePatch.cpp
+++ b/core/jni/android/graphics/NinePatch.cpp
@@ -23,6 +23,7 @@
 
 #include <Caches.h>
 
+#include "Paint.h"
 #include "Canvas.h"
 #include "SkCanvas.h"
 #include "SkRegion.h"
@@ -123,7 +124,7 @@
         SkCanvas* canvas       = reinterpret_cast<Canvas*>(canvasHandle)->getSkCanvas();
         const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
         Res_png_9patch* chunk  = reinterpret_cast<Res_png_9patch*>(chunkHandle);
-        const SkPaint* paint   = reinterpret_cast<SkPaint*>(paintHandle);
+        const Paint* paint     = reinterpret_cast<Paint*>(paintHandle);
         SkASSERT(canvas);
         SkASSERT(boundsRectF);
         SkASSERT(bitmap);
@@ -142,7 +143,7 @@
         SkCanvas* canvas       = reinterpret_cast<Canvas*>(canvasHandle)->getSkCanvas();
         const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
         Res_png_9patch* chunk  = reinterpret_cast<Res_png_9patch*>(chunkHandle);
-        const SkPaint* paint   = reinterpret_cast<SkPaint*>(paintHandle);
+        const Paint* paint     = reinterpret_cast<Paint*>(paintHandle);
         SkASSERT(canvas);
         SkASSERT(boundsRect);
         SkASSERT(bitmap);
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index 0ad390a..c06f0d2 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -39,6 +39,7 @@
 #include <minikin/Layout.h>
 #include "MinikinSkia.h"
 #include "MinikinUtils.h"
+#include "Paint.h"
 #include "TypefaceImpl.h"
 
 // temporary for debugging
@@ -61,47 +62,47 @@
 static jclass   gFontMetricsInt_class;
 static JMetricsID gFontMetricsInt_fieldID;
 
-static void defaultSettingsForAndroid(SkPaint* paint) {
+static void defaultSettingsForAndroid(Paint* paint) {
     // GlyphID encoding is required because we are using Harfbuzz shaping
-    paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+    paint->setTextEncoding(Paint::kGlyphID_TextEncoding);
 
     SkPaintOptionsAndroid paintOpts = paint->getPaintOptionsAndroid();
     paintOpts.setUseFontFallbacks(true);
     paint->setPaintOptionsAndroid(paintOpts);
 }
 
-class SkPaintGlue {
+class PaintGlue {
 public:
     enum MoveOpt {
         AFTER, AT_OR_AFTER, BEFORE, AT_OR_BEFORE, AT
     };
 
     static void finalizer(JNIEnv* env, jobject clazz, jlong objHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         delete obj;
     }
 
     static jlong init(JNIEnv* env, jobject clazz) {
-        SkPaint* obj = new SkPaint();
+        Paint* obj = new Paint();
         defaultSettingsForAndroid(obj);
         return reinterpret_cast<jlong>(obj);
     }
 
     static jlong initWithPaint(JNIEnv* env, jobject clazz, jlong paintHandle) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
-        SkPaint* obj = new SkPaint(*paint);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
+        Paint* obj = new Paint(*paint);
         return reinterpret_cast<jlong>(obj);
     }
 
     static void reset(JNIEnv* env, jobject clazz, jlong objHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         obj->reset();
         defaultSettingsForAndroid(obj);
     }
 
     static void assign(JNIEnv* env, jobject clazz, jlong dstPaintHandle, jlong srcPaintHandle) {
-        SkPaint* dst = reinterpret_cast<SkPaint*>(dstPaintHandle);
-        const SkPaint* src = reinterpret_cast<SkPaint*>(srcPaintHandle);
+        Paint* dst = reinterpret_cast<Paint*>(dstPaintHandle);
+        const Paint* src = reinterpret_cast<Paint*>(srcPaintHandle);
         *dst = *src;
     }
 
@@ -110,10 +111,10 @@
 
     static jint getFlags(JNIEnv* env, jobject paint) {
         NPE_CHECK_RETURN_ZERO(env, paint);
-        SkPaint* nativePaint = GraphicsJNI::getNativePaint(env, paint);
+        Paint* nativePaint = GraphicsJNI::getNativePaint(env, paint);
         uint32_t result = nativePaint->getFlags();
         result &= ~sFilterBitmapFlag; // Filtering no longer stored in this bit. Mask away.
-        if (nativePaint->getFilterLevel() != SkPaint::kNone_FilterLevel) {
+        if (nativePaint->getFilterLevel() != Paint::kNone_FilterLevel) {
             result |= sFilterBitmapFlag;
         }
         return static_cast<jint>(result);
@@ -121,11 +122,11 @@
 
     static void setFlags(JNIEnv* env, jobject paint, jint flags) {
         NPE_CHECK_RETURN_VOID(env, paint);
-        SkPaint* nativePaint = GraphicsJNI::getNativePaint(env, paint);
+        Paint* nativePaint = GraphicsJNI::getNativePaint(env, paint);
         // Instead of modifying 0x02, change the filter level.
         nativePaint->setFilterLevel(flags & sFilterBitmapFlag
-                ? SkPaint::kLow_FilterLevel
-                : SkPaint::kNone_FilterLevel);
+                ? Paint::kLow_FilterLevel
+                : Paint::kNone_FilterLevel);
         // Don't pass through filter flag, which is no longer stored in paint's flags.
         flags &= ~sFilterBitmapFlag;
         // Use the existing value for 0x02.
@@ -137,13 +138,13 @@
     static jint getHinting(JNIEnv* env, jobject paint) {
         NPE_CHECK_RETURN_ZERO(env, paint);
         return GraphicsJNI::getNativePaint(env, paint)->getHinting()
-                == SkPaint::kNo_Hinting ? 0 : 1;
+                == Paint::kNo_Hinting ? 0 : 1;
     }
 
     static void setHinting(JNIEnv* env, jobject paint, jint mode) {
         NPE_CHECK_RETURN_VOID(env, paint);
         GraphicsJNI::getNativePaint(env, paint)->setHinting(
-                mode == 0 ? SkPaint::kNo_Hinting : SkPaint::kNormal_Hinting);
+                mode == 0 ? Paint::kNo_Hinting : Paint::kNormal_Hinting);
     }
 
     static void setAntiAlias(JNIEnv* env, jobject paint, jboolean aa) {
@@ -179,7 +180,7 @@
     static void setFilterBitmap(JNIEnv* env, jobject paint, jboolean filterBitmap) {
         NPE_CHECK_RETURN_VOID(env, paint);
         GraphicsJNI::getNativePaint(env, paint)->setFilterLevel(
-                filterBitmap ? SkPaint::kLow_FilterLevel : SkPaint::kNone_FilterLevel);
+                filterBitmap ? Paint::kLow_FilterLevel : Paint::kNone_FilterLevel);
     }
 
     static void setDither(JNIEnv* env, jobject paint, jboolean dither) {
@@ -188,13 +189,13 @@
     }
 
     static jint getStyle(JNIEnv* env, jobject clazz,jlong objHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         return static_cast<jint>(obj->getStyle());
     }
 
     static void setStyle(JNIEnv* env, jobject clazz, jlong objHandle, jint styleHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
-        SkPaint::Style style = static_cast<SkPaint::Style>(styleHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
+        Paint::Style style = static_cast<Paint::Style>(styleHandle);
         obj->setStyle(style);
     }
 
@@ -243,83 +244,83 @@
     }
 
     static jint getStrokeCap(JNIEnv* env, jobject clazz, jlong objHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         return static_cast<jint>(obj->getStrokeCap());
     }
 
     static void setStrokeCap(JNIEnv* env, jobject clazz, jlong objHandle, jint capHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
-        SkPaint::Cap cap = static_cast<SkPaint::Cap>(capHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
+        Paint::Cap cap = static_cast<Paint::Cap>(capHandle);
         obj->setStrokeCap(cap);
     }
 
     static jint getStrokeJoin(JNIEnv* env, jobject clazz, jlong objHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         return static_cast<jint>(obj->getStrokeJoin());
     }
 
     static void setStrokeJoin(JNIEnv* env, jobject clazz, jlong objHandle, jint joinHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
-        SkPaint::Join join = (SkPaint::Join) joinHandle;
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
+        Paint::Join join = (Paint::Join) joinHandle;
         obj->setStrokeJoin(join);
     }
 
     static jboolean getFillPath(JNIEnv* env, jobject clazz, jlong objHandle, jlong srcHandle, jlong dstHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         SkPath* src = reinterpret_cast<SkPath*>(srcHandle);
         SkPath* dst = reinterpret_cast<SkPath*>(dstHandle);
         return obj->getFillPath(*src, dst) ? JNI_TRUE : JNI_FALSE;
     }
 
     static jlong setShader(JNIEnv* env, jobject clazz, jlong objHandle, jlong shaderHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         SkShader* shader = reinterpret_cast<SkShader*>(shaderHandle);
         return reinterpret_cast<jlong>(obj->setShader(shader));
     }
 
     static jlong setColorFilter(JNIEnv* env, jobject clazz, jlong objHandle, jlong filterHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint *>(objHandle);
+        Paint* obj = reinterpret_cast<Paint *>(objHandle);
         SkColorFilter* filter  = reinterpret_cast<SkColorFilter *>(filterHandle);
         return reinterpret_cast<jlong>(obj->setColorFilter(filter));
     }
 
     static jlong setXfermode(JNIEnv* env, jobject clazz, jlong objHandle, jlong xfermodeHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         SkXfermode* xfermode = reinterpret_cast<SkXfermode*>(xfermodeHandle);
         return reinterpret_cast<jlong>(obj->setXfermode(xfermode));
     }
 
     static jlong setPathEffect(JNIEnv* env, jobject clazz, jlong objHandle, jlong effectHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         SkPathEffect* effect  = reinterpret_cast<SkPathEffect*>(effectHandle);
         return reinterpret_cast<jlong>(obj->setPathEffect(effect));
     }
 
     static jlong setMaskFilter(JNIEnv* env, jobject clazz, jlong objHandle, jlong maskfilterHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         SkMaskFilter* maskfilter  = reinterpret_cast<SkMaskFilter*>(maskfilterHandle);
         return reinterpret_cast<jlong>(obj->setMaskFilter(maskfilter));
     }
 
     static jlong setTypeface(JNIEnv* env, jobject clazz, jlong objHandle, jlong typefaceHandle) {
-        // TODO: in Paint refactoring, set typeface on android Paint, not SkPaint
+        // TODO: in Paint refactoring, set typeface on android Paint, not Paint
         return NULL;
     }
 
     static jlong setRasterizer(JNIEnv* env, jobject clazz, jlong objHandle, jlong rasterizerHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         SkAutoTUnref<SkRasterizer> rasterizer(GraphicsJNI::refNativeRasterizer(rasterizerHandle));
         return reinterpret_cast<jlong>(obj->setRasterizer(rasterizer));
     }
 
     static jint getTextAlign(JNIEnv* env, jobject clazz, jlong objHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         return static_cast<jint>(obj->getTextAlign());
     }
 
     static void setTextAlign(JNIEnv* env, jobject clazz, jlong objHandle, jint alignHandle) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
-        SkPaint::Align align = static_cast<SkPaint::Align>(alignHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
+        Paint::Align align = static_cast<Paint::Align>(alignHandle);
         obj->setTextAlign(align);
     }
 
@@ -364,7 +365,7 @@
     }
 
     static void setTextLocale(JNIEnv* env, jobject clazz, jlong objHandle, jstring locale) {
-        SkPaint* obj = reinterpret_cast<SkPaint*>(objHandle);
+        Paint* obj = reinterpret_cast<Paint*>(objHandle);
         ScopedUtfChars localeChars(env, locale);
         char langTag[ULOC_FULLNAME_CAPACITY];
         toLanguageTag(langTag, ULOC_FULLNAME_CAPACITY, localeChars.c_str());
@@ -376,14 +377,14 @@
 
     static jboolean isElegantTextHeight(JNIEnv* env, jobject paint) {
         NPE_CHECK_RETURN_ZERO(env, paint);
-        SkPaint* obj = GraphicsJNI::getNativePaint(env, paint);
+        Paint* obj = GraphicsJNI::getNativePaint(env, paint);
         SkPaintOptionsAndroid paintOpts = obj->getPaintOptionsAndroid();
         return paintOpts.getFontVariant() == SkPaintOptionsAndroid::kElegant_Variant;
     }
 
     static void setElegantTextHeight(JNIEnv* env, jobject paint, jboolean aa) {
         NPE_CHECK_RETURN_VOID(env, paint);
-        SkPaint* obj = GraphicsJNI::getNativePaint(env, paint);
+        Paint* obj = GraphicsJNI::getNativePaint(env, paint);
         SkPaintOptionsAndroid::FontVariant variant =
             aa ? SkPaintOptionsAndroid::kElegant_Variant :
             SkPaintOptionsAndroid::kDefault_Variant;
@@ -422,13 +423,13 @@
         GraphicsJNI::getNativePaint(env, paint)->setTextSkewX(skewX);
     }
 
-    static SkScalar getMetricsInternal(JNIEnv* env, jobject jpaint, SkPaint::FontMetrics *metrics) {
+    static SkScalar getMetricsInternal(JNIEnv* env, jobject jpaint, Paint::FontMetrics *metrics) {
         const int kElegantTop = 2500;
         const int kElegantBottom = -1000;
         const int kElegantAscent = 1900;
         const int kElegantDescent = -500;
         const int kElegantLeading = 0;
-        SkPaint* paint = GraphicsJNI::getNativePaint(env, jpaint);
+        Paint* paint = GraphicsJNI::getNativePaint(env, jpaint);
         TypefaceImpl* typeface = GraphicsJNI::getNativeTypeface(env, jpaint);
         typeface = TypefaceImpl_resolveDefault(typeface);
         FakedFont baseFont = typeface->fFontCollection->baseFontFaked(typeface->fStyle);
@@ -456,21 +457,21 @@
 
     static jfloat ascent(JNIEnv* env, jobject paint) {
         NPE_CHECK_RETURN_ZERO(env, paint);
-        SkPaint::FontMetrics metrics;
+        Paint::FontMetrics metrics;
         getMetricsInternal(env, paint, &metrics);
         return SkScalarToFloat(metrics.fAscent);
     }
 
     static jfloat descent(JNIEnv* env, jobject paint) {
         NPE_CHECK_RETURN_ZERO(env, paint);
-        SkPaint::FontMetrics metrics;
+        Paint::FontMetrics metrics;
         getMetricsInternal(env, paint, &metrics);
         return SkScalarToFloat(metrics.fDescent);
     }
 
     static jfloat getFontMetrics(JNIEnv* env, jobject paint, jobject metricsObj) {
         NPE_CHECK_RETURN_ZERO(env, paint);
-        SkPaint::FontMetrics metrics;
+        Paint::FontMetrics metrics;
         SkScalar spacing = getMetricsInternal(env, paint, &metrics);
 
         if (metricsObj) {
@@ -486,7 +487,7 @@
 
     static jint getFontMetricsInt(JNIEnv* env, jobject paint, jobject metricsObj) {
         NPE_CHECK_RETURN_ZERO(env, paint);
-        SkPaint::FontMetrics metrics;
+        Paint::FontMetrics metrics;
 
         getMetricsInternal(env, paint, &metrics);
         int ascent = SkScalarRoundToInt(metrics.fAscent);
@@ -518,7 +519,7 @@
             return 0;
         }
 
-        SkPaint* paint = GraphicsJNI::getNativePaint(env, jpaint);
+        Paint* paint = GraphicsJNI::getNativePaint(env, jpaint);
         const jchar* textArray = env->GetCharArrayElements(text, NULL);
         jfloat result = 0;
 
@@ -547,7 +548,7 @@
         }
 
         const jchar* textArray = env->GetStringChars(text, NULL);
-        SkPaint* paint = GraphicsJNI::getNativePaint(env, jpaint);
+        Paint* paint = GraphicsJNI::getNativePaint(env, jpaint);
         jfloat width = 0;
 
         Layout layout;
@@ -570,7 +571,7 @@
         }
 
         const jchar* textArray = env->GetStringChars(text, NULL);
-        SkPaint* paint = GraphicsJNI::getNativePaint(env, jpaint);
+        Paint* paint = GraphicsJNI::getNativePaint(env, jpaint);
         jfloat width = 0;
 
         Layout layout;
@@ -583,7 +584,7 @@
         return width;
     }
 
-    static int dotextwidths(JNIEnv* env, SkPaint* paint, TypefaceImpl* typeface, const jchar text[], int count,
+    static int dotextwidths(JNIEnv* env, Paint* paint, TypefaceImpl* typeface, const jchar text[], int count,
             jfloatArray widths, jint bidiFlags) {
         NPE_CHECK_RETURN_ZERO(env, paint);
         NPE_CHECK_RETURN_ZERO(env, text);
@@ -614,7 +615,7 @@
 
     static jint getTextWidths___CIII_F(JNIEnv* env, jobject clazz, jlong paintHandle, jlong typefaceHandle, jcharArray text,
             jint index, jint count, jint bidiFlags, jfloatArray widths) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
         const jchar* textArray = env->GetCharArrayElements(text, NULL);
         count = dotextwidths(env, paint, typeface, textArray + index, count, widths, bidiFlags);
@@ -625,7 +626,7 @@
 
     static jint getTextWidths__StringIII_F(JNIEnv* env, jobject clazz, jlong paintHandle, jlong typefaceHandle, jstring text,
             jint start, jint end, jint bidiFlags, jfloatArray widths) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
         const jchar* textArray = env->GetStringChars(text, NULL);
         int count = dotextwidths(env, paint, typeface, textArray + start, end - start, widths, bidiFlags);
@@ -633,7 +634,7 @@
         return count;
     }
 
-    static jfloat doTextRunAdvances(JNIEnv *env, SkPaint *paint, TypefaceImpl* typeface, const jchar *text,
+    static jfloat doTextRunAdvances(JNIEnv *env, Paint *paint, TypefaceImpl* typeface, const jchar *text,
                                     jint start, jint count, jint contextCount, jboolean isRtl,
                                     jfloatArray advances, jint advancesIndex) {
         NPE_CHECK_RETURN_ZERO(env, paint);
@@ -675,7 +676,7 @@
             jlong typefaceHandle,
             jcharArray text, jint index, jint count, jint contextIndex, jint contextCount,
             jboolean isRtl, jfloatArray advances, jint advancesIndex) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
         jchar* textArray = env->GetCharArrayElements(text, NULL);
         jfloat result = doTextRunAdvances(env, paint, typeface, textArray + contextIndex,
@@ -688,7 +689,7 @@
             jlong typefaceHandle,
             jstring text, jint start, jint end, jint contextStart, jint contextEnd, jboolean isRtl,
             jfloatArray advances, jint advancesIndex) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
         const jchar* textArray = env->GetStringChars(text, NULL);
         jfloat result = doTextRunAdvances(env, paint, typeface, textArray + contextStart,
@@ -698,7 +699,7 @@
         return result;
     }
 
-    static jint doTextRunCursor(JNIEnv *env, SkPaint* paint, const jchar *text, jint start,
+    static jint doTextRunCursor(JNIEnv *env, Paint* paint, const jchar *text, jint start,
             jint count, jint flags, jint offset, jint opt) {
         GraphemeBreak::MoveOpt moveOpt = GraphemeBreak::MoveOpt(opt);
         size_t result = GraphemeBreak::getTextRunCursor(text, start, count, offset, moveOpt);
@@ -707,7 +708,7 @@
 
     static jint getTextRunCursor___C(JNIEnv* env, jobject clazz, jlong paintHandle, jcharArray text,
             jint contextStart, jint contextCount, jint dir, jint offset, jint cursorOpt) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         jchar* textArray = env->GetCharArrayElements(text, NULL);
         jint result = doTextRunCursor(env, paint, textArray, contextStart, contextCount, dir,
                 offset, cursorOpt);
@@ -717,7 +718,7 @@
 
     static jint getTextRunCursor__String(JNIEnv* env, jobject clazz, jlong paintHandle, jstring text,
             jint contextStart, jint contextEnd, jint dir, jint offset, jint cursorOpt) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         const jchar* textArray = env->GetStringChars(text, NULL);
         jint result = doTextRunCursor(env, paint, textArray, contextStart,
                 contextEnd - contextStart, dir, offset, cursorOpt);
@@ -727,7 +728,7 @@
 
     class GetTextFunctor {
     public:
-        GetTextFunctor(const Layout& layout, SkPath* path, jfloat x, jfloat y, SkPaint* paint,
+        GetTextFunctor(const Layout& layout, SkPath* path, jfloat x, jfloat y, Paint* paint,
                     uint16_t* glyphs, SkPoint* pos)
                 : layout(layout), path(path), x(x), y(y), paint(paint), glyphs(glyphs), pos(pos) {
         }
@@ -750,13 +751,13 @@
         SkPath* path;
         jfloat x;
         jfloat y;
-        SkPaint* paint;
+        Paint* paint;
         uint16_t* glyphs;
         SkPoint* pos;
         SkPath tmpPath;
     };
 
-    static void getTextPath(JNIEnv* env, SkPaint* paint, TypefaceImpl* typeface, const jchar* text,
+    static void getTextPath(JNIEnv* env, Paint* paint, TypefaceImpl* typeface, const jchar* text,
             jint count, jint bidiFlags, jfloat x, jfloat y, SkPath* path) {
         Layout layout;
         std::string css = MinikinUtils::setLayoutProperties(&layout, paint, bidiFlags, typeface);
@@ -766,9 +767,9 @@
         SkPoint* pos = new SkPoint[nGlyphs];
 
         x += MinikinUtils::xOffsetForTextAlign(paint, layout);
-        SkPaint::Align align = paint->getTextAlign();
-        paint->setTextAlign(SkPaint::kLeft_Align);
-        paint->setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+        Paint::Align align = paint->getTextAlign();
+        paint->setTextAlign(Paint::kLeft_Align);
+        paint->setTextEncoding(Paint::kGlyphID_TextEncoding);
         GetTextFunctor f(layout, path, x, y, paint, glyphs, pos);
         MinikinUtils::forFontRun(layout, paint, f);
         paint->setTextAlign(align);
@@ -779,7 +780,7 @@
     static void getTextPath___C(JNIEnv* env, jobject clazz, jlong paintHandle,
             jlong typefaceHandle, jint bidiFlags,
             jcharArray text, jint index, jint count, jfloat x, jfloat y, jlong pathHandle) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
         SkPath* path = reinterpret_cast<SkPath*>(pathHandle);
         const jchar* textArray = env->GetCharArrayElements(text, NULL);
@@ -790,7 +791,7 @@
     static void getTextPath__String(JNIEnv* env, jobject clazz, jlong paintHandle,
             jlong typefaceHandle, jint bidiFlags,
             jstring text, jint start, jint end, jfloat x, jfloat y, jlong pathHandle) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
         SkPath* path = reinterpret_cast<SkPath*>(pathHandle);
         const jchar* textArray = env->GetStringChars(text, NULL);
@@ -800,7 +801,7 @@
 
     static void setShadowLayer(JNIEnv* env, jobject clazz, jlong paintHandle, jfloat radius,
                                jfloat dx, jfloat dy, jint color) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         if (radius <= 0) {
             paint->setLooper(NULL);
         }
@@ -811,13 +812,13 @@
     }
 
     static jboolean hasShadowLayer(JNIEnv* env, jobject clazz, jlong paintHandle) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         return paint->getLooper() && paint->getLooper()->asABlurShadow(NULL);
     }
 
-    static int breakText(JNIEnv* env, const SkPaint& paint, TypefaceImpl* typeface, const jchar text[],
+    static int breakText(JNIEnv* env, const Paint& paint, TypefaceImpl* typeface, const jchar text[],
                          int count, float maxWidth, jint bidiFlags, jfloatArray jmeasured,
-                         SkPaint::TextBufferDirection textBufferDirection) {
+                         Paint::TextBufferDirection textBufferDirection) {
         size_t measuredCount = 0;
         float measured = 0;
 
@@ -826,7 +827,7 @@
         layout.doLayout(text, 0, count, count, css);
         float* advances = new float[count];
         layout.getAdvances(advances);
-        const bool forwardScan = (textBufferDirection == SkPaint::kForward_TextBufferDirection);
+        const bool forwardScan = (textBufferDirection == Paint::kForward_TextBufferDirection);
         for (int i = 0; i < count; i++) {
             // traverse in the given direction
             int index = forwardScan ? i : (count - i - 1);
@@ -854,16 +855,16 @@
             jint index, jint count, jfloat maxWidth, jint bidiFlags, jfloatArray jmeasuredWidth) {
         NPE_CHECK_RETURN_ZERO(env, jtext);
 
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
 
-        SkPaint::TextBufferDirection tbd;
+        Paint::TextBufferDirection tbd;
         if (count < 0) {
-            tbd = SkPaint::kBackward_TextBufferDirection;
+            tbd = Paint::kBackward_TextBufferDirection;
             count = -count;
         }
         else {
-            tbd = SkPaint::kForward_TextBufferDirection;
+            tbd = Paint::kForward_TextBufferDirection;
         }
 
         if ((index < 0) || (index + count > env->GetArrayLength(jtext))) {
@@ -883,12 +884,12 @@
                 jboolean forwards, jfloat maxWidth, jint bidiFlags, jfloatArray jmeasuredWidth) {
         NPE_CHECK_RETURN_ZERO(env, jtext);
 
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
 
-        SkPaint::TextBufferDirection tbd = forwards ?
-                                        SkPaint::kForward_TextBufferDirection :
-                                        SkPaint::kBackward_TextBufferDirection;
+        Paint::TextBufferDirection tbd = forwards ?
+                                        Paint::kForward_TextBufferDirection :
+                                        Paint::kBackward_TextBufferDirection;
 
         int count = env->GetStringLength(jtext);
         const jchar* text = env->GetStringChars(jtext, NULL);
@@ -898,7 +899,7 @@
     }
 
     static void doTextBounds(JNIEnv* env, const jchar* text, int count, jobject bounds,
-            const SkPaint& paint, TypefaceImpl* typeface, jint bidiFlags) {
+            const Paint& paint, TypefaceImpl* typeface, jint bidiFlags) {
         SkRect  r;
         SkIRect ir;
 
@@ -917,7 +918,7 @@
 
     static void getStringBounds(JNIEnv* env, jobject, jlong paintHandle, jlong typefaceHandle,
                                 jstring text, jint start, jint end, jint bidiFlags, jobject bounds) {
-        const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);;
+        const Paint* paint = reinterpret_cast<Paint*>(paintHandle);;
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
         const jchar* textArray = env->GetStringChars(text, NULL);
         doTextBounds(env, textArray + start, end - start, bounds, *paint, typeface, bidiFlags);
@@ -926,7 +927,7 @@
 
     static void getCharArrayBounds(JNIEnv* env, jobject, jlong paintHandle, jlong typefaceHandle,
                         jcharArray text, jint index, jint count, jint bidiFlags, jobject bounds) {
-        const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+        const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
         TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
         const jchar* textArray = env->GetCharArrayElements(text, NULL);
         doTextBounds(env, textArray + index, count, bounds, *paint, typeface, bidiFlags);
@@ -937,83 +938,83 @@
 };
 
 static JNINativeMethod methods[] = {
-    {"finalizer", "(J)V", (void*) SkPaintGlue::finalizer},
-    {"native_init","()J", (void*) SkPaintGlue::init},
-    {"native_initWithPaint","(J)J", (void*) SkPaintGlue::initWithPaint},
-    {"native_reset","(J)V", (void*) SkPaintGlue::reset},
-    {"native_set","(JJ)V", (void*) SkPaintGlue::assign},
-    {"getFlags","()I", (void*) SkPaintGlue::getFlags},
-    {"setFlags","(I)V", (void*) SkPaintGlue::setFlags},
-    {"getHinting","()I", (void*) SkPaintGlue::getHinting},
-    {"setHinting","(I)V", (void*) SkPaintGlue::setHinting},
-    {"setAntiAlias","(Z)V", (void*) SkPaintGlue::setAntiAlias},
-    {"setSubpixelText","(Z)V", (void*) SkPaintGlue::setSubpixelText},
-    {"setLinearText","(Z)V", (void*) SkPaintGlue::setLinearText},
-    {"setUnderlineText","(Z)V", (void*) SkPaintGlue::setUnderlineText},
-    {"setStrikeThruText","(Z)V", (void*) SkPaintGlue::setStrikeThruText},
-    {"setFakeBoldText","(Z)V", (void*) SkPaintGlue::setFakeBoldText},
-    {"setFilterBitmap","(Z)V", (void*) SkPaintGlue::setFilterBitmap},
-    {"setDither","(Z)V", (void*) SkPaintGlue::setDither},
-    {"native_getStyle","(J)I", (void*) SkPaintGlue::getStyle},
-    {"native_setStyle","(JI)V", (void*) SkPaintGlue::setStyle},
-    {"getColor","()I", (void*) SkPaintGlue::getColor},
-    {"setColor","(I)V", (void*) SkPaintGlue::setColor},
-    {"getAlpha","()I", (void*) SkPaintGlue::getAlpha},
-    {"setAlpha","(I)V", (void*) SkPaintGlue::setAlpha},
-    {"getStrokeWidth","()F", (void*) SkPaintGlue::getStrokeWidth},
-    {"setStrokeWidth","(F)V", (void*) SkPaintGlue::setStrokeWidth},
-    {"getStrokeMiter","()F", (void*) SkPaintGlue::getStrokeMiter},
-    {"setStrokeMiter","(F)V", (void*) SkPaintGlue::setStrokeMiter},
-    {"native_getStrokeCap","(J)I", (void*) SkPaintGlue::getStrokeCap},
-    {"native_setStrokeCap","(JI)V", (void*) SkPaintGlue::setStrokeCap},
-    {"native_getStrokeJoin","(J)I", (void*) SkPaintGlue::getStrokeJoin},
-    {"native_setStrokeJoin","(JI)V", (void*) SkPaintGlue::setStrokeJoin},
-    {"native_getFillPath","(JJJ)Z", (void*) SkPaintGlue::getFillPath},
-    {"native_setShader","(JJ)J", (void*) SkPaintGlue::setShader},
-    {"native_setColorFilter","(JJ)J", (void*) SkPaintGlue::setColorFilter},
-    {"native_setXfermode","(JJ)J", (void*) SkPaintGlue::setXfermode},
-    {"native_setPathEffect","(JJ)J", (void*) SkPaintGlue::setPathEffect},
-    {"native_setMaskFilter","(JJ)J", (void*) SkPaintGlue::setMaskFilter},
-    {"native_setTypeface","(JJ)J", (void*) SkPaintGlue::setTypeface},
-    {"native_setRasterizer","(JJ)J", (void*) SkPaintGlue::setRasterizer},
-    {"native_getTextAlign","(J)I", (void*) SkPaintGlue::getTextAlign},
-    {"native_setTextAlign","(JI)V", (void*) SkPaintGlue::setTextAlign},
-    {"native_setTextLocale","(JLjava/lang/String;)V", (void*) SkPaintGlue::setTextLocale},
-    {"isElegantTextHeight","()Z", (void*) SkPaintGlue::isElegantTextHeight},
-    {"setElegantTextHeight","(Z)V", (void*) SkPaintGlue::setElegantTextHeight},
-    {"getTextSize","()F", (void*) SkPaintGlue::getTextSize},
-    {"setTextSize","(F)V", (void*) SkPaintGlue::setTextSize},
-    {"getTextScaleX","()F", (void*) SkPaintGlue::getTextScaleX},
-    {"setTextScaleX","(F)V", (void*) SkPaintGlue::setTextScaleX},
-    {"getTextSkewX","()F", (void*) SkPaintGlue::getTextSkewX},
-    {"setTextSkewX","(F)V", (void*) SkPaintGlue::setTextSkewX},
-    {"ascent","()F", (void*) SkPaintGlue::ascent},
-    {"descent","()F", (void*) SkPaintGlue::descent},
-    {"getFontMetrics", "(Landroid/graphics/Paint$FontMetrics;)F", (void*)SkPaintGlue::getFontMetrics},
-    {"getFontMetricsInt", "(Landroid/graphics/Paint$FontMetricsInt;)I", (void*)SkPaintGlue::getFontMetricsInt},
-    {"native_measureText","([CIII)F", (void*) SkPaintGlue::measureText_CIII},
-    {"native_measureText","(Ljava/lang/String;I)F", (void*) SkPaintGlue::measureText_StringI},
-    {"native_measureText","(Ljava/lang/String;III)F", (void*) SkPaintGlue::measureText_StringIII},
-    {"native_breakText","(JJ[CIIFI[F)I", (void*) SkPaintGlue::breakTextC},
-    {"native_breakText","(JJLjava/lang/String;ZFI[F)I", (void*) SkPaintGlue::breakTextS},
-    {"native_getTextWidths","(JJ[CIII[F)I", (void*) SkPaintGlue::getTextWidths___CIII_F},
-    {"native_getTextWidths","(JJLjava/lang/String;III[F)I", (void*) SkPaintGlue::getTextWidths__StringIII_F},
+    {"finalizer", "(J)V", (void*) PaintGlue::finalizer},
+    {"native_init","()J", (void*) PaintGlue::init},
+    {"native_initWithPaint","(J)J", (void*) PaintGlue::initWithPaint},
+    {"native_reset","(J)V", (void*) PaintGlue::reset},
+    {"native_set","(JJ)V", (void*) PaintGlue::assign},
+    {"getFlags","()I", (void*) PaintGlue::getFlags},
+    {"setFlags","(I)V", (void*) PaintGlue::setFlags},
+    {"getHinting","()I", (void*) PaintGlue::getHinting},
+    {"setHinting","(I)V", (void*) PaintGlue::setHinting},
+    {"setAntiAlias","(Z)V", (void*) PaintGlue::setAntiAlias},
+    {"setSubpixelText","(Z)V", (void*) PaintGlue::setSubpixelText},
+    {"setLinearText","(Z)V", (void*) PaintGlue::setLinearText},
+    {"setUnderlineText","(Z)V", (void*) PaintGlue::setUnderlineText},
+    {"setStrikeThruText","(Z)V", (void*) PaintGlue::setStrikeThruText},
+    {"setFakeBoldText","(Z)V", (void*) PaintGlue::setFakeBoldText},
+    {"setFilterBitmap","(Z)V", (void*) PaintGlue::setFilterBitmap},
+    {"setDither","(Z)V", (void*) PaintGlue::setDither},
+    {"native_getStyle","(J)I", (void*) PaintGlue::getStyle},
+    {"native_setStyle","(JI)V", (void*) PaintGlue::setStyle},
+    {"getColor","()I", (void*) PaintGlue::getColor},
+    {"setColor","(I)V", (void*) PaintGlue::setColor},
+    {"getAlpha","()I", (void*) PaintGlue::getAlpha},
+    {"setAlpha","(I)V", (void*) PaintGlue::setAlpha},
+    {"getStrokeWidth","()F", (void*) PaintGlue::getStrokeWidth},
+    {"setStrokeWidth","(F)V", (void*) PaintGlue::setStrokeWidth},
+    {"getStrokeMiter","()F", (void*) PaintGlue::getStrokeMiter},
+    {"setStrokeMiter","(F)V", (void*) PaintGlue::setStrokeMiter},
+    {"native_getStrokeCap","(J)I", (void*) PaintGlue::getStrokeCap},
+    {"native_setStrokeCap","(JI)V", (void*) PaintGlue::setStrokeCap},
+    {"native_getStrokeJoin","(J)I", (void*) PaintGlue::getStrokeJoin},
+    {"native_setStrokeJoin","(JI)V", (void*) PaintGlue::setStrokeJoin},
+    {"native_getFillPath","(JJJ)Z", (void*) PaintGlue::getFillPath},
+    {"native_setShader","(JJ)J", (void*) PaintGlue::setShader},
+    {"native_setColorFilter","(JJ)J", (void*) PaintGlue::setColorFilter},
+    {"native_setXfermode","(JJ)J", (void*) PaintGlue::setXfermode},
+    {"native_setPathEffect","(JJ)J", (void*) PaintGlue::setPathEffect},
+    {"native_setMaskFilter","(JJ)J", (void*) PaintGlue::setMaskFilter},
+    {"native_setTypeface","(JJ)J", (void*) PaintGlue::setTypeface},
+    {"native_setRasterizer","(JJ)J", (void*) PaintGlue::setRasterizer},
+    {"native_getTextAlign","(J)I", (void*) PaintGlue::getTextAlign},
+    {"native_setTextAlign","(JI)V", (void*) PaintGlue::setTextAlign},
+    {"native_setTextLocale","(JLjava/lang/String;)V", (void*) PaintGlue::setTextLocale},
+    {"isElegantTextHeight","()Z", (void*) PaintGlue::isElegantTextHeight},
+    {"setElegantTextHeight","(Z)V", (void*) PaintGlue::setElegantTextHeight},
+    {"getTextSize","()F", (void*) PaintGlue::getTextSize},
+    {"setTextSize","(F)V", (void*) PaintGlue::setTextSize},
+    {"getTextScaleX","()F", (void*) PaintGlue::getTextScaleX},
+    {"setTextScaleX","(F)V", (void*) PaintGlue::setTextScaleX},
+    {"getTextSkewX","()F", (void*) PaintGlue::getTextSkewX},
+    {"setTextSkewX","(F)V", (void*) PaintGlue::setTextSkewX},
+    {"ascent","()F", (void*) PaintGlue::ascent},
+    {"descent","()F", (void*) PaintGlue::descent},
+    {"getFontMetrics", "(Landroid/graphics/Paint$FontMetrics;)F", (void*)PaintGlue::getFontMetrics},
+    {"getFontMetricsInt", "(Landroid/graphics/Paint$FontMetricsInt;)I", (void*)PaintGlue::getFontMetricsInt},
+    {"native_measureText","([CIII)F", (void*) PaintGlue::measureText_CIII},
+    {"native_measureText","(Ljava/lang/String;I)F", (void*) PaintGlue::measureText_StringI},
+    {"native_measureText","(Ljava/lang/String;III)F", (void*) PaintGlue::measureText_StringIII},
+    {"native_breakText","(JJ[CIIFI[F)I", (void*) PaintGlue::breakTextC},
+    {"native_breakText","(JJLjava/lang/String;ZFI[F)I", (void*) PaintGlue::breakTextS},
+    {"native_getTextWidths","(JJ[CIII[F)I", (void*) PaintGlue::getTextWidths___CIII_F},
+    {"native_getTextWidths","(JJLjava/lang/String;III[F)I", (void*) PaintGlue::getTextWidths__StringIII_F},
     {"native_getTextRunAdvances","(JJ[CIIIIZ[FI)F",
-        (void*) SkPaintGlue::getTextRunAdvances___CIIIIZ_FI},
+        (void*) PaintGlue::getTextRunAdvances___CIIIIZ_FI},
     {"native_getTextRunAdvances","(JJLjava/lang/String;IIIIZ[FI)F",
-        (void*) SkPaintGlue::getTextRunAdvances__StringIIIIZ_FI},
+        (void*) PaintGlue::getTextRunAdvances__StringIIIIZ_FI},
 
-    {"native_getTextRunCursor", "(J[CIIIII)I", (void*) SkPaintGlue::getTextRunCursor___C},
+    {"native_getTextRunCursor", "(J[CIIIII)I", (void*) PaintGlue::getTextRunCursor___C},
     {"native_getTextRunCursor", "(JLjava/lang/String;IIIII)I",
-        (void*) SkPaintGlue::getTextRunCursor__String},
-    {"native_getTextPath","(JJI[CIIFFJ)V", (void*) SkPaintGlue::getTextPath___C},
-    {"native_getTextPath","(JJILjava/lang/String;IIFFJ)V", (void*) SkPaintGlue::getTextPath__String},
+        (void*) PaintGlue::getTextRunCursor__String},
+    {"native_getTextPath","(JJI[CIIFFJ)V", (void*) PaintGlue::getTextPath___C},
+    {"native_getTextPath","(JJILjava/lang/String;IIFFJ)V", (void*) PaintGlue::getTextPath__String},
     {"nativeGetStringBounds", "(JJLjava/lang/String;IIILandroid/graphics/Rect;)V",
-                                        (void*) SkPaintGlue::getStringBounds },
+                                        (void*) PaintGlue::getStringBounds },
     {"nativeGetCharArrayBounds", "(JJ[CIIILandroid/graphics/Rect;)V",
-                                    (void*) SkPaintGlue::getCharArrayBounds },
-    {"native_setShadowLayer", "(JFFFI)V", (void*)SkPaintGlue::setShadowLayer},
-    {"native_hasShadowLayer", "(J)Z", (void*)SkPaintGlue::hasShadowLayer}
+                                    (void*) PaintGlue::getCharArrayBounds },
+    {"native_setShadowLayer", "(JFFFI)V", (void*)PaintGlue::setShadowLayer},
+    {"native_hasShadowLayer", "(J)Z", (void*)PaintGlue::hasShadowLayer}
 };
 
 static jfieldID req_fieldID(jfieldID id) {
diff --git a/core/jni/android/graphics/Paint.h b/core/jni/android/graphics/Paint.h
new file mode 100644
index 0000000..239b217
--- /dev/null
+++ b/core/jni/android/graphics/Paint.h
@@ -0,0 +1,42 @@
+/*
+ * 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 <SkPaint.h>
+
+namespace android {
+
+class 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);
+    }
+
+private:
+};
+
+}  // namespace android
+
+#endif // ANDROID_GRAPHICS_PAINT_H
diff --git a/core/jni/android/graphics/PaintImpl.cpp b/core/jni/android/graphics/PaintImpl.cpp
new file mode 100644
index 0000000..6baae76
--- /dev/null
+++ b/core/jni/android/graphics/PaintImpl.cpp
@@ -0,0 +1,43 @@
+/*
+ * 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"
+#include <SkPaint.h>
+
+#define LOG_TAG "Paint"
+#include <cutils/log.h>
+
+namespace android {
+
+Paint::Paint() : SkPaint() {
+}
+
+Paint::Paint(const Paint& paint) : SkPaint(paint) {
+}
+
+Paint::~Paint() {
+}
+
+Paint& Paint::operator=(const Paint& other) {
+    SkPaint::operator=(other);
+    return *this;
+}
+
+bool operator==(const Paint& a, const Paint& b) {
+    return static_cast<const SkPaint&>(a) == static_cast<const SkPaint&>(b);
+}
+
+}
diff --git a/core/jni/android/graphics/Rasterizer.cpp b/core/jni/android/graphics/Rasterizer.cpp
index a05d19b..2b1aca1 100644
--- a/core/jni/android/graphics/Rasterizer.cpp
+++ b/core/jni/android/graphics/Rasterizer.cpp
@@ -22,6 +22,7 @@
 
 #include "jni.h"
 #include "GraphicsJNI.h"
+#include "Paint.h"
 #include "SkLayerRasterizer.h"
 #include <android_runtime/AndroidRuntime.h>
 
@@ -79,7 +80,7 @@
 
     static void addLayer(JNIEnv* env, jobject, jlong layerHandle, jlong paintHandle, jfloat dx, jfloat dy) {
         NativeLayerRasterizer* nr = reinterpret_cast<NativeLayerRasterizer *>(layerHandle);
-        const SkPaint* paint = reinterpret_cast<SkPaint *>(paintHandle);
+        const Paint* paint = reinterpret_cast<Paint *>(paintHandle);
         SkASSERT(nr);
         SkASSERT(paint);
         nr->fBuilder.addLayer(*paint, dx, dy);
diff --git a/core/jni/android/graphics/SkiaCanvas.cpp b/core/jni/android/graphics/SkiaCanvas.cpp
index a4e0d28..f87033b 100644
--- a/core/jni/android/graphics/SkiaCanvas.cpp
+++ b/core/jni/android/graphics/SkiaCanvas.cpp
@@ -34,6 +34,7 @@
 #include "MinikinSkia.h"
 #include "MinikinUtils.h"
 
+#include "Paint.h"
 #include "TypefaceImpl.h"
 
 #include "unicode/ubidi.h"
@@ -68,7 +69,7 @@
     virtual void restoreToCount(int saveCount);
 
     virtual int saveLayer(float left, float top, float right, float bottom,
-                const SkPaint* paint, SkCanvas::SaveFlags flags);
+                const Paint* paint, SkCanvas::SaveFlags flags);
     virtual int saveLayerAlpha(float left, float top, float right, float bottom,
             int alpha, SkCanvas::SaveFlags flags);
 
@@ -90,39 +91,39 @@
     virtual void setDrawFilter(SkDrawFilter* drawFilter);
 
     virtual void drawColor(int color, SkXfermode::Mode mode);
-    virtual void drawPaint(const SkPaint& paint);
+    virtual void drawPaint(const Paint& paint);
 
-    virtual void drawPoint(float x, float y, const SkPaint& paint);
-    virtual void drawPoints(const float* points, int count, const SkPaint& paint);
+    virtual void drawPoint(float x, float y, const Paint& paint);
+    virtual void drawPoints(const float* points, int count, const Paint& paint);
     virtual void drawLine(float startX, float startY, float stopX, float stopY,
-            const SkPaint& paint);
-    virtual void drawLines(const float* points, int count, const SkPaint& paint);
-    virtual void drawRect(float left, float top, float right, float bottom, const SkPaint& paint);
+            const Paint& paint);
+    virtual void drawLines(const float* points, int count, const Paint& paint);
+    virtual void drawRect(float left, float top, float right, float bottom, const Paint& paint);
     virtual void drawRoundRect(float left, float top, float right, float bottom,
-            float rx, float ry, const SkPaint& paint);
-    virtual void drawCircle(float x, float y, float radius, const SkPaint& paint);
-    virtual void drawOval(float left, float top, float right, float bottom, const SkPaint& paint);
+            float rx, float ry, const Paint& paint);
+    virtual void drawCircle(float x, float y, float radius, const Paint& paint);
+    virtual void drawOval(float left, float top, float right, float bottom, const Paint& paint);
     virtual void drawArc(float left, float top, float right, float bottom,
-            float startAngle, float sweepAngle, bool useCenter, const SkPaint& paint);
-    virtual void drawPath(const SkPath& path, const SkPaint& paint);
+            float startAngle, float sweepAngle, bool useCenter, const Paint& paint);
+    virtual void drawPath(const SkPath& path, const Paint& paint);
     virtual void drawVertices(SkCanvas::VertexMode vertexMode, int vertexCount,
             const float* verts, const float* tex, const int* colors,
-            const uint16_t* indices, int indexCount, const SkPaint& paint);
+            const uint16_t* indices, int indexCount, const Paint& paint);
 
-    virtual void drawBitmap(const SkBitmap& bitmap, float left, float top, const SkPaint* paint);
-    virtual void drawBitmap(const SkBitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint);
+    virtual void drawBitmap(const SkBitmap& bitmap, float left, float top, const Paint* paint);
+    virtual void drawBitmap(const SkBitmap& bitmap, const SkMatrix& matrix, const Paint* paint);
     virtual void drawBitmap(const SkBitmap& bitmap, float srcLeft, float srcTop,
             float srcRight, float srcBottom, float dstLeft, float dstTop,
-            float dstRight, float dstBottom, const SkPaint* paint);
+            float dstRight, float dstBottom, const Paint* paint);
     virtual void drawBitmapMesh(const SkBitmap& bitmap, int meshWidth, int meshHeight,
-            const float* vertices, const int* colors, const SkPaint* paint);
+            const float* vertices, const int* colors, const Paint* paint);
 
     virtual void drawText(const uint16_t* text, int start, int count, int contextCount,
-            float x, float y, int bidiFlags, const SkPaint& paint, TypefaceImpl* typeface);
+            float x, float y, int bidiFlags, const Paint& paint, TypefaceImpl* typeface);
     virtual void drawPosText(const uint16_t* text, const float* positions, int count,
-            int posCount, const SkPaint& paint);
+            int posCount, const Paint& paint);
     virtual void drawTextOnPath(const uint16_t* glyphs, int count, const SkPath& path,
-            float hOffset, float vOffset, const SkPaint& paint);
+            float hOffset, float vOffset, const Paint& paint);
 
 private:
     struct SaveRec {
@@ -134,9 +135,9 @@
     void saveClipsForFrame(SkTArray<SkClipStack::Element>& clips, int frameSaveCount);
     void applyClips(const SkTArray<SkClipStack::Element>& clips);
 
-    void drawPoints(const float* points, int count, const SkPaint& paint,
+    void drawPoints(const float* points, int count, const Paint& paint,
                     SkCanvas::PointMode mode);
-    void drawTextDecorations(float x, float y, float length, const SkPaint& paint);
+    void drawTextDecorations(float x, float y, float length, const Paint& paint);
 
     SkAutoTUnref<SkCanvas> mCanvas;
     SkAutoTDelete<SkDeque> mSaveStack; // lazily allocated, tracks partial saves.
@@ -284,7 +285,7 @@
 }
 
 int SkiaCanvas::saveLayer(float left, float top, float right, float bottom,
-            const SkPaint* paint, SkCanvas::SaveFlags flags) {
+            const Paint* paint, SkCanvas::SaveFlags flags) {
     SkRect bounds = SkRect::MakeLTRB(left, top, right, bottom);
     int count = mCanvas->saveLayer(&bounds, paint, flags | SkCanvas::kMatrixClip_SaveFlag);
     recordPartialSave(flags);
@@ -466,7 +467,7 @@
     mCanvas->drawColor(color, mode);
 }
 
-void SkiaCanvas::drawPaint(const SkPaint& paint) {
+void SkiaCanvas::drawPaint(const Paint& paint) {
     mCanvas->drawPaint(paint);
 }
 
@@ -474,7 +475,7 @@
 // Canvas draw operations: Geometry
 // ----------------------------------------------------------------------------
 
-void SkiaCanvas::drawPoints(const float* points, int count, const SkPaint& paint,
+void SkiaCanvas::drawPoints(const float* points, int count, const Paint& paint,
                             SkCanvas::PointMode mode) {
     // convert the floats into SkPoints
     count >>= 1;    // now it is the number of points
@@ -488,57 +489,57 @@
 }
 
 
-void SkiaCanvas::drawPoint(float x, float y, const SkPaint& paint) {
+void SkiaCanvas::drawPoint(float x, float y, const Paint& paint) {
     mCanvas->drawPoint(x, y, paint);
 }
 
-void SkiaCanvas::drawPoints(const float* points, int count, const SkPaint& paint) {
+void SkiaCanvas::drawPoints(const float* points, int count, const Paint& paint) {
     this->drawPoints(points, count, paint, SkCanvas::kPoints_PointMode);
 }
 
 void SkiaCanvas::drawLine(float startX, float startY, float stopX, float stopY,
-                          const SkPaint& paint) {
+                          const Paint& paint) {
     mCanvas->drawLine(startX, startY, stopX, stopY, paint);
 }
 
-void SkiaCanvas::drawLines(const float* points, int count, const SkPaint& paint) {
+void SkiaCanvas::drawLines(const float* points, int count, const Paint& paint) {
     this->drawPoints(points, count, paint, SkCanvas::kLines_PointMode);
 }
 
 void SkiaCanvas::drawRect(float left, float top, float right, float bottom,
-        const SkPaint& paint) {
+        const Paint& paint) {
     mCanvas->drawRectCoords(left, top, right, bottom, paint);
 
 }
 
 void SkiaCanvas::drawRoundRect(float left, float top, float right, float bottom,
-        float rx, float ry, const SkPaint& paint) {
+        float rx, float ry, const Paint& paint) {
     SkRect rect = SkRect::MakeLTRB(left, top, right, bottom);
     mCanvas->drawRoundRect(rect, rx, ry, paint);
 }
 
-void SkiaCanvas::drawCircle(float x, float y, float radius, const SkPaint& paint) {
+void SkiaCanvas::drawCircle(float x, float y, float radius, const Paint& paint) {
     mCanvas->drawCircle(x, y, radius, paint);
 }
 
-void SkiaCanvas::drawOval(float left, float top, float right, float bottom, const SkPaint& paint) {
+void SkiaCanvas::drawOval(float left, float top, float right, float bottom, const Paint& paint) {
     SkRect oval = SkRect::MakeLTRB(left, top, right, bottom);
     mCanvas->drawOval(oval, paint);
 }
 
 void SkiaCanvas::drawArc(float left, float top, float right, float bottom,
-        float startAngle, float sweepAngle, bool useCenter, const SkPaint& paint) {
+        float startAngle, float sweepAngle, bool useCenter, const Paint& paint) {
     SkRect arc = SkRect::MakeLTRB(left, top, right, bottom);
     mCanvas->drawArc(arc, startAngle, sweepAngle, useCenter, paint);
 }
 
-void SkiaCanvas::drawPath(const SkPath& path, const SkPaint& paint) {
+void SkiaCanvas::drawPath(const SkPath& path, const Paint& paint) {
     mCanvas->drawPath(path, paint);
 }
 
 void SkiaCanvas::drawVertices(SkCanvas::VertexMode vertexMode, int vertexCount,
                               const float* verts, const float* texs, const int* colors,
-                              const uint16_t* indices, int indexCount, const SkPaint& paint) {
+                              const uint16_t* indices, int indexCount, const Paint& paint) {
 #ifndef SK_SCALAR_IS_FLOAT
     SkDEBUGFAIL("SkScalar must be a float for these conversions to be valid");
 #endif
@@ -551,24 +552,24 @@
 // Canvas draw operations: Bitmaps
 // ----------------------------------------------------------------------------
 
-void SkiaCanvas::drawBitmap(const SkBitmap& bitmap, float left, float top, const SkPaint* paint) {
+void SkiaCanvas::drawBitmap(const SkBitmap& bitmap, float left, float top, const Paint* paint) {
     mCanvas->drawBitmap(bitmap, left, top, paint);
 }
 
-void SkiaCanvas::drawBitmap(const SkBitmap& bitmap, const SkMatrix& matrix, const SkPaint* paint) {
+void SkiaCanvas::drawBitmap(const SkBitmap& bitmap, const SkMatrix& matrix, const Paint* paint) {
     mCanvas->drawBitmapMatrix(bitmap, matrix, paint);
 }
 
 void SkiaCanvas::drawBitmap(const SkBitmap& bitmap, float srcLeft, float srcTop,
                             float srcRight, float srcBottom, float dstLeft, float dstTop,
-                            float dstRight, float dstBottom, const SkPaint* paint) {
+                            float dstRight, float dstBottom, const Paint* paint) {
     SkRect srcRect = SkRect::MakeLTRB(srcLeft, srcTop, srcRight, srcBottom);
     SkRect dstRect = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom);
     mCanvas->drawBitmapRectToRect(bitmap, &srcRect, dstRect, paint);
 }
 
 void SkiaCanvas::drawBitmapMesh(const SkBitmap& bitmap, int meshWidth, int meshHeight,
-        const float* vertices, const int* colors, const SkPaint* paint) {
+        const float* vertices, const int* colors, const Paint* paint) {
 
     const int ptCount = (meshWidth + 1) * (meshHeight + 1);
     const int indexCount = meshWidth * meshHeight * 6;
@@ -650,7 +651,7 @@
 #endif
 
     // cons-up a shader for the bitmap
-    SkPaint tmpPaint;
+    Paint tmpPaint;
     if (paint) {
         tmpPaint = *paint;
     }
@@ -670,7 +671,7 @@
 
 class DrawTextFunctor {
 public:
-    DrawTextFunctor(const Layout& layout, SkCanvas* canvas, float x, float y, SkPaint* paint,
+    DrawTextFunctor(const Layout& layout, SkCanvas* canvas, float x, float y, Paint* paint,
                 uint16_t* glyphs, SkPoint* pos)
             : layout(layout), canvas(canvas), x(x), y(y), paint(paint), glyphs(glyphs),
                 pos(pos) { }
@@ -688,13 +689,13 @@
     SkCanvas* canvas;
     float x;
     float y;
-    SkPaint* paint;
+    Paint* paint;
     uint16_t* glyphs;
     SkPoint* pos;
 };
 
 void SkiaCanvas::drawText(const uint16_t* text, int start, int count, int contextCount,
-        float x, float y, int bidiFlags, const SkPaint& paint, TypefaceImpl* typeface) {
+        float x, float y, int bidiFlags, const Paint& paint, TypefaceImpl* typeface) {
     Layout layout;
     std::string css = MinikinUtils::setLayoutProperties(&layout, &paint, bidiFlags, typeface);
     layout.doLayout(text, start, count, contextCount, css);
@@ -703,10 +704,10 @@
     uint16_t* glyphs = new uint16_t[nGlyphs];
     SkPoint* pos = new SkPoint[nGlyphs];
 
-    SkPaint paintCopy(paint);
+    Paint paintCopy(paint);
     x += MinikinUtils::xOffsetForTextAlign(&paintCopy, layout);
-    paintCopy.setTextAlign(SkPaint::kLeft_Align);
-    paintCopy.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
+    paintCopy.setTextAlign(Paint::kLeft_Align);
+    paintCopy.setTextEncoding(Paint::kGlyphID_TextEncoding);
 
     DrawTextFunctor f(layout, mCanvas, x, y, &paintCopy, glyphs, pos);
     MinikinUtils::forFontRun(layout, &paintCopy, f);
@@ -721,27 +722,27 @@
 #define kStdUnderline_Offset    (1.0f / 9.0f)
 #define kStdUnderline_Thickness (1.0f / 18.0f)
 
-void SkiaCanvas::drawTextDecorations(float x, float y, float length, const SkPaint& paint) {
+void SkiaCanvas::drawTextDecorations(float x, float y, float length, const Paint& paint) {
     uint32_t flags;
     SkDrawFilter* drawFilter = mCanvas->getDrawFilter();
     if (drawFilter) {
-        SkPaint paintCopy(paint);
+        Paint paintCopy(paint);
         drawFilter->filter(&paintCopy, SkDrawFilter::kText_Type);
         flags = paintCopy.getFlags();
     } else {
         flags = paint.getFlags();
     }
-    if (flags & (SkPaint::kUnderlineText_Flag | SkPaint::kStrikeThruText_Flag)) {
+    if (flags & (Paint::kUnderlineText_Flag | Paint::kStrikeThruText_Flag)) {
         SkScalar left = x;
         SkScalar right = x + length;
         float textSize = paint.getTextSize();
         float strokeWidth = fmax(textSize * kStdUnderline_Thickness, 1.0f);
-        if (flags & SkPaint::kUnderlineText_Flag) {
+        if (flags & Paint::kUnderlineText_Flag) {
             SkScalar top = y + textSize * kStdUnderline_Offset - 0.5f * strokeWidth;
             SkScalar bottom = y + textSize * kStdUnderline_Offset + 0.5f * strokeWidth;
             mCanvas->drawRectCoords(left, top, right, bottom, paint);
         }
-        if (flags & SkPaint::kStrikeThruText_Flag) {
+        if (flags & Paint::kStrikeThruText_Flag) {
             SkScalar top = y + textSize * kStdStrikeThru_Offset - 0.5f * strokeWidth;
             SkScalar bottom = y + textSize * kStdStrikeThru_Offset + 0.5f * strokeWidth;
             mCanvas->drawRectCoords(left, top, right, bottom, paint);
@@ -750,7 +751,7 @@
 }
 
 void SkiaCanvas::drawPosText(const uint16_t* text, const float* positions, int count, int posCount,
-        const SkPaint& paint) {
+        const Paint& paint) {
     SkPoint* posPtr = posCount > 0 ? new SkPoint[posCount] : NULL;
     int indx;
     for (indx = 0; indx < posCount; indx++) {
@@ -758,15 +759,15 @@
         posPtr[indx].fY = positions[(indx << 1) + 1];
     }
 
-    SkPaint paintCopy(paint);
-    paintCopy.setTextEncoding(SkPaint::kUTF16_TextEncoding);
+    Paint paintCopy(paint);
+    paintCopy.setTextEncoding(Paint::kUTF16_TextEncoding);
     mCanvas->drawPosText(text, count, posPtr, paintCopy);
 
     delete[] posPtr;
 }
 
 void SkiaCanvas::drawTextOnPath(const uint16_t* glyphs, int count, const SkPath& path,
-        float hOffset, float vOffset, const SkPaint& paint) {
+        float hOffset, float vOffset, const Paint& paint) {
     mCanvas->drawTextOnPathHV(glyphs, count, path, hOffset, vOffset, paint);
 }
 
diff --git a/core/jni/android_graphics_Canvas.cpp b/core/jni/android_graphics_Canvas.cpp
index 46eccdd..377e71c 100644
--- a/core/jni/android_graphics_Canvas.cpp
+++ b/core/jni/android_graphics_Canvas.cpp
@@ -21,6 +21,7 @@
 #include "Canvas.h"
 #include "SkGraphics.h"
 #include "SkPorterDuff.h"
+#include "Paint.h"
 #include "TypefaceImpl.h"
 
 #include <minikin/Layout.h>
@@ -76,7 +77,7 @@
 
 static jint saveLayer(JNIEnv* env, jobject, jlong canvasHandle, jfloat l, jfloat t,
                       jfloat r, jfloat b, jlong paintHandle, jint flagsHandle) {
-    SkPaint* paint  = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint  = reinterpret_cast<Paint*>(paintHandle);
     SkCanvas::SaveFlags flags = static_cast<SkCanvas::SaveFlags>(flagsHandle);
     return static_cast<jint>(get_canvas(canvasHandle)->saveLayer(l, t, r, b, paint, flags));
 }
@@ -191,13 +192,13 @@
 }
 
 static void drawPaint(JNIEnv* env, jobject, jlong canvasHandle, jlong paintHandle) {
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawPaint(*paint);
 }
 
 static void drawPoint(JNIEnv*, jobject, jlong canvasHandle, jfloat x, jfloat y,
                       jlong paintHandle) {
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawPoint(x, y, *paint);
 }
 
@@ -213,13 +214,13 @@
         return;
     }
 
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawPoints(floats + offset, count, *paint);
 }
 
 static void drawLine(JNIEnv* env, jobject, jlong canvasHandle, jfloat startX, jfloat startY,
                      jfloat stopX, jfloat stopY, jlong paintHandle) {
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawLine(startX, startY, stopX, stopY, *paint);
 }
 
@@ -235,38 +236,38 @@
         return;
     }
 
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawLines(floats + offset, count, *paint);
 }
 
 static void drawRect(JNIEnv* env, jobject, jlong canvasHandle, jfloat left, jfloat top,
                      jfloat right, jfloat bottom, jlong paintHandle) {
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawRect(left, top, right, bottom, *paint);
 }
 
 static void drawRoundRect(JNIEnv* env, jobject, jlong canvasHandle, jfloat left, jfloat top,
                           jfloat right, jfloat bottom, jfloat rx, jfloat ry, jlong paintHandle) {
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawRoundRect(left, top, right, bottom, rx, ry, *paint);
 }
 
 static void drawCircle(JNIEnv* env, jobject, jlong canvasHandle, jfloat cx, jfloat cy,
                        jfloat radius, jlong paintHandle) {
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawCircle(cx, cy, radius, *paint);
 }
 
 static void drawOval(JNIEnv* env, jobject, jlong canvasHandle, jfloat left, jfloat top,
                      jfloat right, jfloat bottom, jlong paintHandle) {
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawOval(left, top, right, bottom, *paint);
 }
 
 static void drawArc(JNIEnv* env, jobject, jlong canvasHandle, jfloat left, jfloat top,
                     jfloat right, jfloat bottom, jfloat startAngle, jfloat sweepAngle,
                     jboolean useCenter, jlong paintHandle) {
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawArc(left, top, right, bottom, startAngle, sweepAngle,
                                        useCenter, *paint);
 }
@@ -274,7 +275,7 @@
 static void drawPath(JNIEnv* env, jobject, jlong canvasHandle, jlong pathHandle,
                      jlong paintHandle) {
     const SkPath* path = reinterpret_cast<SkPath*>(pathHandle);
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawPath(*path, *paint);
 }
 
@@ -303,7 +304,7 @@
     }
 
     SkCanvas::VertexMode mode = static_cast<SkCanvas::VertexMode>(modeHandle);
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawVertices(mode, vertexCount, verts, texs, colors,
                                            indices, indexCount, *paint);
 }
@@ -313,15 +314,15 @@
                        jint screenDensity, jint bitmapDensity) {
     Canvas* canvas = get_canvas(canvasHandle);
     const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
 
     if (canvasDensity == bitmapDensity || canvasDensity == 0 || bitmapDensity == 0) {
         if (screenDensity != 0 && screenDensity != bitmapDensity) {
-            SkPaint filteredPaint;
+            Paint filteredPaint;
             if (paint) {
                 filteredPaint = *paint;
             }
-            filteredPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
+            filteredPaint.setFilterLevel(Paint::kLow_FilterLevel);
             canvas->drawBitmap(*bitmap, left, top, &filteredPaint);
         } else {
             canvas->drawBitmap(*bitmap, left, top, paint);
@@ -332,11 +333,11 @@
         canvas->translate(left, top);
         canvas->scale(scale, scale);
 
-        SkPaint filteredPaint;
+        Paint filteredPaint;
         if (paint) {
             filteredPaint = *paint;
         }
-        filteredPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
+        filteredPaint.setFilterLevel(Paint::kLow_FilterLevel);
 
         canvas->drawBitmap(*bitmap, 0, 0, &filteredPaint);
         canvas->restore();
@@ -347,7 +348,7 @@
                              jlong matrixHandle, jlong paintHandle) {
     const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
     const SkMatrix* matrix = reinterpret_cast<SkMatrix*>(matrixHandle);
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawBitmap(*bitmap, *matrix, paint);
 }
 
@@ -357,14 +358,14 @@
                            jlong paintHandle, jint screenDensity, jint bitmapDensity) {
     Canvas* canvas = get_canvas(canvasHandle);
     const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
 
     if (screenDensity != 0 && screenDensity != bitmapDensity) {
-        SkPaint filteredPaint;
+        Paint filteredPaint;
         if (paint) {
             filteredPaint = *paint;
         }
-        filteredPaint.setFilterLevel(SkPaint::kLow_FilterLevel);
+        filteredPaint.setFilterLevel(Paint::kLow_FilterLevel);
         canvas->drawBitmap(*bitmap, srcLeft, srcTop, srcRight, srcBottom,
                            dstLeft, dstTop, dstRight, dstBottom, &filteredPaint);
     } else {
@@ -391,7 +392,7 @@
         return;
     }
 
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawBitmap(bitmap, x, y, paint);
 }
 
@@ -403,7 +404,7 @@
     AutoJavaIntArray colorA(env, jcolors, colorIndex + ptCount);
 
     const SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle);
-    const SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    const Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     get_canvas(canvasHandle)->drawBitmapMesh(*bitmap, meshWidth, meshHeight,
                                              vertA.ptr(), colorA.ptr(), paint);
 }
@@ -411,7 +412,7 @@
 static void drawTextChars(JNIEnv* env, jobject, jlong canvasHandle, jcharArray text,
                           jint index, jint count, jfloat x, jfloat y, jint bidiFlags,
                           jlong paintHandle, jlong typefaceHandle) {
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
     jchar* jchars = env->GetCharArrayElements(text, NULL);
     get_canvas(canvasHandle)->drawText(jchars + index, 0, count, count, x, y,
@@ -422,7 +423,7 @@
 static void drawTextString(JNIEnv* env, jobject, jlong canvasHandle, jstring text,
                            jint start, jint end, jfloat x, jfloat y, jint bidiFlags,
                            jlong paintHandle, jlong typefaceHandle) {
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
     const int count = end - start;
     const jchar* jchars = env->GetStringChars(text, NULL);
@@ -434,7 +435,7 @@
 static void drawTextRunChars(JNIEnv* env, jobject, jlong canvasHandle, jcharArray text, jint index,
                              jint count, jint contextIndex, jint contextCount, jfloat x, jfloat y,
                              jboolean isRtl, jlong paintHandle, jlong typefaceHandle) {
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
 
     const int bidiFlags = isRtl ? kBidi_Force_RTL : kBidi_Force_LTR;
@@ -448,7 +449,7 @@
                               jint start, jint end, jint contextStart, jint contextEnd,
                               jfloat x, jfloat y, jboolean isRtl, jlong paintHandle,
                               jlong typefaceHandle) {
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
 
     int bidiFlags = isRtl ? kBidi_Force_RTL : kBidi_Force_LTR;
@@ -462,7 +463,7 @@
 
 static void drawPosTextChars(JNIEnv* env, jobject, jlong canvasHandle, jcharArray text,
                              jint index, jint count, jfloatArray pos, jlong paintHandle) {
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     jchar* jchars = text ? env->GetCharArrayElements(text, NULL) : NULL;
     float* posArray = pos ? env->GetFloatArrayElements(pos, NULL) : NULL;
     int posCount = pos ? env->GetArrayLength(pos) >> 1: 0;
@@ -480,7 +481,7 @@
 
 static void drawPosTextString(JNIEnv* env, jobject, jlong canvasHandle, jstring text,
                               jfloatArray pos, jlong paintHandle) {
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     const jchar* jchars = text ? env->GetStringChars(text, NULL) : NULL;
     int byteLength = text ? env->GetStringLength(text) : 0;
     float* posArray = pos ? env->GetFloatArrayElements(pos, NULL) : NULL;
@@ -499,7 +500,7 @@
 class DrawTextOnPathFunctor {
 public:
     DrawTextOnPathFunctor(const Layout& layout, Canvas* canvas, float hOffset,
-                float vOffset, const SkPaint& paint, const SkPath& path)
+                float vOffset, const Paint& paint, const SkPath& path)
             : layout(layout), canvas(canvas), hOffset(hOffset), vOffset(vOffset),
                 paint(paint), path(path) {
     }
@@ -517,14 +518,14 @@
     Canvas* canvas;
     float hOffset;
     float vOffset;
-    const SkPaint& paint;
+    const Paint& paint;
     const SkPath& path;
 };
 
 static void drawTextOnPath(Canvas* canvas, const uint16_t* text, int count, int bidiFlags,
                            const SkPath& path, float hOffset, float vOffset,
-                           const SkPaint& paint, TypefaceImpl* typeface) {
-    SkPaint paintCopy(paint);
+                           const Paint& paint, TypefaceImpl* typeface) {
+    Paint paintCopy(paint);
     Layout layout;
     std::string css = MinikinUtils::setLayoutProperties(&layout, &paintCopy, bidiFlags, typeface);
     layout.doLayout(text, 0, count, count, css);
@@ -533,7 +534,7 @@
     // 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(SkPaint::kLeft_Align);
+    paintCopy.setTextAlign(Paint::kLeft_Align);
 
     DrawTextOnPathFunctor f(layout, canvas, hOffset, vOffset, paintCopy, path);
     MinikinUtils::forFontRun(layout, &paintCopy, f);
@@ -544,7 +545,7 @@
                                 jfloat vOffset, jint bidiFlags, jlong paintHandle,
                                 jlong typefaceHandle) {
     SkPath* path = reinterpret_cast<SkPath*>(pathHandle);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
 
     jchar* jchars = env->GetCharArrayElements(text, NULL);
@@ -559,7 +560,7 @@
                                  jlong pathHandle, jfloat hOffset, jfloat vOffset,
                                  jint bidiFlags, jlong paintHandle, jlong typefaceHandle) {
     SkPath* path = reinterpret_cast<SkPath*>(pathHandle);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintHandle);
+    Paint* paint = reinterpret_cast<Paint*>(paintHandle);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefaceHandle);
 
     const jchar* jchars = env->GetStringChars(text, NULL);
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index 8641e73..0a259aa 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -32,7 +32,6 @@
 #include <SkCanvas.h>
 #include <SkImageInfo.h>
 #include <SkMatrix.h>
-#include <SkPaint.h>
 #include <SkPorterDuff.h>
 #include <SkRegion.h>
 #include <SkScalerContext.h>
@@ -43,6 +42,7 @@
 #include <Rect.h>
 #include <RenderNode.h>
 #include <CanvasProperty.h>
+#include <Paint.h>
 
 #include <minikin/Layout.h>
 #include "MinikinSkia.h"
@@ -203,14 +203,14 @@
         jlong rendererPtr, jfloat left, jfloat top, jfloat right, jfloat bottom,
         jlong paintPtr, jint saveFlags) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     return renderer->saveLayer(left, top, right, bottom, paint, saveFlags);
 }
 
 static jint android_view_GLES20Canvas_saveLayerClip(JNIEnv* env, jobject clazz,
         jlong rendererPtr, jlong paintPtr, jint saveFlags) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     const android::uirenderer::Rect& bounds(renderer->getLocalClipBounds());
     return renderer->saveLayer(bounds.left, bounds.top, bounds.right, bounds.bottom,
             paint, saveFlags);
@@ -349,7 +349,7 @@
     JavaHeapBitmapRef bitmapRef(env, bitmap, buffer);
 
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawBitmap(bitmap, left, top, paint);
 }
 
@@ -362,7 +362,7 @@
     JavaHeapBitmapRef bitmapRef(env, bitmap, buffer);
 
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawBitmap(bitmap, srcLeft, srcTop, srcRight, srcBottom,
             dstLeft, dstTop, dstRight, dstBottom, paint);
 }
@@ -376,7 +376,7 @@
 
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     SkMatrix* matrix = reinterpret_cast<SkMatrix*>(matrixPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawBitmap(bitmap, *matrix, paint);
 }
 
@@ -400,7 +400,7 @@
     }
 
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawBitmapData(bitmap, left, top, paint);
 
     // Note - bitmap isn't deleted as DisplayListRenderer owns it now
@@ -418,7 +418,7 @@
     jint* colorsArray = colors ? env->GetIntArrayElements(colors, NULL) + colorOffset : NULL;
 
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawBitmapMesh(bitmap, meshWidth, meshHeight, verticesArray, colorsArray, paint);
 
     if (vertices) env->ReleaseFloatArrayElements(vertices, verticesArray, 0);
@@ -434,7 +434,7 @@
 
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     Res_png_9patch* patch = reinterpret_cast<Res_png_9patch*>(patchPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawPatch(bitmap, patch, left, top, right, bottom, paint);
 }
 
@@ -449,7 +449,7 @@
         jlong rendererPtr, jfloat left, jfloat top, jfloat right, jfloat bottom,
         jlong paintPtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawRect(left, top, right, bottom, paint);
 }
 
@@ -457,14 +457,14 @@
         jlong rendererPtr, jfloat left, jfloat top, jfloat right, jfloat bottom,
         jfloat rx, jfloat ry, jlong paintPtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawRoundRect(left, top, right, bottom, rx, ry, paint);
 }
 
 static void android_view_GLES20Canvas_drawCircle(JNIEnv* env, jobject clazz,
         jlong rendererPtr, jfloat x, jfloat y, jfloat radius, jlong paintPtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawCircle(x, y, radius, paint);
 }
 
@@ -482,7 +482,7 @@
         jlong rendererPtr, jfloat left, jfloat top, jfloat right, jfloat bottom,
         jlong paintPtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawOval(left, top, right, bottom, paint);
 }
 
@@ -490,7 +490,7 @@
         jlong rendererPtr, jfloat left, jfloat top, jfloat right, jfloat bottom,
         jfloat startAngle, jfloat sweepAngle, jboolean useCenter, jlong paintPtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawArc(left, top, right, bottom, startAngle, sweepAngle, useCenter, paint);
 }
 
@@ -498,8 +498,8 @@
         jlong rendererPtr, jlong regionPtr, jlong paintPtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     SkRegion* region = reinterpret_cast<SkRegion*>(regionPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
-    if (paint->getStyle() != SkPaint::kFill_Style ||
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
+    if (paint->getStyle() != Paint::kFill_Style ||
             (paint->isAntiAlias() && !renderer->isCurrentTransformSimple())) {
         SkRegion::Iterator it(*region);
         while (!it.done()) {
@@ -528,7 +528,7 @@
         jlong rendererPtr, jfloatArray points, jint offset, jint count, jlong paintPtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     jfloat* storage = env->GetFloatArrayElements(points, NULL);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawPoints(storage + offset, count, paint);
     env->ReleaseFloatArrayElements(points, storage, 0);
 }
@@ -537,7 +537,7 @@
         jlong rendererPtr, jlong pathPtr, jlong paintPtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     SkPath* path = reinterpret_cast<SkPath*>(pathPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawPath(path, paint);
 }
 
@@ -545,7 +545,7 @@
         jlong rendererPtr, jfloatArray points, jint offset, jint count, jlong paintPtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     jfloat* storage = env->GetFloatArrayElements(points, NULL);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     renderer->drawLines(storage + offset, count, paint);
     env->ReleaseFloatArrayElements(points, storage, 0);
 }
@@ -573,7 +573,7 @@
 class RenderTextFunctor {
 public:
     RenderTextFunctor(const Layout& layout, DisplayListRenderer* renderer, jfloat x, jfloat y,
-                SkPaint* paint, uint16_t* glyphs, float* pos, float totalAdvance,
+                Paint* paint, uint16_t* glyphs, float* pos, float totalAdvance,
                 uirenderer::Rect& bounds)
             : layout(layout), renderer(renderer), x(x), y(y), paint(paint), glyphs(glyphs),
             pos(pos), totalAdvance(totalAdvance), bounds(bounds) { }
@@ -593,7 +593,7 @@
     DisplayListRenderer* renderer;
     jfloat x;
     jfloat y;
-    SkPaint* paint;
+    Paint* paint;
     uint16_t* glyphs;
     float* pos;
     float totalAdvance;
@@ -601,7 +601,7 @@
 };
 
 static void renderTextLayout(DisplayListRenderer* renderer, Layout* layout,
-    jfloat x, jfloat y, SkPaint* paint) {
+    jfloat x, jfloat y, Paint* paint) {
     size_t nGlyphs = layout->nGlyphs();
     float* pos = new float[nGlyphs * 2];
     uint16_t* glyphs = new uint16_t[nGlyphs];
@@ -618,7 +618,7 @@
 }
 
 static void renderText(DisplayListRenderer* renderer, const jchar* text, int count,
-        jfloat x, jfloat y, int bidiFlags, SkPaint* paint, TypefaceImpl* typeface) {
+        jfloat x, jfloat y, int bidiFlags, Paint* paint, TypefaceImpl* typeface) {
     Layout layout;
     std::string css = MinikinUtils::setLayoutProperties(&layout, paint, bidiFlags, typeface);
     layout.doLayout(text, 0, count, count, css);
@@ -629,7 +629,7 @@
 class RenderTextOnPathFunctor {
 public:
     RenderTextOnPathFunctor(const Layout& layout, DisplayListRenderer* renderer, float hOffset,
-                float vOffset, SkPaint* paint, SkPath* path)
+                float vOffset, Paint* paint, SkPath* path)
             : layout(layout), renderer(renderer), hOffset(hOffset), vOffset(vOffset),
                 paint(paint), path(path) {
     }
@@ -647,19 +647,19 @@
     DisplayListRenderer* renderer;
     float hOffset;
     float vOffset;
-    SkPaint* paint;
+    Paint* paint;
     SkPath* path;
 };
 
 static void renderTextOnPath(DisplayListRenderer* renderer, const jchar* text, int count,
-        SkPath* path, jfloat hOffset, jfloat vOffset, int bidiFlags, SkPaint* paint,
+        SkPath* path, jfloat hOffset, jfloat vOffset, int bidiFlags, Paint* paint,
         TypefaceImpl* typeface) {
     Layout layout;
     std::string css = MinikinUtils::setLayoutProperties(&layout, paint, bidiFlags, typeface);
     layout.doLayout(text, 0, count, count, css);
     hOffset += MinikinUtils::hOffsetForTextAlign(paint, layout, *path);
-    SkPaint::Align align = paint->getTextAlign();
-    paint->setTextAlign(SkPaint::kLeft_Align);
+    Paint::Align align = paint->getTextAlign();
+    paint->setTextAlign(Paint::kLeft_Align);
 
     RenderTextOnPathFunctor f(layout, renderer, hOffset, vOffset, paint, path);
     MinikinUtils::forFontRun(layout, paint, f);
@@ -668,7 +668,7 @@
 
 static void renderTextRun(DisplayListRenderer* renderer, const jchar* text,
         jint start, jint count, jint contextCount, jfloat x, jfloat y,
-        int bidiFlags, SkPaint* paint, TypefaceImpl* typeface) {
+        int bidiFlags, Paint* paint, TypefaceImpl* typeface) {
     Layout layout;
     std::string css = MinikinUtils::setLayoutProperties(&layout, paint, bidiFlags, typeface);
     layout.doLayout(text, start, count, contextCount, css);
@@ -681,7 +681,7 @@
         jfloat x, jfloat y, jint bidiFlags, jlong paintPtr, jlong typefacePtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     jchar* textArray = env->GetCharArrayElements(text, NULL);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefacePtr);
 
     renderText(renderer, textArray + index, count, x, y, bidiFlags, paint, typeface);
@@ -693,7 +693,7 @@
         jfloat x, jfloat y, jint bidiFlags, jlong paintPtr, jlong typefacePtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     const jchar* textArray = env->GetStringChars(text, NULL);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefacePtr);
 
     renderText(renderer, textArray + start, end - start, x, y, bidiFlags, paint, typeface);
@@ -707,7 +707,7 @@
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     jchar* textArray = env->GetCharArrayElements(text, NULL);
     SkPath* path = reinterpret_cast<SkPath*>(pathPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefacePtr);
 
     renderTextOnPath(renderer, textArray + index, count, path,
@@ -722,7 +722,7 @@
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     const jchar* textArray = env->GetStringChars(text, NULL);
     SkPath* path = reinterpret_cast<SkPath*>(pathPtr);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefacePtr);
 
     renderTextOnPath(renderer, textArray + start, end - start, path,
@@ -736,7 +736,7 @@
         jlong paintPtr, jlong typefacePtr) {
     DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
     jchar* textArray = env->GetCharArrayElements(text, NULL);
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefacePtr);
 
     int bidiFlags = isRtl ? kBidi_Force_RTL : kBidi_Force_LTR;
@@ -753,7 +753,7 @@
     const jchar* textArray = env->GetStringChars(text, NULL);
     jint count = end - start;
     jint contextCount = contextEnd - contextStart;
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     TypefaceImpl* typeface = reinterpret_cast<TypefaceImpl*>(typefacePtr);
 
     int bidiFlags = isRtl ? kBidi_Force_RTL : kBidi_Force_LTR;
diff --git a/core/jni/android_view_HardwareLayer.cpp b/core/jni/android_view_HardwareLayer.cpp
index 50edb76..aa674de 100644
--- a/core/jni/android_view_HardwareLayer.cpp
+++ b/core/jni/android_view_HardwareLayer.cpp
@@ -25,10 +25,10 @@
 
 #include <gui/GLConsumer.h>
 
+#include <Paint.h>
 #include <SkBitmap.h>
 #include <SkCanvas.h>
 #include <SkMatrix.h>
-#include <SkPaint.h>
 #include <SkXfermode.h>
 
 #include <DeferredLayerUpdater.h>
@@ -56,7 +56,7 @@
         jlong layerUpdaterPtr, jlong paintPtr) {
     DeferredLayerUpdater* layer = reinterpret_cast<DeferredLayerUpdater*>(layerUpdaterPtr);
     if (layer) {
-        SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+        Paint* paint = reinterpret_cast<Paint*>(paintPtr);
         layer->setPaint(paint);
     }
 }
diff --git a/core/jni/android_view_RenderNode.cpp b/core/jni/android_view_RenderNode.cpp
index 28473e0..c6ae9cc 100644
--- a/core/jni/android_view_RenderNode.cpp
+++ b/core/jni/android_view_RenderNode.cpp
@@ -26,6 +26,7 @@
 #include <Animator.h>
 #include <DisplayListRenderer.h>
 #include <RenderNode.h>
+#include <Paint.h>
 
 namespace android {
 
@@ -95,7 +96,7 @@
 
 static jboolean android_view_RenderNode_setLayerPaint(JNIEnv* env,
         jobject clazz, jlong renderNodePtr, jlong paintPtr) {
-    SkPaint* paint = reinterpret_cast<SkPaint*>(paintPtr);
+    Paint* paint = reinterpret_cast<Paint*>(paintPtr);
     return SET_AND_DIRTY(mutateLayerProperties().setFromPaint, paint, RenderNode::GENERIC);
 }