OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/gl/android/surface_texture.h" | 5 #include "ui/gl/android/surface_texture.h" |
6 | 6 |
7 #include <android/native_window_jni.h> | 7 #include <android/native_window_jni.h> |
8 | 8 |
9 // TODO(boliu): Remove this include when we move off ICS. | 9 // TODO(boliu): Remove this include when we move off ICS. |
10 #include "base/android/build_info.h" | 10 #include "base/android/build_info.h" |
11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "jni/SurfaceTexturePlatformWrapper_jni.h" | 13 #include "jni/SurfaceTexturePlatformWrapper_jni.h" |
14 #include "ui/gl/android/scoped_java_surface.h" | 14 #include "ui/gl/android/scoped_java_surface.h" |
15 #include "ui/gl/android/surface_texture_listener.h" | 15 #include "ui/gl/android/surface_texture_listener.h" |
16 #include "ui/gl/gl_bindings.h" | 16 #include "ui/gl/gl_bindings.h" |
17 | 17 |
18 // TODO(boliu): Remove this method when when we move off ICS. See | 18 // TODO(boliu): Remove this method when Chromium stops supporting ICS. |
19 // http://crbug.com/161864. | |
20 bool GlContextMethodsAvailable() { | 19 bool GlContextMethodsAvailable() { |
21 bool available = base::android::BuildInfo::GetInstance()->sdk_int() >= 16; | 20 bool available = base::android::BuildInfo::GetInstance()->sdk_int() >= 16; |
22 if (!available) | 21 if (!available) |
23 LOG(WARNING) << "Running on unsupported device: rendering may not work"; | 22 LOG(WARNING) << "Running on unsupported device: rendering may not work"; |
24 return available; | 23 return available; |
25 } | 24 } |
26 | 25 |
27 namespace gfx { | 26 namespace gfx { |
28 | 27 |
29 scoped_refptr<SurfaceTexture> SurfaceTexture::Create(int texture_id) { | 28 scoped_refptr<SurfaceTexture> SurfaceTexture::Create(int texture_id) { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // static | 134 // static |
136 bool SurfaceTexture::IsSingleBufferModeSupported() { | 135 bool SurfaceTexture::IsSingleBufferModeSupported() { |
137 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; | 136 return base::android::BuildInfo::GetInstance()->sdk_int() >= 19; |
138 } | 137 } |
139 | 138 |
140 bool SurfaceTexture::RegisterSurfaceTexture(JNIEnv* env) { | 139 bool SurfaceTexture::RegisterSurfaceTexture(JNIEnv* env) { |
141 return RegisterNativesImpl(env); | 140 return RegisterNativesImpl(env); |
142 } | 141 } |
143 | 142 |
144 } // namespace gfx | 143 } // namespace gfx |
OLD | NEW |