зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1019704 - Stop creating Thebes backed gfxContexts in the old gtests. r=mattwoodrow
This commit is contained in:
Родитель
7d470e718a
Коммит
334d8ccec7
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsString.h"
|
||||
|
@ -19,6 +21,7 @@
|
|||
#include "gfxFontTest.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
enum {
|
||||
S_UTF8 = 0,
|
||||
|
@ -185,12 +188,11 @@ MakeContext ()
|
|||
{
|
||||
const int size = 200;
|
||||
|
||||
nsRefPtr<gfxASurface> surface;
|
||||
RefPtr<DrawTarget> drawTarget = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenContentDrawTarget(IntSize(size, size),
|
||||
SurfaceFormat::B8G8R8X8);
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(drawTarget);
|
||||
|
||||
surface = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenSurface(IntSize(size, size),
|
||||
gfxASurface::ContentFromFormat(gfxImageFormat::RGB24));
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(surface);
|
||||
return ctx.forget();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#include "gtest/gtest.h"
|
||||
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsTArray.h"
|
||||
|
@ -21,6 +23,7 @@
|
|||
#include "gfxFontTest.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
struct TestEntry {
|
||||
const char* mFamilies;
|
||||
|
@ -37,12 +40,11 @@ MakeContext ()
|
|||
{
|
||||
const int size = 200;
|
||||
|
||||
nsRefPtr<gfxASurface> surface;
|
||||
RefPtr<DrawTarget> drawTarget = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenContentDrawTarget(IntSize(size, size),
|
||||
SurfaceFormat::B8G8R8X8);
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(drawTarget);
|
||||
|
||||
surface = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenSurface(IntSize(size, size),
|
||||
gfxASurface::ContentFromFormat(gfxImageFormat::RGB24));
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(surface);
|
||||
return ctx.forget();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsString.h"
|
||||
|
@ -19,6 +21,9 @@
|
|||
#include "gfxFontTest.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
class FrameTextRunCache;
|
||||
|
||||
static FrameTextRunCache *gTextRuns = nullptr;
|
||||
|
@ -78,13 +83,12 @@ MakeContext ()
|
|||
{
|
||||
const int size = 200;
|
||||
|
||||
nsRefPtr<gfxASurface> surface;
|
||||
RefPtr<DrawTarget> drawTarget = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenContentDrawTarget(IntSize(size, size),
|
||||
SurfaceFormat::B8G8R8X8);
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(drawTarget);
|
||||
|
||||
surface = gfxPlatform::GetPlatform()->
|
||||
CreateOffscreenSurface(IntSize(size, size),
|
||||
gfxASurface::ContentFromFormat(gfxImageFormat::RGB24));
|
||||
nsRefPtr<gfxContext> ctx = new gfxContext(surface);
|
||||
return ctx.forget();
|
||||
return ctx.forget();
|
||||
}
|
||||
|
||||
TEST(Gfx, WordCache) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче