| 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 "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 ContentViewRenderView::ContentViewRenderView(JNIEnv* env, jobject obj) | 34 ContentViewRenderView::ContentViewRenderView(JNIEnv* env, jobject obj) |
| 35 : buffers_swapped_during_composite_(false) { | 35 : buffers_swapped_during_composite_(false) { |
| 36 java_obj_.Reset(env, obj); | 36 java_obj_.Reset(env, obj); |
| 37 } | 37 } |
| 38 | 38 |
| 39 ContentViewRenderView::~ContentViewRenderView() { | 39 ContentViewRenderView::~ContentViewRenderView() { |
| 40 } | 40 } |
| 41 | 41 |
| 42 // static | 42 // static |
| 43 static jint Init(JNIEnv* env, jobject obj) { | 43 static jlong Init(JNIEnv* env, jobject obj) { |
| 44 ContentViewRenderView* content_view_render_view = | 44 ContentViewRenderView* content_view_render_view = |
| 45 new ContentViewRenderView(env, obj); | 45 new ContentViewRenderView(env, obj); |
| 46 return reinterpret_cast<jint>(content_view_render_view); | 46 return reinterpret_cast<intptr_t>(content_view_render_view); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void ContentViewRenderView::Destroy(JNIEnv* env, jobject obj) { | 49 void ContentViewRenderView::Destroy(JNIEnv* env, jobject obj) { |
| 50 delete this; | 50 delete this; |
| 51 } | 51 } |
| 52 | 52 |
| 53 void ContentViewRenderView::SetCurrentContentView( | 53 void ContentViewRenderView::SetCurrentContentView( |
| 54 JNIEnv* env, jobject obj, int native_content_view) { | 54 JNIEnv* env, jobject obj, int native_content_view) { |
| 55 InitCompositor(); | 55 InitCompositor(); |
| 56 ContentViewCoreImpl* content_view = | 56 ContentViewCoreImpl* content_view = |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 JNIEnv* env = base::android::AttachCurrentThread(); | 107 JNIEnv* env = base::android::AttachCurrentThread(); |
| 108 Java_ContentViewRenderView_onSwapBuffersCompleted(env, java_obj_.obj()); | 108 Java_ContentViewRenderView_onSwapBuffersCompleted(env, java_obj_.obj()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void ContentViewRenderView::InitCompositor() { | 111 void ContentViewRenderView::InitCompositor() { |
| 112 if (!compositor_) | 112 if (!compositor_) |
| 113 compositor_.reset(Compositor::Create(this)); | 113 compositor_.reset(Compositor::Create(this)); |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace content | 116 } // namespace content |
| OLD | NEW |