зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1460496 - Remove WebRenderCanvasRendererSync r=nical
This commit is contained in:
Родитель
20c5d26efc
Коммит
0098e3b6c3
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче