Bug 979905 - Make VectorImage use a Moz2D backed gfxContext. r=mattwoodrow

This commit is contained in:
Jonathan Watt 2014-03-05 16:10:34 +00:00
parent 0cc9e2da9d
commit cf3ab2df31

View File

@ -14,6 +14,8 @@
#include "mozilla/AutoRestore.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/SVGSVGElement.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "nsIDOMEvent.h"
#include "nsIPresShell.h"
#include "nsIStreamListener.h"
@ -680,7 +682,16 @@ VectorImage::GetFrame(uint32_t aWhichFrame,
nsRefPtr<gfxImageSurface> surface =
new gfxImageSurface(surfaceSize, gfxImageFormat::ARGB32);
nsRefPtr<gfxContext> context = new gfxContext(surface);
RefPtr<DrawTarget> drawTarget =
Factory::CreateDrawTargetForData(BackendType::CAIRO,
surface->Data(),
IntSize(imageIntSize.width,
imageIntSize.height),
surface->Stride(),
SurfaceFormat::B8G8R8A8);
nsRefPtr<gfxContext> context = new gfxContext(drawTarget);
// Draw to our surface!
// --------------------