зеркало из https://github.com/AvaloniaUI/angle.git
libANGLE: Add a unique ID to the Surface
This is needed when capturing Pbuffer calls. Bug: angleproject:4964 Change-Id: Id9f35683bf887f08f916de69bbab8c414e5e8872 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3711740 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Родитель
2a5193f6ce
Коммит
ce4e11d3cb
|
@ -60,6 +60,7 @@ EGLint SurfaceState::getPreferredSwapInterval() const
|
|||
}
|
||||
|
||||
Surface::Surface(EGLint surfaceType,
|
||||
GLuint serialId,
|
||||
const egl::Config *config,
|
||||
const AttributeMap &attributes,
|
||||
bool forceRobustResourceInit,
|
||||
|
@ -100,7 +101,8 @@ Surface::Surface(EGLint surfaceType,
|
|||
mIsDamageRegionSet(false),
|
||||
mColorInitState(gl::InitState::Initialized),
|
||||
mDepthStencilInitState(gl::InitState::Initialized),
|
||||
mImplObserverBinding(this, kSurfaceImplSubjectIndex)
|
||||
mImplObserverBinding(this, kSurfaceImplSubjectIndex),
|
||||
mSerialId(serialId)
|
||||
{
|
||||
mPostSubBufferRequested =
|
||||
(attributes.get(EGL_POST_SUB_BUFFER_SUPPORTED_NV, EGL_FALSE) == EGL_TRUE);
|
||||
|
@ -624,8 +626,7 @@ bool Surface::isCreatedWithAHB() const
|
|||
|
||||
GLuint Surface::getId() const
|
||||
{
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return mSerialId;
|
||||
}
|
||||
|
||||
Error Surface::getBufferAgeImpl(const gl::Context *context, EGLint *age) const
|
||||
|
@ -863,7 +864,7 @@ WindowSurface::WindowSurface(rx::EGLImplFactory *implFactory,
|
|||
EGLNativeWindowType window,
|
||||
const AttributeMap &attribs,
|
||||
bool robustResourceInit)
|
||||
: Surface(EGL_WINDOW_BIT, config, attribs, robustResourceInit)
|
||||
: Surface(EGL_WINDOW_BIT, implFactory->getNextSurfaceID(), config, attribs, robustResourceInit)
|
||||
{
|
||||
mImplementation = implFactory->createWindowSurface(mState, window, attribs);
|
||||
}
|
||||
|
@ -879,7 +880,7 @@ PbufferSurface::PbufferSurface(rx::EGLImplFactory *implFactory,
|
|||
const Config *config,
|
||||
const AttributeMap &attribs,
|
||||
bool robustResourceInit)
|
||||
: Surface(EGL_PBUFFER_BIT, config, attribs, robustResourceInit)
|
||||
: Surface(EGL_PBUFFER_BIT, implFactory->getNextSurfaceID(), config, attribs, robustResourceInit)
|
||||
{
|
||||
mImplementation = implFactory->createPbufferSurface(mState, attribs);
|
||||
}
|
||||
|
@ -890,7 +891,12 @@ PbufferSurface::PbufferSurface(rx::EGLImplFactory *implFactory,
|
|||
EGLClientBuffer clientBuffer,
|
||||
const AttributeMap &attribs,
|
||||
bool robustResourceInit)
|
||||
: Surface(EGL_PBUFFER_BIT, config, attribs, robustResourceInit, buftype)
|
||||
: Surface(EGL_PBUFFER_BIT,
|
||||
implFactory->getNextSurfaceID(),
|
||||
config,
|
||||
attribs,
|
||||
robustResourceInit,
|
||||
buftype)
|
||||
{
|
||||
mImplementation =
|
||||
implFactory->createPbufferFromClientBuffer(mState, buftype, clientBuffer, attribs);
|
||||
|
@ -903,7 +909,7 @@ PixmapSurface::PixmapSurface(rx::EGLImplFactory *implFactory,
|
|||
NativePixmapType nativePixmap,
|
||||
const AttributeMap &attribs,
|
||||
bool robustResourceInit)
|
||||
: Surface(EGL_PIXMAP_BIT, config, attribs, robustResourceInit)
|
||||
: Surface(EGL_PIXMAP_BIT, implFactory->getNextSurfaceID(), config, attribs, robustResourceInit)
|
||||
{
|
||||
mImplementation = implFactory->createPixmapSurface(mState, nativePixmap, attribs);
|
||||
}
|
||||
|
|
|
@ -222,6 +222,7 @@ class Surface : public LabeledObject, public gl::FramebufferAttachmentObject
|
|||
|
||||
protected:
|
||||
Surface(EGLint surfaceType,
|
||||
GLuint serialId,
|
||||
const egl::Config *config,
|
||||
const AttributeMap &attributes,
|
||||
bool forceRobustResourceInit,
|
||||
|
@ -297,6 +298,8 @@ class Surface : public LabeledObject, public gl::FramebufferAttachmentObject
|
|||
gl::InitState mColorInitState;
|
||||
gl::InitState mDepthStencilInitState;
|
||||
angle::ObserverBinding mImplObserverBinding;
|
||||
|
||||
GLuint mSerialId;
|
||||
};
|
||||
|
||||
class WindowSurface final : public Surface
|
||||
|
|
|
@ -148,4 +148,11 @@ egl::Error DisplayImpl::queryDmaBufModifiers(EGLint format,
|
|||
return egl::NoError();
|
||||
}
|
||||
|
||||
GLuint DisplayImpl::getNextSurfaceID()
|
||||
{
|
||||
uint64_t id = mNextSurfaceID.generate().getValue();
|
||||
ASSERT(id <= 0xfffffffful);
|
||||
return static_cast<GLuint>(id);
|
||||
}
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -131,6 +131,7 @@ class DisplayImpl : public EGLImplFactory, public angle::Subject
|
|||
EGLuint64KHR *modifiers,
|
||||
EGLBoolean *external_only,
|
||||
EGLint *num_modifiers);
|
||||
GLuint getNextSurfaceID() override;
|
||||
|
||||
protected:
|
||||
const egl::DisplayState &mState;
|
||||
|
@ -146,6 +147,7 @@ class DisplayImpl : public EGLImplFactory, public angle::Subject
|
|||
mutable egl::Caps mCaps;
|
||||
|
||||
egl::BlobCache *mBlobCache;
|
||||
rx::AtomicSerialFactory mNextSurfaceID;
|
||||
};
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -79,6 +79,8 @@ class EGLImplFactory : angle::NonCopyable
|
|||
virtual EGLSyncImpl *createSync(const egl::AttributeMap &attribs);
|
||||
|
||||
virtual ShareGroupImpl *createShareGroup() = 0;
|
||||
|
||||
virtual GLuint getNextSurfaceID() = 0;
|
||||
};
|
||||
|
||||
inline ExternalImageSiblingImpl *EGLImplFactory::createExternalImageSibling(
|
||||
|
|
|
@ -134,6 +134,7 @@ class MockEGLFactory : public EGLImplFactory
|
|||
MOCK_METHOD2(createStreamProducerD3DTexture,
|
||||
StreamProducerImpl *(egl::Stream::ConsumerType, const egl::AttributeMap &));
|
||||
MOCK_METHOD0(createShareGroup, ShareGroupImpl *());
|
||||
MOCK_METHOD0(getNextSurfaceID, GLuint());
|
||||
};
|
||||
|
||||
} // namespace rx
|
||||
|
|
Загрузка…
Ссылка в новой задаче