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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
217 : window_(window), | 217 : window_(window), |
218 surface_(NULL), | 218 surface_(NULL), |
219 supports_post_sub_buffer_(false), | 219 supports_post_sub_buffer_(false), |
220 config_(NULL) { | 220 config_(NULL) { |
221 software_ = software; | 221 software_ = software; |
222 } | 222 } |
223 | 223 |
224 bool NativeViewGLSurfaceEGL::Initialize() { | 224 bool NativeViewGLSurfaceEGL::Initialize() { |
225 DCHECK(!surface_); | 225 DCHECK(!surface_); |
226 | 226 |
227 if (!window_) { | |
no sievers
2013/01/28 20:55:06
if (window_ == kNullAcceleratedWidget)
| |
228 LOG(ERROR) << "Trying to create surface without window."; | |
229 return false; | |
230 } | |
231 | |
227 if (!GetDisplay()) { | 232 if (!GetDisplay()) { |
228 LOG(ERROR) << "Trying to create surface with invalid display."; | 233 LOG(ERROR) << "Trying to create surface with invalid display."; |
229 return false; | 234 return false; |
230 } | 235 } |
231 | 236 |
232 static const EGLint egl_window_attributes_sub_buffer[] = { | 237 static const EGLint egl_window_attributes_sub_buffer[] = { |
233 EGL_POST_SUB_BUFFER_SUPPORTED_NV, EGL_TRUE, | 238 EGL_POST_SUB_BUFFER_SUPPORTED_NV, EGL_TRUE, |
234 EGL_NONE | 239 EGL_NONE |
235 }; | 240 }; |
236 | 241 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
553 | 558 |
554 return handle; | 559 return handle; |
555 #endif | 560 #endif |
556 } | 561 } |
557 | 562 |
558 PbufferGLSurfaceEGL::~PbufferGLSurfaceEGL() { | 563 PbufferGLSurfaceEGL::~PbufferGLSurfaceEGL() { |
559 Destroy(); | 564 Destroy(); |
560 } | 565 } |
561 | 566 |
562 } // namespace gfx | 567 } // namespace gfx |
OLD | NEW |