| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/gl/gl_surface_egl.h" | 5 #include "ui/gfx/gl/gl_surface_egl.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "third_party/angle/include/EGL/egl.h" | 10 #include "third_party/angle/include/EGL/egl.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 return gfx::Size(); | 255 return gfx::Size(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 return gfx::Size(width, height); | 258 return gfx::Size(width, height); |
| 259 } | 259 } |
| 260 | 260 |
| 261 EGLSurface NativeViewGLSurfaceEGL::GetHandle() { | 261 EGLSurface NativeViewGLSurfaceEGL::GetHandle() { |
| 262 return surface_; | 262 return surface_; |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool NativeViewGLSurfaceEGL::SupportsPostSubBuffer() { | 265 std::string NativeViewGLSurfaceEGL::GetExtensions() { |
| 266 return supports_post_sub_buffer_; | 266 std::string extensions = GLSurface::GetExtensions(); |
| 267 if (supports_post_sub_buffer_) { |
| 268 extensions += extensions.empty() ? "" : " "; |
| 269 extensions += "GL_CHROMIUM_post_sub_buffer"; |
| 270 } |
| 271 return extensions; |
| 267 } | 272 } |
| 268 | 273 |
| 269 bool NativeViewGLSurfaceEGL::PostSubBuffer( | 274 bool NativeViewGLSurfaceEGL::PostSubBuffer( |
| 270 int x, int y, int width, int height) { | 275 int x, int y, int width, int height) { |
| 271 DCHECK(supports_post_sub_buffer_); | 276 DCHECK(supports_post_sub_buffer_); |
| 272 if (!eglPostSubBufferNV(GetDisplay(), surface_, x, y, width, height)) { | 277 if (!eglPostSubBufferNV(GetDisplay(), surface_, x, y, width, height)) { |
| 273 VLOG(1) << "eglPostSubBufferNV failed with error " | 278 VLOG(1) << "eglPostSubBufferNV failed with error " |
| 274 << GetLastEGLErrorString(); | 279 << GetLastEGLErrorString(); |
| 275 return false; | 280 return false; |
| 276 } | 281 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 GetHandle(), | 365 GetHandle(), |
| 361 EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE, | 366 EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE, |
| 362 &handle)) { | 367 &handle)) { |
| 363 return NULL; | 368 return NULL; |
| 364 } | 369 } |
| 365 | 370 |
| 366 return handle; | 371 return handle; |
| 367 } | 372 } |
| 368 | 373 |
| 369 } // namespace gfx | 374 } // namespace gfx |
| OLD | NEW |