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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 GLSurface::CreateViewGLSurface(bool software, gfx::AcceleratedWidget window) { | 619 GLSurface::CreateViewGLSurface(bool software, gfx::AcceleratedWidget window) { |
620 if (software) | 620 if (software) |
621 return NULL; | 621 return NULL; |
622 | 622 |
623 DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2); | 623 DCHECK(GetGLImplementation() == kGLImplementationEGLGLES2); |
624 if (window) { | 624 if (window) { |
625 scoped_refptr<NativeViewGLSurfaceEGL> surface; | 625 scoped_refptr<NativeViewGLSurfaceEGL> surface; |
626 VSyncProvider* sync_provider = NULL; | 626 VSyncProvider* sync_provider = NULL; |
627 #if defined(USE_OZONE) | 627 #if defined(USE_OZONE) |
628 window = ui::SurfaceFactoryOzone::GetInstance()->RealizeAcceleratedWidget( | 628 window = ui::SurfaceFactoryOzone::GetInstance()->RealizeAcceleratedWidget( |
629 window)); | 629 window); |
630 sync_provider = | 630 sync_provider = |
631 ui::SurfaceFactoryOzone::GetInstance()->GetVSyncProvider(window); | 631 ui::SurfaceFactoryOzone::GetInstance()->GetVSyncProvider(window); |
632 #endif | 632 #endif |
633 surface = new NativeViewGLSurfaceEGL(false, window); | 633 surface = new NativeViewGLSurfaceEGL(false, window); |
634 if(surface->Initialize(sync_provider)) | 634 if(surface->Initialize(sync_provider)) |
635 return surface; | 635 return surface; |
636 } else { | 636 } else { |
637 scoped_refptr<GLSurface> surface = new GLSurfaceStub(); | 637 scoped_refptr<GLSurface> surface = new GLSurfaceStub(); |
638 if (surface->Initialize()) | 638 if (surface->Initialize()) |
639 return surface; | 639 return surface; |
(...skipping 17 matching lines...) Expand all Loading... |
657 } | 657 } |
658 default: | 658 default: |
659 NOTREACHED(); | 659 NOTREACHED(); |
660 return NULL; | 660 return NULL; |
661 } | 661 } |
662 } | 662 } |
663 | 663 |
664 #endif | 664 #endif |
665 | 665 |
666 } // namespace gfx | 666 } // namespace gfx |
OLD | NEW |