| Index: cc/occlusion_tracker.cc
|
| diff --git a/cc/occlusion_tracker.cc b/cc/occlusion_tracker.cc
|
| index 513b330ce62718566053dc15ddb57e59c78b20fe..4ea3d3cff553a072df89ef97178ce9c49e17e110 100644
|
| --- a/cc/occlusion_tracker.cc
|
| +++ b/cc/occlusion_tracker.cc
|
| @@ -14,7 +14,6 @@
|
| #include "ui/gfx/rect_conversions.h"
|
|
|
| using namespace std;
|
| -using WebKit::WebTransformationMatrix;
|
|
|
| namespace cc {
|
|
|
| @@ -121,7 +120,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::finishedRenderTarget(co
|
| }
|
|
|
| template<typename RenderSurfaceType>
|
| -static inline Region transformSurfaceOpaqueRegion(const RenderSurfaceType* surface, const Region& region, const WebTransformationMatrix& transform)
|
| +static inline Region transformSurfaceOpaqueRegion(const RenderSurfaceType* surface, const Region& region, const gfx::Transform& transform)
|
| {
|
| // Verify that rects within the |surface| will remain rects in its target surface after applying |transform|. If this is true, then
|
| // apply |transform| to each rect within |region| in order to transform the entire Region.
|
| @@ -182,7 +181,7 @@ static inline void reduceOcclusion(const gfx::Rect& affectedArea, const gfx::Rec
|
| }
|
|
|
| template<typename LayerType>
|
| -static void reduceOcclusionBelowSurface(LayerType* contributingLayer, const gfx::Rect& surfaceRect, const WebTransformationMatrix& surfaceTransform, LayerType* renderTarget, Region& occlusionInTarget, Region& occlusionInScreen)
|
| +static void reduceOcclusionBelowSurface(LayerType* contributingLayer, const gfx::Rect& surfaceRect, const gfx::Transform& surfaceTransform, LayerType* renderTarget, Region& occlusionInTarget, Region& occlusionInScreen)
|
| {
|
| if (surfaceRect.IsEmpty())
|
| return;
|
| @@ -249,7 +248,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::leaveToRenderTarget(con
|
|
|
| // FIXME: Remove usePaintTracking when paint tracking is on for paint culling.
|
| 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, std::vector<gfx::Rect>* nonOccludingScreenSpaceRects)
|
| +static inline void addOcclusionBehindLayer(Region& region, const LayerType* layer, const gfx::Transform& transform, const Region& opaqueContents, const gfx::Rect& clipRectInTarget, const gfx::Size& minimumTrackingSize, std::vector<gfx::Rect>* occludingScreenSpaceRects, std::vector<gfx::Rect>* nonOccludingScreenSpaceRects)
|
| {
|
| DCHECK(layer->visibleContentRect().Contains(opaqueContents.bounds()));
|
|
|
| @@ -309,7 +308,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::markOccludedBehindLayer
|
| // remain rectilinear, then we don't add any occlusion in screen space.
|
|
|
| if (layerTransformsToScreenKnown(layer)) {
|
| - WebTransformationMatrix targetToScreenTransform = m_stack.back().target->renderSurface()->screenSpaceTransform();
|
| + gfx::Transform targetToScreenTransform = m_stack.back().target->renderSurface()->screenSpaceTransform();
|
| bool clipped;
|
| gfx::QuadF clipQuadInScreen = MathUtil::mapQuad(targetToScreenTransform, gfx::QuadF(clipRectInTarget), clipped);
|
| // FIXME: Find a rect interior to the transformed clip quad.
|
| @@ -320,7 +319,7 @@ void OcclusionTrackerBase<LayerType, RenderSurfaceType>::markOccludedBehindLayer
|
| }
|
| }
|
|
|
| -static inline bool testContentRectOccluded(const gfx::Rect& contentRect, const WebTransformationMatrix& contentSpaceTransform, const gfx::Rect& clipRectInTarget, const Region& occlusion)
|
| +static inline bool testContentRectOccluded(const gfx::Rect& contentRect, const gfx::Transform& contentSpaceTransform, const gfx::Rect& clipRectInTarget, const Region& occlusion)
|
| {
|
| gfx::RectF transformedRect = MathUtil::mapClippedRect(contentSpaceTransform, gfx::RectF(contentRect));
|
| // Take the gfx::ToEnclosingRect, as we want to include partial pixels in the test.
|
| @@ -329,7 +328,7 @@ static inline bool testContentRectOccluded(const gfx::Rect& contentRect, const W
|
| }
|
|
|
| template<typename LayerType, typename RenderSurfaceType>
|
| -bool OcclusionTrackerBase<LayerType, RenderSurfaceType>::occluded(const LayerType* renderTarget, const gfx::Rect& contentRect, const WebKit::WebTransformationMatrix& drawTransform, bool implDrawTransformIsUnknown, const gfx::Rect& clippedRectInTarget, bool* hasOcclusionFromOutsideTargetSurface) const
|
| +bool OcclusionTrackerBase<LayerType, RenderSurfaceType>::occluded(const LayerType* renderTarget, const gfx::Rect& contentRect, const gfx::Transform& drawTransform, bool implDrawTransformIsUnknown, const gfx::Rect& clippedRectInTarget, bool* hasOcclusionFromOutsideTargetSurface) const
|
| {
|
| if (hasOcclusionFromOutsideTargetSurface)
|
| *hasOcclusionFromOutsideTargetSurface = false;
|
| @@ -368,21 +367,21 @@ static inline gfx::Rect rectSubtractRegion(const gfx::Rect& rect, const Region&
|
| return rectRegion.bounds();
|
| }
|
|
|
| -static inline gfx::Rect computeUnoccludedContentRect(const gfx::Rect& contentRect, const WebTransformationMatrix& contentSpaceTransform, const gfx::Rect& clipRectInTarget, const Region& occlusion)
|
| +static inline gfx::Rect computeUnoccludedContentRect(const gfx::Rect& contentRect, const gfx::Transform& contentSpaceTransform, const gfx::Rect& clipRectInTarget, const Region& occlusion)
|
| {
|
| - if (!contentSpaceTransform.isInvertible())
|
| + if (!contentSpaceTransform.IsInvertible())
|
| return contentRect;
|
|
|
| // Take the ToEnclosingRect at each step, as we want to contain any unoccluded partial pixels in the resulting Rect.
|
| 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(), gfx::RectF(shrunkRect)));
|
| + gfx::Rect unoccludedRect = gfx::ToEnclosingRect(MathUtil::projectClippedRect(MathUtil::inverse(contentSpaceTransform), 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);
|
| }
|
|
|
| template<typename LayerType, typename RenderSurfaceType>
|
| -gfx::Rect OcclusionTrackerBase<LayerType, RenderSurfaceType>::unoccludedContentRect(const LayerType* renderTarget, const gfx::Rect& contentRect, const WebKit::WebTransformationMatrix& drawTransform, bool implDrawTransformIsUnknown, const gfx::Rect& clippedRectInTarget, bool* hasOcclusionFromOutsideTargetSurface) const
|
| +gfx::Rect OcclusionTrackerBase<LayerType, RenderSurfaceType>::unoccludedContentRect(const LayerType* renderTarget, const gfx::Rect& contentRect, const gfx::Transform& drawTransform, bool implDrawTransformIsUnknown, const gfx::Rect& clippedRectInTarget, bool* hasOcclusionFromOutsideTargetSurface) const
|
| {
|
| DCHECK(!m_stack.empty());
|
| if (m_stack.empty())
|
| @@ -439,8 +438,8 @@ gfx::Rect OcclusionTrackerBase<LayerType, RenderSurfaceType>::unoccludedContribu
|
| // found just below the top of the stack (if it exists).
|
| bool hasOcclusion = m_stack.size() > 1;
|
|
|
| - const WebTransformationMatrix& transformToScreen = forReplica ? surface->replicaScreenSpaceTransform() : surface->screenSpaceTransform();
|
| - const WebTransformationMatrix& transformToTarget = forReplica ? surface->replicaDrawTransform() : surface->drawTransform();
|
| + const gfx::Transform& transformToScreen = forReplica ? surface->replicaScreenSpaceTransform() : surface->screenSpaceTransform();
|
| + const gfx::Transform& transformToTarget = forReplica ? surface->replicaDrawTransform() : surface->drawTransform();
|
|
|
| gfx::Rect unoccludedInScreen = contentRect;
|
| if (surfaceTransformsToScreenKnown(surface)) {
|
|
|