Commit 3cacf69b by Geoff Lang Committed by Commit Bot

Pass all context creation parameters to DisplayImpl::createContext.

Knowing the share context at native context creation time is required if we want to honor the requested share group instead of virtualizing contexts or using global share groups. BUG=angleproject:2464 Change-Id: I1fb4d71de266b3191986b1754e73d474e49445bb Reviewed-on: https://chromium-review.googlesource.com/1108743 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent 24ddc7a8
......@@ -279,7 +279,7 @@ Context::Context(rx::EGLImplFactory *implFactory,
mSkipValidation(GetNoError(attribs)),
mDisplayTextureShareGroup(shareTextures != nullptr),
mSavedArgsType(nullptr),
mImplementation(implFactory->createContext(mState)),
mImplementation(implFactory->createContext(mState, config, shareContext, attribs)),
mLabel(nullptr),
mCompiler(),
mGLState(GetDebug(attribs),
......
......@@ -761,7 +761,7 @@ Error Display::createStream(const AttributeMap &attribs, Stream **outStream)
}
Error Display::createContext(const Config *configuration,
gl::Context *shareContext,
const gl::Context *shareContext,
const AttributeMap &attribs,
gl::Context **outContext)
{
......
......@@ -102,7 +102,7 @@ class Display final : public LabeledObject, angle::NonCopyable
Error createStream(const AttributeMap &attribs, Stream **outStream);
Error createContext(const Config *configuration,
gl::Context *shareContext,
const gl::Context *shareContext,
const AttributeMap &attribs,
gl::Context **outContext);
......
......@@ -56,7 +56,10 @@ class EGLImplFactory : angle::NonCopyable
EGLenum target,
const egl::AttributeMap &attribs) = 0;
virtual ContextImpl *createContext(const gl::ContextState &state) = 0;
virtual ContextImpl *createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) = 0;
virtual StreamProducerImpl *createStreamProducerD3DTexture(
egl::Stream::ConsumerType consumerType,
......
......@@ -200,7 +200,10 @@ DeviceImpl *DisplayD3D::createDevice()
return mRenderer->createEGLDevice();
}
ContextImpl *DisplayD3D::createContext(const gl::ContextState &state)
ContextImpl *DisplayD3D::createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs)
{
ASSERT(mRenderer != nullptr);
return mRenderer->createContext(state);
......
......@@ -42,7 +42,10 @@ class DisplayD3D : public DisplayImpl
EGLenum target,
const egl::AttributeMap &attribs) override;
ContextImpl *createContext(const gl::ContextState &state) override;
ContextImpl *createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
......
......@@ -39,7 +39,10 @@ class DisplayCGL : public DisplayGL
NativePixmapType nativePixmap,
const egl::AttributeMap &attribs) override;
ContextImpl *createContext(const gl::ContextState &state) override;
ContextImpl *createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
egl::ConfigSet generateConfigs() override;
......
......@@ -155,7 +155,10 @@ SurfaceImpl *DisplayCGL::createPixmapSurface(const egl::SurfaceState &state,
return nullptr;
}
ContextImpl *DisplayCGL::createContext(const gl::ContextState &state)
ContextImpl *DisplayCGL::createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs)
{
return new ContextGL(state, mRenderer);
}
......
......@@ -255,7 +255,10 @@ ImageImpl *DisplayAndroid::createImage(const egl::ImageState &state,
return DisplayGL::createImage(state, target, attribs);
}
ContextImpl *DisplayAndroid::createContext(const gl::ContextState &state)
ContextImpl *DisplayAndroid::createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs)
{
return new ContextGL(state, mRenderer);
}
......
......@@ -44,7 +44,10 @@ class DisplayAndroid : public DisplayEGL
EGLenum target,
const egl::AttributeMap &attribs) override;
ContextImpl *createContext(const gl::ContextState &state) override;
ContextImpl *createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
egl::ConfigSet generateConfigs() override;
......
......@@ -931,7 +931,10 @@ SurfaceImpl *DisplayOzone::createPixmapSurface(const egl::SurfaceState &state,
return nullptr;
}
ContextImpl *DisplayOzone::createContext(const gl::ContextState &state)
ContextImpl *DisplayOzone::createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs)
{
return new ContextGL(state, mRenderer);
}
......
......@@ -127,7 +127,10 @@ class DisplayOzone final : public DisplayEGL
NativePixmapType nativePixmap,
const egl::AttributeMap &attribs) override;
ContextImpl *createContext(const gl::ContextState &state) override;
ContextImpl *createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
egl::ConfigSet generateConfigs() override;
......
......@@ -404,7 +404,10 @@ SurfaceImpl *DisplayGLX::createPixmapSurface(const egl::SurfaceState &state,
return nullptr;
}
ContextImpl *DisplayGLX::createContext(const gl::ContextState &state)
ContextImpl *DisplayGLX::createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs)
{
return new ContextGL(state, mRenderer);
}
......
......@@ -61,7 +61,10 @@ class DisplayGLX : public DisplayGL
NativePixmapType nativePixmap,
const egl::AttributeMap &attribs) override;
ContextImpl *createContext(const gl::ContextState &state) override;
ContextImpl *createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
egl::ConfigSet generateConfigs() override;
......
......@@ -445,7 +445,10 @@ SurfaceImpl *DisplayWGL::createPixmapSurface(const egl::SurfaceState &state,
return nullptr;
}
ContextImpl *DisplayWGL::createContext(const gl::ContextState &state)
ContextImpl *DisplayWGL::createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs)
{
std::shared_ptr<RendererWGL> renderer;
if (mVirtualizedContexts)
......
......@@ -45,7 +45,10 @@ class DisplayWGL : public DisplayGL
NativePixmapType nativePixmap,
const egl::AttributeMap &attribs) override;
ContextImpl *createContext(const gl::ContextState &state) override;
ContextImpl *createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
egl::ConfigSet generateConfigs() override;
......
......@@ -165,7 +165,10 @@ ImageImpl *DisplayNULL::createImage(const egl::ImageState &state,
return new ImageNULL(state);
}
ContextImpl *DisplayNULL::createContext(const gl::ContextState &state)
ContextImpl *DisplayNULL::createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs)
{
return new ContextNULL(state, mAllocationTracker.get());
}
......
......@@ -62,7 +62,10 @@ class DisplayNULL : public DisplayImpl
EGLenum target,
const egl::AttributeMap &attribs) override;
ContextImpl *createContext(const gl::ContextState &state) override;
ContextImpl *createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
......
......@@ -134,7 +134,10 @@ ImageImpl *DisplayVk::createImage(const egl::ImageState &state,
return static_cast<ImageImpl *>(0);
}
ContextImpl *DisplayVk::createContext(const gl::ContextState &state)
ContextImpl *DisplayVk::createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs)
{
return new ContextVk(state, mRenderer.get());
}
......
......@@ -56,7 +56,10 @@ class DisplayVk : public DisplayImpl
EGLenum target,
const egl::AttributeMap &attribs) override;
ContextImpl *createContext(const gl::ContextState &state) override;
ContextImpl *createContext(const gl::ContextState &state,
const egl::Config *configuration,
const gl::Context *shareContext,
const egl::AttributeMap &attribs) override;
StreamProducerImpl *createStreamProducerD3DTexture(egl::Stream::ConsumerType consumerType,
const egl::AttributeMap &attribs) override;
......
......@@ -121,7 +121,11 @@ class MockEGLFactory : public EGLImplFactory
const egl::AttributeMap &));
MOCK_METHOD3(createImage,
ImageImpl *(const egl::ImageState &, EGLenum, const egl::AttributeMap &));
MOCK_METHOD1(createContext, ContextImpl *(const gl::ContextState &));
MOCK_METHOD4(createContext,
ContextImpl *(const gl::ContextState &,
const egl::Config *,
const gl::Context *,
const egl::AttributeMap &));
MOCK_METHOD2(createStreamProducerD3DTexture,
StreamProducerImpl *(egl::Stream::ConsumerType, const egl::AttributeMap &));
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment