Bug 1019704 - Stop creating Thebes backed gfxContexts in the old gtests. r=mattwoodrow

This commit is contained in:
Jonathan Watt 2014-06-04 08:08:39 +01:00
Родитель 7d470e718a
Коммит 334d8ccec7
3 изменённых файлов: 24 добавлений и 16 удалений

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

@ -5,6 +5,8 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "nsString.h" #include "nsString.h"
@ -19,6 +21,7 @@
#include "gfxFontTest.h" #include "gfxFontTest.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::gfx;
enum { enum {
S_UTF8 = 0, S_UTF8 = 0,
@ -185,12 +188,11 @@ MakeContext ()
{ {
const int size = 200; 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();
} }

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

@ -6,6 +6,8 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "mozilla/ArrayUtils.h" #include "mozilla/ArrayUtils.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsTArray.h" #include "nsTArray.h"
@ -21,6 +23,7 @@
#include "gfxFontTest.h" #include "gfxFontTest.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::gfx;
struct TestEntry { struct TestEntry {
const char* mFamilies; const char* mFamilies;
@ -37,12 +40,11 @@ MakeContext ()
{ {
const int size = 200; 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();
} }

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

@ -5,6 +5,8 @@
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/RefPtr.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "nsString.h" #include "nsString.h"
@ -19,6 +21,9 @@
#include "gfxFontTest.h" #include "gfxFontTest.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
using namespace mozilla;
using namespace mozilla::gfx;
class FrameTextRunCache; class FrameTextRunCache;
static FrameTextRunCache *gTextRuns = nullptr; static FrameTextRunCache *gTextRuns = nullptr;
@ -78,13 +83,12 @@ MakeContext ()
{ {
const int size = 200; 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()-> return ctx.forget();
CreateOffscreenSurface(IntSize(size, size),
gfxASurface::ContentFromFormat(gfxImageFormat::RGB24));
nsRefPtr<gfxContext> ctx = new gfxContext(surface);
return ctx.forget();
} }
TEST(Gfx, WordCache) { TEST(Gfx, WordCache) {