| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/android/compositor/compositor_view.h" | 5 #include "chrome/browser/android/compositor/compositor_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> |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 const JavaParamRef<jobject>& jobj) { | 115 const JavaParamRef<jobject>& jobj) { |
| 116 return compositor_->GetResourceManager().GetJavaObject(); | 116 return compositor_->GetResourceManager().GetJavaObject(); |
| 117 } | 117 } |
| 118 | 118 |
| 119 void CompositorView::UpdateLayerTreeHost() { | 119 void CompositorView::UpdateLayerTreeHost() { |
| 120 JNIEnv* env = base::android::AttachCurrentThread(); | 120 JNIEnv* env = base::android::AttachCurrentThread(); |
| 121 // TODO(wkorman): Rename JNI interface to onCompositorUpdateLayerTreeHost. | 121 // TODO(wkorman): Rename JNI interface to onCompositorUpdateLayerTreeHost. |
| 122 Java_CompositorView_onCompositorLayout(env, obj_); | 122 Java_CompositorView_onCompositorLayout(env, obj_); |
| 123 } | 123 } |
| 124 | 124 |
| 125 void CompositorView::OnSwapBuffersCompleted(int pending_swap_buffers) { | 125 void CompositorView::DidSwapFrame(int pending_frames) { |
| 126 JNIEnv* env = base::android::AttachCurrentThread(); | 126 JNIEnv* env = base::android::AttachCurrentThread(); |
| 127 Java_CompositorView_onSwapBuffersCompleted(env, obj_, pending_swap_buffers); | 127 Java_CompositorView_didSwapFrame(env, obj_, pending_frames); |
| 128 } | 128 } |
| 129 | 129 |
| 130 ui::UIResourceProvider* CompositorView::GetUIResourceProvider() { | 130 ui::UIResourceProvider* CompositorView::GetUIResourceProvider() { |
| 131 return compositor_ ? &compositor_->GetUIResourceProvider() : nullptr; | 131 return compositor_ ? &compositor_->GetUIResourceProvider() : nullptr; |
| 132 } | 132 } |
| 133 | 133 |
| 134 void CompositorView::SurfaceCreated(JNIEnv* env, | 134 void CompositorView::SurfaceCreated(JNIEnv* env, |
| 135 const JavaParamRef<jobject>& object) { | 135 const JavaParamRef<jobject>& object) { |
| 136 compositor_->SetRootLayer(root_layer_); | 136 compositor_->SetRootLayer(root_layer_); |
| 137 current_surface_format_ = 0; | 137 current_surface_format_ = 0; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 // The Android TERMINATION_STATUS_OOM_PROTECTED hack causes us to never go | 253 // The Android TERMINATION_STATUS_OOM_PROTECTED hack causes us to never go |
| 254 // through here but through BrowserChildProcessHostDisconnected() instead. | 254 // through here but through BrowserChildProcessHostDisconnected() instead. |
| 255 } | 255 } |
| 256 | 256 |
| 257 // Register native methods | 257 // Register native methods |
| 258 bool RegisterCompositorView(JNIEnv* env) { | 258 bool RegisterCompositorView(JNIEnv* env) { |
| 259 return RegisterNativesImpl(env); | 259 return RegisterNativesImpl(env); |
| 260 } | 260 } |
| 261 | 261 |
| 262 } // namespace android | 262 } // namespace android |
| OLD | NEW |