Backed out changeset cd50c7187a48 (bug 1022821) for compilation errors

This commit is contained in:
Ed Morley 2014-06-12 13:00:19 +01:00
Родитель 3e5bf1f4f6
Коммит bddaa172cb
6 изменённых файлов: 30 добавлений и 33 удалений

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

@ -98,7 +98,7 @@ gfxPattern::AddColorStop(gfxFloat offset, const gfxRGBA& c)
}
void
gfxPattern::SetColorStops(GradientStops* aStops)
gfxPattern::SetColorStops(mozilla::RefPtr<GradientStops> aStops)
{
mStops = aStops;
}

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

@ -38,7 +38,7 @@ public:
cairo_pattern_t *CairoPattern();
void AddColorStop(gfxFloat offset, const gfxRGBA& c);
void SetColorStops(mozilla::gfx::GradientStops* aStops);
void SetColorStops(mozilla::RefPtr<mozilla::gfx::GradientStops> aStops);
// This should only be called on a cairo pattern that we want to use with
// Azure. We will read back the color stops from cairo and try to look

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

@ -534,19 +534,19 @@ gfxPlatform::~gfxPlatform()
cairo_user_data_key_t kDrawTarget;
TemporaryRef<DrawTarget>
RefPtr<DrawTarget>
gfxPlatform::CreateDrawTargetForSurface(gfxASurface *aSurface, const IntSize& aSize)
{
SurfaceFormat format = Optimal2DFormatForContent(aSurface->GetContentType());
RefPtr<DrawTarget> drawTarget = Factory::CreateDrawTargetForCairoSurface(aSurface->CairoSurface(), aSize, &format);
aSurface->SetData(&kDrawTarget, drawTarget, nullptr);
return drawTarget.forget();
return drawTarget;
}
// This is a temporary function used by ContentClient to build a DrawTarget
// around the gfxASurface. This should eventually be replaced by plumbing
// the DrawTarget through directly
TemporaryRef<DrawTarget>
RefPtr<DrawTarget>
gfxPlatform::CreateDrawTargetForUpdateSurface(gfxASurface *aSurface, const IntSize& aSize)
{
#ifdef XP_MACOSX
@ -643,7 +643,7 @@ CopySurface(gfxASurface* aSurface)
return data;
}
/* static */ TemporaryRef<SourceSurface>
/* static */ RefPtr<SourceSurface>
gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurface)
{
if (!aSurface->CairoSurface() || aSurface->CairoStatus()) {
@ -709,7 +709,7 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa
if (srcBuffer) {
// It's cheap enough to make a new one so we won't keep it around and
// keeping it creates a cycle.
return srcBuffer.forget();
return srcBuffer;
}
}
@ -734,7 +734,7 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa
// Our wrapping surface will hold a reference to its image surface. We cause
// a reference cycle if we add it to the cache. And caching it is pretty
// pointless since we'll just wrap it again next use.
return srcBuffer.forget();
return srcBuffer;
}
}
@ -744,10 +744,10 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa
srcSurfUD->mSrcSurface = srcBuffer;
aSurface->SetData(&kSourceSurface, srcSurfUD, SourceBufferDestroy);
return srcBuffer.forget();
return srcBuffer;
}
TemporaryRef<DataSourceSurface>
RefPtr<DataSourceSurface>
gfxPlatform::GetWrappedDataSourceSurface(gfxASurface* aSurface)
{
nsRefPtr<gfxImageSurface> image = aSurface->GetAsImageSurface();
@ -770,7 +770,7 @@ gfxPlatform::GetWrappedDataSourceSurface(gfxASurface* aSurface)
srcSurfUD->mSurface = aSurface;
result->AddUserData(&kThebesSurface, srcSurfUD, SourceSurfaceDestroyed);
return result.forget();
return result;
}
TemporaryRef<ScaledFont>
@ -927,7 +927,7 @@ gfxPlatform::GetThebesSurfaceForDrawTarget(DrawTarget *aTarget)
return surf.forget();
}
TemporaryRef<DrawTarget>
RefPtr<DrawTarget>
gfxPlatform::CreateDrawTargetForBackend(BackendType aBackend, const IntSize& aSize, SurfaceFormat aFormat)
{
// There is a bunch of knowledge in the gfxPlatform heirarchy about how to
@ -951,27 +951,27 @@ gfxPlatform::CreateDrawTargetForBackend(BackendType aBackend, const IntSize& aSi
}
}
TemporaryRef<DrawTarget>
RefPtr<DrawTarget>
gfxPlatform::CreateOffscreenCanvasDrawTarget(const IntSize& aSize, SurfaceFormat aFormat)
{
NS_ASSERTION(mPreferredCanvasBackend != BackendType::NONE, "No backend.");
RefPtr<DrawTarget> target = CreateDrawTargetForBackend(mPreferredCanvasBackend, aSize, aFormat);
if (target ||
mFallbackCanvasBackend == BackendType::NONE) {
return target.forget();
return target;
}
return CreateDrawTargetForBackend(mFallbackCanvasBackend, aSize, aFormat);
}
TemporaryRef<DrawTarget>
RefPtr<DrawTarget>
gfxPlatform::CreateOffscreenContentDrawTarget(const IntSize& aSize, SurfaceFormat aFormat)
{
NS_ASSERTION(mPreferredCanvasBackend != BackendType::NONE, "No backend.");
return CreateDrawTargetForBackend(mContentBackend, aSize, aFormat);
}
TemporaryRef<DrawTarget>
RefPtr<DrawTarget>
gfxPlatform::CreateDrawTargetForData(unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat)
{
NS_ASSERTION(mContentBackend != BackendType::NONE, "No backend.");

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

@ -155,10 +155,7 @@ GetBackendName(mozilla::gfx::BackendType aBackend)
class gfxPlatform {
public:
typedef mozilla::gfx::DataSourceSurface DataSourceSurface;
typedef mozilla::gfx::DrawTarget DrawTarget;
typedef mozilla::gfx::IntSize IntSize;
typedef mozilla::gfx::SourceSurface SourceSurface;
/**
* Return a pointer to the current active platform.
@ -190,10 +187,10 @@ public:
* support the DrawTarget we get back.
* See SupportsAzureContentForDrawTarget.
*/
virtual mozilla::TemporaryRef<DrawTarget>
virtual mozilla::RefPtr<mozilla::gfx::DrawTarget>
CreateDrawTargetForSurface(gfxASurface *aSurface, const mozilla::gfx::IntSize& aSize);
virtual mozilla::TemporaryRef<DrawTarget>
virtual mozilla::RefPtr<mozilla::gfx::DrawTarget>
CreateDrawTargetForUpdateSurface(gfxASurface *aSurface, const mozilla::gfx::IntSize& aSize);
/*
@ -208,12 +205,12 @@ public:
* PluginInstanceChild (where we can't call gfxPlatform::GetPlatform()
* because the prefs service can only be accessed from the main process).
*/
static mozilla::TemporaryRef<SourceSurface>
static mozilla::RefPtr<mozilla::gfx::SourceSurface>
GetSourceSurfaceForSurface(mozilla::gfx::DrawTarget *aTarget, gfxASurface *aSurface);
static void ClearSourceSurfaceForSurface(gfxASurface *aSurface);
static mozilla::TemporaryRef<DataSourceSurface>
static mozilla::RefPtr<mozilla::gfx::DataSourceSurface>
GetWrappedDataSourceSurface(gfxASurface *aSurface);
virtual mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
@ -222,13 +219,13 @@ public:
virtual already_AddRefed<gfxASurface>
GetThebesSurfaceForDrawTarget(mozilla::gfx::DrawTarget *aTarget);
mozilla::TemporaryRef<DrawTarget>
mozilla::RefPtr<mozilla::gfx::DrawTarget>
CreateOffscreenContentDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat);
mozilla::TemporaryRef<DrawTarget>
mozilla::RefPtr<mozilla::gfx::DrawTarget>
CreateOffscreenCanvasDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat);
virtual mozilla::TemporaryRef<DrawTarget>
virtual mozilla::RefPtr<mozilla::gfx::DrawTarget>
CreateDrawTargetForData(unsigned char* aData, const mozilla::gfx::IntSize& aSize,
int32_t aStride, mozilla::gfx::SurfaceFormat aFormat);
@ -560,7 +557,7 @@ protected:
* Helper method, creates a draw target for a specific Azure backend.
* Used by CreateOffscreenDrawTarget.
*/
mozilla::TemporaryRef<DrawTarget>
mozilla::RefPtr<mozilla::gfx::DrawTarget>
CreateDrawTargetForBackend(mozilla::gfx::BackendType aBackend,
const mozilla::gfx::IntSize& aSize,
mozilla::gfx::SurfaceFormat aFormat);

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

@ -965,7 +965,7 @@ gfxUtils::CopyAsDataURL(DrawTarget* aDT)
}
/* static */ void
gfxUtils::WriteAsPNG(gfx::SourceSurface* aSourceSurface, const char* aFile)
gfxUtils::WriteAsPNG(RefPtr<gfx::SourceSurface> aSourceSurface, const char* aFile)
{
RefPtr<gfx::DataSourceSurface> dataSurface = aSourceSurface->GetDataSurface();
RefPtr<gfx::DrawTarget> dt
@ -978,7 +978,7 @@ gfxUtils::WriteAsPNG(gfx::SourceSurface* aSourceSurface, const char* aFile)
}
/* static */ void
gfxUtils::DumpAsDataURL(gfx::SourceSurface* aSourceSurface)
gfxUtils::DumpAsDataURL(RefPtr<gfx::SourceSurface> aSourceSurface)
{
RefPtr<gfx::DataSourceSurface> dataSurface = aSourceSurface->GetDataSurface();
RefPtr<gfx::DrawTarget> dt
@ -991,7 +991,7 @@ gfxUtils::DumpAsDataURL(gfx::SourceSurface* aSourceSurface)
}
/* static */ void
gfxUtils::CopyAsDataURL(gfx::SourceSurface* aSourceSurface)
gfxUtils::CopyAsDataURL(RefPtr<gfx::SourceSurface> aSourceSurface)
{
RefPtr<gfx::DataSourceSurface> dataSurface = aSourceSurface->GetDataSurface();
RefPtr<gfx::DrawTarget> dt

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

@ -240,19 +240,19 @@ public:
* Writes a binary PNG file.
* Expensive. Creates a DataSourceSurface, then a DrawTarget, then passes to DrawTarget overloads
*/
static void WriteAsPNG(mozilla::gfx::SourceSurface* aSourceSurface, const char* aFile);
static void WriteAsPNG(mozilla::RefPtr<mozilla::gfx::SourceSurface> aSourceSurface, const char* aFile);
/**
* Write as a PNG encoded Data URL to stdout.
* Expensive. Creates a DataSourceSurface, then a DrawTarget, then passes to DrawTarget overloads
*/
static void DumpAsDataURL(mozilla::gfx::SourceSurface* aSourceSurface);
static void DumpAsDataURL(mozilla::RefPtr<mozilla::gfx::SourceSurface> aSourceSurface);
/**
* Copy a PNG encoded Data URL to the clipboard.
* Expensive. Creates a DataSourceSurface, then a DrawTarget, then passes to DrawTarget overloads
*/
static void CopyAsDataURL(mozilla::gfx::SourceSurface* aSourceSurface);
static void CopyAsDataURL(mozilla::RefPtr<mozilla::gfx::SourceSurface> aSourceSurface);
#endif
};