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 *
if (deviceType == EGL_D3D11_DEVICE_ANGLE)
{
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());
GetDeviceSet()->insert(*outDevice);
return NoError();
......@@ -86,7 +86,7 @@ Device::~Device()
ASSERT(GetDeviceSet()->find(this) != GetDeviceSet()->end());
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
SafeDelete(mImplementation);
......
......@@ -29,7 +29,6 @@ class DeviceImpl : angle::NonCopyable
virtual egl::Error getDevice(void **outValue) = 0;
virtual EGLint getType() = 0;
virtual void generateExtensions(egl::DeviceExtensions *outExtensions) const = 0;
virtual bool deviceExternallySourced() = 0;
};
}
......
......@@ -17,8 +17,7 @@
namespace rx
{
DeviceD3D::DeviceD3D()
: mDevice(0), mDeviceType(0), mDeviceExternallySourced(false), mIsInitialized(false)
DeviceD3D::DeviceD3D() : mDevice(0), mDeviceType(0), mIsInitialized(false)
{
}
......@@ -46,9 +45,7 @@ egl::Error DeviceD3D::getDevice(void **outValue)
return egl::NoError();
}
egl::Error DeviceD3D::initialize(void *device,
EGLint deviceType,
EGLBoolean deviceExternallySourced)
egl::Error DeviceD3D::initialize(void *device, EGLint deviceType)
{
ASSERT(!mIsInitialized);
if (mIsInitialized)
......@@ -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
// D3D11 device.
}
else
#endif
{
ASSERT(deviceExternallySourced == EGL_FALSE);
}
mDevice = device;
mDeviceType = deviceType;
mDeviceExternallySourced = !!deviceExternallySourced;
mIsInitialized = true;
return egl::NoError();
......@@ -98,8 +90,4 @@ void DeviceD3D::generateExtensions(egl::DeviceExtensions *outExtensions) const
outExtensions->deviceD3D = true;
}
bool DeviceD3D::deviceExternallySourced()
{
return mDeviceExternallySourced;
}
}
......@@ -21,16 +21,14 @@ class DeviceD3D : public DeviceImpl
DeviceD3D();
~DeviceD3D() override;
egl::Error initialize(void *device, EGLint deviceType, EGLBoolean external);
egl::Error initialize(void *device, EGLint deviceType);
egl::Error getDevice(void **outValue) override;
EGLint getType() override;
void generateExtensions(egl::DeviceExtensions *outExtensions) const override;
bool deviceExternallySourced() override;
private:
void *mDevice;
EGLint mDeviceType;
bool mDeviceExternallySourced;
bool mIsInitialized;
};
......
......@@ -3814,8 +3814,8 @@ egl::Error Renderer11::getEGLDevice(DeviceImpl **device)
{
ASSERT(mDevice != nullptr);
mEGLDevice = new DeviceD3D();
egl::Error error = mEGLDevice->initialize(reinterpret_cast<void *>(mDevice),
EGL_D3D11_DEVICE_ANGLE, EGL_FALSE);
egl::Error error =
mEGLDevice->initialize(reinterpret_cast<void *>(mDevice), EGL_D3D11_DEVICE_ANGLE);
if (error.isError())
{
......
......@@ -3090,8 +3090,8 @@ egl::Error Renderer9::getEGLDevice(DeviceImpl **device)
{
ASSERT(mDevice != nullptr);
mEGLDevice = new DeviceD3D();
egl::Error error = mEGLDevice->initialize(reinterpret_cast<void *>(mDevice),
EGL_D3D9_DEVICE_ANGLE, EGL_FALSE);
egl::Error error =
mEGLDevice->initialize(reinterpret_cast<void *>(mDevice), EGL_D3D9_DEVICE_ANGLE);
if (error.isError())
{
......
......@@ -37,9 +37,4 @@ void DeviceNULL::generateExtensions(egl::DeviceExtensions *outExtensions) const
{
}
bool DeviceNULL::deviceExternallySourced()
{
return false;
}
} // namespace rx
......@@ -24,7 +24,6 @@ class DeviceNULL : public DeviceImpl
egl::Error getDevice(void **outValue) override;
EGLint getType() override;
void generateExtensions(egl::DeviceExtensions *outExtensions) const override;
bool deviceExternallySourced() override;
};
} // namespace rx
......
......@@ -39,10 +39,4 @@ void DeviceVk::generateExtensions(egl::DeviceExtensions *outExtensions) const
UNIMPLEMENTED();
}
bool DeviceVk::deviceExternallySourced()
{
UNIMPLEMENTED();
return bool();
}
} // namespace rx
......@@ -24,7 +24,6 @@ class DeviceVk : public DeviceImpl
egl::Error getDevice(void **outValue) override;
EGLint getType() override;
void generateExtensions(egl::DeviceExtensions *outExtensions) const override;
bool deviceExternallySourced() override;
};
} // 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