Bug 932096 - Add a GetDrawTarget method to nsRenderingContext to aid in Moz2D conversion. r=Bas

This commit is contained in:
Jonathan Watt 2013-10-29 08:14:40 +00:00
parent 2d9d4c1ac1
commit a5a975b719

View File

@ -10,6 +10,7 @@
#include <sys/types.h> // for int32_t
#include "gfxContext.h" // for gfxContext
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/UserData.h" // for UserData, UserDataKey
#include "nsAutoPtr.h" // for nsRefPtr
#include "nsBoundingMetrics.h" // for nsBoundingMetrics
@ -37,6 +38,7 @@ class nsRenderingContext
{
typedef mozilla::gfx::UserData UserData;
typedef mozilla::gfx::UserDataKey UserDataKey;
typedef mozilla::gfx::DrawTarget DrawTarget;
public:
nsRenderingContext() : mP2A(0.) {}
@ -49,6 +51,7 @@ public:
// These accessors will never return null.
gfxContext *ThebesContext() { return mThebes; }
DrawTarget *GetDrawTarget() { return mThebes->GetDrawTarget(); }
nsDeviceContext *DeviceContext() { return mDeviceContext; }
int32_t AppUnitsPerDevPixel() { return NSToIntRound(mP2A); }