Bug 1004375 - Removed use of legacy skia compatible device API - r=gw280

This commit is contained in:
Walter Litwinczyk 2014-06-24 15:35:07 -07:00
parent 046a7f6d8c
commit f3a8550e6e
2 changed files with 12 additions and 4 deletions

View File

@ -721,9 +721,18 @@ DrawTargetSkia::CopySurface(SourceSurface *aSurface,
bool
DrawTargetSkia::Init(const IntSize &aSize, SurfaceFormat aFormat)
{
SkAutoTUnref<SkBaseDevice> device(new SkBitmapDevice(GfxFormatToSkiaConfig(aFormat),
aSize.width, aSize.height,
aFormat == SurfaceFormat::B8G8R8X8));
SkAlphaType alphaType = (aFormat == SurfaceFormat::B8G8R8X8) ?
kOpaque_SkAlphaType : kPremul_SkAlphaType;
SkImageInfo skiInfo = SkImageInfo::Make(
aSize.width, aSize.height,
GfxFormatToSkiaColorType(aFormat),
alphaType);
SkAutoTUnref<SkBaseDevice> device(SkBitmapDevice::Create(skiInfo));
if (!device) {
return false;
}
SkBitmap bitmap = device->accessBitmap(true);
if (!bitmap.allocPixels()) {

View File

@ -204,4 +204,3 @@
#endif
#define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0
#define SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG 1