mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Backed out changeset a0827d7c8a02 (bug 981621)
This commit is contained in:
parent
1207c28e56
commit
9ba6fe2dd0
@ -979,7 +979,7 @@ public:
|
||||
}
|
||||
|
||||
#ifdef USE_SKIA_GPU
|
||||
virtual bool InitWithGrContext(GrContext* aGrContext,
|
||||
virtual void InitWithGrContext(GrContext* aGrContext,
|
||||
const IntSize &aSize,
|
||||
SurfaceFormat aFormat)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user