mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 740560 - [Azure] Add Factory::CreateDrawTargetForData. r=Bas,gw280
This commit is contained in:
parent
00bbd5f1fe
commit
7e20c213c5
@ -132,6 +132,33 @@ Factory::CreateDrawTarget(BackendType aBackend, const IntSize &aSize, SurfaceFor
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
Factory::CreateDrawTargetForData(BackendType aBackend,
|
||||
unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
SurfaceFormat aFormat)
|
||||
{
|
||||
switch (aBackend) {
|
||||
#ifdef USE_SKIA
|
||||
case BACKEND_SKIA:
|
||||
{
|
||||
RefPtr<DrawTargetSkia> newTarget;
|
||||
newTarget = new DrawTargetSkia();
|
||||
newTarget->Init(aData, aSize, aStride, aFormat);
|
||||
return newTarget;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
gfxDebug() << "Invalid draw target type specified.";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gfxDebug() << "Failed to create DrawTarget, Type: " << aBackend << " Size: " << aSize;
|
||||
// Failed
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TemporaryRef<ScaledFont>
|
||||
Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSize)
|
||||
{
|
||||
|
@ -647,6 +647,16 @@ gfxPlatform::CreateOffscreenDrawTarget(const IntSize& aSize, SurfaceFormat aForm
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<DrawTarget>
|
||||
gfxPlatform::CreateDrawTargetForData(unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat)
|
||||
{
|
||||
BackendType backend;
|
||||
if (!SupportsAzure(backend)) {
|
||||
return NULL;
|
||||
}
|
||||
return Factory::CreateDrawTargetForData(backend, aData, aSize, aStride, aFormat);
|
||||
}
|
||||
|
||||
nsresult
|
||||
gfxPlatform::GetFontList(nsIAtom *aLangGroup,
|
||||
const nsACString& aGenericFamily,
|
||||
|
@ -208,6 +208,10 @@ public:
|
||||
virtual mozilla::RefPtr<mozilla::gfx::DrawTarget>
|
||||
CreateOffscreenDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat);
|
||||
|
||||
virtual mozilla::RefPtr<mozilla::gfx::DrawTarget>
|
||||
CreateDrawTargetForData(unsigned char* aData, const mozilla::gfx::IntSize& aSize,
|
||||
int32_t aStride, mozilla::gfx::SurfaceFormat aFormat);
|
||||
|
||||
virtual bool SupportsAzure(mozilla::gfx::BackendType& aBackend) { return false; }
|
||||
|
||||
void GetAzureBackendInfo(mozilla::widget::InfoObject &aObj) {
|
||||
|
Loading…
Reference in New Issue
Block a user