| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::DidSwapFrame(int pending_frames) { | 125 void CompositorView::DidSwapFrame(int pending_frames) { |
| 126 JNIEnv* env = base::android::AttachCurrentThread(); | 126 JNIEnv* env = base::android::AttachCurrentThread(); |
| 127 Java_CompositorView_didSwapFrame(env, obj_, pending_frames); | 127 Java_CompositorView_didSwapFrame(env, obj_, pending_frames); |
| 128 } | 128 } |
| 129 | 129 |
| 130 void CompositorView::DidSwapBuffers() { | |
| 131 JNIEnv* env = base::android::AttachCurrentThread(); | |
| 132 Java_CompositorView_didSwapBuffers(env, obj_); | |
| 133 } | |
| 134 | |
| 135 ui::UIResourceProvider* CompositorView::GetUIResourceProvider() { | 130 ui::UIResourceProvider* CompositorView::GetUIResourceProvider() { |
| 136 return compositor_ ? &compositor_->GetUIResourceProvider() : nullptr; | 131 return compositor_ ? &compositor_->GetUIResourceProvider() : nullptr; |
| 137 } | 132 } |
| 138 | 133 |
| 139 void CompositorView::SurfaceCreated(JNIEnv* env, | 134 void CompositorView::SurfaceCreated(JNIEnv* env, |
| 140 const JavaParamRef<jobject>& object) { | 135 const JavaParamRef<jobject>& object) { |
| 141 compositor_->SetRootLayer(root_layer_); | 136 compositor_->SetRootLayer(root_layer_); |
| 142 current_surface_format_ = 0; | 137 current_surface_format_ = 0; |
| 143 } | 138 } |
| 144 | 139 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 // 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 |
| 259 // through here but through BrowserChildProcessHostDisconnected() instead. | 254 // through here but through BrowserChildProcessHostDisconnected() instead. |
| 260 } | 255 } |
| 261 | 256 |
| 262 // Register native methods | 257 // Register native methods |
| 263 bool RegisterCompositorView(JNIEnv* env) { | 258 bool RegisterCompositorView(JNIEnv* env) { |
| 264 return RegisterNativesImpl(env); | 259 return RegisterNativesImpl(env); |
| 265 } | 260 } |
| 266 | 261 |
| 267 } // namespace android | 262 } // namespace android |
| OLD | NEW |