mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Bug 1158122 - Remove most occurences of nsIntRect in gfx/tests. r=nical
This commit is contained in:
parent
f8d4cbad76
commit
0e5d0b5e17
@ -905,8 +905,8 @@ TEST_F(APZCBasicTester, ComplexTransform) {
|
||||
const char* layerTreeSyntax = "c(c)";
|
||||
// LayerID 0 1
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, 300, 300)),
|
||||
nsIntRegion(nsIntRect(0, 0, 150, 300)),
|
||||
nsIntRegion(IntRect(0, 0, 300, 300)),
|
||||
nsIntRegion(IntRect(0, 0, 150, 300)),
|
||||
};
|
||||
Matrix4x4 transforms[] = {
|
||||
Matrix4x4(),
|
||||
@ -1865,7 +1865,7 @@ protected:
|
||||
CSSRect aScrollableRect = CSSRect(-1, -1, -1, -1)) {
|
||||
FrameMetrics metrics;
|
||||
metrics.SetScrollId(aScrollId);
|
||||
nsIntRect layerBound = aLayer->GetVisibleRegion().GetBounds();
|
||||
IntRect layerBound = aLayer->GetVisibleRegion().GetBounds();
|
||||
metrics.mCompositionBounds = ParentLayerRect(layerBound.x, layerBound.y,
|
||||
layerBound.width, layerBound.height);
|
||||
metrics.SetScrollableRect(aScrollableRect);
|
||||
@ -1877,8 +1877,8 @@ protected:
|
||||
// case of a scrollable frame with the event regions and clip. This lets
|
||||
// us exercise the hit-testing code in APZCTreeManager
|
||||
EventRegions er = aLayer->GetEventRegions();
|
||||
nsIntRect scrollRect = LayerIntRect::ToUntyped(RoundedToInt(aScrollableRect * metrics.LayersPixelsPerCSSPixel()));
|
||||
er.mHitRegion = nsIntRegion(nsIntRect(layerBound.TopLeft(), scrollRect.Size()));
|
||||
IntRect scrollRect = LayerIntRect::ToUntyped(RoundedToInt(aScrollableRect * metrics.LayersPixelsPerCSSPixel()));
|
||||
er.mHitRegion = nsIntRegion(IntRect(layerBound.TopLeft(), scrollRect.Size()));
|
||||
aLayer->SetEventRegions(er);
|
||||
}
|
||||
}
|
||||
@ -1897,7 +1897,7 @@ protected:
|
||||
void CreateSimpleScrollingLayer() {
|
||||
const char* layerTreeSyntax = "t";
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0,0,200,200)),
|
||||
nsIntRegion(IntRect(0,0,200,200)),
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(root, FrameMetrics::START_SCROLL_ID, CSSRect(0, 0, 500, 500));
|
||||
@ -1907,9 +1907,9 @@ protected:
|
||||
const char* layerTreeSyntax = "c(tt)";
|
||||
// LayerID 0 12
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0,0,100,100)),
|
||||
nsIntRegion(nsIntRect(0,0,100,50)),
|
||||
nsIntRegion(nsIntRect(0,50,100,50)),
|
||||
nsIntRegion(IntRect(0,0,100,100)),
|
||||
nsIntRegion(IntRect(0,0,100,50)),
|
||||
nsIntRegion(IntRect(0,50,100,50)),
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
}
|
||||
@ -1945,11 +1945,11 @@ protected:
|
||||
const char* layerTreeSyntax = "c(tttt)";
|
||||
// LayerID 0 1234
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0,0,100,100)),
|
||||
nsIntRegion(nsIntRect(0,0,100,100)),
|
||||
nsIntRegion(nsIntRect(10,10,20,20)),
|
||||
nsIntRegion(nsIntRect(10,10,20,20)),
|
||||
nsIntRegion(nsIntRect(5,5,20,20)),
|
||||
nsIntRegion(IntRect(0,0,100,100)),
|
||||
nsIntRegion(IntRect(0,0,100,100)),
|
||||
nsIntRegion(IntRect(10,10,20,20)),
|
||||
nsIntRegion(IntRect(10,10,20,20)),
|
||||
nsIntRegion(IntRect(5,5,20,20)),
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
}
|
||||
@ -1958,10 +1958,10 @@ protected:
|
||||
const char* layerTreeSyntax = "c(tc(t))";
|
||||
// LayerID 0 12 3
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0,0,100,100)),
|
||||
nsIntRegion(nsIntRect(10,10,40,40)),
|
||||
nsIntRegion(nsIntRect(10,60,40,40)),
|
||||
nsIntRegion(nsIntRect(10,60,40,40)),
|
||||
nsIntRegion(IntRect(0,0,100,100)),
|
||||
nsIntRegion(IntRect(10,10,40,40)),
|
||||
nsIntRegion(IntRect(10,60,40,40)),
|
||||
nsIntRegion(IntRect(10,60,40,40)),
|
||||
};
|
||||
Matrix4x4 transforms[] = {
|
||||
Matrix4x4(),
|
||||
@ -1980,16 +1980,16 @@ protected:
|
||||
const char* layerTreeSyntax = "c(tc(t)tc(c(t)tt))";
|
||||
// LayerID 0 12 3 45 6 7 89
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0,0,300,400)), // root(0)
|
||||
nsIntRegion(nsIntRect(0,0,100,100)), // thebes(1) in top-left
|
||||
nsIntRegion(nsIntRect(50,50,200,300)), // container(2) centered in root(0)
|
||||
nsIntRegion(nsIntRect(50,50,200,300)), // thebes(3) fully occupying parent container(2)
|
||||
nsIntRegion(nsIntRect(0,200,100,100)), // thebes(4) in bottom-left
|
||||
nsIntRegion(nsIntRect(200,0,100,400)), // container(5) along the right 100px of root(0)
|
||||
nsIntRegion(nsIntRect(200,0,100,200)), // container(6) taking up the top half of parent container(5)
|
||||
nsIntRegion(nsIntRect(200,0,100,200)), // thebes(7) fully occupying parent container(6)
|
||||
nsIntRegion(nsIntRect(200,200,100,100)), // thebes(8) in bottom-right (below (6))
|
||||
nsIntRegion(nsIntRect(200,300,100,100)), // thebes(9) in bottom-right (below (8))
|
||||
nsIntRegion(IntRect(0,0,300,400)), // root(0)
|
||||
nsIntRegion(IntRect(0,0,100,100)), // thebes(1) in top-left
|
||||
nsIntRegion(IntRect(50,50,200,300)), // container(2) centered in root(0)
|
||||
nsIntRegion(IntRect(50,50,200,300)), // thebes(3) fully occupying parent container(2)
|
||||
nsIntRegion(IntRect(0,200,100,100)), // thebes(4) in bottom-left
|
||||
nsIntRegion(IntRect(200,0,100,400)), // container(5) along the right 100px of root(0)
|
||||
nsIntRegion(IntRect(200,0,100,200)), // container(6) taking up the top half of parent container(5)
|
||||
nsIntRegion(IntRect(200,0,100,200)), // thebes(7) fully occupying parent container(6)
|
||||
nsIntRegion(IntRect(200,200,100,100)), // thebes(8) in bottom-right (below (6))
|
||||
nsIntRegion(IntRect(200,300,100,100)), // thebes(9) in bottom-right (below (8))
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(layers[1], FrameMetrics::START_SCROLL_ID);
|
||||
@ -2005,8 +2005,8 @@ protected:
|
||||
const char* layerTreeSyntax = "c(t)";
|
||||
// LayerID 0 1
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0,0,200,200)),
|
||||
nsIntRegion(nsIntRect(0,0,200,200)),
|
||||
nsIntRegion(IntRect(0,0,200,200)),
|
||||
nsIntRegion(IntRect(0,0,200,200)),
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(layers[1], FrameMetrics::START_SCROLL_ID);
|
||||
@ -2423,7 +2423,7 @@ TEST_F(APZHitTestingTester, Bug1148350) {
|
||||
}
|
||||
time += 100;
|
||||
|
||||
layers[0]->SetVisibleRegion(nsIntRegion(nsIntRect(0,50,200,150)));
|
||||
layers[0]->SetVisibleRegion(nsIntRegion(IntRect(0,50,200,150)));
|
||||
layers[0]->SetBaseTransform(Matrix4x4::Translation(0, 50, 0));
|
||||
manager->UpdateHitTestingTree(nullptr, root, false, 0, 0);
|
||||
|
||||
@ -2440,8 +2440,8 @@ protected:
|
||||
void CreateOverscrollHandoffLayerTree1() {
|
||||
const char* layerTreeSyntax = "c(t)";
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(nsIntRect(0, 50, 100, 50))
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 50, 100, 50))
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(root, FrameMetrics::START_SCROLL_ID, CSSRect(0, 0, 200, 200));
|
||||
@ -2455,9 +2455,9 @@ protected:
|
||||
void CreateOverscrollHandoffLayerTree2() {
|
||||
const char* layerTreeSyntax = "c(c(t))";
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(nsIntRect(0, 50, 100, 50))
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 50, 100, 50))
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(root, FrameMetrics::START_SCROLL_ID, CSSRect(0, 0, 200, 200));
|
||||
@ -2475,11 +2475,11 @@ protected:
|
||||
void CreateOverscrollHandoffLayerTree3() {
|
||||
const char* layerTreeSyntax = "c(c(t)c(t))";
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)), // root
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 50)), // scrolling parent 1
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 50)), // scrolling child 1
|
||||
nsIntRegion(nsIntRect(0, 50, 100, 50)), // scrolling parent 2
|
||||
nsIntRegion(nsIntRect(0, 50, 100, 50)) // scrolling child 2
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)), // root
|
||||
nsIntRegion(IntRect(0, 0, 100, 50)), // scrolling parent 1
|
||||
nsIntRegion(IntRect(0, 0, 100, 50)), // scrolling child 1
|
||||
nsIntRegion(IntRect(0, 50, 100, 50)), // scrolling parent 2
|
||||
nsIntRegion(IntRect(0, 50, 100, 50)) // scrolling child 2
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(layers[1], FrameMetrics::START_SCROLL_ID, CSSRect(0, 0, 100, 100));
|
||||
@ -2495,8 +2495,8 @@ protected:
|
||||
void CreateScrollgrabLayerTree() {
|
||||
const char* layerTreeSyntax = "c(t)";
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)), // scroll-grabbing parent
|
||||
nsIntRegion(nsIntRect(0, 20, 100, 80)) // child
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)), // scroll-grabbing parent
|
||||
nsIntRegion(IntRect(0, 20, 100, 80)) // child
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(root, FrameMetrics::START_SCROLL_ID, CSSRect(0, 0, 100, 120));
|
||||
@ -2698,9 +2698,9 @@ protected:
|
||||
void CreateEventRegionsLayerTree1() {
|
||||
const char* layerTreeSyntax = "c(tt)";
|
||||
nsIntRegion layerVisibleRegions[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, 200, 200)), // root
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 200)), // left half
|
||||
nsIntRegion(nsIntRect(0, 100, 200, 100)), // bottom half
|
||||
nsIntRegion(IntRect(0, 0, 200, 200)), // root
|
||||
nsIntRegion(IntRect(0, 0, 100, 200)), // left half
|
||||
nsIntRegion(IntRect(0, 100, 200, 100)), // bottom half
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegions, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(root, FrameMetrics::START_SCROLL_ID);
|
||||
@ -2715,12 +2715,12 @@ protected:
|
||||
// in the d-t-c region for both layers[1] and layers[2] (but layers[2] is
|
||||
// on top so it gets the events by default if the main thread doesn't
|
||||
// respond).
|
||||
EventRegions regions(nsIntRegion(nsIntRect(0, 0, 200, 200)));
|
||||
EventRegions regions(nsIntRegion(IntRect(0, 0, 200, 200)));
|
||||
root->SetEventRegions(regions);
|
||||
regions.mDispatchToContentHitRegion = nsIntRegion(nsIntRect(0, 100, 100, 100));
|
||||
regions.mHitRegion = nsIntRegion(nsIntRect(0, 0, 100, 200));
|
||||
regions.mDispatchToContentHitRegion = nsIntRegion(IntRect(0, 100, 100, 100));
|
||||
regions.mHitRegion = nsIntRegion(IntRect(0, 0, 100, 200));
|
||||
layers[1]->SetEventRegions(regions);
|
||||
regions.mHitRegion = nsIntRegion(nsIntRect(0, 100, 200, 100));
|
||||
regions.mHitRegion = nsIntRegion(IntRect(0, 100, 200, 100));
|
||||
layers[2]->SetEventRegions(regions);
|
||||
|
||||
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
|
||||
@ -2731,17 +2731,17 @@ protected:
|
||||
void CreateEventRegionsLayerTree2() {
|
||||
const char* layerTreeSyntax = "c(t)";
|
||||
nsIntRegion layerVisibleRegions[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 500)),
|
||||
nsIntRegion(nsIntRect(0, 150, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 0, 100, 500)),
|
||||
nsIntRegion(IntRect(0, 150, 100, 100)),
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegions, nullptr, lm, layers);
|
||||
SetScrollableFrameMetrics(root, FrameMetrics::START_SCROLL_ID);
|
||||
|
||||
// Set up the event regions so that the child thebes layer is positioned far
|
||||
// away from the scrolling container layer.
|
||||
EventRegions regions(nsIntRegion(nsIntRect(0, 0, 100, 100)));
|
||||
EventRegions regions(nsIntRegion(IntRect(0, 0, 100, 100)));
|
||||
root->SetEventRegions(regions);
|
||||
regions.mHitRegion = nsIntRegion(nsIntRect(0, 150, 100, 100));
|
||||
regions.mHitRegion = nsIntRegion(IntRect(0, 150, 100, 100));
|
||||
layers[1]->SetEventRegions(regions);
|
||||
|
||||
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
|
||||
@ -2758,10 +2758,10 @@ protected:
|
||||
// 3 is the Obscurer, who ruins everything.
|
||||
nsIntRegion layerVisibleRegions[] = {
|
||||
// x coordinates are uninteresting
|
||||
nsIntRegion(nsIntRect(0, 0, 200, 200)), // [0, 200]
|
||||
nsIntRegion(nsIntRect(0, 0, 200, 200)), // [0, 200]
|
||||
nsIntRegion(nsIntRect(0, 100, 200, 50)), // [100, 150]
|
||||
nsIntRegion(nsIntRect(0, 100, 200, 100)) // [100, 200]
|
||||
nsIntRegion(IntRect(0, 0, 200, 200)), // [0, 200]
|
||||
nsIntRegion(IntRect(0, 0, 200, 200)), // [0, 200]
|
||||
nsIntRegion(IntRect(0, 100, 200, 50)), // [100, 150]
|
||||
nsIntRegion(IntRect(0, 100, 200, 100)) // [100, 200]
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegions, nullptr, lm, layers);
|
||||
|
||||
@ -2771,11 +2771,11 @@ protected:
|
||||
SetScrollHandoff(layers[2], layers[1]);
|
||||
SetScrollHandoff(layers[1], root);
|
||||
|
||||
EventRegions regions(nsIntRegion(nsIntRect(0, 0, 200, 200)));
|
||||
EventRegions regions(nsIntRegion(IntRect(0, 0, 200, 200)));
|
||||
root->SetEventRegions(regions);
|
||||
regions.mHitRegion = nsIntRegion(nsIntRect(0, 0, 200, 300));
|
||||
regions.mHitRegion = nsIntRegion(IntRect(0, 0, 200, 300));
|
||||
layers[1]->SetEventRegions(regions);
|
||||
regions.mHitRegion = nsIntRegion(nsIntRect(0, 100, 200, 100));
|
||||
regions.mHitRegion = nsIntRegion(IntRect(0, 100, 200, 100));
|
||||
layers[2]->SetEventRegions(regions);
|
||||
|
||||
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
|
||||
@ -2790,9 +2790,9 @@ protected:
|
||||
// 1 is behind 2 and does have an APZC
|
||||
// 2 entirely covers 1 and should take all the input events
|
||||
nsIntRegion layerVisibleRegions[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
};
|
||||
root = CreateLayerTree(layerTreeSyntax, layerVisibleRegions, nullptr, lm, layers);
|
||||
|
||||
@ -2812,10 +2812,10 @@ protected:
|
||||
// 2 is a small layer that is the actual target
|
||||
// 3 is a big layer obscuring 2 with a dispatch-to-content region
|
||||
nsIntRegion layerVisibleRegions[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(nsIntRect(0, 0, 0, 0)),
|
||||
nsIntRegion(nsIntRect(0, 0, 10, 10)),
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 0, 0, 0)),
|
||||
nsIntRegion(IntRect(0, 0, 10, 10)),
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
};
|
||||
Matrix4x4 layerTransforms[] = {
|
||||
Matrix4x4(),
|
||||
@ -2828,10 +2828,10 @@ protected:
|
||||
SetScrollableFrameMetrics(layers[2], FrameMetrics::START_SCROLL_ID + 1, CSSRect(0, 0, 10, 10));
|
||||
SetScrollableFrameMetrics(layers[3], FrameMetrics::START_SCROLL_ID + 2, CSSRect(0, 0, 100, 100));
|
||||
|
||||
EventRegions regions(nsIntRegion(nsIntRect(0, 0, 10, 10)));
|
||||
EventRegions regions(nsIntRegion(IntRect(0, 0, 10, 10)));
|
||||
layers[2]->SetEventRegions(regions);
|
||||
regions.mHitRegion = nsIntRegion(nsIntRect(0, 0, 100, 100));
|
||||
regions.mDispatchToContentHitRegion = nsIntRegion(nsIntRect(0, 0, 100, 100));
|
||||
regions.mHitRegion = nsIntRegion(IntRect(0, 0, 100, 100));
|
||||
regions.mDispatchToContentHitRegion = nsIntRegion(IntRect(0, 0, 100, 100));
|
||||
layers[3]->SetEventRegions(regions);
|
||||
|
||||
registration = MakeUnique<ScopedLayerTreeRegistration>(0, root, mcc);
|
||||
|
@ -33,11 +33,11 @@ public:
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
NS_IMETHOD GetClientBounds(nsIntRect &aRect) override {
|
||||
aRect = nsIntRect(0, 0, gCompWidth, gCompHeight);
|
||||
NS_IMETHOD GetClientBounds(IntRect &aRect) override {
|
||||
aRect = IntRect(0, 0, gCompWidth, gCompHeight);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHOD GetBounds(nsIntRect &aRect) override { return GetClientBounds(aRect); }
|
||||
NS_IMETHOD GetBounds(IntRect &aRect) override { return GetClientBounds(aRect); }
|
||||
|
||||
void* GetNativeData(uint32_t aDataType) override {
|
||||
if (aDataType == NS_NATIVE_OPENGL_CONTEXT) {
|
||||
@ -53,7 +53,7 @@ public:
|
||||
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
nsNativeWidget aNativeParent,
|
||||
const nsIntRect &aRect,
|
||||
const IntRect &aRect,
|
||||
nsWidgetInitData *aInitData = nullptr) override { return NS_OK; }
|
||||
NS_IMETHOD Show(bool aState) override { return NS_OK; }
|
||||
virtual bool IsVisible() const override { return true; }
|
||||
@ -68,7 +68,7 @@ public:
|
||||
virtual bool IsEnabled() const override { return true; }
|
||||
NS_IMETHOD SetFocus(bool aRaise) override { return NS_OK; }
|
||||
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations) override { return NS_OK; }
|
||||
NS_IMETHOD Invalidate(const nsIntRect &aRect) override { return NS_OK; }
|
||||
NS_IMETHOD Invalidate(const IntRect &aRect) override { return NS_OK; }
|
||||
NS_IMETHOD SetTitle(const nsAString& title) override { return NS_OK; }
|
||||
virtual LayoutDeviceIntPoint WidgetToScreenOffset() override { return LayoutDeviceIntPoint(0, 0); }
|
||||
NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
|
||||
@ -182,7 +182,7 @@ static bool CompositeAndCompare(nsRefPtr<LayerManagerComposite> layerManager, Dr
|
||||
{
|
||||
RefPtr<DrawTarget> drawTarget = CreateDT();
|
||||
|
||||
layerManager->BeginTransactionWithDrawTarget(drawTarget, nsIntRect(0, 0, gCompWidth, gCompHeight));
|
||||
layerManager->BeginTransactionWithDrawTarget(drawTarget, IntRect(0, 0, gCompWidth, gCompHeight));
|
||||
layerManager->EndEmptyTransaction();
|
||||
|
||||
RefPtr<SourceSurface> ss = drawTarget->Snapshot();
|
||||
@ -231,10 +231,10 @@ TEST(Gfx, CompositorSimpleTree)
|
||||
nsRefPtr<LayerManager> lmBase = layerManager.get();
|
||||
nsTArray<nsRefPtr<Layer>> layers;
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0, 0, gCompWidth, gCompHeight)),
|
||||
nsIntRegion(nsIntRect(0, 0, gCompWidth, gCompHeight)),
|
||||
nsIntRegion(nsIntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(nsIntRect(0, 50, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 0, gCompWidth, gCompHeight)),
|
||||
nsIntRegion(IntRect(0, 0, gCompWidth, gCompHeight)),
|
||||
nsIntRegion(IntRect(0, 0, 100, 100)),
|
||||
nsIntRegion(IntRect(0, 50, 100, 100)),
|
||||
};
|
||||
nsRefPtr<Layer> root = CreateLayerTree("c(ooo)", layerVisibleRegion, nullptr, lmBase, layers);
|
||||
|
||||
|
@ -248,10 +248,10 @@ already_AddRefed<Layer> CreateLayerTree(
|
||||
TEST(Layers, LayerTree) {
|
||||
const char* layerTreeSyntax = "c(c(tt))";
|
||||
nsIntRegion layerVisibleRegion[] = {
|
||||
nsIntRegion(nsIntRect(0,0,100,100)),
|
||||
nsIntRegion(nsIntRect(0,0,100,100)),
|
||||
nsIntRegion(nsIntRect(0,0,100,100)),
|
||||
nsIntRegion(nsIntRect(10,10,20,20)),
|
||||
nsIntRegion(IntRect(0,0,100,100)),
|
||||
nsIntRegion(IntRect(0,0,100,100)),
|
||||
nsIntRegion(IntRect(0,0,100,100)),
|
||||
nsIntRegion(IntRect(10,10,20,20)),
|
||||
};
|
||||
Matrix4x4 transforms[] = {
|
||||
Matrix4x4(),
|
||||
|
@ -143,7 +143,7 @@ TEST(Gfx, RegionScaleToInside) {
|
||||
nsRegion r(nsRect(0,44760,19096,264));
|
||||
|
||||
nsIntRegion scaled = r.ScaleToInsidePixels(1, 1, 60);
|
||||
nsIntRegion result(nsIntRect(0,746,318,4));
|
||||
nsIntRegion result(mozilla::gfx::IntRect(0,746,318,4));
|
||||
|
||||
EXPECT_TRUE(result.IsEqual(scaled)) <<
|
||||
"scaled result incorrect";
|
||||
@ -155,8 +155,8 @@ TEST(Gfx, RegionScaleToInside) {
|
||||
r.Or(r, nsRect(0,45024,19360,1056));
|
||||
|
||||
nsIntRegion scaled = r.ScaleToInsidePixels(1, 1, 60);
|
||||
nsIntRegion result(nsIntRect(0,746,318,5));
|
||||
result.Or(result, nsIntRect(0,751,322,17));
|
||||
nsIntRegion result(mozilla::gfx::IntRect(0,746,318,5));
|
||||
result.Or(result, mozilla::gfx::IntRect(0,751,322,17));
|
||||
|
||||
EXPECT_TRUE(result.IsEqual(scaled)) <<
|
||||
"scaled result incorrect";
|
||||
@ -167,8 +167,8 @@ TEST(Gfx, RegionScaleToInside) {
|
||||
r.Or(r, nsRect(0,45024,19096,1056));
|
||||
|
||||
nsIntRegion scaled = r.ScaleToInsidePixels(1, 1, 60);
|
||||
nsIntRegion result(nsIntRect(0,746,322,4));
|
||||
result.Or(result, nsIntRect(0,750,318,18));
|
||||
nsIntRegion result(mozilla::gfx::IntRect(0,746,322,4));
|
||||
result.Or(result, mozilla::gfx::IntRect(0,750,318,18));
|
||||
|
||||
EXPECT_TRUE(result.IsEqual(scaled)) <<
|
||||
"scaled result incorrect";
|
||||
|
@ -81,7 +81,7 @@ TEST(TiledLayerBuffer, EmptyUpdate) {
|
||||
|
||||
TestTiledLayerBuffer buffer;
|
||||
|
||||
nsIntRegion validRegion(nsIntRect(0, 0, 10, 10));
|
||||
nsIntRegion validRegion(gfx::IntRect(0, 0, 10, 10));
|
||||
buffer.TestUpdate(validRegion, validRegion);
|
||||
|
||||
ASSERT_EQ(buffer.GetValidRegion(), validRegion);
|
||||
|
Loading…
Reference in New Issue
Block a user