| 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 "base/memory/ptr_util.h" |    9 #include "base/memory/ptr_util.h" | 
|   10 #include "blimp/client/app/android/blimp_client_session_android.h" |   10 #include "blimp/client/app/android/blimp_client_session_android.h" | 
|   11 #include "blimp/client/app/compositor/browser_compositor.h" |   11 #include "blimp/client/app/compositor/browser_compositor.h" | 
|   12 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" |   12 #include "blimp/client/core/compositor/blimp_compositor_dependencies.h" | 
|   13 #include "blimp/client/core/compositor/blimp_compositor_manager.h" |   13 #include "blimp/client/core/compositor/blimp_compositor_manager.h" | 
 |   14 #include "blimp/client/core/render_widget/render_widget_feature.h" | 
|   14 #include "blimp/client/support/compositor/compositor_dependencies_impl.h" |   15 #include "blimp/client/support/compositor/compositor_dependencies_impl.h" | 
|   15 #include "jni/BlimpView_jni.h" |   16 #include "jni/BlimpView_jni.h" | 
|   16 #include "ui/events/android/motion_event_android.h" |   17 #include "ui/events/android/motion_event_android.h" | 
|   17 #include "ui/gfx/geometry/size.h" |   18 #include "ui/gfx/geometry/size.h" | 
|   18  |   19  | 
|   19 using base::android::JavaParamRef; |   20 using base::android::JavaParamRef; | 
|   20  |   21  | 
|   21 namespace blimp { |   22 namespace blimp { | 
|   22 namespace client { |   23 namespace client { | 
 |   24 namespace app { | 
|   23  |   25  | 
|   24 static jlong Init(JNIEnv* env, |   26 static jlong Init(JNIEnv* env, | 
|   25                   const JavaParamRef<jobject>& jobj, |   27                   const JavaParamRef<jobject>& jobj, | 
|   26                   const JavaParamRef<jobject>& blimp_client_session, |   28                   const JavaParamRef<jobject>& blimp_client_session, | 
|   27                   jint real_width, |   29                   jint real_width, | 
|   28                   jint real_height, |   30                   jint real_height, | 
|   29                   jint width, |   31                   jint width, | 
|   30                   jint height, |   32                   jint height, | 
|   31                   jfloat dp_to_px) { |   33                   jfloat dp_to_px) { | 
|   32   BlimpClientSession* client_session = |   34   BlimpClientSession* client_session = | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
|   45 // static |   47 // static | 
|   46 bool BlimpView::RegisterJni(JNIEnv* env) { |   48 bool BlimpView::RegisterJni(JNIEnv* env) { | 
|   47   return RegisterNativesImpl(env); |   49   return RegisterNativesImpl(env); | 
|   48 } |   50 } | 
|   49  |   51  | 
|   50 BlimpView::BlimpView(JNIEnv* env, |   52 BlimpView::BlimpView(JNIEnv* env, | 
|   51                      const JavaParamRef<jobject>& jobj, |   53                      const JavaParamRef<jobject>& jobj, | 
|   52                      const gfx::Size& real_size, |   54                      const gfx::Size& real_size, | 
|   53                      const gfx::Size& size, |   55                      const gfx::Size& size, | 
|   54                      float dp_to_px, |   56                      float dp_to_px, | 
|   55                      RenderWidgetFeature* render_widget_feature) |   57                      blimp::client::RenderWidgetFeature* render_widget_feature) | 
|   56     : device_scale_factor_(dp_to_px), |   58     : device_scale_factor_(dp_to_px), | 
|   57       current_surface_format_(0), |   59       current_surface_format_(0), | 
|   58       window_(gfx::kNullAcceleratedWidget), |   60       window_(gfx::kNullAcceleratedWidget), | 
|   59       weak_ptr_factory_(this) { |   61       weak_ptr_factory_(this) { | 
|   60   compositor_dependencies_ = base::MakeUnique<BlimpCompositorDependencies>( |   62   compositor_dependencies_ = base::MakeUnique<BlimpCompositorDependencies>( | 
|   61       base::MakeUnique<CompositorDependenciesImpl>()); |   63       base::MakeUnique<CompositorDependenciesImpl>()); | 
|   62  |   64  | 
|   63   compositor_ = base::MakeUnique<BrowserCompositor>( |   65   compositor_ = base::MakeUnique<BrowserCompositor>( | 
|   64       compositor_dependencies_->GetEmbedderDependencies()); |   66       compositor_dependencies_->GetEmbedderDependencies()); | 
|   65   compositor_->set_did_complete_swap_buffers_callback(base::Bind( |   67   compositor_->set_did_complete_swap_buffers_callback(base::Bind( | 
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  200                                pointer1); |  202                                pointer1); | 
|  201  |  203  | 
|  202   return compositor_manager_->OnTouchEvent(event); |  204   return compositor_manager_->OnTouchEvent(event); | 
|  203 } |  205 } | 
|  204  |  206  | 
|  205 void BlimpView::OnSwapBuffersCompleted() { |  207 void BlimpView::OnSwapBuffersCompleted() { | 
|  206   JNIEnv* env = base::android::AttachCurrentThread(); |  208   JNIEnv* env = base::android::AttachCurrentThread(); | 
|  207   Java_BlimpView_onSwapBuffersCompleted(env, java_obj_); |  209   Java_BlimpView_onSwapBuffersCompleted(env, java_obj_); | 
|  208 } |  210 } | 
|  209  |  211  | 
 |  212 }  // namespace app | 
|  210 }  // namespace client |  213 }  // namespace client | 
|  211 }  // namespace blimp |  214 }  // namespace blimp | 
| OLD | NEW |