Backed out changeset a0827d7c8a02 (bug 981621)

This commit is contained in:
Ed Morley 2014-03-26 15:14:57 +00:00
parent 1207c28e56
commit 9ba6fe2dd0
4 changed files with 6 additions and 12 deletions

View File

@ -979,7 +979,7 @@ public:
}
#ifdef USE_SKIA_GPU
virtual bool InitWithGrContext(GrContext* aGrContext,
virtual void InitWithGrContext(GrContext* aGrContext,
const IntSize &aSize,
SurfaceFormat aFormat)
{

View File

@ -659,7 +659,7 @@ DrawTargetSkia::Init(const IntSize &aSize, SurfaceFormat aFormat)
}
#ifdef USE_SKIA_GPU
bool
void
DrawTargetSkia::InitWithGrContext(GrContext* aGrContext,
const IntSize &aSize,
SurfaceFormat aFormat)
@ -681,17 +681,12 @@ DrawTargetSkia::InitWithGrContext(GrContext* aGrContext,
targetDescriptor.fSampleCnt = 0;
SkAutoTUnref<GrTexture> skiaTexture(mGrContext->createUncachedTexture(targetDescriptor, NULL, 0));
if (!skiaTexture) {
return false;
}
mTexture = (uint32_t)skiaTexture->getTextureHandle();
SkAutoTUnref<SkBaseDevice> device(new SkGpuDevice(mGrContext.get(), skiaTexture->asRenderTarget()));
SkAutoTUnref<SkCanvas> canvas(new SkCanvas(device.get()));
mCanvas = canvas.get();
return true;
}
#endif

View File

@ -106,7 +106,7 @@ public:
void Init(unsigned char* aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat);
#ifdef USE_SKIA_GPU
bool InitWithGrContext(GrContext* aGrContext,
void InitWithGrContext(GrContext* aGrContext,
const IntSize &aSize,
SurfaceFormat aFormat) MOZ_OVERRIDE;
#endif

View File

@ -590,10 +590,9 @@ Factory::CreateDrawTargetSkiaWithGrContext(GrContext* aGrContext,
const IntSize &aSize,
SurfaceFormat aFormat)
{
RefPtr<DrawTarget> newTarget = new DrawTargetSkia();
if (!newTarget->InitWithGrContext(aGrContext, aSize, aFormat)) {
return nullptr;
}
DrawTargetSkia* newDrawTargetSkia = new DrawTargetSkia();
newDrawTargetSkia->InitWithGrContext(aGrContext, aSize, aFormat);
RefPtr<DrawTarget> newTarget = newDrawTargetSkia;
return newTarget;
}