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
Родитель b67b8321a1
Коммит 1490825198
1 изменённых файлов: 12 добавлений и 1 удалений

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

@ -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!
// --------------------