mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 907926 - Supprt having different content/canvas backends in gfxPlatform. r=nrc
This commit is contained in:
parent
bd22797dd3
commit
11914fb596
@ -874,7 +874,7 @@ CanvasRenderingContext2D::EnsureTarget()
|
||||
#endif
|
||||
mTarget = layerManager->CreateDrawTarget(size, format);
|
||||
} else {
|
||||
mTarget = gfxPlatform::GetPlatform()->CreateOffscreenDrawTarget(size, format);
|
||||
mTarget = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(size, format);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3566,7 +3566,7 @@ CanvasRenderingContext2D::EnsureErrorTarget()
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<DrawTarget> errorTarget = gfxPlatform::GetPlatform()->CreateOffscreenDrawTarget(IntSize(1, 1), FORMAT_B8G8R8A8);
|
||||
RefPtr<DrawTarget> errorTarget = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(IntSize(1, 1), FORMAT_B8G8R8A8);
|
||||
NS_ABORT_IF_FALSE(errorTarget, "Failed to allocate the error target!");
|
||||
|
||||
sErrorTarget = errorTarget;
|
||||
|
@ -135,7 +135,7 @@ LayerManager::CreateDrawTarget(const IntSize &aSize,
|
||||
SurfaceFormat aFormat)
|
||||
{
|
||||
return gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenDrawTarget(aSize, aFormat);
|
||||
CreateOffscreenCanvasDrawTarget(aSize, aFormat);
|
||||
}
|
||||
|
||||
TextureFactoryIdentifier
|
||||
|
@ -408,8 +408,8 @@ public:
|
||||
CreateOptimalMaskSurface(const gfxIntSize &aSize);
|
||||
|
||||
/**
|
||||
* Creates a DrawTarget which is optimized for inter-operating with this
|
||||
* layermanager.
|
||||
* Creates a DrawTarget for use with canvas which is optimized for
|
||||
* inter-operating with this layermanager.
|
||||
*/
|
||||
virtual TemporaryRef<mozilla::gfx::DrawTarget>
|
||||
CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
|
||||
|
@ -373,7 +373,7 @@ BasicCompositor::BeginFrame(const gfx::Rect *aClipRectIn,
|
||||
if (mCopyTarget) {
|
||||
// If we have a copy target, then we don't have a widget-provided mDrawTarget (currently). Create a dummy
|
||||
// placeholder so that CreateRenderTarget() works.
|
||||
mDrawTarget = gfxPlatform::GetPlatform()->CreateOffscreenDrawTarget(IntSize(1,1), FORMAT_B8G8R8A8);
|
||||
mDrawTarget = gfxPlatform::GetPlatform()->CreateOffscreenCanvasDrawTarget(IntSize(1,1), FORMAT_B8G8R8A8);
|
||||
} else {
|
||||
mDrawTarget = mWidget->StartRemoteDrawing();
|
||||
}
|
||||
|
@ -876,7 +876,7 @@ gfxPlatform::CreateDrawTargetForBackend(BackendType aBackend, const IntSize& aSi
|
||||
}
|
||||
|
||||
RefPtr<DrawTarget>
|
||||
gfxPlatform::CreateOffscreenDrawTarget(const IntSize& aSize, SurfaceFormat aFormat)
|
||||
gfxPlatform::CreateOffscreenCanvasDrawTarget(const IntSize& aSize, SurfaceFormat aFormat)
|
||||
{
|
||||
NS_ASSERTION(mPreferredCanvasBackend, "No backend.");
|
||||
RefPtr<DrawTarget> target = CreateDrawTargetForBackend(mPreferredCanvasBackend, aSize, aFormat);
|
||||
@ -888,6 +888,12 @@ gfxPlatform::CreateOffscreenDrawTarget(const IntSize& aSize, SurfaceFormat aForm
|
||||
return CreateDrawTargetForBackend(mFallbackCanvasBackend, aSize, aFormat);
|
||||
}
|
||||
|
||||
RefPtr<DrawTarget>
|
||||
gfxPlatform::CreateOffscreenContentDrawTarget(const IntSize& aSize, SurfaceFormat aFormat)
|
||||
{
|
||||
NS_ASSERTION(mContentBackend, "No backend.");
|
||||
return CreateDrawTargetForBackend(mContentBackend, aSize, aFormat);
|
||||
}
|
||||
|
||||
RefPtr<DrawTarget>
|
||||
gfxPlatform::CreateDrawTargetForData(unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat)
|
||||
|
@ -234,8 +234,11 @@ public:
|
||||
virtual already_AddRefed<gfxASurface>
|
||||
GetThebesSurfaceForDrawTarget(mozilla::gfx::DrawTarget *aTarget);
|
||||
|
||||
virtual mozilla::RefPtr<mozilla::gfx::DrawTarget>
|
||||
CreateOffscreenDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat);
|
||||
mozilla::RefPtr<mozilla::gfx::DrawTarget>
|
||||
CreateOffscreenContentDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat);
|
||||
|
||||
mozilla::RefPtr<mozilla::gfx::DrawTarget>
|
||||
CreateOffscreenCanvasDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat);
|
||||
|
||||
virtual mozilla::RefPtr<mozilla::gfx::DrawTarget>
|
||||
CreateDrawTargetForData(unsigned char* aData, const mozilla::gfx::IntSize& aSize,
|
||||
|
@ -232,8 +232,8 @@ ClippedImage::GetFrameInternal(const nsIntSize& aViewportSize,
|
||||
// Create a surface to draw into.
|
||||
mozilla::RefPtr<mozilla::gfx::DrawTarget> target;
|
||||
target = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenDrawTarget(gfx::IntSize(mClip.width, mClip.height),
|
||||
gfx::FORMAT_B8G8R8A8);
|
||||
CreateOffscreenCanvasDrawTarget(gfx::IntSize(mClip.width, mClip.height),
|
||||
gfx::FORMAT_B8G8R8A8);
|
||||
nsRefPtr<gfxASurface> surface = gfxPlatform::GetPlatform()->
|
||||
GetThebesSurfaceForDrawTarget(target);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user