Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: ui/gl/gl_surface_egl.cc

Issue 792623002: egl: Don't query EGL_POST_SUB_BUFFER_SUPPORTED_NV without extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 surface_ = eglCreateWindowSurface( 388 surface_ = eglCreateWindowSurface(
389 GetDisplay(), GetConfig(), window_, &egl_window_attributes[0]); 389 GetDisplay(), GetConfig(), window_, &egl_window_attributes[0]);
390 390
391 if (!surface_) { 391 if (!surface_) {
392 LOG(ERROR) << "eglCreateWindowSurface failed with error " 392 LOG(ERROR) << "eglCreateWindowSurface failed with error "
393 << GetLastEGLErrorString(); 393 << GetLastEGLErrorString();
394 Destroy(); 394 Destroy();
395 return false; 395 return false;
396 } 396 }
397 397
398 EGLint surfaceVal; 398 if (gfx::g_driver_egl.ext.b_EGL_NV_post_sub_buffer) {
399 EGLBoolean retVal = eglQuerySurface(GetDisplay(), 399 EGLint surfaceVal;
400 surface_, 400 EGLBoolean retVal = eglQuerySurface(
401 EGL_POST_SUB_BUFFER_SUPPORTED_NV, 401 GetDisplay(), surface_, EGL_POST_SUB_BUFFER_SUPPORTED_NV, &surfaceVal);
402 &surfaceVal); 402 supports_post_sub_buffer_ = (surfaceVal && retVal) == EGL_TRUE;
403 supports_post_sub_buffer_ = (surfaceVal && retVal) == EGL_TRUE; 403 }
404 404
405 if (sync_provider) 405 if (sync_provider)
406 vsync_provider_.reset(sync_provider.release()); 406 vsync_provider_.reset(sync_provider.release());
407 else if (g_egl_sync_control_supported) 407 else if (g_egl_sync_control_supported)
408 vsync_provider_.reset(new EGLSyncControlVSyncProvider(surface_)); 408 vsync_provider_.reset(new EGLSyncControlVSyncProvider(surface_));
409 return true; 409 return true;
410 } 410 }
411 411
412 void NativeViewGLSurfaceEGL::Destroy() { 412 void NativeViewGLSurfaceEGL::Destroy() {
413 if (surface_) { 413 if (surface_) {
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 } 760 }
761 761
762 void* SurfacelessEGL::GetShareHandle() { 762 void* SurfacelessEGL::GetShareHandle() {
763 return NULL; 763 return NULL;
764 } 764 }
765 765
766 SurfacelessEGL::~SurfacelessEGL() { 766 SurfacelessEGL::~SurfacelessEGL() {
767 } 767 }
768 768
769 } // namespace gfx 769 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698