mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 950553 - Use Moz2D for drawing in OrientedImage. r=seth
This commit is contained in:
parent
83c116b78a
commit
175023e83d
@ -110,9 +110,7 @@ OrientedImage::GetFrame(uint32_t aWhichFrame,
|
||||
// Create a surface to draw into.
|
||||
mozilla::RefPtr<mozilla::gfx::DrawTarget> target;
|
||||
target = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenCanvasDrawTarget(gfx::IntSize(width, height), surfaceFormat);
|
||||
nsRefPtr<gfxASurface> surface = gfxPlatform::GetPlatform()->
|
||||
GetThebesSurfaceForDrawTarget(target);
|
||||
CreateOffscreenContentDrawTarget(gfx::IntSize(width, height), surfaceFormat);
|
||||
|
||||
// Create our drawable.
|
||||
nsRefPtr<gfxASurface> innerSurface =
|
||||
@ -122,11 +120,14 @@ OrientedImage::GetFrame(uint32_t aWhichFrame,
|
||||
new gfxSurfaceDrawable(innerSurface, gfxIntSize(width, height));
|
||||
|
||||
// Draw.
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(surface);
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(target);
|
||||
gfxRect imageRect(0, 0, width, height);
|
||||
gfxUtils::DrawPixelSnapped(ctx, drawable, OrientationMatrix(nsIntSize(width, height)),
|
||||
imageRect, imageRect, imageRect, imageRect,
|
||||
imageFormat, GraphicsFilter::FILTER_FAST);
|
||||
|
||||
nsRefPtr<gfxASurface> surface = gfxPlatform::GetPlatform()->
|
||||
GetThebesSurfaceForDrawTarget(target);
|
||||
|
||||
return surface.forget();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user