Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/compositor_impl_android.h" | 5 #include "content/browser/renderer_host/compositor_impl_android.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 "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 398 window_ = NULL; | 398 window_ = NULL; |
| 399 surface_id_ = 0; | 399 surface_id_ = 0; |
| 400 } | 400 } |
| 401 | 401 |
| 402 if (window) { | 402 if (window) { |
| 403 window_ = window; | 403 window_ = window; |
| 404 ANativeWindow_acquire(window); | 404 ANativeWindow_acquire(window); |
| 405 surface_id_ = tracker->AddSurfaceForNativeWidget(window); | 405 surface_id_ = tracker->AddSurfaceForNativeWidget(window); |
| 406 tracker->SetSurfaceHandle( | 406 tracker->SetSurfaceHandle( |
| 407 surface_id_, | 407 surface_id_, |
| 408 gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::NATIVE_DIRECT)); | 408 gfx::GLSurfaceHandle(surface_id_, gfx::NATIVE_DIRECT)); |
|
piman
2015/09/23 04:50:51
I moved the surface id into the handle slot, becau
| |
| 409 SetVisible(true); | 409 SetVisible(true); |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 | 412 |
| 413 void CompositorImpl::SetSurface(jobject surface) { | 413 void CompositorImpl::SetSurface(jobject surface) { |
| 414 JNIEnv* env = base::android::AttachCurrentThread(); | 414 JNIEnv* env = base::android::AttachCurrentThread(); |
| 415 base::android::ScopedJavaLocalRef<jobject> j_surface(env, surface); | 415 base::android::ScopedJavaLocalRef<jobject> j_surface(env, surface); |
| 416 | 416 |
| 417 // First, shut down the GL context. | 417 // First, shut down the GL context. |
| 418 int surface_id = surface_id_; | 418 int surface_id = surface_id_; |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 785 | 785 |
| 786 void CompositorImpl::SetNeedsAnimate() { | 786 void CompositorImpl::SetNeedsAnimate() { |
| 787 needs_animate_ = true; | 787 needs_animate_ = true; |
| 788 if (!host_) | 788 if (!host_) |
| 789 return; | 789 return; |
| 790 | 790 |
| 791 host_->SetNeedsAnimate(); | 791 host_->SetNeedsAnimate(); |
| 792 } | 792 } |
| 793 | 793 |
| 794 } // namespace content | 794 } // namespace content |
| OLD | NEW |