Bug 1460496 - Remove WebRenderCanvasRendererSync r=nical

This commit is contained in:
sotaro 2018-05-14 10:25:47 +09:00
Родитель 20c5d26efc
Коммит 0098e3b6c3
3 изменённых файлов: 6 добавлений и 96 удалений

Просмотреть файл

@ -26,7 +26,6 @@ class AsyncCanvasRenderer;
class ClientCanvasRenderer;
class CopyableCanvasRenderer;
class PersistentBufferProvider;
class WebRenderCanvasRendererSync;
class WebRenderCanvasRendererAsync;
struct CanvasInitializeData {
@ -83,8 +82,6 @@ struct CanvasInitializeData {
// ClientCanvasLayer.
// WebRenderCanvasRenderer inherites ShareableCanvasRenderer and provides all
// functionality that WebRender uses.
// WebRenderCanvasRendererSync inherites WebRenderCanvasRenderer and be used in
// WebRenderCanvasLayer.
// WebRenderCanvasRendererAsync inherites WebRenderCanvasRenderer and be used in
// layers-free mode of WebRender.
//
@ -108,13 +105,12 @@ struct CanvasInitializeData {
// | |
// +--------------------+ +---------+-------------+
// |ClientCanvasRenderer| |WebRenderCanvasRenderer|
// +--------------------+ +--------+--+-----------+
// ^ ^
// +-----------------------+ +----+
// | |
// +-------------+-------------+ +-------------+--------------+
// |WebRenderCanvasRendererSync| |WebRenderCanvasRendererAsync|
// +---------------------------+ +----------------------------+
// +--------------------+ +-----------+-----------+
// ^
// |
// +-------------+--------------+
// |WebRenderCanvasRendererAsync|
// +----------------------------+
class CanvasRenderer
{
public:
@ -136,7 +132,6 @@ public:
virtual CopyableCanvasRenderer* AsCopyableCanvasRenderer() { return nullptr; }
virtual ClientCanvasRenderer* AsClientCanvasRenderer() { return nullptr; }
virtual WebRenderCanvasRendererSync* AsWebRenderCanvasRendererSync() { return nullptr; }
virtual WebRenderCanvasRendererAsync* AsWebRenderCanvasRendererAsync() { return nullptr; }
protected:

Просмотреть файл

@ -28,70 +28,6 @@ WebRenderCanvasRenderer::Initialize(const CanvasInitializeData& aData)
ShareableCanvasRenderer::Initialize(aData);
}
WebRenderCanvasRendererSync::~WebRenderCanvasRendererSync()
{
Destroy();
}
void
WebRenderCanvasRendererSync::Initialize(const CanvasInitializeData& aData)
{
WebRenderCanvasRenderer::Initialize(aData);
if (mExternalImageId.isSome()) {
mManager->WrBridge()->DeallocExternalImageId(mExternalImageId.ref());
mExternalImageId.reset();
}
}
bool
WebRenderCanvasRendererSync::CreateCompositable()
{
if (!mCanvasClient) {
TextureFlags flags = TextureFlags::DEFAULT;
if (mOriginPos == gl::OriginPos::BottomLeft) {
flags |= TextureFlags::ORIGIN_BOTTOM_LEFT;
}
if (!mIsAlphaPremultiplied) {
flags |= TextureFlags::NON_PREMULTIPLIED;
}
mCanvasClient = CanvasClient::CreateCanvasClient(GetCanvasClientType(),
GetForwarder(),
flags);
if (!mCanvasClient) {
return false;
}
mCanvasClient->Connect();
}
if (mExternalImageId.isNothing()) {
mExternalImageId = Some(mManager->WrBridge()->AllocExternalImageIdForCompositable(mCanvasClient));
}
return true;
}
void
WebRenderCanvasRendererSync::ClearCachedResources()
{
if (mExternalImageId.isSome()) {
mManager->WrBridge()->DeallocExternalImageId(mExternalImageId.ref());
mExternalImageId.reset();
}
}
void
WebRenderCanvasRendererSync::Destroy()
{
if (mExternalImageId.isSome()) {
mManager->WrBridge()->DeallocExternalImageId(mExternalImageId.ref());
mExternalImageId.reset();
}
}
WebRenderCanvasRendererAsync::~WebRenderCanvasRendererAsync()
{
Destroy();

Просмотреть файл

@ -29,27 +29,6 @@ protected:
WebRenderLayerManager* mManager;
};
class WebRenderCanvasRendererSync : public WebRenderCanvasRenderer
{
public:
explicit WebRenderCanvasRendererSync(WebRenderLayerManager* aManager)
: WebRenderCanvasRenderer(aManager)
{ }
virtual ~WebRenderCanvasRendererSync();
WebRenderCanvasRendererSync* AsWebRenderCanvasRendererSync() override { return this; }
void Initialize(const CanvasInitializeData& aData) override;
bool CreateCompositable() override;
void ClearCachedResources() override;
void Destroy() override;
wr::MaybeExternalImageId GetExternalImageId() { return mExternalImageId; }
protected:
wr::MaybeExternalImageId mExternalImageId;
};
class WebRenderCanvasRendererAsync : public WebRenderCanvasRenderer
{
public: