blob: f2feaed4c027e44edcf98f211ac63c6ff6bf0f8b [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "gpu/ipc/service/image_transport_surface.h"
#include "base/logging.h"
#include "ui/gl/gl_surface.h"
#include "ui/gl/gl_surface_stub.h"
#include "ui/gl/init/gl_factory.h"
namespace gpu {
// static
scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface(
base::WeakPtr<ImageTransportSurfaceDelegate> delegate,
SurfaceHandle surface_handle,
gl::GLSurfaceFormat format) {
if (gl::GetGLImplementation() == gl::kGLImplementationMockGL ||
gl::GetGLImplementation() == gl::kGLImplementationStubGL) {
return new gl::GLSurfaceStub;
}
return gl::init::CreateViewGLSurface(surface_handle);
}
} // namespace gpu