| 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 #if defined(OS_ANDROID) | 7 #if defined(OS_ANDROID) |
| 8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 if (!Initialize()) { | 404 if (!Initialize()) { |
| 405 LOG(ERROR) << "Failed to resize pbuffer."; | 405 LOG(ERROR) << "Failed to resize pbuffer."; |
| 406 return false; | 406 return false; |
| 407 } | 407 } |
| 408 | 408 |
| 409 if (was_current) | 409 if (was_current) |
| 410 return current_context->MakeCurrent(this); | 410 return current_context->MakeCurrent(this); |
| 411 return true; | 411 return true; |
| 412 } | 412 } |
| 413 | 413 |
| 414 bool NativeViewGLSurfaceEGL::Recreate() { |
| 415 Destroy(); |
| 416 if (!Initialize()) { |
| 417 LOG(ERROR) << "Failed to create surface."; |
| 418 return false; |
| 419 } |
| 420 return true; |
| 421 } |
| 422 |
| 414 EGLSurface NativeViewGLSurfaceEGL::GetHandle() { | 423 EGLSurface NativeViewGLSurfaceEGL::GetHandle() { |
| 415 return surface_; | 424 return surface_; |
| 416 } | 425 } |
| 417 | 426 |
| 418 std::string NativeViewGLSurfaceEGL::GetExtensions() { | 427 std::string NativeViewGLSurfaceEGL::GetExtensions() { |
| 419 std::string extensions = GLSurface::GetExtensions(); | 428 std::string extensions = GLSurface::GetExtensions(); |
| 420 if (supports_post_sub_buffer_) { | 429 if (supports_post_sub_buffer_) { |
| 421 extensions += extensions.empty() ? "" : " "; | 430 extensions += extensions.empty() ? "" : " "; |
| 422 extensions += "GL_CHROMIUM_post_sub_buffer"; | 431 extensions += "GL_CHROMIUM_post_sub_buffer"; |
| 423 } | 432 } |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 | 579 |
| 571 return handle; | 580 return handle; |
| 572 #endif | 581 #endif |
| 573 } | 582 } |
| 574 | 583 |
| 575 PbufferGLSurfaceEGL::~PbufferGLSurfaceEGL() { | 584 PbufferGLSurfaceEGL::~PbufferGLSurfaceEGL() { |
| 576 Destroy(); | 585 Destroy(); |
| 577 } | 586 } |
| 578 | 587 |
| 579 } // namespace gfx | 588 } // namespace gfx |
| OLD | NEW |