diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 18:15:58 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 18:15:58 +0000 |
commit | aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53 (patch) | |
tree | 24c9af166977bbf8f25aa5b129defb35f3f8ec05 /cc/occlusion_tracker.cc | |
parent | 33432d8c37e3b929c60097c1eb7a53b13f364fb5 (diff) | |
download | chromium_src-aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53.zip chromium_src-aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53.tar.gz chromium_src-aad0a007e1cd343892d7b13ce5ea8d90e8ef7f53.tar.bz2 |
cc: Use gfx:: Geometry types for positions, bounds, and related things.
This covers layers, layer tree hosts, and related classes. *phew*
I intentionally avoided anything to do with scrolling or page scale. Those
should be changed to be Vectors and need a bit more thought. This change
should be pretty mindless.
It converts to gfx Rect, Size, Vector, and Point classes. No change is
made for FloatPoint3D or FloatQuad yet.
I've added cc/geometry.h as a place for free functions that don't exist
on gfx types yet, and that we should port over in the future.
No change in behaviour; covered by existing tests.
BUG=147395
R=enne
Review URL: https://codereview.chromium.org/11264056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/occlusion_tracker.cc')
-rw-r--r-- | cc/occlusion_tracker.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cc/occlusion_tracker.cc b/cc/occlusion_tracker.cc index abe2661..b2326d4 100644 --- a/cc/occlusion_tracker.cc +++ b/cc/occlusion_tracker.cc @@ -133,7 +133,7 @@ static inline Region transformSurfaceOpaqueRegion(const RenderSurfaceType* surfa for (size_t i = 0; i < rects.size(); ++i) { // We've already checked for clipping in the mapQuad call above, these calls should not clip anything further. gfx::Rect transformedRect = gfx::ToEnclosedRect(MathUtil::mapClippedRect(transform, cc::FloatRect(rects[i]))); - if (!surface->clipRect().isEmpty()) + if (!surface->clipRect().IsEmpty()) transformedRect.Intersect(surface->clipRect()); transformedRegion.unite(cc::IntRect(transformedRect)); } @@ -185,7 +185,7 @@ static void reduceOcclusionBelowSurface(LayerType* contributingLayer, const gfx: return; gfx::Rect boundsInTarget = gfx::ToEnclosingRect(MathUtil::mapClippedRect(surfaceTransform, cc::FloatRect(surfaceRect))); - if (!contributingLayer->renderSurface()->clipRect().isEmpty()) + if (!contributingLayer->renderSurface()->clipRect().IsEmpty()) boundsInTarget.Intersect(contributingLayer->renderSurface()->clipRect()); int outsetTop, outsetRight, outsetBottom, outsetLeft; @@ -248,7 +248,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::leaveToRenderTarget(con template<typename LayerType> static inline void addOcclusionBehindLayer(Region& region, const LayerType* layer, const WebTransformationMatrix& transform, const Region& opaqueContents, const gfx::Rect& clipRectInTarget, const gfx::Size& minimumTrackingSize, std::vector<gfx::Rect>* occludingScreenSpaceRects) { - DCHECK(layer->visibleContentRect().contains(opaqueContents.bounds())); + DCHECK(layer->visibleContentRect().Contains(cc::IntRect(opaqueContents.bounds()))); bool clipped; FloatQuad visibleTransformedQuad = MathUtil::mapQuad(transform, FloatQuad(layer->visibleContentRect()), clipped); @@ -308,7 +308,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::markOccludedBehindLayer static inline bool testContentRectOccluded(const gfx::Rect& contentRect, const WebTransformationMatrix& contentSpaceTransform, const gfx::Rect& clipRectInTarget, const Region& occlusion) { - gfx::RectF transformedRect = MathUtil::mapClippedRect(contentSpaceTransform, cc::FloatRect(contentRect)); + gfx::RectF transformedRect = MathUtil::mapClippedRect(contentSpaceTransform, gfx::RectF(contentRect)); // Take the gfx::ToEnclosingRect, as we want to include partial pixels in the test. gfx::Rect targetRect = gfx::IntersectRects(gfx::ToEnclosingRect(transformedRect), clipRectInTarget); return targetRect.IsEmpty() || occlusion.contains(cc::IntRect(targetRect)); @@ -358,9 +358,9 @@ static inline gfx::Rect computeUnoccludedContentRect(const gfx::Rect& contentRec return contentRect; // Take the ToEnclosingRect at each step, as we want to contain any unoccluded partial pixels in the resulting Rect. - FloatRect transformedRect = MathUtil::mapClippedRect(contentSpaceTransform, cc::FloatRect(contentRect)); + gfx::RectF transformedRect = MathUtil::mapClippedRect(contentSpaceTransform, gfx::RectF(contentRect)); gfx::Rect shrunkRect = rectSubtractRegion(gfx::IntersectRects(gfx::ToEnclosingRect(transformedRect), clipRectInTarget), occlusion); - gfx::Rect unoccludedRect = gfx::ToEnclosingRect(MathUtil::projectClippedRect(contentSpaceTransform.inverse(), cc::FloatRect(shrunkRect))); + gfx::Rect unoccludedRect = gfx::ToEnclosingRect(MathUtil::projectClippedRect(contentSpaceTransform.inverse(), gfx::RectF(shrunkRect))); // The rect back in content space is a bounding box and may extend outside of the original contentRect, so clamp it to the contentRectBounds. return gfx::IntersectRects(unoccludedRect, contentRect); } |