| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ANDROID_WEBVIEW_NATIVE_AW_GL_FUNCTOR_H_ |
| 6 #define ANDROID_WEBVIEW_NATIVE_AW_GL_FUNCTOR_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "android_webview/browser/render_thread_manager.h" |
| 11 #include "android_webview/browser/render_thread_manager_client.h" |
| 12 #include "base/android/jni_weak_ref.h" |
| 13 #include "base/android/scoped_java_ref.h" |
| 14 |
| 15 namespace android_webview { |
| 16 |
| 17 class AwGLFunctor : public RenderThreadManagerClient { |
| 18 public: |
| 19 void OnParentDrawConstraintsUpdated() override; |
| 20 bool RequestDrawGL(bool wait_for_completion) override; |
| 21 void DetachFunctorFromView() override; |
| 22 |
| 23 AwGLFunctor(const JavaObjectWeakGlobalRef& java_ref); |
| 24 ~AwGLFunctor() override; |
| 25 |
| 26 void SetClient(JNIEnv* env, |
| 27 const base::android::JavaParamRef<jobject>& obj, |
| 28 jlong client); |
| 29 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 30 |
| 31 void DeleteHardwareRenderer(JNIEnv* env, |
| 32 const base::android::JavaParamRef<jobject>& obj); |
| 33 |
| 34 jlong GetAwDrawGLViewContext(JNIEnv* env, |
| 35 const base::android::JavaParamRef<jobject>& obj); |
| 36 |
| 37 jlong GetAwDrawGLFunction(JNIEnv* env, |
| 38 const base::android::JavaParamRef<jobject>& obj); |
| 39 |
| 40 RenderThreadManager* GetRenderThreadManager() { |
| 41 return &render_thread_manager_; |
| 42 } |
| 43 |
| 44 private: |
| 45 JavaObjectWeakGlobalRef java_ref_; |
| 46 RenderThreadManager render_thread_manager_; |
| 47 }; |
| 48 |
| 49 bool RegisterAwGLFunctor(JNIEnv* env); |
| 50 |
| 51 } // namespace android_webview |
| 52 |
| 53 #endif // ANDROID_WEBVIEW_NATIVE_AW_GL_FUNCTOR_H_ |
| OLD | NEW |