Commit 28334a41 by Geoff Lang Committed by Commit Bot

Remove the externallyForced method of DeviceImpl.

It can be inferred from the presence of an owning display. BUG=742034 Change-Id: I6a33378f4256733da6d9658d47763153e431ad70 Reviewed-on: https://chromium-review.googlesource.com/854625Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent cd3acf67
...@@ -51,7 +51,7 @@ egl::Error Device::CreateDevice(void *devicePointer, EGLint deviceType, Device * ...@@ -51,7 +51,7 @@ egl::Error Device::CreateDevice(void *devicePointer, EGLint deviceType, Device *
if (deviceType == EGL_D3D11_DEVICE_ANGLE) if (deviceType == EGL_D3D11_DEVICE_ANGLE)
{ {
std::unique_ptr<rx::DeviceD3D> deviceD3D(new rx::DeviceD3D()); std::unique_ptr<rx::DeviceD3D> deviceD3D(new rx::DeviceD3D());
ANGLE_TRY(deviceD3D->initialize(devicePointer, deviceType, EGL_TRUE)); ANGLE_TRY(deviceD3D->initialize(devicePointer, deviceType));
*outDevice = new Device(nullptr, deviceD3D.release()); *outDevice = new Device(nullptr, deviceD3D.release());
GetDeviceSet()->insert(*outDevice); GetDeviceSet()->insert(*outDevice);
return NoError(); return NoError();
...@@ -86,7 +86,7 @@ Device::~Device() ...@@ -86,7 +86,7 @@ Device::~Device()
ASSERT(GetDeviceSet()->find(this) != GetDeviceSet()->end()); ASSERT(GetDeviceSet()->find(this) != GetDeviceSet()->end());
GetDeviceSet()->erase(this); GetDeviceSet()->erase(this);
if (mImplementation->deviceExternallySourced()) if (!mOwningDisplay)
{ {
// If the device isn't externally sourced then it is up to the renderer to delete the impl // If the device isn't externally sourced then it is up to the renderer to delete the impl
SafeDelete(mImplementation); SafeDelete(mImplementation);
......
...@@ -29,7 +29,6 @@ class DeviceImpl : angle::NonCopyable ...@@ -29,7 +29,6 @@ class DeviceImpl : angle::NonCopyable
virtual egl::Error getDevice(void **outValue) = 0; virtual egl::Error getDevice(void **outValue) = 0;
virtual EGLint getType() = 0; virtual EGLint getType() = 0;
virtual void generateExtensions(egl::DeviceExtensions *outExtensions) const = 0; virtual void generateExtensions(egl::DeviceExtensions *outExtensions) const = 0;
virtual bool deviceExternallySourced() = 0;
}; };
} }
......
...@@ -17,8 +17,7 @@ ...@@ -17,8 +17,7 @@
namespace rx namespace rx
{ {
DeviceD3D::DeviceD3D() DeviceD3D::DeviceD3D() : mDevice(0), mDeviceType(0), mIsInitialized(false)
: mDevice(0), mDeviceType(0), mDeviceExternallySourced(false), mIsInitialized(false)
{ {
} }
...@@ -46,9 +45,7 @@ egl::Error DeviceD3D::getDevice(void **outValue) ...@@ -46,9 +45,7 @@ egl::Error DeviceD3D::getDevice(void **outValue)
return egl::NoError(); return egl::NoError();
} }
egl::Error DeviceD3D::initialize(void *device, egl::Error DeviceD3D::initialize(void *device, EGLint deviceType)
EGLint deviceType,
EGLBoolean deviceExternallySourced)
{ {
ASSERT(!mIsInitialized); ASSERT(!mIsInitialized);
if (mIsInitialized) if (mIsInitialized)
...@@ -74,15 +71,10 @@ egl::Error DeviceD3D::initialize(void *device, ...@@ -74,15 +71,10 @@ egl::Error DeviceD3D::initialize(void *device,
// Deliberately don't release the ref here, so that the DeviceD3D holds a ref to the // Deliberately don't release the ref here, so that the DeviceD3D holds a ref to the
// D3D11 device. // D3D11 device.
} }
else
#endif #endif
{
ASSERT(deviceExternallySourced == EGL_FALSE);
}
mDevice = device; mDevice = device;
mDeviceType = deviceType; mDeviceType = deviceType;
mDeviceExternallySourced = !!deviceExternallySourced;
mIsInitialized = true; mIsInitialized = true;
return egl::NoError(); return egl::NoError();
...@@ -98,8 +90,4 @@ void DeviceD3D::generateExtensions(egl::DeviceExtensions *outExtensions) const ...@@ -98,8 +90,4 @@ void DeviceD3D::generateExtensions(egl::DeviceExtensions *outExtensions) const
outExtensions->deviceD3D = true; outExtensions->deviceD3D = true;
} }
bool DeviceD3D::deviceExternallySourced()
{
return mDeviceExternallySourced;
}
} }
...@@ -21,16 +21,14 @@ class DeviceD3D : public DeviceImpl ...@@ -21,16 +21,14 @@ class DeviceD3D : public DeviceImpl
DeviceD3D(); DeviceD3D();
~DeviceD3D() override; ~DeviceD3D() override;
egl::Error initialize(void *device, EGLint deviceType, EGLBoolean external); egl::Error initialize(void *device, EGLint deviceType);
egl::Error getDevice(void **outValue) override; egl::Error getDevice(void **outValue) override;
EGLint getType() override; EGLint getType() override;
void generateExtensions(egl::DeviceExtensions *outExtensions) const override; void generateExtensions(egl::DeviceExtensions *outExtensions) const override;
bool deviceExternallySourced() override;
private: private:
void *mDevice; void *mDevice;
EGLint mDeviceType; EGLint mDeviceType;
bool mDeviceExternallySourced;
bool mIsInitialized; bool mIsInitialized;
}; };
......
...@@ -3814,8 +3814,8 @@ egl::Error Renderer11::getEGLDevice(DeviceImpl **device) ...@@ -3814,8 +3814,8 @@ egl::Error Renderer11::getEGLDevice(DeviceImpl **device)
{ {
ASSERT(mDevice != nullptr); ASSERT(mDevice != nullptr);
mEGLDevice = new DeviceD3D(); mEGLDevice = new DeviceD3D();
egl::Error error = mEGLDevice->initialize(reinterpret_cast<void *>(mDevice), egl::Error error =
EGL_D3D11_DEVICE_ANGLE, EGL_FALSE); mEGLDevice->initialize(reinterpret_cast<void *>(mDevice), EGL_D3D11_DEVICE_ANGLE);
if (error.isError()) if (error.isError())
{ {
......
...@@ -3090,8 +3090,8 @@ egl::Error Renderer9::getEGLDevice(DeviceImpl **device) ...@@ -3090,8 +3090,8 @@ egl::Error Renderer9::getEGLDevice(DeviceImpl **device)
{ {
ASSERT(mDevice != nullptr); ASSERT(mDevice != nullptr);
mEGLDevice = new DeviceD3D(); mEGLDevice = new DeviceD3D();
egl::Error error = mEGLDevice->initialize(reinterpret_cast<void *>(mDevice), egl::Error error =
EGL_D3D9_DEVICE_ANGLE, EGL_FALSE); mEGLDevice->initialize(reinterpret_cast<void *>(mDevice), EGL_D3D9_DEVICE_ANGLE);
if (error.isError()) if (error.isError())
{ {
......
...@@ -37,9 +37,4 @@ void DeviceNULL::generateExtensions(egl::DeviceExtensions *outExtensions) const ...@@ -37,9 +37,4 @@ void DeviceNULL::generateExtensions(egl::DeviceExtensions *outExtensions) const
{ {
} }
bool DeviceNULL::deviceExternallySourced()
{
return false;
}
} // namespace rx } // namespace rx
...@@ -24,7 +24,6 @@ class DeviceNULL : public DeviceImpl ...@@ -24,7 +24,6 @@ class DeviceNULL : public DeviceImpl
egl::Error getDevice(void **outValue) override; egl::Error getDevice(void **outValue) override;
EGLint getType() override; EGLint getType() override;
void generateExtensions(egl::DeviceExtensions *outExtensions) const override; void generateExtensions(egl::DeviceExtensions *outExtensions) const override;
bool deviceExternallySourced() override;
}; };
} // namespace rx } // namespace rx
......
...@@ -39,10 +39,4 @@ void DeviceVk::generateExtensions(egl::DeviceExtensions *outExtensions) const ...@@ -39,10 +39,4 @@ void DeviceVk::generateExtensions(egl::DeviceExtensions *outExtensions) const
UNIMPLEMENTED(); UNIMPLEMENTED();
} }
bool DeviceVk::deviceExternallySourced()
{
UNIMPLEMENTED();
return bool();
}
} // namespace rx } // namespace rx
...@@ -24,7 +24,6 @@ class DeviceVk : public DeviceImpl ...@@ -24,7 +24,6 @@ class DeviceVk : public DeviceImpl
egl::Error getDevice(void **outValue) override; egl::Error getDevice(void **outValue) override;
EGLint getType() override; EGLint getType() override;
void generateExtensions(egl::DeviceExtensions *outExtensions) const override; void generateExtensions(egl::DeviceExtensions *outExtensions) const override;
bool deviceExternallySourced() override;
}; };
} // namespace rx } // namespace rx
......
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