sk_sp: fix contravariant constructors

TBR=reed
This is obviously correct and needs to be fixed.

Review URL: https://codereview.chromium.org/1771583002
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index 9e8f3be..9b05ad4 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -250,7 +250,7 @@
      */
     sk_sp(const sk_sp<T>& that) : fPtr(SkSafeRef(that.get())) {}
     template <typename U,
-              typename = skstd::enable_if_t<skstd::is_convertible<U, T>::value>>
+              typename = skstd::enable_if_t<skstd::is_convertible<U*, T*>::value>>
     sk_sp(const sk_sp<U>& that) : fPtr(SkSafeRef(that.get())) {}
 
     /**
@@ -260,7 +260,7 @@
      */
     sk_sp(sk_sp<T>&& that) : fPtr(that.release()) {}
     template <typename U,
-              typename = skstd::enable_if_t<skstd::is_convertible<U, T>::value>>
+              typename = skstd::enable_if_t<skstd::is_convertible<U*, T*>::value>>
     sk_sp(sk_sp<U>&& that) : fPtr(that.release()) {}
 
     /**
@@ -288,7 +288,7 @@
         return *this;
     }
     template <typename U,
-              typename = skstd::enable_if_t<skstd::is_convertible<U, T>::value>>
+              typename = skstd::enable_if_t<skstd::is_convertible<U*, T*>::value>>
     sk_sp<T>& operator=(const sk_sp<U>& that) {
         this->reset(SkSafeRef(that.get()));
         return *this;
@@ -304,7 +304,7 @@
         return *this;
     }
     template <typename U,
-              typename = skstd::enable_if_t<skstd::is_convertible<U, T>::value>>
+              typename = skstd::enable_if_t<skstd::is_convertible<U*, T*>::value>>
     sk_sp<T>& operator=(sk_sp<U>&& that) {
         this->reset(that.release());
         return *this;
diff --git a/tests/RefCntTest.cpp b/tests/RefCntTest.cpp
index 60a34ec..8914ccf 100644
--- a/tests/RefCntTest.cpp
+++ b/tests/RefCntTest.cpp
@@ -274,3 +274,19 @@
     check(reporter, 1, 2, 1, 1);
 }
 
+namespace {
+struct FooAbstract : public SkRefCnt {
+    virtual void f() = 0;
+};
+struct FooConcrete : public FooAbstract {
+    void f() override {}
+};
+}
+static sk_sp<FooAbstract> make_foo() {
+    // can not cast FooConcrete to FooAbstract.
+    // can cast FooConcrete* to FooAbstract*.
+    return sk_make_sp<FooConcrete>();
+}
+DEF_TEST(sk_make_sp, r) {
+    auto x = make_foo();
+}