| 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 #include "android_webview/native/aw_picture.h" | 5 #include "android_webview/native/aw_picture.h" |
| 6 | 6 |
| 7 #include "android_webview/native/java_browser_view_renderer_helper.h" | 7 #include "android_webview/native/java_browser_view_renderer_helper.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "jni/AwPicture_jni.h" | 9 #include "jni/AwPicture_jni.h" |
| 10 #include "third_party/skia/include/core/SkPicture.h" | 10 #include "third_party/skia/include/core/SkPicture.h" |
| 11 | 11 |
| 12 namespace android_webview { | 12 namespace android_webview { |
| 13 | 13 |
| 14 AwPicture::AwPicture(skia::RefPtr<SkPicture> picture) | 14 AwPicture::AwPicture(sk_sp<SkPicture> picture) |
| 15 : picture_(picture) { | 15 : picture_(std::move(picture)) { |
| 16 DCHECK(picture_); | 16 DCHECK(picture_); |
| 17 } | 17 } |
| 18 | 18 |
| 19 AwPicture::~AwPicture() {} | 19 AwPicture::~AwPicture() {} |
| 20 | 20 |
| 21 void AwPicture::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 21 void AwPicture::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 22 delete this; | 22 delete this; |
| 23 } | 23 } |
| 24 | 24 |
| 25 jint AwPicture::GetWidth(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 25 jint AwPicture::GetWidth(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 43 return; | 43 return; |
| 44 } | 44 } |
| 45 picture_->playback(canvas_holder->GetCanvas()); | 45 picture_->playback(canvas_holder->GetCanvas()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool RegisterAwPicture(JNIEnv* env) { | 48 bool RegisterAwPicture(JNIEnv* env) { |
| 49 return RegisterNativesImpl(env); | 49 return RegisterNativesImpl(env); |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace android_webview | 52 } // namespace android_webview |
| OLD | NEW |