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

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

Issue 1652873002: Android: Use virtualized context only for those with compatible config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 4 years, 10 months 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 | « ui/gl/gl_surface_osmesa.cc ('k') | ui/gl/gl_surface_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.h" 5 #include "ui/gl/gl_surface.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 } else { 717 } else {
718 scoped_refptr<GLSurface> surface = new GLSurfaceStub(); 718 scoped_refptr<GLSurface> surface = new GLSurfaceStub();
719 if (surface->Initialize()) 719 if (surface->Initialize())
720 return surface; 720 return surface;
721 } 721 }
722 return nullptr; 722 return nullptr;
723 } 723 }
724 724
725 // static 725 // static
726 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface( 726 scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(
727 const gfx::Size& size, GLSurface::Format format) { 727 const gfx::Size& size) {
728 switch (GetGLImplementation()) { 728 switch (GetGLImplementation()) {
729 case kGLImplementationOSMesaGL: { 729 case kGLImplementationOSMesaGL: {
730 scoped_refptr<GLSurface> surface( 730 scoped_refptr<GLSurface> surface(
731 new GLSurfaceOSMesa(OSMesaSurfaceFormatBGRA, size)); 731 new GLSurfaceOSMesa(SURFACE_OSMESA_BGRA, size));
732 if (!surface->Initialize(format)) 732 if (!surface->Initialize())
733 return nullptr; 733 return nullptr;
734 734
735 return surface; 735 return surface;
736 } 736 }
737 case kGLImplementationEGLGLES2: { 737 case kGLImplementationEGLGLES2: {
738 scoped_refptr<GLSurface> surface; 738 scoped_refptr<GLSurface> surface;
739 if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() && 739 if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
740 (size.width() == 0 && size.height() == 0)) { 740 (size.width() == 0 && size.height() == 0)) {
741 surface = new SurfacelessEGL(size); 741 surface = new SurfacelessEGL(size);
742 } else { 742 } else {
743 surface = new PbufferGLSurfaceEGL(size); 743 surface = new PbufferGLSurfaceEGL(size);
744 } 744 }
745 745
746 if (!surface->Initialize(format)) 746 if (!surface->Initialize())
747 return nullptr; 747 return nullptr;
748 return surface; 748 return surface;
749 } 749 }
750 case kGLImplementationMockGL: 750 case kGLImplementationMockGL:
751 return new GLSurfaceStub; 751 return new GLSurfaceStub;
752 default: 752 default:
753 NOTREACHED(); 753 NOTREACHED();
754 return nullptr; 754 return nullptr;
755 } 755 }
756 } 756 }
757 757
758 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() { 758 EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
759 return ui::OzonePlatform::GetInstance() 759 return ui::OzonePlatform::GetInstance()
760 ->GetSurfaceFactoryOzone() 760 ->GetSurfaceFactoryOzone()
761 ->GetNativeDisplay(); 761 ->GetNativeDisplay();
762 } 762 }
763 763
764 } // namespace gfx 764 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_osmesa.cc ('k') | ui/gl/gl_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698