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 |
130 ui::UIResourceProvider* CompositorView::GetUIResourceProvider() { | 135 ui::UIResourceProvider* CompositorView::GetUIResourceProvider() { |
131 return compositor_ ? &compositor_->GetUIResourceProvider() : nullptr; | 136 return compositor_ ? &compositor_->GetUIResourceProvider() : nullptr; |
132 } | 137 } |
133 | 138 |
134 void CompositorView::SurfaceCreated(JNIEnv* env, | 139 void CompositorView::SurfaceCreated(JNIEnv* env, |
135 const JavaParamRef<jobject>& object) { | 140 const JavaParamRef<jobject>& object) { |
136 compositor_->SetRootLayer(root_layer_); | 141 compositor_->SetRootLayer(root_layer_); |
137 current_surface_format_ = 0; | 142 current_surface_format_ = 0; |
138 } | 143 } |
139 | 144 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // The Android TERMINATION_STATUS_OOM_PROTECTED hack causes us to never go | 258 // The Android TERMINATION_STATUS_OOM_PROTECTED hack causes us to never go |
254 // through here but through BrowserChildProcessHostDisconnected() instead. | 259 // through here but through BrowserChildProcessHostDisconnected() instead. |
255 } | 260 } |
256 | 261 |
257 // Register native methods | 262 // Register native methods |
258 bool RegisterCompositorView(JNIEnv* env) { | 263 bool RegisterCompositorView(JNIEnv* env) { |
259 return RegisterNativesImpl(env); | 264 return RegisterNativesImpl(env); |
260 } | 265 } |
261 | 266 |
262 } // namespace android | 267 } // namespace android |
OLD | NEW |