| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/android/content_view_render_view.h" | 5 #include "content/browser/android/content_view_render_view.h" |
| 6 | 6 |
| 7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/android/jni_android.h" | 12 #include "base/android/jni_android.h" |
| 13 #include "base/android/jni_string.h" | 13 #include "base/android/jni_string.h" |
| 14 #include "base/android/scoped_java_ref.h" | 14 #include "base/android/scoped_java_ref.h" |
| 15 #include "base/bind.h" | 15 #include "base/bind.h" |
| 16 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "cc/layers/layer.h" | 18 #include "cc/layers/layer.h" |
| 19 #include "content/public/browser/android/compositor.h" | 19 #include "content/public/browser/android/compositor.h" |
| 20 #include "content/public/browser/android/content_view_layer_renderer.h" | 20 #include "content/public/browser/android/content_view_layer_renderer.h" |
| 21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
| 22 #include "jni/ContentViewRenderView_jni.h" | 22 #include "jni/ContentViewRenderView_jni.h" |
| 23 #include "ui/android/view_android.h" | 23 #include "ui/android/view_android.h" |
| 24 #include "ui/gfx/android/java_bitmap.h" | 24 #include "ui/gfx/android/java_bitmap.h" |
| 25 #include "ui/gfx/geometry/size.h" | 25 #include "ui/gfx/geometry/size.h" |
| 26 | 26 |
| 27 using base::android::JavaParamRef; |
| 27 using base::android::ScopedJavaLocalRef; | 28 using base::android::ScopedJavaLocalRef; |
| 28 | 29 |
| 29 namespace content { | 30 namespace content { |
| 30 | 31 |
| 31 // static | 32 // static |
| 32 bool ContentViewRenderView::RegisterContentViewRenderView(JNIEnv* env) { | 33 bool ContentViewRenderView::RegisterContentViewRenderView(JNIEnv* env) { |
| 33 return RegisterNativesImpl(env); | 34 return RegisterNativesImpl(env); |
| 34 } | 35 } |
| 35 | 36 |
| 36 ContentViewRenderView::ContentViewRenderView(JNIEnv* env, | 37 ContentViewRenderView::ContentViewRenderView(JNIEnv* env, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 JNIEnv* env = base::android::AttachCurrentThread(); | 114 JNIEnv* env = base::android::AttachCurrentThread(); |
| 114 Java_ContentViewRenderView_onSwapBuffersCompleted(env, java_obj_.obj()); | 115 Java_ContentViewRenderView_onSwapBuffersCompleted(env, java_obj_.obj()); |
| 115 } | 116 } |
| 116 | 117 |
| 117 void ContentViewRenderView::InitCompositor() { | 118 void ContentViewRenderView::InitCompositor() { |
| 118 if (!compositor_) | 119 if (!compositor_) |
| 119 compositor_.reset(Compositor::Create(this, root_window_)); | 120 compositor_.reset(Compositor::Create(this, root_window_)); |
| 120 } | 121 } |
| 121 | 122 |
| 122 } // namespace content | 123 } // namespace content |
| OLD | NEW |