Backed out changeset b15136f926ca (bug 1272778) for build bustage

This commit is contained in:
Wes Kocher 2016-05-13 16:05:12 -07:00
Родитель 4ed215c5a2
Коммит 69ee17e2fb
29 изменённых файлов: 135 добавлений и 130 удалений

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

@ -49,7 +49,7 @@ Compositor::ShouldDrawDiagnostics(DiagnosticFlags aFlags)
void
Compositor::DrawDiagnostics(DiagnosticFlags aFlags,
const nsIntRegion& aVisibleRegion,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& aTransform,
uint32_t aFlashCounter)
{
@ -72,7 +72,7 @@ Compositor::DrawDiagnostics(DiagnosticFlags aFlags,
void
Compositor::DrawDiagnostics(DiagnosticFlags aFlags,
const gfx::Rect& aVisibleRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& aTransform,
uint32_t aFlashCounter)
{
@ -87,7 +87,7 @@ Compositor::DrawDiagnostics(DiagnosticFlags aFlags,
void
Compositor::DrawDiagnosticsInternal(DiagnosticFlags aFlags,
const gfx::Rect& aVisibleRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& aTransform,
uint32_t aFlashCounter)
{
@ -145,7 +145,7 @@ Compositor::DrawDiagnosticsInternal(DiagnosticFlags aFlags,
void
Compositor::SlowDrawRect(const gfx::Rect& aRect, const gfx::Color& aColor,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& aTransform, int aStrokeWidth)
{
// TODO This should draw a rect using a single draw call but since
@ -178,7 +178,7 @@ Compositor::SlowDrawRect(const gfx::Rect& aRect, const gfx::Color& aColor,
void
Compositor::FillRect(const gfx::Rect& aRect, const gfx::Color& aColor,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& aTransform)
{
float opacity = 1.0f;
@ -356,7 +356,7 @@ DecomposeIntoNoRepeatRects(const gfx::Rect& aRect,
gfx::IntRect
Compositor::ComputeBackdropCopyRect(const gfx::Rect& aRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& aTransform,
gfx::Matrix4x4* aOutTransform,
gfx::Rect* aOutLayerQuad)
@ -365,7 +365,7 @@ Compositor::ComputeBackdropCopyRect(const gfx::Rect& aRect,
gfx::IntPoint rtOffset = GetCurrentRenderTarget()->GetOrigin();
gfx::IntSize rtSize = GetCurrentRenderTarget()->GetSize();
gfx::IntRect renderBounds(0, 0, rtSize.width, rtSize.height);
gfx::Rect renderBounds(0, 0, rtSize.width, rtSize.height);
renderBounds.IntersectRect(renderBounds, aClipRect);
renderBounds.MoveBy(rtOffset);

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

@ -319,7 +319,7 @@ public:
* aVisibleRect is used to determine which edges should be antialiased,
* without applying the effect to the inner edges of a tiled layer.
*/
virtual void DrawQuad(const gfx::Rect& aRect, const gfx::IntRect& aClipRect,
virtual void DrawQuad(const gfx::Rect& aRect, const gfx::Rect& aClipRect,
const EffectChain& aEffectChain,
gfx::Float aOpacity, const gfx::Matrix4x4& aTransform,
const gfx::Rect& aVisibleRect) = 0;
@ -329,7 +329,7 @@ public:
* Use this when you are drawing a single quad that is not part of a tiled
* layer.
*/
void DrawQuad(const gfx::Rect& aRect, const gfx::IntRect& aClipRect,
void DrawQuad(const gfx::Rect& aRect, const gfx::Rect& aClipRect,
const EffectChain& aEffectChain,
gfx::Float aOpacity, const gfx::Matrix4x4& aTransform) {
DrawQuad(aRect, aClipRect, aEffectChain, aOpacity, aTransform, aRect);
@ -339,7 +339,7 @@ public:
* Draw an unfilled solid color rect. Typically used for debugging overlays.
*/
void SlowDrawRect(const gfx::Rect& aRect, const gfx::Color& color,
const gfx::IntRect& aClipRect = gfx::IntRect(),
const gfx::Rect& aClipRect = gfx::Rect(),
const gfx::Matrix4x4& aTransform = gfx::Matrix4x4(),
int aStrokeWidth = 1);
@ -347,7 +347,7 @@ public:
* Draw a solid color filled rect. This is a simple DrawQuad helper.
*/
void FillRect(const gfx::Rect& aRect, const gfx::Color& color,
const gfx::IntRect& aClipRect = gfx::IntRect(),
const gfx::Rect& aClipRect = gfx::Rect(),
const gfx::Matrix4x4& aTransform = gfx::Matrix4x4());
/*
@ -378,11 +378,11 @@ public:
* opaque content.
*/
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect* aClipRectIn,
const gfx::IntRect& aRenderBounds,
const gfx::Rect* aClipRectIn,
const gfx::Rect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
gfx::IntRect* aClipRectOut = nullptr,
gfx::IntRect* aRenderBoundsOut = nullptr) = 0;
gfx::Rect* aClipRectOut = nullptr,
gfx::Rect* aRenderBoundsOut = nullptr) = 0;
/**
* Flush the current frame to the screen and tidy up.
@ -417,13 +417,13 @@ public:
void DrawDiagnostics(DiagnosticFlags aFlags,
const gfx::Rect& visibleRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& transform,
uint32_t aFlashCounter = DIAGNOSTIC_FLASH_COUNTER_MAX);
void DrawDiagnostics(DiagnosticFlags aFlags,
const nsIntRegion& visibleRegion,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& transform,
uint32_t aFlashCounter = DIAGNOSTIC_FLASH_COUNTER_MAX);
@ -540,7 +540,7 @@ public:
protected:
void DrawDiagnosticsInternal(DiagnosticFlags aFlags,
const gfx::Rect& aVisibleRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& transform,
uint32_t aFlashCounter);
@ -556,7 +556,7 @@ protected:
*/
gfx::IntRect ComputeBackdropCopyRect(
const gfx::Rect& aRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& aTransform,
gfx::Matrix4x4* aOutTransform,
gfx::Rect* aOutLayerQuad = nullptr);

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

@ -277,7 +277,7 @@ SetupMask(const EffectChain& aEffectChain,
void
BasicCompositor::DrawQuad(const gfx::Rect& aRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const EffectChain &aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform,
@ -323,7 +323,7 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
new3DTransform.PreTranslate(aRect.x, aRect.y, 0);
}
buffer->PushClipRect(Rect(aClipRect));
buffer->PushClipRect(aClipRect);
newTransform.PostTranslate(-offset.x, -offset.y);
buffer->SetTransform(newTransform);
@ -475,14 +475,14 @@ BasicCompositor::ClearRect(const gfx::Rect& aRect)
void
BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect *aClipRectIn,
const gfx::IntRect& aRenderBounds,
const gfx::Rect *aClipRectIn,
const gfx::Rect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
gfx::IntRect *aClipRectOut /* = nullptr */,
gfx::IntRect *aRenderBoundsOut /* = nullptr */)
gfx::Rect *aClipRectOut /* = nullptr */,
gfx::Rect *aRenderBoundsOut /* = nullptr */)
{
LayoutDeviceIntRect intRect(LayoutDeviceIntPoint(), mWidget->GetClientSize());
IntRect rect = IntRect(0, 0, intRect.width, intRect.height);
Rect rect = Rect(0, 0, intRect.width, intRect.height);
LayoutDeviceIntRegion invalidRegionSafe;
if (mDidExternalComposition) {
@ -500,7 +500,7 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
mInvalidRect = mInvalidRegion.GetBounds();
if (aRenderBoundsOut) {
*aRenderBoundsOut = IntRect();
*aRenderBoundsOut = Rect();
}
BufferMode bufferMode = BufferMode::BUFFERED;
@ -560,9 +560,9 @@ BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
}
if (aClipRectIn) {
mRenderTarget->mDrawTarget->PushClipRect(Rect(*aClipRectIn));
mRenderTarget->mDrawTarget->PushClipRect(*aClipRectIn);
} else {
mRenderTarget->mDrawTarget->PushClipRect(Rect(rect));
mRenderTarget->mDrawTarget->PushClipRect(rect);
if (aClipRectOut) {
*aClipRectOut = rect;
}

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

@ -91,7 +91,7 @@ public:
}
virtual void DrawQuad(const gfx::Rect& aRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const EffectChain &aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform,
@ -100,11 +100,11 @@ public:
virtual void ClearRect(const gfx::Rect& aRect) override;
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect *aClipRectIn,
const gfx::IntRect& aRenderBounds,
const gfx::Rect *aClipRectIn,
const gfx::Rect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
gfx::IntRect *aClipRectOut = nullptr,
gfx::IntRect *aRenderBoundsOut = nullptr) override;
gfx::Rect *aClipRectOut = nullptr,
gfx::Rect *aRenderBoundsOut = nullptr) override;
virtual void EndFrame() override;
virtual void EndFrameForExternalComposition(const gfx::Matrix& aTransform) override;

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

@ -95,7 +95,7 @@ CanvasLayerComposite::RenderLayer(const IntRect& aClipRect)
#endif
RenderWithAllMasks(this, mCompositor, aClipRect,
[&](EffectChain& effectChain, const IntRect& clipRect) {
[&](EffectChain& effectChain, const Rect& clipRect) {
mCompositableHost->Composite(this, effectChain,
GetEffectiveOpacity(),
GetEffectiveTransform(),

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

@ -26,13 +26,13 @@ ColorLayerComposite::RenderLayer(const IntRect& aClipRect)
const Matrix4x4& transform = GetEffectiveTransform();
RenderWithAllMasks(this, mCompositor, aClipRect,
[&](EffectChain& effectChain, const IntRect& clipRect) {
[&](EffectChain& effectChain, const Rect& clipRect) {
GenEffectChain(effectChain);
mCompositor->DrawQuad(rect, clipRect, effectChain, GetEffectiveOpacity(),
transform);
});
mCompositor->DrawDiagnostics(DiagnosticFlags::COLOR, rect, aClipRect,
mCompositor->DrawDiagnostics(DiagnosticFlags::COLOR, rect, Rect(aClipRect),
transform);
}

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

@ -82,7 +82,7 @@ public:
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion* aVisibleRegion = nullptr) = 0;
/**

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

@ -322,8 +322,8 @@ ContainerRenderVR(ContainerT* aContainer,
}
}
gfx::IntRect rect(surfaceRect.x, surfaceRect.y, surfaceRect.width, surfaceRect.height);
gfx::IntRect clipRect(aClipRect.x, aClipRect.y, aClipRect.width, aClipRect.height);
gfx::Rect rect(surfaceRect.x, surfaceRect.y, surfaceRect.width, surfaceRect.height);
gfx::Rect clipRect(aClipRect.x, aClipRect.y, aClipRect.width, aClipRect.height);
// The VR geometry may not cover the entire area; we need to fill with a solid color
// first.
@ -332,7 +332,7 @@ ContainerRenderVR(ContainerT* aContainer,
// the entire rect)
EffectChain solidEffect(aContainer);
solidEffect.mPrimaryEffect = new EffectSolidColor(Color(0.0, 0.0, 0.0, 1.0));
aManager->GetCompositor()->DrawQuad(Rect(rect), rect, solidEffect, 1.0, gfx::Matrix4x4());
aManager->GetCompositor()->DrawQuad(rect, rect, solidEffect, 1.0, gfx::Matrix4x4());
// draw the temporary surface with VR distortion to the original destination
EffectChain vrEffect(aContainer);
@ -351,7 +351,7 @@ ContainerRenderVR(ContainerT* aContainer,
// XXX we shouldn't use visibleRect here -- the VR distortion needs to know the
// full rect, not just the visible one. Luckily, right now, VR distortion is only
// rendered when the element is fullscreen, so the visibleRect will be right anyway.
aManager->GetCompositor()->DrawQuad(Rect(rect), clipRect, vrEffect, opacity,
aManager->GetCompositor()->DrawQuad(rect, clipRect, vrEffect, opacity,
scaleTransform);
DUMP("<<< ContainerRenderVR [%p]\n", aContainer);
@ -559,7 +559,9 @@ RenderMinimap(ContainerT* aContainer, LayerManagerComposite* aManager,
Rect transformedScrollRect = transform.TransformBounds(scrollRect.ToUnknownRect());
IntRect clipRect = RoundedOut(aContainer->GetEffectiveTransform().TransformBounds(transformedScrollRect));
Rect clipRect = aContainer->GetEffectiveTransform().TransformBounds(transformedScrollRect);
clipRect.width++;
clipRect.height++;
// Render the scrollable area.
compositor->FillRect(transformedScrollRect, backgroundColor, clipRect, aContainer->GetEffectiveTransform());
@ -640,7 +642,7 @@ RenderLayers(ContainerT* aContainer,
EffectChain effectChain(layer);
effectChain.mPrimaryEffect = new EffectSolidColor(color);
aManager->GetCompositor()->DrawQuad(gfx::Rect(layerBounds.x, layerBounds.y, layerBounds.width, layerBounds.height),
clipRect.ToUnknownRect(),
gfx::Rect(clipRect.ToUnknownRect()),
effectChain, layer->GetEffectiveOpacity(),
layer->GetEffectiveTransform());
}
@ -683,7 +685,7 @@ RenderLayers(ContainerT* aContainer,
ParentLayerRect compositionBounds = layer->GetFrameMetrics(i - 1).GetCompositionBounds();
aManager->GetCompositor()->DrawDiagnostics(DiagnosticFlags::CONTAINER,
compositionBounds.ToUnknownRect(),
aClipRect.ToUnknownRect(),
gfx::Rect(aClipRect.ToUnknownRect()),
asyncTransform * aContainer->GetEffectiveTransform());
if (AsyncPanZoomController* apzc = layer->GetAsyncPanZoomController(i - 1)) {
asyncTransform =
@ -815,7 +817,7 @@ ContainerRender(ContainerT* aContainer,
RefPtr<ContainerT> container = aContainer;
RenderWithAllMasks(aContainer, compositor, aClipRect,
[&, surface, compositor, container](EffectChain& effectChain, const IntRect& clipRect) {
[&, surface, compositor, container](EffectChain& effectChain, const Rect& clipRect) {
effectChain.mPrimaryEffect = new EffectRenderTarget(surface);
compositor->DrawQuad(visibleRect, clipRect, effectChain,
container->GetEffectiveOpacity(),

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

@ -37,7 +37,7 @@ ContentHostTexture::Composite(LayerComposite* aLayer,
float aOpacity,
const gfx::Matrix4x4& aTransform,
const Filter& aFilter,
const IntRect& aClipRect,
const Rect& aClipRect,
const nsIntRegion* aVisibleRegion)
{
NS_ASSERTION(aVisibleRegion, "Requires a visible region");

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

@ -122,7 +122,7 @@ public:
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion* aVisibleRegion = nullptr) override;
virtual void SetCompositor(Compositor* aCompositor) override;

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

@ -393,7 +393,7 @@ static void DrawDigits(unsigned int aValue,
texturedEffect->mTextureCoords = Rect(float(digit * FontWidth) / textureWidth, 0, FontWidth / textureWidth, 1.0f);
Rect drawRect = Rect(aOffsetX + n * FontWidth, aOffsetY, FontWidth, FontHeight);
IntRect clipRect = IntRect(0, 0, 300, 100);
Rect clipRect = Rect(0, 0, 300, 100);
aCompositor->DrawQuad(drawRect, clipRect,
aEffectChain, opacity, transform);
}

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

@ -296,7 +296,7 @@ ImageHost::Composite(LayerComposite* aLayer,
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion* aVisibleRegion)
{
if (!GetCompositor()) {
@ -683,7 +683,7 @@ ImageHostOverlay::Composite(Compositor* aCompositor,
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion* aVisibleRegion)
{
MOZ_ASSERT(mCompositor == aCompositor);

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

@ -48,7 +48,7 @@ public:
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion* aVisibleRegion = nullptr) override;
virtual void UseTextureHost(const nsTArray<TimedTexture>& aTextures) override;
@ -182,7 +182,7 @@ public:
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion* aVisibleRegion);
virtual LayerRenderState GetRenderState();
virtual void UseOverlaySource(OverlaySource aOverlay,

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

@ -106,7 +106,7 @@ ImageLayerComposite::RenderLayer(const IntRect& aClipRect)
mCompositor->MakeCurrent();
RenderWithAllMasks(this, mCompositor, aClipRect,
[&](EffectChain& effectChain, const IntRect& clipRect) {
[&](EffectChain& effectChain, const Rect& clipRect) {
mImageHost->SetCompositor(mCompositor);
mImageHost->Composite(this, effectChain,
GetEffectiveOpacity(),

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

@ -570,7 +570,7 @@ LayerManagerComposite::InvalidateDebugOverlay(nsIntRegion& aInvalidRegion, const
static uint16_t sFrameCount = 0;
void
LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
LayerManagerComposite::RenderDebugOverlay(const Rect& aBounds)
{
bool drawFps = gfxPrefs::LayersDrawFPS();
bool drawFrameCounter = gfxPrefs::DrawFrameCounter();
@ -641,11 +641,11 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
}
if (drawFrameColorBars) {
gfx::IntRect sideRect(0, 0, 10, aBounds.height);
gfx::Rect sideRect(0, 0, 10, aBounds.height);
EffectChain effects;
effects.mPrimaryEffect = new EffectSolidColor(gfxUtils::GetColorForFrameNumber(sFrameCount));
mCompositor->DrawQuad(Rect(sideRect),
mCompositor->DrawQuad(sideRect,
sideRect,
effects,
1.0,
@ -662,7 +662,7 @@ LayerManagerComposite::RenderDebugOverlay(const IntRect& aBounds)
int padding = 2;
float opacity = 1.0;
const uint16_t bitWidth = 5;
gfx::IntRect clip(0,0, bitWidth*640, bitWidth*640);
gfx::Rect clip(0,0, bitWidth*640, bitWidth*640);
// Draw the white squares at once
gfx::Color bitColor(1.0, 1.0, 1.0, 1.0);
@ -786,7 +786,8 @@ LayerManagerComposite::PopGroupForLayerEffects(RefPtr<CompositingRenderTarget> a
effectChain.mPrimaryEffect = new EffectRenderTarget(mTwoPassTmpTarget);
effectChain.mSecondaryEffects[EffectTypes::COLOR_MATRIX] = new EffectColorMatrix(effectMatrix);
mCompositor->DrawQuad(Rect(Point(0, 0), Size(mTwoPassTmpTarget->GetSize())), aClipRect, effectChain, 1.,
gfx::Rect clipRectF(aClipRect.x, aClipRect.y, aClipRect.width, aClipRect.height);
mCompositor->DrawQuad(Rect(Point(0, 0), Size(mTwoPassTmpTarget->GetSize())), clipRectF, effectChain, 1.,
Matrix4x4());
}
@ -884,18 +885,18 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
}
ParentLayerIntRect clipRect;
IntRect bounds(mRenderBounds.x, mRenderBounds.y, mRenderBounds.width, mRenderBounds.height);
IntRect actualBounds;
Rect bounds(mRenderBounds.x, mRenderBounds.y, mRenderBounds.width, mRenderBounds.height);
Rect actualBounds;
CompositorBench(mCompositor, bounds);
MOZ_ASSERT(mRoot->GetOpacity() == 1);
if (mRoot->GetClipRect()) {
clipRect = *mRoot->GetClipRect();
IntRect rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
Rect rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
mCompositor->BeginFrame(aInvalidRegion, &rect, bounds, aOpaqueRegion, nullptr, &actualBounds);
} else {
gfx::IntRect rect;
gfx::Rect rect;
mCompositor->BeginFrame(aInvalidRegion, nullptr, bounds, aOpaqueRegion, &rect, &actualBounds);
clipRect = ParentLayerIntRect(rect.x, rect.y, rect.width, rect.height);
}
@ -907,7 +908,7 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
// Allow widget to render a custom background.
mCompositor->GetWidget()->DrawWindowUnderlay(
this, LayoutDeviceIntRect::FromUnknownRect(actualBounds));
this, LayoutDeviceIntRect::FromUnknownRect(TruncatedToInt(actualBounds)));
RefPtr<CompositingRenderTarget> previousTarget;
if (haveLayerEffects) {
@ -935,7 +936,7 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion, const nsIntRegi
// Allow widget to render a custom foreground.
mCompositor->GetWidget()->DrawWindowOverlay(
this, LayoutDeviceIntRect::FromUnknownRect(actualBounds));
this, LayoutDeviceIntRect::FromUnknownRect(TruncatedToInt(actualBounds)));
// Debugging
RenderDebugOverlay(actualBounds);
@ -1148,8 +1149,8 @@ LayerManagerComposite::RenderToPresentationSurface()
PostProcessLayers(mRoot, opaque, visible, Nothing());
nsIntRegion invalid;
IntRect bounds(0, 0, scale * pageWidth, actualHeight);
IntRect rect, actualBounds;
Rect bounds(0.0f, 0.0f, scale * pageWidth, (float)actualHeight);
Rect rect, actualBounds;
MOZ_ASSERT(mRoot->GetOpacity() == 1);
mCompositor->BeginFrame(invalid, nullptr, bounds, nsIntRegion(), &rect, &actualBounds);

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

@ -381,7 +381,7 @@ private:
/**
* Render debug overlays such as the FPS/FrameCounter above the frame.
*/
void RenderDebugOverlay(const gfx::IntRect& aBounds);
void RenderDebugOverlay(const gfx::Rect& aBounds);
RefPtr<CompositingRenderTarget> PushGroupForLayerEffects();
@ -621,7 +621,7 @@ RenderWithAllMasks(Layer* aLayer, Compositor* aCompositor,
LayerManagerComposite::AutoAddMaskEffect
autoMaskEffect(firstMask, effectChain);
aLayer->AsLayerComposite()->AddBlendModeEffect(effectChain);
aRenderCallback(effectChain, aClipRect);
aRenderCallback(effectChain, gfx::Rect(aClipRect));
return;
}
@ -659,13 +659,13 @@ RenderWithAllMasks(Layer* aLayer, Compositor* aCompositor,
EffectChain firstEffectChain(aLayer);
LayerManagerComposite::AutoAddMaskEffect
firstMaskEffect(firstMask, firstEffectChain);
aRenderCallback(firstEffectChain, aClipRect - surfaceRect.TopLeft());
aRenderCallback(firstEffectChain, gfx::Rect(aClipRect - surfaceRect.TopLeft()));
// firstTarget now contains the transformed source with the first mask and
// opacity already applied.
}
// Apply the intermediate masks.
gfx::IntRect intermediateClip(surfaceRect - surfaceRect.TopLeft());
gfx::Rect intermediateClip(surfaceRect - surfaceRect.TopLeft());
RefPtr<CompositingRenderTarget> previousTarget = firstTarget;
for (size_t i = nextAncestorMaskLayer; i < ancestorMaskLayerCount - 1; i++) {
Layer* intermediateMask = aLayer->GetAncestorMaskLayerAt(i);
@ -699,7 +699,7 @@ RenderWithAllMasks(Layer* aLayer, Compositor* aCompositor,
aLayer->AsLayerComposite()->AddBlendModeEffect(finalEffectChain);
LayerManagerComposite::AutoAddMaskEffect autoMaskEffect(finalMask, finalEffectChain);
if (!autoMaskEffect.Failed()) {
aCompositor->DrawQuad(gfx::Rect(surfaceRect), aClipRect,
aCompositor->DrawQuad(gfx::Rect(surfaceRect), gfx::Rect(aClipRect),
finalEffectChain, 1.0, gfx::Matrix4x4());
}
}

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

@ -125,7 +125,7 @@ PaintedLayerComposite::RenderLayer(const gfx::IntRect& aClipRect)
RenderWithAllMasks(this, compositor, aClipRect,
[&](EffectChain& effectChain, const gfx::IntRect& clipRect) {
[&](EffectChain& effectChain, const gfx::Rect& clipRect) {
mBuffer->SetPaintWillResample(MayResample());
mBuffer->Composite(this, effectChain,

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

@ -138,7 +138,7 @@ TextRenderer::RenderText(const string& aText, const IntPoint& aOrigin,
Matrix4x4 transform = aTransform;
transform.PreScale(scaleFactor, scaleFactor, 1.0f);
mCompositor->DrawQuad(Rect(aOrigin.x, aOrigin.y, maxWidth, numLines * 16),
IntRect(-10000, -10000, 20000, 20000), chain, 1.0f, transform);
Rect(-10000, -10000, 20000, 20000), chain, 1.0f, transform);
}
void

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

@ -464,7 +464,7 @@ TiledContentHost::Composite(LayerComposite* aLayer,
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion* aVisibleRegion /* = nullptr */)
{
MOZ_ASSERT(mCompositor);
@ -524,7 +524,7 @@ TiledContentHost::RenderTile(TileHost& aTile,
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion& aScreenRegion,
const IntPoint& aTextureOffset,
const IntSize& aTextureBounds,
@ -587,7 +587,7 @@ TiledContentHost::RenderLayerBuffer(TiledLayerBufferComposite& aLayerBuffer,
EffectChain& aEffectChain,
float aOpacity,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
nsIntRegion aVisibleRegion,
gfx::Matrix4x4 aTransform)
{

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

@ -253,7 +253,7 @@ public:
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion* aVisibleRegion = nullptr) override;
virtual CompositableType GetType() override { return CompositableType::CONTENT_TILED; }
@ -282,7 +282,7 @@ private:
EffectChain& aEffectChain,
float aOpacity,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
nsIntRegion aMaskRegion,
gfx::Matrix4x4 aTransform);
@ -292,7 +292,7 @@ private:
float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Filter& aFilter,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const nsIntRegion& aScreenRegion,
const gfx::IntPoint& aTextureOffset,
const gfx::IntSize& aTextureBounds,

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

@ -696,7 +696,7 @@ CompositorD3D11::ClearRect(const gfx::Rect& aRect)
void
CompositorD3D11::DrawVRDistortion(const gfx::Rect& aRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const EffectChain& aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform)
@ -872,7 +872,7 @@ EffectToBlendLayerType(Effect* aEffect)
void
CompositorD3D11::DrawQuad(const gfx::Rect& aRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const EffectChain& aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform,
@ -1116,18 +1116,18 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect,
void
CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
const IntRect* aClipRectIn,
const IntRect& aRenderBounds,
const Rect* aClipRectIn,
const Rect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
IntRect* aClipRectOut,
IntRect* aRenderBoundsOut)
Rect* aClipRectOut,
Rect* aRenderBoundsOut)
{
// Don't composite if we are minimised. Other than for the sake of efficency,
// this is important because resizing our buffers when mimised will fail and
// cause a crash when we're restored.
NS_ASSERTION(mHwnd, "Couldn't find an HWND when initialising?");
if (::IsIconic(mHwnd) || mDevice->GetDeviceRemovedReason() != S_OK) {
*aRenderBoundsOut = IntRect();
*aRenderBoundsOut = Rect();
return;
}
@ -1136,7 +1136,7 @@ CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
// Failed to create a render target or the view.
if (!UpdateRenderTarget() || !mDefaultRT || !mDefaultRT->mRTView ||
mSize.width <= 0 || mSize.height <= 0) {
*aRenderBoundsOut = IntRect();
*aRenderBoundsOut = Rect();
return;
}
@ -1173,10 +1173,10 @@ CompositorD3D11::BeginFrame(const nsIntRegion& aInvalidRegion,
mInvalidRegion = invalidRegionSafe;
if (aClipRectOut) {
*aClipRectOut = IntRect(0, 0, mSize.width, mSize.height);
*aClipRectOut = Rect(0, 0, mSize.width, mSize.height);
}
if (aRenderBoundsOut) {
*aRenderBoundsOut = IntRect(0, 0, mSize.width, mSize.height);
*aRenderBoundsOut = Rect(0, 0, mSize.width, mSize.height);
}
mCurrentClip = IntRect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);

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

@ -93,7 +93,7 @@ public:
virtual void ClearRect(const gfx::Rect& aRect) override;
virtual void DrawQuad(const gfx::Rect &aRect,
const gfx::IntRect &aClipRect,
const gfx::Rect &aClipRect,
const EffectChain &aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform,
@ -101,7 +101,7 @@ public:
/* Helper for when the primary effect is VR_DISTORTION */
void DrawVRDistortion(const gfx::Rect &aRect,
const gfx::IntRect &aClipRect,
const gfx::Rect &aClipRect,
const EffectChain &aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4 &aTransform);
@ -111,11 +111,11 @@ public:
* screen dimensions.
*/
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect *aClipRectIn,
const gfx::IntRect& aRenderBounds,
const gfx::Rect *aClipRectIn,
const gfx::Rect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
gfx::IntRect *aClipRectOut = nullptr,
gfx::IntRect *aRenderBoundsOut = nullptr) override;
gfx::Rect *aClipRectOut = nullptr,
gfx::Rect *aRenderBoundsOut = nullptr) override;
/**
* Flush the current frame to the screen.

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

@ -242,7 +242,7 @@ CompositorD3D9::ClearRect(const gfx::Rect& aRect)
void
CompositorD3D9::DrawQuad(const gfx::Rect &aRect,
const gfx::IntRect &aClipRect,
const gfx::Rect &aClipRect,
const EffectChain &aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform,
@ -671,11 +671,11 @@ CompositorD3D9::FailedToResetDevice() {
void
CompositorD3D9::BeginFrame(const nsIntRegion& aInvalidRegion,
const IntRect *aClipRectIn,
const IntRect& aRenderBounds,
const Rect *aClipRectIn,
const Rect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
IntRect *aClipRectOut,
IntRect *aRenderBoundsOut)
Rect *aClipRectOut,
Rect *aRenderBoundsOut)
{
MOZ_ASSERT(mDeviceManager && mSwapChain);
@ -687,10 +687,10 @@ CompositorD3D9::BeginFrame(const nsIntRegion& aInvalidRegion,
device()->BeginScene();
if (aClipRectOut) {
*aClipRectOut = IntRect(0, 0, mSize.width, mSize.height);
*aClipRectOut = Rect(0, 0, mSize.width, mSize.height);
}
if (aRenderBoundsOut) {
*aRenderBoundsOut = IntRect(0, 0, mSize.width, mSize.height);
*aRenderBoundsOut = Rect(0, 0, mSize.width, mSize.height);
}
RECT r;

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

@ -57,18 +57,18 @@ public:
virtual void ClearRect(const gfx::Rect& aRect) override;
virtual void DrawQuad(const gfx::Rect &aRect,
const gfx::IntRect &aClipRect,
const gfx::Rect &aClipRect,
const EffectChain &aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform,
const gfx::Rect& aVisibleRect) override;
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect *aClipRectIn,
const gfx::IntRect& aRenderBounds,
const gfx::Rect *aClipRectIn,
const gfx::Rect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
gfx::IntRect *aClipRectOut = nullptr,
gfx::IntRect *aRenderBoundsOut = nullptr) override;
gfx::Rect *aClipRectOut = nullptr,
gfx::Rect *aRenderBoundsOut = nullptr) override;
virtual void EndFrame() override;

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

@ -418,7 +418,7 @@ static void RunCompositorBench(Compositor* aCompositor, const gfx::Rect& aScreen
}
}
void CompositorBench(Compositor* aCompositor, const gfx::IntRect& aScreenRect)
void CompositorBench(Compositor* aCompositor, const gfx::Rect& aScreenRect)
{
static bool sRanBenchmark = false;
bool wantBenchmark = gfxPrefs::LayersBenchEnabled();

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

@ -18,9 +18,9 @@ class Compositor;
// #define MOZ_COMPOSITOR_BENCH
#ifdef MOZ_COMPOSITOR_BENCH
void CompositorBench(Compositor* aCompositor, const gfx::IntRect& aScreenRect);
void CompositorBench(Compositor* aCompositor, const gfx::Rect& aScreenRect);
#else
static inline void CompositorBench(Compositor* aCompositor, const gfx::IntRect& aScreenRect) {}
static inline void CompositorBench(Compositor* aCompositor, const gfx::Rect& aScreenRect) {}
#endif
} // namespace layers

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

@ -627,22 +627,22 @@ CompositorOGL::ClearRect(const gfx::Rect& aRect)
void
CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion,
const IntRect *aClipRectIn,
const IntRect& aRenderBounds,
const Rect *aClipRectIn,
const Rect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
IntRect *aClipRectOut,
IntRect *aRenderBoundsOut)
Rect *aClipRectOut,
Rect *aRenderBoundsOut)
{
PROFILER_LABEL("CompositorOGL", "BeginFrame",
js::ProfileEntry::Category::GRAPHICS);
MOZ_ASSERT(!mFrameInProgress, "frame still in progress (should have called EndFrame");
gfx::IntRect rect;
gfx::Rect rect;
if (mUseExternalSurfaceSize) {
rect = gfx::IntRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
rect = gfx::Rect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
} else {
rect = gfx::IntRect(aRenderBounds.x, aRenderBounds.y, aRenderBounds.width, aRenderBounds.height);
rect = gfx::Rect(aRenderBounds.x, aRenderBounds.y, aRenderBounds.width, aRenderBounds.height);
}
if (aRenderBoundsOut) {
@ -988,7 +988,7 @@ CompositorOGL::GetLineCoefficients(const gfx::Point& aPoint1,
void
CompositorOGL::DrawQuad(const Rect& aRect,
const IntRect& aClipRect,
const Rect& aClipRect,
const EffectChain &aEffectChain,
Float aOpacity,
const gfx::Matrix4x4& aTransform,
@ -1009,7 +1009,7 @@ CompositorOGL::DrawQuad(const Rect& aRect,
IntSize size = mCurrentRenderTarget->GetSize();
Rect renderBound(0, 0, size.width, size.height);
renderBound.IntersectRect(renderBound, Rect(aClipRect));
renderBound.IntersectRect(renderBound, aClipRect);
renderBound.MoveBy(offset);
Rect destRect = aTransform.TransformAndClipBounds(aRect, renderBound);
@ -1029,7 +1029,7 @@ CompositorOGL::DrawQuad(const Rect& aRect,
LayerScope::DrawBegin();
IntRect clipRect = aClipRect;
Rect clipRect = aClipRect;
// aClipRect is in destination coordinate space (after all
// transforms and offsets have been applied) so if our
// drawing is going to be shifted by mRenderOffset then we need
@ -1037,9 +1037,11 @@ CompositorOGL::DrawQuad(const Rect& aRect,
if (!mTarget && mCurrentRenderTarget->IsWindow()) {
clipRect.MoveBy(mRenderOffset.x, mRenderOffset.y);
}
IntRect intClipRect;
clipRect.ToIntRect(&intClipRect);
gl()->fScissor(clipRect.x, FlipY(clipRect.y + clipRect.height),
clipRect.width, clipRect.height);
gl()->fScissor(intClipRect.x, FlipY(intClipRect.y + intClipRect.height),
intClipRect.width, intClipRect.height);
MaskType maskType;
EffectMask* effectMask;

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

@ -234,7 +234,7 @@ public:
virtual CompositingRenderTarget* GetCurrentRenderTarget() const override;
virtual void DrawQuad(const gfx::Rect& aRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const EffectChain &aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform,
@ -342,7 +342,7 @@ private:
void DestroyVR(GLContext *gl);
void DrawVRDistortion(const gfx::Rect& aRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const EffectChain& aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform);
@ -400,11 +400,11 @@ private:
* sets *aClipRectOut to the screen dimensions.
*/
virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
const gfx::IntRect *aClipRectIn,
const gfx::IntRect& aRenderBounds,
const gfx::Rect *aClipRectIn,
const gfx::Rect& aRenderBounds,
const nsIntRegion& aOpaqueRegion,
gfx::IntRect *aClipRectOut = nullptr,
gfx::IntRect *aRenderBoundsOut = nullptr) override;
gfx::Rect *aClipRectOut = nullptr,
gfx::Rect *aRenderBoundsOut = nullptr) override;
ShaderConfigOGL GetShaderConfigFor(Effect *aEffect,
MaskType aMask = MaskType::MaskNone,

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

@ -204,7 +204,7 @@ CompositorOGL::DestroyVR(GLContext *gl)
void
CompositorOGL::DrawVRDistortion(const gfx::Rect& aRect,
const gfx::IntRect& aClipRect,
const gfx::Rect& aClipRect,
const EffectChain& aEffectChain,
gfx::Float aOpacity,
const gfx::Matrix4x4& aTransform)