Skip to content

Commit

Permalink
Bug 979905 - Make VectorImage use a Moz2D backed gfxContext. r=mattwo…
Browse files Browse the repository at this point in the history
…odrow
  • Loading branch information
jwatt committed Mar 5, 2014
1 parent b67b832 commit 1490825
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion image/src/VectorImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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!
// --------------------
Expand Down

0 comments on commit 1490825

Please sign in to comment.