mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 924679. Part 4: Add Factory::CreateSourceSurfaceForCairoSurface. r=mattwoodrow
--HG-- extra : rebase_source : 0c9187e8b9597e47e9d0d63d6da757db9a8c8a5c
This commit is contained in:
parent
9ff4985627
commit
b3e3eccd1a
@ -937,6 +937,10 @@ public:
|
||||
|
||||
static TemporaryRef<DrawTarget> CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSize& aSize);
|
||||
|
||||
static TemporaryRef<SourceSurface>
|
||||
CreateSourceSurfaceForCairoSurface(cairo_surface_t* aSurface,
|
||||
SurfaceFormat aFormat);
|
||||
|
||||
static TemporaryRef<DrawTarget>
|
||||
CreateDrawTarget(BackendType aBackend, const IntSize &aSize, SurfaceFormat aFormat);
|
||||
|
||||
|
@ -1061,6 +1061,20 @@ DrawTargetCairo::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurf
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
DrawTargetCairo::CreateSourceSurfaceForCairoSurface(cairo_surface_t *aSurface,
|
||||
SurfaceFormat aFormat)
|
||||
{
|
||||
IntSize size;
|
||||
if (GetCairoSurfaceSize(aSurface, size)) {
|
||||
RefPtr<SourceSurfaceCairo> source =
|
||||
new SourceSurfaceCairo(aSurface, size, aFormat);
|
||||
return source;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
DrawTargetCairo::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const
|
||||
{
|
||||
|
@ -157,6 +157,10 @@ public:
|
||||
|
||||
static cairo_surface_t *GetDummySurface();
|
||||
|
||||
static TemporaryRef<SourceSurface>
|
||||
CreateSourceSurfaceForCairoSurface(cairo_surface_t* aSurface,
|
||||
SurfaceFormat aFormat);
|
||||
|
||||
private: // methods
|
||||
// Init cairo surface without doing a cairo_surface_reference() call.
|
||||
bool InitAlreadyReferenced(cairo_surface_t* aSurface, const IntSize& aSize);
|
||||
|
@ -554,6 +554,18 @@ Factory::CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSiz
|
||||
return retVal;
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
Factory::CreateSourceSurfaceForCairoSurface(cairo_surface_t* aSurface,
|
||||
SurfaceFormat aFormat)
|
||||
{
|
||||
RefPtr<SourceSurface> retVal;
|
||||
|
||||
#ifdef USE_CAIRO
|
||||
retVal = DrawTargetCairo::CreateSourceSurfaceForCairoSurface(aSurface, aFormat);
|
||||
#endif
|
||||
return retVal;
|
||||
}
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
TemporaryRef<DrawTarget>
|
||||
Factory::CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize)
|
||||
|
Loading…
Reference in New Issue
Block a user