Bug 907926 - Make ContentClientBasic support Azure content. r=nrc

This commit is contained in:
Matt Woodrow 2013-08-23 18:13:55 +12:00
Родитель e2c4e8b284
Коммит 0b9458a071
3 изменённых файлов: 26 добавлений и 6 удалений

Просмотреть файл

@ -277,6 +277,7 @@ ThebesLayerBuffer::DrawTo(ThebesLayer* aLayer,
aTarget->Restore();
} else {
RefPtr<DrawTarget> dt = aTarget->GetDrawTarget();
bool clipped = false;
// If the entire buffer is valid, we can just draw the whole thing,
// no need to clip. But we'll still clip if clipping is cheap ---
@ -292,11 +293,24 @@ ThebesLayerBuffer::DrawTo(ThebesLayer* aLayer,
// we might sample pixels outside GetEffectiveVisibleRegion(), which is wrong
// and may cause gray lines.
gfxUtils::ClipToRegionSnapped(dt, aLayer->GetEffectiveVisibleRegion());
clipped = true;
}
DrawBufferWithRotation(aTarget, BUFFER_BLACK, aOpacity, aMask, aMaskTransform);
aTarget->Restore();
}
RefPtr<SourceSurface> mask;
if (aMask) {
mask = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(dt, aMask);
}
Matrix maskTransform;
if (aMaskTransform) {
maskTransform = ToMatrix(*aMaskTransform);
}
DrawBufferWithRotation(dt, BUFFER_BLACK, aOpacity, mask, &maskTransform);
if (clipped) {
dt->PopClip();
}
}
}
static void

Просмотреть файл

@ -83,6 +83,7 @@ ContentClientBasic::CreateBuffer(ContentType aType,
uint32_t aFlags,
gfxASurface**)
{
MOZ_ASSERT(!(aFlags & BUFFER_COMPONENT_ALPHA));
nsRefPtr<gfxASurface> referenceSurface = GetBuffer();
if (!referenceSurface) {
gfxContext* defaultTarget = mManager->GetDefaultTarget();
@ -105,9 +106,13 @@ ContentClientBasic::CreateDTBuffer(ContentType aType,
uint32_t aFlags,
RefPtr<DrawTarget>* aWhiteDT)
{
NS_RUNTIMEABORT("ContentClientBasic does not support Moz2D drawing yet!");
// TODO[Bas] - Implement me!?
return nullptr;
MOZ_ASSERT(!(aFlags & BUFFER_COMPONENT_ALPHA));
gfxASurface::gfxImageFormat format =
gfxPlatform::GetPlatform()->OptimalFormatForContent(aType);
return gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
IntSize(aRect.width, aRect.height),
ImageFormatToSurfaceFormat(format));
}
void

Просмотреть файл

@ -160,6 +160,7 @@ public:
const nsIntRect& aRect,
uint32_t aFlags,
RefPtr<gfx::DrawTarget>* aWhiteDT);
virtual bool SupportsAzureContent() const { return true; }
virtual TextureInfo GetTextureInfo() const MOZ_OVERRIDE
{