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