Use gfx::Rect types for occlusion tracker and quad culler classes.
This depends on the non-mutating methods for Rect operations: https://codereview.chromium.org/11270042/
Covered by existing tests, just changing data types.
BUG=147395
R=enne
Review URL: https://codereview.chromium.org/11272045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165220 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/occlusion_tracker_unittest.cc b/cc/occlusion_tracker_unittest.cc
index e746262..cab12b1 100644
--- a/cc/occlusion_tracker_unittest.cc
+++ b/cc/occlusion_tracker_unittest.cc
@@ -91,32 +91,32 @@
template<typename LayerType, typename RenderSurfaceType>
class TestOcclusionTrackerWithClip : public TestOcclusionTrackerBase<LayerType, RenderSurfaceType> {
public:
- TestOcclusionTrackerWithClip(IntRect viewportRect, bool recordMetricsForFrame = false)
+ TestOcclusionTrackerWithClip(gfx::Rect viewportRect, bool recordMetricsForFrame = false)
: TestOcclusionTrackerBase<LayerType, RenderSurfaceType>(viewportRect, recordMetricsForFrame)
, m_overrideLayerClipRect(false)
{
}
- void setLayerClipRect(const IntRect& rect) { m_overrideLayerClipRect = true; m_layerClipRect = rect;}
+ void setLayerClipRect(const gfx::Rect& rect) { m_overrideLayerClipRect = true; m_layerClipRect = rect;}
void useDefaultLayerClipRect() { m_overrideLayerClipRect = false; }
// Returns true if the given rect in content space for the layer is fully occluded in either screen space or the layer's target surface.
- bool occludedLayer(const LayerType* layer, const IntRect& contentRect, bool* hasOcclusionFromOutsideTargetSurface = 0) const
+ bool occludedLayer(const LayerType* layer, const gfx::Rect& contentRect, bool* hasOcclusionFromOutsideTargetSurface = 0) const
{
return this->occluded(layer->renderTarget(), contentRect, layer->drawTransform(), layerImplDrawTransformIsUnknown(layer), layerClipRectInTarget(layer), hasOcclusionFromOutsideTargetSurface);
}
// Gives an unoccluded sub-rect of |contentRect| in the content space of the layer. Simple wrapper around unoccludedContentRect.
- IntRect unoccludedLayerContentRect(const LayerType* layer, const IntRect& contentRect, bool* hasOcclusionFromOutsideTargetSurface = 0) const
+ gfx::Rect unoccludedLayerContentRect(const LayerType* layer, const gfx::Rect& contentRect, bool* hasOcclusionFromOutsideTargetSurface = 0) const
{
return this->unoccludedContentRect(layer->renderTarget(), contentRect, layer->drawTransform(), layerImplDrawTransformIsUnknown(layer), layerClipRectInTarget(layer), hasOcclusionFromOutsideTargetSurface);
}
protected:
- virtual IntRect layerClipRectInTarget(const LayerType* layer) const { return m_overrideLayerClipRect ? m_layerClipRect : OcclusionTrackerBase<LayerType, RenderSurfaceType>::layerClipRectInTarget(layer); }
+ virtual gfx::Rect layerClipRectInTarget(const LayerType* layer) const { return m_overrideLayerClipRect ? m_layerClipRect : OcclusionTrackerBase<LayerType, RenderSurfaceType>::layerClipRectInTarget(layer); }
private:
bool m_overrideLayerClipRect;
- IntRect m_layerClipRect;
+ gfx::Rect m_layerClipRect;
};
struct OcclusionTrackerTestMainThreadTypes {
@@ -465,40 +465,40 @@
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(30, 30), IntSize(500, 500), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 29, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(31, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 31, 70, 70)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 29, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(31, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 31, 70, 70)));
occlusion.useDefaultLayerClipRect();
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 29, 70, 70)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(31, 30, 70, 70)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 31, 70, 70)));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 29, 70, 70)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(31, 30, 70, 70)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 31, 70, 70)));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(30, 30, 70, 70)).isEmpty());
- EXPECT_RECT_EQ(IntRect(29, 30, 1, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(29, 30, 70, 70)));
- EXPECT_RECT_EQ(IntRect(29, 29, 70, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(29, 29, 70, 70)));
- EXPECT_RECT_EQ(IntRect(30, 29, 70, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 29, 70, 70)));
- EXPECT_RECT_EQ(IntRect(31, 29, 70, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(31, 29, 70, 70)));
- EXPECT_RECT_EQ(IntRect(100, 30, 1, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(31, 30, 70, 70)));
- EXPECT_RECT_EQ(IntRect(31, 31, 70, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(31, 31, 70, 70)));
- EXPECT_RECT_EQ(IntRect(30, 100, 70, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 31, 70, 70)));
- EXPECT_RECT_EQ(IntRect(29, 31, 70, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(29, 31, 70, 70)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 30, 70, 70)).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(29, 30, 1, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(29, 30, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(29, 29, 70, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(29, 29, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(30, 29, 70, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 29, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(31, 29, 70, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(31, 29, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 30, 1, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(31, 30, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(31, 31, 70, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(31, 31, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(30, 100, 70, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 31, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(29, 31, 70, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(29, 31, 70, 70)));
}
};
@@ -518,14 +518,14 @@
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(layer1, layerTransform, FloatPoint(0, 0), IntSize(50, 50), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(layer2, occlusion);
this->enterLayer(layer1, occlusion);
- EXPECT_RECT_EQ(IntRect(20, 20, 50, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(20, 20, 50, 50), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(20, 20, 50, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(20, 20, 50, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
// This checks cases where the quads don't match their "containing"
@@ -534,13 +534,13 @@
WebTransformationMatrix quadTransform;
quadTransform.translate(30, 30);
- IntRect clipRectInTarget(0, 0, 100, 100);
+ gfx::Rect clipRectInTarget(0, 0, 100, 100);
- EXPECT_TRUE(occlusion.unoccludedContentRect(parent, IntRect(0, 0, 10, 10), quadTransform, false, clipRectInTarget).isEmpty());
- EXPECT_RECT_EQ(IntRect(0, 0, 10, 10), occlusion.unoccludedContentRect(parent, IntRect(0, 0, 10, 10), quadTransform, true, clipRectInTarget));
- EXPECT_RECT_EQ(IntRect(40, 40, 10, 10), occlusion.unoccludedContentRect(parent, IntRect(40, 40, 10, 10), quadTransform, false, clipRectInTarget));
- EXPECT_RECT_EQ(IntRect(40, 30, 5, 10), occlusion.unoccludedContentRect(parent, IntRect(35, 30, 10, 10), quadTransform, false, clipRectInTarget));
- EXPECT_RECT_EQ(IntRect(40, 40, 5, 5), occlusion.unoccludedContentRect(parent, IntRect(40, 40, 10, 10), quadTransform, false, IntRect(0, 0, 75, 75)));
+ EXPECT_TRUE(occlusion.unoccludedContentRect(parent, gfx::Rect(0, 0, 10, 10), quadTransform, false, clipRectInTarget).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 10, 10), occlusion.unoccludedContentRect(parent, gfx::Rect(0, 0, 10, 10), quadTransform, true, clipRectInTarget));
+ EXPECT_RECT_EQ(gfx::Rect(40, 40, 10, 10), occlusion.unoccludedContentRect(parent, gfx::Rect(40, 40, 10, 10), quadTransform, false, clipRectInTarget));
+ EXPECT_RECT_EQ(gfx::Rect(40, 30, 5, 10), occlusion.unoccludedContentRect(parent, gfx::Rect(35, 30, 10, 10), quadTransform, false, clipRectInTarget));
+ EXPECT_RECT_EQ(gfx::Rect(40, 40, 5, 5), occlusion.unoccludedContentRect(parent, gfx::Rect(40, 40, 10, 10), quadTransform, false, gfx::Rect(0, 0, 75, 75)));
}
};
@@ -561,40 +561,40 @@
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, layerTransform, FloatPoint(30, 30), IntSize(500, 500), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 29, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(31, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 31, 70, 70)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 29, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(31, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 31, 70, 70)));
occlusion.useDefaultLayerClipRect();
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 30, 70, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 29, 70, 70)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(31, 30, 70, 70)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 31, 70, 70)));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 29, 70, 70)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(31, 30, 70, 70)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 31, 70, 70)));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(30, 30, 70, 70)).isEmpty());
- EXPECT_RECT_EQ(IntRect(29, 30, 1, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(29, 30, 70, 70)));
- EXPECT_RECT_EQ(IntRect(29, 29, 70, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(29, 29, 70, 70)));
- EXPECT_RECT_EQ(IntRect(30, 29, 70, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 29, 70, 70)));
- EXPECT_RECT_EQ(IntRect(31, 29, 70, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(31, 29, 70, 70)));
- EXPECT_RECT_EQ(IntRect(100, 30, 1, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(31, 30, 70, 70)));
- EXPECT_RECT_EQ(IntRect(31, 31, 70, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(31, 31, 70, 70)));
- EXPECT_RECT_EQ(IntRect(30, 100, 70, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 31, 70, 70)));
- EXPECT_RECT_EQ(IntRect(29, 31, 70, 70), occlusion.unoccludedLayerContentRect(parent, IntRect(29, 31, 70, 70)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 30, 70, 70)).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(29, 30, 1, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(29, 30, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(29, 29, 70, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(29, 29, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(30, 29, 70, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 29, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(31, 29, 70, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(31, 29, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 30, 1, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(31, 30, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(31, 31, 70, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(31, 31, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(30, 100, 70, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 31, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(29, 31, 70, 70), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(29, 31, 70, 70)));
}
};
@@ -613,52 +613,52 @@
typename Types::ContentLayerType* layer = this->createDrawingLayer(parent, layerTransform, FloatPoint(30, 30), IntSize(500, 500), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(50, 50, 50, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(50, 50, 50, 50), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(50, 50, 50, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(50, 50, 50, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(50, 50, 50, 50)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(49, 50, 50, 50)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(50, 49, 50, 50)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(51, 50, 50, 50)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(50, 51, 50, 50)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(50, 50, 50, 50)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(49, 50, 50, 50)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(50, 49, 50, 50)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(51, 50, 50, 50)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(50, 51, 50, 50)));
occlusion.useDefaultLayerClipRect();
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(50, 50, 50, 50)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(49, 50, 50, 50)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(50, 49, 50, 50)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(51, 50, 50, 50)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(50, 51, 50, 50)));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(50, 50, 50, 50)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(49, 50, 50, 50)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(50, 49, 50, 50)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(51, 50, 50, 50)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(50, 51, 50, 50)));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(50, 50, 50, 50)).isEmpty());
- EXPECT_RECT_EQ(IntRect(49, 50, 1, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(49, 50, 50, 50)));
- EXPECT_RECT_EQ(IntRect(49, 49, 50, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(49, 49, 50, 50)));
- EXPECT_RECT_EQ(IntRect(50, 49, 50, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(50, 49, 50, 50)));
- EXPECT_RECT_EQ(IntRect(51, 49, 50, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(51, 49, 50, 50)));
- EXPECT_RECT_EQ(IntRect(100, 50, 1, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(51, 50, 50, 50)));
- EXPECT_RECT_EQ(IntRect(51, 51, 50, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(51, 51, 50, 50)));
- EXPECT_RECT_EQ(IntRect(50, 100, 50, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(50, 51, 50, 50)));
- EXPECT_RECT_EQ(IntRect(49, 51, 50, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(49, 51, 50, 50)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(50, 50, 50, 50)).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(49, 50, 1, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(49, 50, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(49, 49, 50, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(49, 49, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(50, 49, 50, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(50, 49, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(51, 49, 50, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(51, 49, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 50, 1, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(51, 50, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(51, 51, 50, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(51, 51, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(50, 100, 50, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(50, 51, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(49, 51, 50, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(49, 51, 50, 50)));
occlusion.useDefaultLayerClipRect();
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(50, 50, 50, 50)).isEmpty());
- EXPECT_RECT_EQ(IntRect(49, 50, 1, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(49, 50, 50, 50)));
- EXPECT_RECT_EQ(IntRect(49, 49, 50, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(49, 49, 50, 50)));
- EXPECT_RECT_EQ(IntRect(50, 49, 50, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(50, 49, 50, 50)));
- EXPECT_RECT_EQ(IntRect(51, 49, 49, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(51, 49, 50, 50)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(51, 50, 50, 50)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(51, 51, 50, 50)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(50, 51, 50, 50)).isEmpty());
- EXPECT_RECT_EQ(IntRect(49, 51, 1, 49), occlusion.unoccludedLayerContentRect(parent, IntRect(49, 51, 50, 50)));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(50, 50, 50, 50)).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(49, 50, 1, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(49, 50, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(49, 49, 50, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(49, 49, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(50, 49, 50, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(50, 49, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(51, 49, 49, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(51, 49, 50, 50)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(51, 50, 50, 50)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(51, 51, 50, 50)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(50, 51, 50, 50)).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(49, 51, 1, 49), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(49, 51, 50, 50)));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
}
};
@@ -682,38 +682,38 @@
typename Types::ContentLayerType* layer = this->createDrawingLayer(child, this->identityMatrix, FloatPoint(10, 10), IntSize(500, 500), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(layer, occlusion);
this->enterContributingSurface(child, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 40, 70, 60), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 40, 70, 60), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(10, 430, 60, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(10, 430, 60, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->leaveContributingSurface(child, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 40, 70, 60), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 40, 70, 60), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(30, 40, 70, 60), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 40, 70, 60), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 40, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 40, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 39, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(31, 40, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 41, 70, 60)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 40, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 40, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 39, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(31, 40, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 41, 70, 60)));
occlusion.useDefaultLayerClipRect();
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 40, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 40, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 39, 70, 60)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(31, 40, 70, 60)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 41, 70, 60)));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 40, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 40, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 39, 70, 60)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(31, 40, 70, 60)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 41, 70, 60)));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
/* Justification for the above occlusion from |layer|:
@@ -765,20 +765,20 @@
typename Types::ContentLayerType* occluder = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(100, 100), IntSize(500, 500), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(occluder, occlusion);
this->enterLayer(layer2, occlusion);
- EXPECT_RECT_EQ(IntRect(100, 100, 100, 100), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(100, 100, 100, 100), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty());
EXPECT_EQ(0u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 25, 25), occlusion.unoccludedLayerContentRect(layer2, IntRect(0, 0, 25, 25)));
- EXPECT_RECT_EQ(IntRect(10, 25, 15, 25), occlusion.unoccludedLayerContentRect(layer2, IntRect(10, 25, 25, 25)));
- EXPECT_RECT_EQ(IntRect(25, 10, 25, 15), occlusion.unoccludedLayerContentRect(layer2, IntRect(25, 10, 25, 25)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(layer2, IntRect(25, 25, 25, 25)).isEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 25, 25), occlusion.unoccludedLayerContentRect(layer2, gfx::Rect(0, 0, 25, 25)));
+ EXPECT_RECT_EQ(gfx::Rect(10, 25, 15, 25), occlusion.unoccludedLayerContentRect(layer2, gfx::Rect(10, 25, 25, 25)));
+ EXPECT_RECT_EQ(gfx::Rect(25, 10, 25, 15), occlusion.unoccludedLayerContentRect(layer2, gfx::Rect(25, 10, 25, 25)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(layer2, gfx::Rect(25, 25, 25, 25)).IsEmpty());
}
};
@@ -805,68 +805,68 @@
typename Types::ContentLayerType* child2 = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(30, 30), IntSize(60, 20), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(-10, -10, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(-10, -10, 1000, 1000));
this->visitLayer(child2, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 30, 60, 20), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 60, 20), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(30, 30, 60, 20), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 60, 20), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->visitLayer(layer, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(2u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(10, 430, 60, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(10, 430, 60, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->enterContributingSurface(child, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(2u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(10, 430, 60, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(10, 430, 60, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
// Occlusion in |child2| should get merged with the |child| surface we are leaving now.
this->leaveContributingSurface(child, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(2u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(2u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 30, 70, 70)));
- EXPECT_RECT_EQ(IntRect(90, 30, 10, 10), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 30, 70, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 30, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(90, 30, 10, 10), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 30, 70, 70)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 30, 60, 10)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 30, 60, 10)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 29, 60, 10)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(31, 30, 60, 10)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 31, 60, 10)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 30, 60, 10)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 30, 60, 10)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 29, 60, 10)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(31, 30, 60, 10)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 31, 60, 10)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 40, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 40, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 39, 70, 60)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 40, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 40, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 39, 70, 60)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(30, 30, 60, 10)).isEmpty());
- EXPECT_RECT_EQ(IntRect(29, 30, 1, 10), occlusion.unoccludedLayerContentRect(parent, IntRect(29, 30, 60, 10)));
- EXPECT_RECT_EQ(IntRect(30, 29, 60, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 29, 60, 10)));
- EXPECT_RECT_EQ(IntRect(90, 30, 1, 10), occlusion.unoccludedLayerContentRect(parent, IntRect(31, 30, 60, 10)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(30, 31, 60, 10)).isEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 30, 60, 10)).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(29, 30, 1, 10), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(29, 30, 60, 10)));
+ EXPECT_RECT_EQ(gfx::Rect(30, 29, 60, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 29, 60, 10)));
+ EXPECT_RECT_EQ(gfx::Rect(90, 30, 1, 10), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(31, 30, 60, 10)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 31, 60, 10)).IsEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(30, 40, 70, 60)).isEmpty());
- EXPECT_RECT_EQ(IntRect(29, 40, 1, 60), occlusion.unoccludedLayerContentRect(parent, IntRect(29, 40, 70, 60)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 40, 70, 60)).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(29, 40, 1, 60), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(29, 40, 70, 60)));
// This rect is mostly occluded by |child2|.
- EXPECT_RECT_EQ(IntRect(90, 39, 10, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 39, 70, 60)));
+ EXPECT_RECT_EQ(gfx::Rect(90, 39, 10, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 39, 70, 60)));
// This rect extends past top/right ends of |child2|.
- EXPECT_RECT_EQ(IntRect(30, 29, 70, 11), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 29, 70, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(30, 29, 70, 11), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 29, 70, 70)));
// This rect extends past left/right ends of |child2|.
- EXPECT_RECT_EQ(IntRect(20, 39, 80, 60), occlusion.unoccludedLayerContentRect(parent, IntRect(20, 39, 80, 60)));
- EXPECT_RECT_EQ(IntRect(100, 40, 1, 60), occlusion.unoccludedLayerContentRect(parent, IntRect(31, 40, 70, 60)));
- EXPECT_RECT_EQ(IntRect(30, 100, 70, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 41, 70, 60)));
+ EXPECT_RECT_EQ(gfx::Rect(20, 39, 80, 60), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(20, 39, 80, 60)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 40, 1, 60), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(31, 40, 70, 60)));
+ EXPECT_RECT_EQ(gfx::Rect(30, 100, 70, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 41, 70, 60)));
/* Justification for the above occlusion from |layer|:
100
@@ -917,48 +917,48 @@
typename Types::ContentLayerType* layer = this->createDrawingLayer(child, layerTransform, FloatPoint(0, 0), IntSize(500, 500), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
- IntRect clippedLayerInChild = MathUtil::mapClippedRect(layerTransform, layer->visibleContentRect());
+ gfx::Rect clippedLayerInChild = MathUtil::mapClippedRect(layerTransform, layer->visibleContentRect());
this->visitLayer(layer, occlusion);
this->enterContributingSurface(child, occlusion);
- EXPECT_RECT_EQ(IntRect(), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(0u, occlusion.occlusionInScreenSpace().rects().size());
EXPECT_RECT_EQ(clippedLayerInChild, occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
EXPECT_TRUE(occlusion.occludedLayer(child, clippedLayerInChild));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).isEmpty());
- clippedLayerInChild.move(-1, 0);
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).IsEmpty());
+ clippedLayerInChild.Offset(-1, 0);
EXPECT_FALSE(occlusion.occludedLayer(child, clippedLayerInChild));
- EXPECT_FALSE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).isEmpty());
- clippedLayerInChild.move(1, 0);
- clippedLayerInChild.move(1, 0);
+ EXPECT_FALSE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).IsEmpty());
+ clippedLayerInChild.Offset(1, 0);
+ clippedLayerInChild.Offset(1, 0);
EXPECT_FALSE(occlusion.occludedLayer(child, clippedLayerInChild));
- EXPECT_FALSE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).isEmpty());
- clippedLayerInChild.move(-1, 0);
- clippedLayerInChild.move(0, -1);
+ EXPECT_FALSE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).IsEmpty());
+ clippedLayerInChild.Offset(-1, 0);
+ clippedLayerInChild.Offset(0, -1);
EXPECT_FALSE(occlusion.occludedLayer(child, clippedLayerInChild));
- EXPECT_FALSE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).isEmpty());
- clippedLayerInChild.move(0, 1);
- clippedLayerInChild.move(0, 1);
+ EXPECT_FALSE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).IsEmpty());
+ clippedLayerInChild.Offset(0, 1);
+ clippedLayerInChild.Offset(0, 1);
EXPECT_FALSE(occlusion.occludedLayer(child, clippedLayerInChild));
- EXPECT_FALSE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).isEmpty());
- clippedLayerInChild.move(0, -1);
+ EXPECT_FALSE(occlusion.unoccludedLayerContentRect(child, clippedLayerInChild).IsEmpty());
+ clippedLayerInChild.Offset(0, -1);
this->leaveContributingSurface(child, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(0u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(0u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(75, 55, 1, 1)));
- EXPECT_RECT_EQ(IntRect(75, 55, 1, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(75, 55, 1, 1)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(75, 55, 1, 1)));
+ EXPECT_RECT_EQ(gfx::Rect(75, 55, 1, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(75, 55, 1, 1)));
}
};
@@ -983,47 +983,47 @@
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(child, this->identityMatrix, FloatPoint(10, 450), IntSize(500, 60), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(layer2, occlusion);
this->visitLayer(layer1, occlusion);
this->enterContributingSurface(child, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 40, 70, 60), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 40, 70, 60), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(10, 430, 60, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(10, 430, 60, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(child, IntRect(10, 430, 60, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(child, IntRect(9, 430, 60, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(child, IntRect(10, 429, 60, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(child, IntRect(11, 430, 60, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(child, IntRect(10, 431, 60, 70)));
+ EXPECT_TRUE(occlusion.occludedLayer(child, gfx::Rect(10, 430, 60, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(child, gfx::Rect(9, 430, 60, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(child, gfx::Rect(10, 429, 60, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(child, gfx::Rect(11, 430, 60, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(child, gfx::Rect(10, 431, 60, 70)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(child, IntRect(10, 430, 60, 70)).isEmpty());
- EXPECT_RECT_EQ(IntRect(9, 430, 1, 70), occlusion.unoccludedLayerContentRect(child, IntRect(9, 430, 60, 70)));
- EXPECT_RECT_EQ(IntRect(10, 429, 60, 1), occlusion.unoccludedLayerContentRect(child, IntRect(10, 429, 60, 70)));
- EXPECT_RECT_EQ(IntRect(70, 430, 1, 70), occlusion.unoccludedLayerContentRect(child, IntRect(11, 430, 60, 70)));
- EXPECT_RECT_EQ(IntRect(10, 500, 60, 1), occlusion.unoccludedLayerContentRect(child, IntRect(10, 431, 60, 70)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(child, gfx::Rect(10, 430, 60, 70)).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(9, 430, 1, 70), occlusion.unoccludedLayerContentRect(child, gfx::Rect(9, 430, 60, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(10, 429, 60, 1), occlusion.unoccludedLayerContentRect(child, gfx::Rect(10, 429, 60, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(70, 430, 1, 70), occlusion.unoccludedLayerContentRect(child, gfx::Rect(11, 430, 60, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(10, 500, 60, 1), occlusion.unoccludedLayerContentRect(child, gfx::Rect(10, 431, 60, 70)));
this->leaveContributingSurface(child, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 40, 70, 60), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 40, 70, 60), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(30, 40, 70, 60), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 40, 70, 60), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 40, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 40, 70, 60)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 39, 70, 60)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 40, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 40, 70, 60)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 39, 70, 60)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(30, 40, 70, 60)).isEmpty());
- EXPECT_RECT_EQ(IntRect(29, 40, 1, 60), occlusion.unoccludedLayerContentRect(parent, IntRect(29, 40, 70, 60)));
- EXPECT_RECT_EQ(IntRect(30, 39, 70, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 39, 70, 60)));
- EXPECT_RECT_EQ(IntRect(100, 40, 1, 60), occlusion.unoccludedLayerContentRect(parent, IntRect(31, 40, 70, 60)));
- EXPECT_RECT_EQ(IntRect(30, 100, 70, 1), occlusion.unoccludedLayerContentRect(parent, IntRect(30, 41, 70, 60)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 40, 70, 60)).IsEmpty());
+ EXPECT_RECT_EQ(gfx::Rect(29, 40, 1, 60), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(29, 40, 70, 60)));
+ EXPECT_RECT_EQ(gfx::Rect(30, 39, 70, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 39, 70, 60)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 40, 1, 60), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(31, 40, 70, 60)));
+ EXPECT_RECT_EQ(gfx::Rect(30, 100, 70, 1), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(30, 41, 70, 60)));
/* Justification for the above occlusion from |layer1| and |layer2|:
@@ -1073,69 +1073,69 @@
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(child2, this->identityMatrix, FloatPoint(-10, -10), IntSize(510, 510), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(-20, -20, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(-20, -20, 1000, 1000));
this->visitLayer(layer2, occlusion);
this->enterContributingSurface(child2, occlusion);
- EXPECT_RECT_EQ(IntRect(20, 30, 80, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(20, 30, 80, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(-10, 420, 70, 80), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(-10, 420, 70, 80), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(child2, IntRect(-10, 420, 70, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(child2, IntRect(-11, 420, 70, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(child2, IntRect(-10, 419, 70, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(child2, IntRect(-10, 420, 71, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(child2, IntRect(-10, 420, 70, 81)));
+ EXPECT_TRUE(occlusion.occludedLayer(child2, gfx::Rect(-10, 420, 70, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(child2, gfx::Rect(-11, 420, 70, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(child2, gfx::Rect(-10, 419, 70, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(child2, gfx::Rect(-10, 420, 71, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(child2, gfx::Rect(-10, 420, 70, 81)));
occlusion.useDefaultLayerClipRect();
- EXPECT_TRUE(occlusion.occludedLayer(child2, IntRect(-10, 420, 70, 80)));
- EXPECT_TRUE(occlusion.occludedLayer(child2, IntRect(-11, 420, 70, 80)));
- EXPECT_TRUE(occlusion.occludedLayer(child2, IntRect(-10, 419, 70, 80)));
- EXPECT_TRUE(occlusion.occludedLayer(child2, IntRect(-10, 420, 71, 80)));
- EXPECT_TRUE(occlusion.occludedLayer(child2, IntRect(-10, 420, 70, 81)));
- occlusion.setLayerClipRect(IntRect(-20, -20, 1000, 1000));
+ EXPECT_TRUE(occlusion.occludedLayer(child2, gfx::Rect(-10, 420, 70, 80)));
+ EXPECT_TRUE(occlusion.occludedLayer(child2, gfx::Rect(-11, 420, 70, 80)));
+ EXPECT_TRUE(occlusion.occludedLayer(child2, gfx::Rect(-10, 419, 70, 80)));
+ EXPECT_TRUE(occlusion.occludedLayer(child2, gfx::Rect(-10, 420, 71, 80)));
+ EXPECT_TRUE(occlusion.occludedLayer(child2, gfx::Rect(-10, 420, 70, 81)));
+ occlusion.setLayerClipRect(gfx::Rect(-20, -20, 1000, 1000));
// There is nothing above child2's surface in the z-order.
- EXPECT_RECT_EQ(IntRect(-10, 420, 70, 80), occlusion.unoccludedContributingSurfaceContentRect(child2, false, IntRect(-10, 420, 70, 80)));
+ EXPECT_RECT_EQ(gfx::Rect(-10, 420, 70, 80), occlusion.unoccludedContributingSurfaceContentRect(child2, false, gfx::Rect(-10, 420, 70, 80)));
this->leaveContributingSurface(child2, occlusion);
this->visitLayer(layer1, occlusion);
this->enterContributingSurface(child1, occlusion);
- EXPECT_RECT_EQ(IntRect(20, 20, 80, 80), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(20, 20, 80, 80), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(2u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(-10, 430, 80, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(-10, 430, 80, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(child1, IntRect(-10, 430, 80, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(child1, IntRect(-11, 430, 80, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(child1, IntRect(-10, 429, 80, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(child1, IntRect(-10, 430, 81, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(child1, IntRect(-10, 430, 80, 71)));
+ EXPECT_TRUE(occlusion.occludedLayer(child1, gfx::Rect(-10, 430, 80, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(child1, gfx::Rect(-11, 430, 80, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(child1, gfx::Rect(-10, 429, 80, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(child1, gfx::Rect(-10, 430, 81, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(child1, gfx::Rect(-10, 430, 80, 71)));
// child2's contents will occlude child1 below it.
- EXPECT_RECT_EQ(IntRect(-10, 430, 10, 70), occlusion.unoccludedContributingSurfaceContentRect(child1, false, IntRect(-10, 430, 80, 70)));
+ EXPECT_RECT_EQ(gfx::Rect(-10, 430, 10, 70), occlusion.unoccludedContributingSurfaceContentRect(child1, false, gfx::Rect(-10, 430, 80, 70)));
this->leaveContributingSurface(child1, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(20, 20, 80, 80), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(20, 20, 80, 80), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(2u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(20, 20, 80, 80), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(20, 20, 80, 80), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(2u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(20, 20, 80, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(20, 20, 80, 80)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(30, 20, 70, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(29, 20, 70, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(30, 19, 70, 80)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(30, 20, 70, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(29, 20, 70, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(30, 19, 70, 80)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(20, 30, 80, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(19, 30, 80, 70)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(20, 29, 80, 70)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(20, 30, 80, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(19, 30, 80, 70)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(20, 29, 80, 70)));
/* Justification for the above occlusion:
100
@@ -1189,62 +1189,62 @@
typename Types::ContentLayerType* layer2 = this->createDrawingLayer(child2, this->identityMatrix, FloatPoint(-10, -10), IntSize(510, 510), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(-30, -30, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(-30, -30, 1000, 1000));
this->visitLayer(layer2, occlusion);
this->enterLayer(child2, occlusion);
- EXPECT_RECT_EQ(IntRect(20, 30, 80, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(20, 30, 80, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(-10, 420, 70, 80), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(-10, 420, 70, 80), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(child2, IntRect(-10, 420, 70, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(child2, IntRect(-11, 420, 70, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(child2, IntRect(-10, 419, 70, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(child2, IntRect(-10, 420, 71, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(child2, IntRect(-10, 420, 70, 81)));
+ EXPECT_TRUE(occlusion.occludedLayer(child2, gfx::Rect(-10, 420, 70, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(child2, gfx::Rect(-11, 420, 70, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(child2, gfx::Rect(-10, 419, 70, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(child2, gfx::Rect(-10, 420, 71, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(child2, gfx::Rect(-10, 420, 70, 81)));
this->leaveLayer(child2, occlusion);
this->enterContributingSurface(child2, occlusion);
// There is nothing above child2's surface in the z-order.
- EXPECT_RECT_EQ(IntRect(-10, 420, 70, 80), occlusion.unoccludedContributingSurfaceContentRect(child2, false, IntRect(-10, 420, 70, 80)));
+ EXPECT_RECT_EQ(gfx::Rect(-10, 420, 70, 80), occlusion.unoccludedContributingSurfaceContentRect(child2, false, gfx::Rect(-10, 420, 70, 80)));
this->leaveContributingSurface(child2, occlusion);
this->visitLayer(layer1, occlusion);
this->enterContributingSurface(child1, occlusion);
- EXPECT_RECT_EQ(IntRect(10, 20, 90, 80), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(10, 20, 90, 80), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(420, -20, 80, 90), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(420, -20, 80, 90), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(child1, IntRect(420, -20, 80, 90)));
- EXPECT_FALSE(occlusion.occludedLayer(child1, IntRect(419, -20, 80, 90)));
- EXPECT_FALSE(occlusion.occludedLayer(child1, IntRect(420, -21, 80, 90)));
- EXPECT_FALSE(occlusion.occludedLayer(child1, IntRect(420, -19, 80, 90)));
- EXPECT_FALSE(occlusion.occludedLayer(child1, IntRect(421, -20, 80, 90)));
+ EXPECT_TRUE(occlusion.occludedLayer(child1, gfx::Rect(420, -20, 80, 90)));
+ EXPECT_FALSE(occlusion.occludedLayer(child1, gfx::Rect(419, -20, 80, 90)));
+ EXPECT_FALSE(occlusion.occludedLayer(child1, gfx::Rect(420, -21, 80, 90)));
+ EXPECT_FALSE(occlusion.occludedLayer(child1, gfx::Rect(420, -19, 80, 90)));
+ EXPECT_FALSE(occlusion.occludedLayer(child1, gfx::Rect(421, -20, 80, 90)));
// child2's contents will occlude child1 below it.
- EXPECT_RECT_EQ(IntRect(420, -20, 80, 90), occlusion.unoccludedContributingSurfaceContentRect(child1, false, IntRect(420, -20, 80, 90)));
- EXPECT_RECT_EQ(IntRect(490, -10, 10, 80), occlusion.unoccludedContributingSurfaceContentRect(child1, false, IntRect(420, -10, 80, 90)));
- EXPECT_RECT_EQ(IntRect(420, -20, 70, 10), occlusion.unoccludedContributingSurfaceContentRect(child1, false, IntRect(420, -20, 70, 90)));
+ EXPECT_RECT_EQ(gfx::Rect(420, -20, 80, 90), occlusion.unoccludedContributingSurfaceContentRect(child1, false, gfx::Rect(420, -20, 80, 90)));
+ EXPECT_RECT_EQ(gfx::Rect(490, -10, 10, 80), occlusion.unoccludedContributingSurfaceContentRect(child1, false, gfx::Rect(420, -10, 80, 90)));
+ EXPECT_RECT_EQ(gfx::Rect(420, -20, 70, 10), occlusion.unoccludedContributingSurfaceContentRect(child1, false, gfx::Rect(420, -20, 70, 90)));
this->leaveContributingSurface(child1, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(10, 20, 90, 80), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(10, 20, 90, 80), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(10, 20, 90, 80), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(10, 20, 90, 80), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(10, 20, 90, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(9, 20, 90, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(10, 19, 90, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(11, 20, 90, 80)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(10, 21, 90, 80)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(10, 20, 90, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(9, 20, 90, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(10, 19, 90, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(11, 20, 90, 80)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(10, 21, 90, 80)));
/* Justification for the above occlusion:
100
@@ -1305,8 +1305,8 @@
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
// Opacity layer won't contribute to occlusion.
this->visitLayer(opacityLayer, occlusion);
@@ -1324,16 +1324,16 @@
this->visitLayer(opaqueLayer, occlusion);
this->enterContributingSurface(opaqueLayer, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 430, 70, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 430, 70, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
// And it gets translated to the parent surface.
this->leaveContributingSurface(opaqueLayer, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
// The blur layer needs to throw away any occlusion from outside its subtree.
@@ -1350,9 +1350,9 @@
// But the opaque layer's occlusion is preserved on the parent.
this->leaveContributingSurface(blurLayer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(30, 30, 70, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
}
};
@@ -1370,21 +1370,21 @@
this->createReplicaLayer(surface, this->identityMatrix, FloatPoint(50, 50), IntSize());
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 100, 50, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 100, 50, 50), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->visitContributingSurface(surface, occlusion);
this->enterLayer(parent, occlusion);
// The surface and replica should both be occluding the parent.
- EXPECT_RECT_EQ(IntRect(0, 100, 100, 100), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 100, 100, 100), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(2u, occlusion.occlusionInTargetSurface().rects().size());
}
};
@@ -1403,21 +1403,21 @@
this->createReplicaLayer(surface, this->identityMatrix, FloatPoint(50, 50), IntSize());
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 100, 50, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 100, 50, 50), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->visitContributingSurface(surface, occlusion);
this->enterLayer(parent, occlusion);
// The surface and replica should both be occluding the parent.
- EXPECT_RECT_EQ(IntRect(0, 100, 100, 70), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 100, 100, 70), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(2u, occlusion.occlusionInTargetSurface().rects().size());
}
};
@@ -1436,21 +1436,21 @@
this->createMaskLayer(replica, IntSize(10, 10));
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 100, 50, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 100, 50, 50), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->visitContributingSurface(surface, occlusion);
this->enterLayer(parent, occlusion);
// The replica should not be occluding the parent, since it has a mask applied to it.
- EXPECT_RECT_EQ(IntRect(0, 100, 50, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 100, 50, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
}
};
@@ -1467,36 +1467,36 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(200, 100, 100, 100));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(200, 100, 100, 100));
this->enterLayer(layer, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(200, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(200, 100, 100, 100)));
occlusion.useDefaultLayerClipRect();
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(200, 100, 100, 100)));
- occlusion.setLayerClipRect(IntRect(200, 100, 100, 100));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(200, 100, 100, 100)));
+ occlusion.setLayerClipRect(gfx::Rect(200, 100, 100, 100));
this->leaveLayer(layer, occlusion);
this->visitContributingSurface(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
- EXPECT_RECT_EQ(IntRect(200, 100, 100, 100), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 100, 100, 100), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)));
}
};
@@ -1512,36 +1512,36 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(200, 100, 100, 100));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(200, 100, 100, 100));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->enterLayer(layer, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(200, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(200, 100, 100, 100)));
occlusion.useDefaultLayerClipRect();
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(200, 100, 100, 100)));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(200, 100, 100, 100)));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->leaveLayer(layer, occlusion);
this->visitContributingSurface(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
- EXPECT_RECT_EQ(IntRect(200, 100, 100, 100), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 100, 100, 100), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)));
}
};
@@ -1557,31 +1557,31 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(100, 100, 100, 100));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(100, 100, 100, 100));
this->enterLayer(layer, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
this->leaveLayer(layer, occlusion);
this->visitContributingSurface(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)).isEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)).IsEmpty());
}
};
@@ -1597,31 +1597,31 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(100, 100, 100, 100));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(100, 100, 100, 100));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->enterLayer(layer, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
this->leaveLayer(layer, occlusion);
this->visitContributingSurface(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)).isEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)).IsEmpty());
}
};
@@ -1637,35 +1637,35 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(50, 50, 200, 200));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(50, 50, 200, 200));
this->enterLayer(layer, occlusion);
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
this->leaveLayer(layer, occlusion);
this->visitContributingSurface(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(0, 200, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(100, 200, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(0, 200, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(100, 200, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
- EXPECT_RECT_EQ(IntRect(50, 50, 200, 200), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)));
- EXPECT_RECT_EQ(IntRect(200, 50, 50, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 100)));
- EXPECT_RECT_EQ(IntRect(200, 100, 50, 100), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 100, 300, 100)));
- EXPECT_RECT_EQ(IntRect(200, 100, 50, 100), occlusion.unoccludedLayerContentRect(parent, IntRect(200, 100, 100, 100)));
- EXPECT_RECT_EQ(IntRect(100, 200, 100, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(100, 200, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(50, 50, 200, 200), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 50, 50, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 100, 50, 100), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 100, 300, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 100, 50, 100), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 200, 100, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(100, 200, 100, 100)));
}
};
@@ -1681,35 +1681,35 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(50, 50, 200, 200));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(50, 50, 200, 200));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->enterLayer(layer, occlusion);
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
this->leaveLayer(layer, occlusion);
this->visitContributingSurface(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(0, 200, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(100, 200, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(0, 200, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(100, 200, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
- EXPECT_RECT_EQ(IntRect(50, 50, 200, 200), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)));
- EXPECT_RECT_EQ(IntRect(200, 50, 50, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 100)));
- EXPECT_RECT_EQ(IntRect(200, 100, 50, 100), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 100, 300, 100)));
- EXPECT_RECT_EQ(IntRect(200, 100, 50, 100), occlusion.unoccludedLayerContentRect(parent, IntRect(200, 100, 100, 100)));
- EXPECT_RECT_EQ(IntRect(100, 200, 100, 50), occlusion.unoccludedLayerContentRect(parent, IntRect(100, 200, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(50, 50, 200, 200), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 50, 50, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 100, 50, 100), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 100, 300, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 100, 50, 100), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 200, 100, 50), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(100, 200, 100, 100)));
}
};
@@ -1725,35 +1725,35 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(500, 500, 100, 100));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(500, 500, 100, 100));
this->enterLayer(layer, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
this->leaveLayer(layer, occlusion);
this->visitContributingSurface(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 100)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(0, 100, 300, 100)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(200, 100, 100, 100)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(100, 200, 100, 100)).isEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 100)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 100, 300, 100)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(200, 100, 100, 100)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(100, 200, 100, 100)).IsEmpty());
}
};
@@ -1769,35 +1769,35 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(500, 500, 100, 100));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(500, 500, 100, 100));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->enterLayer(layer, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
this->leaveLayer(layer, occlusion);
this->visitContributingSurface(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 0, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(0, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 200, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 0, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(0, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 200, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 100)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(0, 100, 300, 100)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(200, 100, 100, 100)).isEmpty());
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, IntRect(100, 200, 100, 100)).isEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 100)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 100, 300, 100)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(200, 100, 100, 100)).IsEmpty());
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(parent, gfx::Rect(100, 200, 100, 100)).IsEmpty());
}
};
@@ -1813,16 +1813,16 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->enterLayer(layer, occlusion);
// This layer is translated when drawn into its target. So if the clip rect given from the target surface
// is not in that target space, then after translating these query rects into the target, they will fall outside
// the clip and be considered occluded.
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
}
};
@@ -1838,20 +1838,20 @@
typename Types::ContentLayerType* layer = this->createDrawingSurface(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(200, 200), false);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->enterLayer(layer, occlusion);
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(0, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 0, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(0, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 0, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(100, 100, 100, 100)));
// Occluded since its outside the surface bounds.
- EXPECT_TRUE(occlusion.occludedLayer(layer, IntRect(200, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(layer, gfx::Rect(200, 100, 100, 100)));
// Test without any clip rect.
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
- EXPECT_FALSE(occlusion.occludedLayer(layer, IntRect(200, 100, 100, 100)));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
+ EXPECT_FALSE(occlusion.occludedLayer(layer, gfx::Rect(200, 100, 100, 100)));
occlusion.useDefaultLayerClipRect();
this->leaveLayer(layer, occlusion);
@@ -1876,51 +1876,51 @@
this->calcDrawEtc(parent);
{
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
layer->setOpaqueContentsRect(IntRect(0, 0, 100, 100));
this->resetLayerIterator();
this->visitLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(100, 100, 100, 100), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(100, 100, 100, 100), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(100, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
}
{
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
layer->setOpaqueContentsRect(IntRect(20, 20, 180, 180));
this->resetLayerIterator();
this->visitLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(120, 120, 180, 180), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(120, 120, 180, 180), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(100, 100, 100, 100)));
- EXPECT_TRUE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_TRUE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
}
{
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
layer->setOpaqueContentsRect(IntRect(150, 150, 100, 100));
this->resetLayerIterator();
this->visitLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(250, 250, 50, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(250, 250, 50, 50), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(0, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(100, 100, 100, 100)));
- EXPECT_FALSE(occlusion.occludedLayer(parent, IntRect(200, 200, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(0, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(100, 100, 100, 100)));
+ EXPECT_FALSE(occlusion.occludedLayer(parent, gfx::Rect(200, 200, 100, 100)));
}
}
};
@@ -1941,11 +1941,11 @@
typename Types::ContentLayerType* layer = this->createDrawingLayer(container, transform, FloatPoint(100, 100), IntSize(200, 200), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->enterLayer(layer, occlusion);
// The layer is rotated in 3d but without preserving 3d, so it only gets resized.
- EXPECT_RECT_EQ(IntRect(0, 0, 200, 200), occlusion.unoccludedLayerContentRect(layer, IntRect(0, 0, 200, 200)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 200, 200), occlusion.unoccludedLayerContentRect(layer, gfx::Rect(0, 0, 200, 200)));
}
};
@@ -1976,7 +1976,7 @@
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(child2, occlusion);
EXPECT_TRUE(occlusion.occlusionInScreenSpace().isEmpty());
EXPECT_TRUE(occlusion.occlusionInTargetSurface().isEmpty());
@@ -2009,10 +2009,10 @@
layer->setPreserves3D(true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->enterLayer(layer, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 200, 200), occlusion.unoccludedLayerContentRect(layer, IntRect(0, 0, 200, 200)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 200, 200), occlusion.unoccludedLayerContentRect(layer, gfx::Rect(0, 0, 200, 200)));
}
};
@@ -2041,12 +2041,12 @@
layer->setPreserves3D(true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->enterLayer(layer, occlusion);
// The bottom 11 pixel rows of this layer remain visible inside the container, after translation to the target surface. When translated back,
// this will include many more pixels but must include at least the bottom 11 rows.
- EXPECT_TRUE(occlusion.unoccludedLayerContentRect(layer, IntRect(0, 0, 500, 500)).contains(IntRect(0, 489, 500, 11)));
+ EXPECT_TRUE(occlusion.unoccludedLayerContentRect(layer, gfx::Rect(0, 0, 500, 500)).Contains(gfx::Rect(0, 489, 500, 11)));
}
};
@@ -2071,7 +2071,7 @@
layer->setPreserves3D(true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
// The |layer| is entirely behind the camera and should not occlude.
this->visitLayer(layer, occlusion);
@@ -2103,15 +2103,15 @@
layer->setPreserves3D(true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
// This is very close to the camera, so pixels in its visibleContentRect will actually go outside of the layer's clipRect.
// Ensure that those pixels don't occlude things outside the clipRect.
this->visitLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
}
};
@@ -2141,32 +2141,32 @@
EXPECT_FALSE(surface->drawOpacityIsAnimating());
EXPECT_TRUE(surface->renderSurface()->drawOpacityIsAnimating());
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(topmost, occlusion);
this->enterLayer(parent2, occlusion);
// This occlusion will affect all surfaces.
- EXPECT_RECT_EQ(IntRect(0, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent2, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent2, gfx::Rect(0, 0, 300, 300)));
this->leaveLayer(parent2, occlusion);
this->visitLayer(surfaceChild2, occlusion);
this->enterLayer(surfaceChild, occlusion);
- EXPECT_RECT_EQ(IntRect(100, 0, 100, 300), occlusion.unoccludedLayerContentRect(surfaceChild, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 0, 100, 300), occlusion.unoccludedLayerContentRect(surfaceChild, gfx::Rect(0, 0, 300, 300)));
this->leaveLayer(surfaceChild, occlusion);
this->enterLayer(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(200, 0, 50, 300), occlusion.unoccludedLayerContentRect(surface, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 0, 50, 300), occlusion.unoccludedLayerContentRect(surface, gfx::Rect(0, 0, 300, 300)));
this->leaveLayer(surface, occlusion);
this->enterContributingSurface(surface, occlusion);
// Occlusion within the surface is lost when leaving the animating surface.
- EXPECT_RECT_EQ(IntRect(0, 0, 250, 300), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 250, 300), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 300, 300)));
this->leaveContributingSurface(surface, occlusion);
this->visitLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
// Occlusion is not added for the animating |layer|.
- EXPECT_RECT_EQ(IntRect(0, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)));
}
};
@@ -2194,32 +2194,32 @@
EXPECT_FALSE(surface->drawOpacityIsAnimating());
EXPECT_TRUE(surface->renderSurface()->drawOpacityIsAnimating());
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(topmost, occlusion);
this->enterLayer(parent2, occlusion);
// This occlusion will affect all surfaces.
- EXPECT_RECT_EQ(IntRect(0, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)));
this->leaveLayer(parent2, occlusion);
this->visitLayer(surfaceChild2, occlusion);
this->enterLayer(surfaceChild, occlusion);
- EXPECT_RECT_EQ(IntRect(100, 0, 100, 300), occlusion.unoccludedLayerContentRect(surfaceChild, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 0, 100, 300), occlusion.unoccludedLayerContentRect(surfaceChild, gfx::Rect(0, 0, 300, 300)));
this->leaveLayer(surfaceChild, occlusion);
this->enterLayer(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(200, 0, 50, 300), occlusion.unoccludedLayerContentRect(surface, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(200, 0, 50, 300), occlusion.unoccludedLayerContentRect(surface, gfx::Rect(0, 0, 300, 300)));
this->leaveLayer(surface, occlusion);
this->enterContributingSurface(surface, occlusion);
// Occlusion within the surface is lost when leaving the animating surface.
- EXPECT_RECT_EQ(IntRect(0, 0, 250, 300), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 250, 300), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 300, 300)));
this->leaveContributingSurface(surface, occlusion);
this->visitLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
// Occlusion is not added for the animating |layer|.
- EXPECT_RECT_EQ(IntRect(0, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)));
}
};
@@ -2253,12 +2253,12 @@
EXPECT_TRUE(surfaceChild->drawTransformIsAnimating());
EXPECT_TRUE(surfaceChild->screenSpaceTransformIsAnimating());
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(surface2, occlusion);
this->enterContributingSurface(surface2, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 300), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 300), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
this->leaveContributingSurface(surface2, occlusion);
@@ -2266,53 +2266,53 @@
// surfaceChild2 is moving in screen space but not relative to its target, so occlusion should happen in its target space only.
// It also means that things occluding in screen space (e.g. surface2) cannot occlude this layer.
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 300), occlusion.unoccludedLayerContentRect(surfaceChild2, IntRect(0, 0, 100, 300)));
- EXPECT_FALSE(occlusion.occludedLayer(surfaceChild, IntRect(0, 0, 50, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 300), occlusion.unoccludedLayerContentRect(surfaceChild2, gfx::Rect(0, 0, 100, 300)));
+ EXPECT_FALSE(occlusion.occludedLayer(surfaceChild, gfx::Rect(0, 0, 50, 300)));
this->leaveLayer(surfaceChild2, occlusion);
this->enterLayer(surfaceChild, occlusion);
- EXPECT_FALSE(occlusion.occludedLayer(surfaceChild, IntRect(0, 0, 100, 300)));
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 300), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_FALSE(occlusion.occludedLayer(surfaceChild, gfx::Rect(0, 0, 100, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 300), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 300), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 300), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_RECT_EQ(IntRect(100, 0, 200, 300), occlusion.unoccludedLayerContentRect(surface, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 0, 200, 300), occlusion.unoccludedLayerContentRect(surface, gfx::Rect(0, 0, 300, 300)));
// The surfaceChild is occluded by the surfaceChild2, but is moving relative its target and the screen, so it
// can't be occluded.
- EXPECT_RECT_EQ(IntRect(0, 0, 200, 300), occlusion.unoccludedLayerContentRect(surfaceChild, IntRect(0, 0, 200, 300)));
- EXPECT_FALSE(occlusion.occludedLayer(surfaceChild, IntRect(0, 0, 50, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 200, 300), occlusion.unoccludedLayerContentRect(surfaceChild, gfx::Rect(0, 0, 200, 300)));
+ EXPECT_FALSE(occlusion.occludedLayer(surfaceChild, gfx::Rect(0, 0, 50, 300)));
this->leaveLayer(surfaceChild, occlusion);
this->enterLayer(surface, occlusion);
// The surfaceChild is moving in screen space but not relative to its target, so occlusion should happen in its target space only.
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 300), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 300), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 300), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 300), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_RECT_EQ(IntRect(100, 0, 200, 300), occlusion.unoccludedLayerContentRect(surface, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(100, 0, 200, 300), occlusion.unoccludedLayerContentRect(surface, gfx::Rect(0, 0, 300, 300)));
this->leaveLayer(surface, occlusion);
// The surface's owning layer is moving in screen space but not relative to its target, so occlusion should happen in its target space only.
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 300), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 300), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 300), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 300), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), occlusion.unoccludedLayerContentRect(surface, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), occlusion.unoccludedLayerContentRect(surface, gfx::Rect(0, 0, 300, 300)));
this->enterContributingSurface(surface, occlusion);
// The contributing |surface| is animating so it can't be occluded.
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 300), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 300), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 300, 300)));
this->leaveContributingSurface(surface, occlusion);
this->enterLayer(layer, occlusion);
// The |surface| is moving in the screen and in its target, so all occlusion within the surface is lost when leaving it.
- EXPECT_RECT_EQ(IntRect(50, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(50, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)));
this->leaveLayer(layer, occlusion);
this->enterLayer(parent, occlusion);
// The |layer| is animating in the screen and in its target, so no occlusion is added.
- EXPECT_RECT_EQ(IntRect(50, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, IntRect(0, 0, 300, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(50, 0, 250, 300), occlusion.unoccludedLayerContentRect(parent, gfx::Rect(0, 0, 300, 300)));
}
};
@@ -2336,14 +2336,14 @@
surface2->setOpaqueContentsRect(IntRect(0, 0, 200, 200));
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(surface2, occlusion);
this->visitContributingSurface(surface2, occlusion);
- EXPECT_RECT_EQ(IntRect(50, 50, 200, 200), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(50, 50, 200, 200), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(50, 50, 200, 200), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(50, 50, 200, 200), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
// Clear any stored occlusion.
@@ -2353,9 +2353,9 @@
this->visitLayer(surface, occlusion);
this->visitContributingSurface(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 400, 400), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 400, 400), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 400, 400), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 400, 400), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
}
};
@@ -2374,14 +2374,14 @@
surface->setOpaqueContentsRect(IntRect(0, 0, 400, 200));
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(surface, occlusion);
this->visitContributingSurface(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 200), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 200), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 200), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 200), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
}
};
@@ -2400,28 +2400,28 @@
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 100), IntSize(100, 100), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
// |topmost| occludes the replica, but not the surface itself.
this->visitLayer(topmost, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 100, 100, 100), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 100, 100, 100), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 100, 100, 100), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 100, 100, 100), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->visitLayer(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 200), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 200), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->enterContributingSurface(surface, occlusion);
// Surface is not occluded so it shouldn't think it is.
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 100, 100)));
}
};
@@ -2439,29 +2439,29 @@
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(100, 110), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
// |topmost| occludes the surface, but not the entire surface's replica.
this->visitLayer(topmost, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 110), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 110), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 110), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 110), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->visitLayer(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 110), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 110), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->enterContributingSurface(surface, occlusion);
// Surface is occluded, but only the top 10px of the replica.
- EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 100, 100)));
- EXPECT_RECT_EQ(IntRect(0, 10, 100, 90), occlusion.unoccludedContributingSurfaceContentRect(surface, true, IntRect(0, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 10, 100, 90), occlusion.unoccludedContributingSurfaceContentRect(surface, true, gfx::Rect(0, 0, 100, 100)));
}
};
@@ -2480,30 +2480,30 @@
typename Types::LayerType* overReplica = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 100), IntSize(50, 100), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
// These occlude the surface and replica differently, so we can test each one.
this->visitLayer(overReplica, occlusion);
this->visitLayer(overSurface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 200), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 200), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(2u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 200), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 200), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(2u, occlusion.occlusionInTargetSurface().rects().size());
this->visitLayer(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 200), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 200), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(2u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->enterContributingSurface(surface, occlusion);
// Surface and replica are occluded different amounts.
- EXPECT_RECT_EQ(IntRect(40, 0, 60, 100), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 100, 100)));
- EXPECT_RECT_EQ(IntRect(50, 0, 50, 100), occlusion.unoccludedContributingSurfaceContentRect(surface, true, IntRect(0, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(40, 0, 60, 100), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(50, 0, 50, 100), occlusion.unoccludedContributingSurfaceContentRect(surface, true, gfx::Rect(0, 0, 100, 100)));
}
};
@@ -2523,23 +2523,23 @@
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(100, 50), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(-100, -100, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(-100, -100, 1000, 1000));
// |topmost| occludes everything partially so we know occlusion is happening at all.
this->visitLayer(topmost, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 50), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->visitLayer(surfaceChild, occlusion);
// surfaceChild increases the occlusion in the screen by a narrow sliver.
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 60), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 60), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
// In its own surface, surfaceChild is at 0,0 as is its occlusion.
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
// The root layer always has a clipRect. So the parent of |surface| has a clipRect. However, the owning layer for |surface| does not
@@ -2549,20 +2549,20 @@
this->enterContributingSurface(surfaceChild, occlusion);
// The surfaceChild's parent does not have a clipRect as it owns a render surface. Make sure the unoccluded rect
// does not get clipped away inappropriately.
- EXPECT_RECT_EQ(IntRect(0, 40, 100, 10), occlusion.unoccludedContributingSurfaceContentRect(surfaceChild, false, IntRect(0, 0, 100, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 40, 100, 10), occlusion.unoccludedContributingSurfaceContentRect(surfaceChild, false, gfx::Rect(0, 0, 100, 50)));
this->leaveContributingSurface(surfaceChild, occlusion);
// When the surfaceChild's occlusion is transformed up to its parent, make sure it is not clipped away inappropriately also.
this->enterLayer(surface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 60), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 60), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 10, 100, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 10, 100, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->leaveLayer(surface, occlusion);
this->enterContributingSurface(surface, occlusion);
// The surface's parent does have a clipRect as it is the root layer.
- EXPECT_RECT_EQ(IntRect(0, 50, 100, 50), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 50, 100, 50), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 100, 100)));
}
};
@@ -2582,26 +2582,26 @@
{
// Make a viewport rect that is larger than the root layer.
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(surface, occlusion);
// The root layer always has a clipRect. So the parent of |surface| has a clipRect giving the surface itself a clipRect.
this->enterContributingSurface(surface, occlusion);
// Make sure the parent's clipRect clips the unoccluded region of the child surface.
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 200), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 100, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 200), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 100, 300)));
}
this->resetLayerIterator();
{
// Make a viewport rect that is smaller than the root layer.
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 100, 100));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 100, 100));
this->visitLayer(surface, occlusion);
// The root layer always has a clipRect. So the parent of |surface| has a clipRect giving the surface itself a clipRect.
this->enterContributingSurface(surface, occlusion);
// Make sure the viewport rect clips the unoccluded region of the child surface.
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 100), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 100, 300)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 100), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 100, 300)));
}
}
};
@@ -2623,23 +2623,23 @@
typename Types::LayerType* topmost = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), IntSize(100, 50), true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
// |topmost| occludes everything partially so we know occlusion is happening at all.
this->visitLayer(topmost, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 80, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 80, 50), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 80, 50), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 80, 50), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
// surfaceChild is not opaque and does not occlude, so we have a non-empty unoccluded area on surface.
this->visitLayer(surfaceChild, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 80, 50), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 80, 50), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(0u, occlusion.occlusionInTargetSurface().rects().size());
// The root layer always has a clipRect. So the parent of |surface| has a clipRect. However, the owning layer for |surface| does not
@@ -2648,13 +2648,13 @@
this->enterContributingSurface(surfaceChild, occlusion);
// The surfaceChild's parent does not have a clipRect as it owns a render surface.
- EXPECT_RECT_EQ(IntRect(0, 50, 80, 50), occlusion.unoccludedContributingSurfaceContentRect(surfaceChild, false, IntRect(0, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 50, 80, 50), occlusion.unoccludedContributingSurfaceContentRect(surfaceChild, false, gfx::Rect(0, 0, 100, 100)));
this->leaveContributingSurface(surfaceChild, occlusion);
this->visitLayer(surface, occlusion);
this->enterContributingSurface(surface, occlusion);
// The surface's parent does have a clipRect as it is the root layer.
- EXPECT_RECT_EQ(IntRect(0, 50, 80, 50), occlusion.unoccludedContributingSurfaceContentRect(surface, false, IntRect(0, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 50, 80, 50), occlusion.unoccludedContributingSurfaceContentRect(surface, false, gfx::Rect(0, 0, 100, 100)));
}
};
@@ -2692,8 +2692,8 @@
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
// These layers occlude pixels directly beside the filteredSurface. Because filtered surface blends pixels in a radius, it will
// need to see some of the pixels (up to radius far) underneath the occludingLayers.
@@ -2703,28 +2703,28 @@
this->visitLayer(occludingLayer2, occlusion);
this->visitLayer(occludingLayer1, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(5u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 150), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 150), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(5u, occlusion.occlusionInTargetSurface().rects().size());
// Everything outside the surface/replica is occluded but the surface/replica itself is not.
this->enterLayer(filteredSurface, occlusion);
- EXPECT_RECT_EQ(IntRect(1, 0, 99, 100), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(1, 0, 100, 100)));
- EXPECT_RECT_EQ(IntRect(0, 1, 100, 99), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(0, 1, 100, 100)));
- EXPECT_RECT_EQ(IntRect(0, 0, 99, 100), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(-1, 0, 100, 100)));
- EXPECT_RECT_EQ(IntRect(0, 0, 100, 99), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(0, -1, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(1, 0, 99, 100), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(1, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 1, 100, 99), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(0, 1, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 99, 100), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(-1, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 100, 99), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(0, -1, 100, 100)));
- EXPECT_RECT_EQ(IntRect(300 + 1, 0, 99, 100), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(300 + 1, 0, 100, 100)));
- EXPECT_RECT_EQ(IntRect(300 + 0, 1, 100, 99), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(300 + 0, 1, 100, 100)));
- EXPECT_RECT_EQ(IntRect(300 + 0, 0, 99, 100), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(300 - 1, 0, 100, 100)));
- EXPECT_RECT_EQ(IntRect(300 + 0, 0, 100, 99), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(300 + 0, -1, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(300 + 1, 0, 99, 100), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(300 + 1, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(300 + 0, 1, 100, 99), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(300 + 0, 1, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(300 + 0, 0, 99, 100), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(300 - 1, 0, 100, 100)));
+ EXPECT_RECT_EQ(gfx::Rect(300 + 0, 0, 100, 99), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(300 + 0, -1, 100, 100)));
this->leaveLayer(filteredSurface, occlusion);
// The filtered layer/replica does not occlude.
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(5u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(0u, occlusion.occlusionInTargetSurface().rects().size());
// The surface has a background blur, so it needs pixels that are currently considered occluded in order to be drawn. So the pixels
@@ -2732,54 +2732,50 @@
this->visitContributingSurface(filteredSurface, occlusion);
this->enterLayer(parent, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(5u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 150), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 150), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(5u, occlusion.occlusionInTargetSurface().rects().size());
- IntRect outsetRect;
- IntRect testRect;
+ gfx::Rect outsetRect;
+ gfx::Rect testRect;
// Nothing in the blur outsets for the filteredSurface is occluded.
- outsetRect = IntRect(50 - outsetLeft, 50 - outsetTop, 50 + outsetLeft + outsetRight, 50 + outsetTop + outsetBottom);
+ outsetRect = gfx::Rect(50 - outsetLeft, 50 - outsetTop, 50 + outsetLeft + outsetRight, 50 + outsetTop + outsetBottom);
testRect = outsetRect;
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
// Stuff outside the blur outsets is still occluded though.
testRect = outsetRect;
- testRect.expand(1, 0);
+ testRect.Inset(0, 0, -1, 0);
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
testRect = outsetRect;
- testRect.expand(0, 1);
+ testRect.Inset(0, 0, 0, -1);
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
testRect = outsetRect;
- testRect.move(-1, 0);
- testRect.expand(1, 0);
+ testRect.Inset(-1, 0, 0, 0);
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
testRect = outsetRect;
- testRect.move(0, -1);
- testRect.expand(0, 1);
+ testRect.Inset(0, -1, 0, 0);
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
// Nothing in the blur outsets for the filteredSurface's replica is occluded.
- outsetRect = IntRect(200 - outsetLeft, 50 - outsetTop, 50 + outsetLeft + outsetRight, 50 + outsetTop + outsetBottom);
+ outsetRect = gfx::Rect(200 - outsetLeft, 50 - outsetTop, 50 + outsetLeft + outsetRight, 50 + outsetTop + outsetBottom);
testRect = outsetRect;
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
// Stuff outside the blur outsets is still occluded though.
testRect = outsetRect;
- testRect.expand(1, 0);
+ testRect.Inset(0, 0, -1, 0);
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
testRect = outsetRect;
- testRect.expand(0, 1);
+ testRect.Inset(0, 0, 0, -1);
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
testRect = outsetRect;
- testRect.move(-1, 0);
- testRect.expand(1, 0);
+ testRect.Inset(-1, 0, 0, 0);
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
testRect = outsetRect;
- testRect.move(0, -1);
- testRect.expand(0, 1);
+ testRect.Inset(0, -1, 0, 0);
EXPECT_RECT_EQ(outsetRect, occlusion.unoccludedLayerContentRect(parent, testRect));
}
};
@@ -2815,13 +2811,13 @@
this->calcDrawEtc(root);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(occludingLayerAbove, occlusion);
- EXPECT_RECT_EQ(IntRect(100 / 2, 100 / 2, 50 / 2, 50 / 2), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(100 / 2, 100 / 2, 50 / 2, 50 / 2), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(100 / 2, 100 / 2, 50 / 2, 50 / 2), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(100 / 2, 100 / 2, 50 / 2, 50 / 2), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
this->visitLayer(filteredSurface2, occlusion);
@@ -2833,7 +2829,7 @@
ASSERT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
// Test expectations in the target.
- IntRect expectedOcclusion = IntRect(100 / 2 + outsetRight * 2, 100 / 2 + outsetBottom * 2, 50 / 2 - (outsetLeft + outsetRight) * 2, 50 / 2 - (outsetTop + outsetBottom) * 2);
+ gfx::Rect expectedOcclusion = gfx::Rect(100 / 2 + outsetRight * 2, 100 / 2 + outsetBottom * 2, 50 / 2 - (outsetLeft + outsetRight) * 2, 50 / 2 - (outsetTop + outsetBottom) * 2);
EXPECT_RECT_EQ(expectedOcclusion, occlusion.occlusionInTargetSurface().rects()[0]);
// Test expectations in the screen are the same as in the target, as the render surface is 1:1 with the screen.
@@ -2874,8 +2870,8 @@
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
// These layers occlude pixels directly beside the filteredSurface. Because filtered surface blends pixels in a radius, it will
// need to see some of the pixels (up to radius far) underneath the occludingLayers.
@@ -2885,28 +2881,28 @@
this->visitLayer(occludingLayer2, occlusion);
this->visitLayer(occludingLayer1, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(5u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 150), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 150), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(5u, occlusion.occlusionInTargetSurface().rects().size());
// Everything outside the surface/replica is occluded but the surface/replica itself is not.
this->enterLayer(filteredSurface, occlusion);
- EXPECT_RECT_EQ(IntRect(1, 0, 49, 50), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(1, 0, 50, 50)));
- EXPECT_RECT_EQ(IntRect(0, 1, 50, 49), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(0, 1, 50, 50)));
- EXPECT_RECT_EQ(IntRect(0, 0, 49, 50), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(-1, 0, 50, 50)));
- EXPECT_RECT_EQ(IntRect(0, 0, 50, 49), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(0, -1, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(1, 0, 49, 50), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(1, 0, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 1, 50, 49), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(0, 1, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 49, 50), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(-1, 0, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 50, 49), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(0, -1, 50, 50)));
- EXPECT_RECT_EQ(IntRect(150 + 1, 0, 49, 50), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(150 + 1, 0, 50, 50)));
- EXPECT_RECT_EQ(IntRect(150 + 0, 1, 50, 49), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(150 + 0, 1, 50, 50)));
- EXPECT_RECT_EQ(IntRect(150 + 0, 0, 49, 50), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(150 - 1, 0, 50, 50)));
- EXPECT_RECT_EQ(IntRect(150 + 0, 0, 50, 49), occlusion.unoccludedLayerContentRect(filteredSurface, IntRect(150 + 0, -1, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(150 + 1, 0, 49, 50), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(150 + 1, 0, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(150 + 0, 1, 50, 49), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(150 + 0, 1, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(150 + 0, 0, 49, 50), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(150 - 1, 0, 50, 50)));
+ EXPECT_RECT_EQ(gfx::Rect(150 + 0, 0, 50, 49), occlusion.unoccludedLayerContentRect(filteredSurface, gfx::Rect(150 + 0, -1, 50, 50)));
this->leaveLayer(filteredSurface, occlusion);
// The filtered layer/replica does not occlude.
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(5u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(0, 0, 0, 0), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 0, 0), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(0u, occlusion.occlusionInTargetSurface().rects().size());
// The surface has a background blur, so it needs pixels that are currently considered occluded in order to be drawn. So the pixels
@@ -2914,55 +2910,51 @@
this->visitContributingSurface(filteredSurface, occlusion);
this->enterContributingSurface(clippingSurface, occlusion);
- EXPECT_RECT_EQ(IntRect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(0, 0, 300, 150), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(5u, occlusion.occlusionInScreenSpace().rects().size());
- IntRect outsetRect;
- IntRect clippedOutsetRect;
- IntRect testRect;
+ gfx::Rect outsetRect;
+ gfx::Rect clippedOutsetRect;
+ gfx::Rect testRect;
// Nothing in the (clipped) blur outsets for the filteredSurface is occluded.
- outsetRect = IntRect(50 - outsetLeft, 50 - outsetTop, 50 + outsetLeft + outsetRight, 50 + outsetTop + outsetBottom);
- clippedOutsetRect = intersection(outsetRect, IntRect(0 - outsetLeft, 0 - outsetTop, 300 + outsetLeft + outsetRight, 70 + outsetTop + outsetBottom));
+ outsetRect = gfx::Rect(50 - outsetLeft, 50 - outsetTop, 50 + outsetLeft + outsetRight, 50 + outsetTop + outsetBottom);
+ clippedOutsetRect = gfx::IntersectRects(outsetRect, gfx::Rect(0 - outsetLeft, 0 - outsetTop, 300 + outsetLeft + outsetRight, 70 + outsetTop + outsetBottom));
testRect = outsetRect;
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
// Stuff outside the (clipped) blur outsets is still occluded though.
testRect = outsetRect;
- testRect.expand(1, 0);
+ testRect.Inset(0, 0, -1, 0);
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
testRect = outsetRect;
- testRect.expand(0, 1);
+ testRect.Inset(0, 0, 0, -1);
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
testRect = outsetRect;
- testRect.move(-1, 0);
- testRect.expand(1, 0);
+ testRect.Inset(-1, 0, 0, 0);
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
testRect = outsetRect;
- testRect.move(0, -1);
- testRect.expand(0, 1);
+ testRect.Inset(0, -1, 0, 0);
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
// Nothing in the (clipped) blur outsets for the filteredSurface's replica is occluded.
- outsetRect = IntRect(200 - outsetLeft, 50 - outsetTop, 50 + outsetLeft + outsetRight, 50 + outsetTop + outsetBottom);
- clippedOutsetRect = intersection(outsetRect, IntRect(0 - outsetLeft, 0 - outsetTop, 300 + outsetLeft + outsetRight, 70 + outsetTop + outsetBottom));
+ outsetRect = gfx::Rect(200 - outsetLeft, 50 - outsetTop, 50 + outsetLeft + outsetRight, 50 + outsetTop + outsetBottom);
+ clippedOutsetRect = gfx::IntersectRects(outsetRect, gfx::Rect(0 - outsetLeft, 0 - outsetTop, 300 + outsetLeft + outsetRight, 70 + outsetTop + outsetBottom));
testRect = outsetRect;
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
// Stuff outside the (clipped) blur outsets is still occluded though.
testRect = outsetRect;
- testRect.expand(1, 0);
+ testRect.Inset(0, 0, -1, 0);
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
testRect = outsetRect;
- testRect.expand(0, 1);
+ testRect.Inset(0, 0, 0, -1);
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
testRect = outsetRect;
- testRect.move(-1, 0);
- testRect.expand(1, 0);
+ testRect.Inset(-1, 0, 0, 0);
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
testRect = outsetRect;
- testRect.move(0, -1);
- testRect.expand(0, 1);
+ testRect.Inset(0, -1, 0, 0);
EXPECT_RECT_EQ(clippedOutsetRect, occlusion.unoccludedLayerContentRect(clippingSurface, testRect));
}
};
@@ -2994,8 +2986,8 @@
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
// The surface has a background blur, so it blurs non-opaque pixels below it.
this->visitLayer(filteredSurface, occlusion);
@@ -3006,10 +2998,10 @@
// The layers behind the surface are not blurred, and their occlusion does not change, until we leave the surface.
// So it should not be modified by the filter here.
- IntRect occlusionBehindSurface = IntRect(60, 60, 30, 30);
- IntRect occlusionBehindReplica = IntRect(210, 60, 30, 30);
+ gfx::Rect occlusionBehindSurface = gfx::Rect(60, 60, 30, 30);
+ gfx::Rect occlusionBehindReplica = gfx::Rect(210, 60, 30, 30);
- IntRect expectedOpaqueBounds = unionRect(occlusionBehindSurface, occlusionBehindReplica);
+ gfx::Rect expectedOpaqueBounds = gfx::UnionRects(occlusionBehindSurface, occlusionBehindReplica);
EXPECT_RECT_EQ(expectedOpaqueBounds, occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(2u, occlusion.occlusionInScreenSpace().rects().size());
EXPECT_RECT_EQ(expectedOpaqueBounds, occlusion.occlusionInTargetSurface().bounds());
@@ -3044,8 +3036,8 @@
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(aboveReplicaLayer, occlusion);
this->visitLayer(aboveSurfaceLayer, occlusion);
@@ -3055,10 +3047,10 @@
this->visitContributingSurface(filteredSurface, occlusion);
// The filter is completely occluded, so it should not blur anything and reduce any occlusion.
- IntRect occlusionAboveSurface = IntRect(50, 50, 50, 50);
- IntRect occlusionAboveReplica = IntRect(200, 50, 50, 50);
+ gfx::Rect occlusionAboveSurface = gfx::Rect(50, 50, 50, 50);
+ gfx::Rect occlusionAboveReplica = gfx::Rect(200, 50, 50, 50);
- IntRect expectedOpaqueBounds = unionRect(occlusionAboveSurface, occlusionAboveReplica);
+ gfx::Rect expectedOpaqueBounds = gfx::UnionRects(occlusionAboveSurface, occlusionAboveReplica);
EXPECT_RECT_EQ(expectedOpaqueBounds, occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(2u, occlusion.occlusionInScreenSpace().rects().size());
EXPECT_RECT_EQ(expectedOpaqueBounds, occlusion.occlusionInTargetSurface().bounds());
@@ -3099,8 +3091,8 @@
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
this->visitLayer(besideReplicaLayer, occlusion);
this->visitLayer(besideSurfaceLayer, occlusion);
@@ -3115,24 +3107,24 @@
// This means it will push back the occlusion that touches the unoccluded part (occlusionAbove___), but it will not
// touch occlusionBeside____ since that is not beside the unoccluded part of the surface, even though it is beside
// the occluded part of the surface.
- IntRect occlusionAboveSurface = IntRect(70 + outsetRight, 50, 30 - outsetRight, 50);
- IntRect occlusionAboveReplica = IntRect(200, 50, 30 - outsetLeft, 50);
- IntRect occlusionBesideSurface = IntRect(90, 40, 10, 10);
- IntRect occlusionBesideReplica = IntRect(200, 40, 10, 10);
+ gfx::Rect occlusionAboveSurface = gfx::Rect(70 + outsetRight, 50, 30 - outsetRight, 50);
+ gfx::Rect occlusionAboveReplica = gfx::Rect(200, 50, 30 - outsetLeft, 50);
+ gfx::Rect occlusionBesideSurface = gfx::Rect(90, 40, 10, 10);
+ gfx::Rect occlusionBesideReplica = gfx::Rect(200, 40, 10, 10);
Region expectedOcclusion;
- expectedOcclusion.unite(occlusionAboveSurface);
- expectedOcclusion.unite(occlusionAboveReplica);
- expectedOcclusion.unite(occlusionBesideSurface);
- expectedOcclusion.unite(occlusionBesideReplica);
+ expectedOcclusion.unite(cc::IntRect(occlusionAboveSurface));
+ expectedOcclusion.unite(cc::IntRect(occlusionAboveReplica));
+ expectedOcclusion.unite(cc::IntRect(occlusionBesideSurface));
+ expectedOcclusion.unite(cc::IntRect(occlusionBesideReplica));
ASSERT_EQ(expectedOcclusion.rects().size(), occlusion.occlusionInTargetSurface().rects().size());
ASSERT_EQ(expectedOcclusion.rects().size(), occlusion.occlusionInScreenSpace().rects().size());
for (size_t i = 0; i < expectedOcclusion.rects().size(); ++i) {
- IntRect expectedRect = expectedOcclusion.rects()[i];
- IntRect screenRect = occlusion.occlusionInScreenSpace().rects()[i];
- IntRect targetRect = occlusion.occlusionInTargetSurface().rects()[i];
+ cc::IntRect expectedRect = expectedOcclusion.rects()[i];
+ cc::IntRect screenRect = occlusion.occlusionInScreenSpace().rects()[i];
+ cc::IntRect targetRect = occlusion.occlusionInTargetSurface().rects()[i];
EXPECT_EQ(expectedRect, screenRect);
EXPECT_EQ(expectedRect, targetRect);
}
@@ -3155,24 +3147,24 @@
typename Types::LayerType* small = this->createDrawingLayer(parent, this->identityMatrix, FloatPoint(0, 0), belowTrackingSize, true);
this->calcDrawEtc(parent);
- TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(IntRect(0, 0, 1000, 1000));
- occlusion.setLayerClipRect(IntRect(0, 0, 1000, 1000));
+ TestOcclusionTrackerWithClip<typename Types::LayerType, typename Types::RenderSurfaceType> occlusion(gfx::Rect(0, 0, 1000, 1000));
+ occlusion.setLayerClipRect(gfx::Rect(0, 0, 1000, 1000));
occlusion.setMinimumTrackingSize(trackingSize);
// The small layer is not tracked because it is too small.
this->visitLayer(small, occlusion);
- EXPECT_RECT_EQ(IntRect(), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(0u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(0u, occlusion.occlusionInTargetSurface().rects().size());
// The large layer is tracked as it is large enough.
this->visitLayer(large, occlusion);
- EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInScreenSpace().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(IntPoint(), trackingSize), occlusion.occlusionInScreenSpace().bounds());
EXPECT_EQ(1u, occlusion.occlusionInScreenSpace().rects().size());
- EXPECT_RECT_EQ(IntRect(IntPoint(), trackingSize), occlusion.occlusionInTargetSurface().bounds());
+ EXPECT_RECT_EQ(gfx::Rect(IntPoint(), trackingSize), occlusion.occlusionInTargetSurface().bounds());
EXPECT_EQ(1u, occlusion.occlusionInTargetSurface().rects().size());
}
};