mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 907926 - Make ContentClientBasic support Azure content. r=nrc
This commit is contained in:
parent
e2c4e8b284
commit
0b9458a071
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user