| OLD | NEW | 
|   1 // Copyright 2013 The Chromium Authors. All rights reserved. |   1 // Copyright 2013 The Chromium Authors. All rights reserved. | 
|   2 // Use of this source code is governed by a BSD-style license that can be |   2 // Use of this source code is governed by a BSD-style license that can be | 
|   3 // found in the LICENSE file. |   3 // found in the LICENSE file. | 
|   4  |   4  | 
|   5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_PICTURE_H_ |   5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_PICTURE_H_ | 
|   6 #define ANDROID_WEBVIEW_NATIVE_AW_PICTURE_H_ |   6 #define ANDROID_WEBVIEW_NATIVE_AW_PICTURE_H_ | 
|   7  |   7  | 
|   8 #include <jni.h> |   8 #include <jni.h> | 
|   9  |   9  | 
|  10 #include <memory> |  10 #include <memory> | 
|  11  |  11  | 
|  12 #include "base/android/jni_weak_ref.h" |  12 #include "base/android/jni_weak_ref.h" | 
|  13 #include "base/android/scoped_java_ref.h" |  13 #include "base/android/scoped_java_ref.h" | 
|  14 #include "base/macros.h" |  14 #include "base/macros.h" | 
|  15 #include "content/public/browser/web_contents_observer.h" |  15 #include "content/public/browser/web_contents_observer.h" | 
|  16 #include "skia/ext/refptr.h" |  16 #include "third_party/skia/include/core/SkRefCnt.h" | 
|  17  |  17  | 
|  18 class SkPicture; |  18 class SkPicture; | 
|  19  |  19  | 
|  20 namespace android_webview { |  20 namespace android_webview { | 
|  21  |  21  | 
|  22 class AwPicture { |  22 class AwPicture { | 
|  23  public: |  23  public: | 
|  24   AwPicture(skia::RefPtr<SkPicture> picture); |  24   AwPicture(sk_sp<SkPicture> picture); | 
|  25   ~AwPicture(); |  25   ~AwPicture(); | 
|  26  |  26  | 
|  27   // Methods called from Java. |  27   // Methods called from Java. | 
|  28   void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |  28   void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 
|  29   jint GetWidth(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |  29   jint GetWidth(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 
|  30   jint GetHeight(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |  30   jint GetHeight(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); | 
|  31   void Draw(JNIEnv* env, |  31   void Draw(JNIEnv* env, | 
|  32             const base::android::JavaParamRef<jobject>& obj, |  32             const base::android::JavaParamRef<jobject>& obj, | 
|  33             const base::android::JavaParamRef<jobject>& canvas); |  33             const base::android::JavaParamRef<jobject>& canvas); | 
|  34  |  34  | 
|  35  private: |  35  private: | 
|  36   skia::RefPtr<SkPicture> picture_; |  36   sk_sp<SkPicture> picture_; | 
|  37  |  37  | 
|  38   DISALLOW_IMPLICIT_CONSTRUCTORS(AwPicture); |  38   DISALLOW_IMPLICIT_CONSTRUCTORS(AwPicture); | 
|  39 }; |  39 }; | 
|  40  |  40  | 
|  41 bool RegisterAwPicture(JNIEnv* env); |  41 bool RegisterAwPicture(JNIEnv* env); | 
|  42  |  42  | 
|  43 }  // android_webview |  43 }  // android_webview | 
|  44  |  44  | 
|  45 #endif  // ANDROID_WEBVIEW_NATIVE_AW_PICTURE_ |  45 #endif  // ANDROID_WEBVIEW_NATIVE_AW_PICTURE_ | 
| OLD | NEW |