| 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 "ui/gl/gl_surface_egl.h" | 5 #include "ui/gl/gl_surface_egl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 bool PbufferGLSurfaceEGL::Initialize(GLSurfaceFormat format) { | 1078 bool PbufferGLSurfaceEGL::Initialize(GLSurfaceFormat format) { |
| 1079 EGLSurface old_surface = surface_; | 1079 EGLSurface old_surface = surface_; |
| 1080 | 1080 |
| 1081 #if defined(OS_ANDROID) | 1081 #if defined(OS_ANDROID) |
| 1082 // This is to allow context virtualization which requires on- and offscreen | 1082 // This is to allow context virtualization which requires on- and offscreen |
| 1083 // to use a compatible config. We expect the client to request RGB565 | 1083 // to use a compatible config. We expect the client to request RGB565 |
| 1084 // onscreen surface also for this to work (with the exception of | 1084 // onscreen surface also for this to work (with the exception of |
| 1085 // fullscreen video). | 1085 // fullscreen video). |
| 1086 if (base::SysInfo::IsLowEndDevice()) | 1086 if (base::SysInfo::AmountOfPhysicalMemoryMB() <= 512) |
| 1087 format.SetRGB565(); | 1087 format.SetRGB565(); |
| 1088 #endif | 1088 #endif |
| 1089 | 1089 |
| 1090 format_ = format; | 1090 format_ = format; |
| 1091 | 1091 |
| 1092 EGLDisplay display = GetDisplay(); | 1092 EGLDisplay display = GetDisplay(); |
| 1093 if (!display) { | 1093 if (!display) { |
| 1094 LOG(ERROR) << "Trying to create surface with invalid display."; | 1094 LOG(ERROR) << "Trying to create surface with invalid display."; |
| 1095 return false; | 1095 return false; |
| 1096 } | 1096 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1246 } | 1246 } |
| 1247 | 1247 |
| 1248 void* SurfacelessEGL::GetShareHandle() { | 1248 void* SurfacelessEGL::GetShareHandle() { |
| 1249 return NULL; | 1249 return NULL; |
| 1250 } | 1250 } |
| 1251 | 1251 |
| 1252 SurfacelessEGL::~SurfacelessEGL() { | 1252 SurfacelessEGL::~SurfacelessEGL() { |
| 1253 } | 1253 } |
| 1254 | 1254 |
| 1255 } // namespace gl | 1255 } // namespace gl |
| OLD | NEW |