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 "blimp/client/app/android/blimp_view.h" | 5 #include "blimp/client/app/android/blimp_view.h" |
6 | 6 |
7 #include <android/native_window_jni.h> | 7 #include <android/native_window_jni.h> |
8 | 8 |
9 #include "blimp/client/app/android/blimp_client_session_android.h" | 9 #include "blimp/client/app/android/blimp_client_session_android.h" |
10 #include "jni/BlimpView_jni.h" | 10 #include "jni/BlimpView_jni.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
25 BlimpClientSession* client_session = | 25 BlimpClientSession* client_session = |
26 BlimpClientSessionAndroid::FromJavaObject(env, | 26 BlimpClientSessionAndroid::FromJavaObject(env, |
27 blimp_client_session.obj()); | 27 blimp_client_session.obj()); |
28 | 28 |
29 // TODO(dtrainor): Pull the feature object from the BlimpClientSession and | 29 // TODO(dtrainor): Pull the feature object from the BlimpClientSession and |
30 // pass it through to the BlimpCompositor. | 30 // pass it through to the BlimpCompositor. |
31 ALLOW_UNUSED_LOCAL(client_session); | 31 ALLOW_UNUSED_LOCAL(client_session); |
32 | 32 |
33 return reinterpret_cast<intptr_t>(new BlimpView( | 33 return reinterpret_cast<intptr_t>(new BlimpView( |
34 env, jobj, gfx::Size(real_width, real_height), gfx::Size(width, height), | 34 env, jobj, gfx::Size(real_width, real_height), gfx::Size(width, height), |
35 dp_to_px, client_session->GetRenderWidgetFeature())); | 35 dp_to_px, client_session->GetRenderWidgetFeature(), |
36 client_session->GetBlimpConnectionDetails())); | |
36 } | 37 } |
37 | 38 |
38 // static | 39 // static |
39 bool BlimpView::RegisterJni(JNIEnv* env) { | 40 bool BlimpView::RegisterJni(JNIEnv* env) { |
40 return RegisterNativesImpl(env); | 41 return RegisterNativesImpl(env); |
41 } | 42 } |
42 | 43 |
43 BlimpView::BlimpView(JNIEnv* env, | 44 BlimpView::BlimpView(JNIEnv* env, |
44 const JavaParamRef<jobject>& jobj, | 45 const JavaParamRef<jobject>& jobj, |
45 const gfx::Size& real_size, | 46 const gfx::Size& real_size, |
46 const gfx::Size& size, | 47 const gfx::Size& size, |
47 float dp_to_px, | 48 float dp_to_px, |
48 RenderWidgetFeature* render_widget_feature) | 49 RenderWidgetFeature* render_widget_feature, |
50 BlimpConnectionDetails* blimp_connection_details) | |
49 : device_scale_factor_(dp_to_px), | 51 : device_scale_factor_(dp_to_px), |
50 compositor_manager_( | 52 compositor_manager_( |
51 BlimpCompositorManagerAndroid::Create(real_size, | 53 BlimpCompositorManagerAndroid::Create(real_size, |
52 size, | 54 size, |
53 render_widget_feature, | 55 render_widget_feature, |
54 this)), | 56 this)), |
55 current_surface_format_(0), | 57 current_surface_format_(0), |
56 window_(gfx::kNullAcceleratedWidget) { | 58 window_(gfx::kNullAcceleratedWidget), |
59 blimp_connection_details_(blimp_connection_details) { | |
Khushal
2016/05/18 00:23:00
DCHECK |blimp_connection_details_| here.
shaktisahu
2016/05/19 21:39:18
Done.
| |
57 java_obj_.Reset(env, jobj); | 60 java_obj_.Reset(env, jobj); |
58 } | 61 } |
59 | 62 |
60 BlimpView::~BlimpView() { | 63 BlimpView::~BlimpView() { |
61 ReleaseAcceleratedWidget(); | 64 ReleaseAcceleratedWidget(); |
62 } | 65 } |
63 | 66 |
64 void BlimpView::Destroy(JNIEnv* env, const JavaParamRef<jobject>& jobj) { | 67 void BlimpView::Destroy(JNIEnv* env, const JavaParamRef<jobject>& jobj) { |
65 delete this; | 68 delete this; |
66 } | 69 } |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
173 pointer1); | 176 pointer1); |
174 | 177 |
175 return compositor_manager_->OnTouchEvent(event); | 178 return compositor_manager_->OnTouchEvent(event); |
176 } | 179 } |
177 | 180 |
178 void BlimpView::OnSwapBuffersCompleted() { | 181 void BlimpView::OnSwapBuffersCompleted() { |
179 JNIEnv* env = base::android::AttachCurrentThread(); | 182 JNIEnv* env = base::android::AttachCurrentThread(); |
180 Java_BlimpView_onSwapBuffersCompleted(env, java_obj_.obj()); | 183 Java_BlimpView_onSwapBuffersCompleted(env, java_obj_.obj()); |
181 } | 184 } |
182 | 185 |
186 void BlimpView::DidCommitAndDrawFrame() { | |
187 blimp_connection_details_->OnCommit(); | |
188 } | |
189 | |
183 } // namespace client | 190 } // namespace client |
184 } // namespace blimp | 191 } // namespace blimp |
OLD | NEW |