blob: cac38cb00824a1a42e51f24c23b899c9b640be43 [file] [log] [blame]
// Copyright 2018 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 "ui/gl/gl_image_io_surface.h"
#include <EGL/egl.h>
namespace gl {
// Implements a IOSurface-backed GLImage that uses the
// EGL_ANGLE_iosurface_client_buffer extension to bind the IOSurface to textures
class GL_EXPORT GLImageIOSurfaceEGL : public GLImageIOSurface {
GLImageIOSurfaceEGL(const gfx::Size& size,
unsigned internalformat,
bool emulate_rgb);
void ReleaseTexImage(unsigned target) override;
~GLImageIOSurfaceEGL() override;
bool BindTexImageImpl(unsigned internalformat) override;
bool CopyTexImage(unsigned target) override;
// If Swiftshader is being used, use the RGB emulation paths in the validating
// command decoder instead of creating the IOSurface with an RGB format. ANGLE
// handles the emulation internally. This can be removed once Swiftshader is
// used as an ANGLE backend.
bool emulate_rgb_;
EGLDisplay display_;
EGLSurface pbuffer_;
EGLConfig dummy_config_;
bool texture_bound_;
} // namespace gl