Bug 1962966 - Add offset handling to eglCreatePbufferFromClientBuffer() r=gfx-reviewers,lsalzman

Add the following attributes handling
- EGL_TEXTURE_OFFSET_X_ANGLE
- EGL_TEXTURE_OFFSET_Y_ANGLE

Differential Revision: https://phabricator.services.mozilla.com/D247213
This commit is contained in:
sotaro
2025-04-30 04:20:06 +00:00
parent fdf464542a
commit 6043320ed2
2 changed files with 11 additions and 2 deletions

View File

@@ -6610,6 +6610,8 @@
#define LOCAL_EGL_YUV_SUBSAMPLE_EXT 0x3312
#define LOCAL_EGL_Y_AXIS_NV 0x3370
#define LOCAL_EGL_Y_INVERTED_NOK 0x307F
#define LOCAL_EGL_TEXTURE_OFFSET_X_ANGLE 0x3490
#define LOCAL_EGL_TEXTURE_OFFSET_Y_ANGLE 0x3491
// GLX
#define LOCAL_GLX_3DFX_FULLSCREEN_MODE_MESA 0x2

View File

@@ -1650,8 +1650,15 @@ void DCLayerCompositionSurface::Bind() {
const auto& gle = gl::GLContextEGL::Cast(gl);
const auto& egl = gle->mEgl;
const EGLint pbuffer_attribs[]{LOCAL_EGL_WIDTH, mSize.width, LOCAL_EGL_HEIGHT,
mSize.height, LOCAL_EGL_NONE};
const EGLint pbuffer_attribs[]{LOCAL_EGL_WIDTH,
mSize.width,
LOCAL_EGL_HEIGHT,
mSize.height,
LOCAL_EGL_TEXTURE_OFFSET_X_ANGLE,
offset.x,
LOCAL_EGL_TEXTURE_OFFSET_Y_ANGLE,
offset.y,
LOCAL_EGL_NONE};
const auto buffer = reinterpret_cast<EGLClientBuffer>(backBuffer.get());
EGLConfig eglConfig = mDCLayerTree->GetEGLConfig();