| 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 "blimp/client/app/android/blimp_compositor_android.h" | 10 #include "blimp/client/app/android/blimp_compositor_android.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 current_surface_format_ = format; | 78 current_surface_format_ = format; |
| 79 ReleaseAcceleratedWidget(); | 79 ReleaseAcceleratedWidget(); |
| 80 | 80 |
| 81 if (jsurface) { | 81 if (jsurface) { |
| 82 base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env); | 82 base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env); |
| 83 window_ = ANativeWindow_fromSurface(env, jsurface); | 83 window_ = ANativeWindow_fromSurface(env, jsurface); |
| 84 compositor_->SetAcceleratedWidget(window_); | 84 compositor_->SetAcceleratedWidget(window_); |
| 85 compositor_->SetVisible(true); | 85 compositor_->SetVisible(true); |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | |
| 89 compositor_->SetSize(gfx::Size(width, height)); | |
| 90 } | 88 } |
| 91 | 89 |
| 92 void BlimpView::OnSurfaceCreated(JNIEnv* env, | 90 void BlimpView::OnSurfaceCreated(JNIEnv* env, |
| 93 const JavaParamRef<jobject>& jobj) { | 91 const JavaParamRef<jobject>& jobj) { |
| 94 current_surface_format_ = 0 /** PixelFormat.UNKNOWN */; | 92 current_surface_format_ = 0 /** PixelFormat.UNKNOWN */; |
| 95 } | 93 } |
| 96 | 94 |
| 97 void BlimpView::OnSurfaceDestroyed(JNIEnv* env, | 95 void BlimpView::OnSurfaceDestroyed(JNIEnv* env, |
| 98 const JavaParamRef<jobject>& jobj) { | 96 const JavaParamRef<jobject>& jobj) { |
| 99 current_surface_format_ = 0 /** PixelFormat.UNKNOWN */; | 97 current_surface_format_ = 0 /** PixelFormat.UNKNOWN */; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 raw_pos_x - pos_x_0, | 170 raw_pos_x - pos_x_0, |
| 173 raw_pos_y - pos_y_0, | 171 raw_pos_y - pos_y_0, |
| 174 pointer0, | 172 pointer0, |
| 175 pointer1); | 173 pointer1); |
| 176 | 174 |
| 177 return compositor_->OnTouchEvent(event); | 175 return compositor_->OnTouchEvent(event); |
| 178 } | 176 } |
| 179 | 177 |
| 180 } // namespace client | 178 } // namespace client |
| 181 } // namespace blimp | 179 } // namespace blimp |
| OLD | NEW |