| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/occlusion_tracker.h" | 5 #include "cc/occlusion_tracker.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "cc/layer.h" | 9 #include "cc/layer.h" |
| 10 #include "cc/layer_impl.h" | 10 #include "cc/layer_impl.h" |
| 11 #include "cc/math_util.h" | 11 #include "cc/math_util.h" |
| 12 #include "cc/overdraw_metrics.h" | 12 #include "cc/overdraw_metrics.h" |
| 13 #include "ui/gfx/quad_f.h" | 13 #include "ui/gfx/quad_f.h" |
| 14 #include "ui/gfx/rect_conversions.h" | 14 #include "ui/gfx/rect_conversions.h" |
| 15 | 15 |
| 16 using namespace std; | 16 using namespace std; |
| 17 using WebKit::WebTransformationMatrix; | |
| 18 | 17 |
| 19 namespace cc { | 18 namespace cc { |
| 20 | 19 |
| 21 template<typename LayerType, typename RenderSurfaceType> | 20 template<typename LayerType, typename RenderSurfaceType> |
| 22 OcclusionTrackerBase<LayerType, RenderSurfaceType>::OcclusionTrackerBase(gfx::Re
ct rootTargetRect, bool recordMetricsForFrame) | 21 OcclusionTrackerBase<LayerType, RenderSurfaceType>::OcclusionTrackerBase(gfx::Re
ct rootTargetRect, bool recordMetricsForFrame) |
| 23 : m_rootTargetRect(rootTargetRect) | 22 : m_rootTargetRect(rootTargetRect) |
| 24 , m_overdrawMetrics(OverdrawMetrics::create(recordMetricsForFrame)) | 23 , m_overdrawMetrics(OverdrawMetrics::create(recordMetricsForFrame)) |
| 25 , m_occludingScreenSpaceRects(0) | 24 , m_occludingScreenSpaceRects(0) |
| 26 , m_nonOccludingScreenSpaceRects(0) | 25 , m_nonOccludingScreenSpaceRects(0) |
| 27 { | 26 { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 m_stack.back().occlusionInTarget.Clear(); | 113 m_stack.back().occlusionInTarget.Clear(); |
| 115 } else { | 114 } else { |
| 116 if (!surfaceTransformsToTargetKnown(surface)) | 115 if (!surfaceTransformsToTargetKnown(surface)) |
| 117 m_stack.back().occlusionInTarget.Clear(); | 116 m_stack.back().occlusionInTarget.Clear(); |
| 118 if (!surfaceTransformsToScreenKnown(surface)) | 117 if (!surfaceTransformsToScreenKnown(surface)) |
| 119 m_stack.back().occlusionInScreen.Clear(); | 118 m_stack.back().occlusionInScreen.Clear(); |
| 120 } | 119 } |
| 121 } | 120 } |
| 122 | 121 |
| 123 template<typename RenderSurfaceType> | 122 template<typename RenderSurfaceType> |
| 124 static inline Region transformSurfaceOpaqueRegion(const RenderSurfaceType* surfa
ce, const Region& region, const WebTransformationMatrix& transform) | 123 static inline Region transformSurfaceOpaqueRegion(const RenderSurfaceType* surfa
ce, const Region& region, const gfx::Transform& transform) |
| 125 { | 124 { |
| 126 // Verify that rects within the |surface| will remain rects in its target su
rface after applying |transform|. If this is true, then | 125 // Verify that rects within the |surface| will remain rects in its target su
rface after applying |transform|. If this is true, then |
| 127 // apply |transform| to each rect within |region| in order to transform the
entire Region. | 126 // apply |transform| to each rect within |region| in order to transform the
entire Region. |
| 128 | 127 |
| 129 bool clipped; | 128 bool clipped; |
| 130 gfx::QuadF transformedBoundsQuad = MathUtil::mapQuad(transform, gfx::QuadF(r
egion.bounds()), clipped); | 129 gfx::QuadF transformedBoundsQuad = MathUtil::mapQuad(transform, gfx::QuadF(r
egion.bounds()), clipped); |
| 131 // FIXME: Find a rect interior to each transformed quad. | 130 // FIXME: Find a rect interior to each transformed quad. |
| 132 if (clipped || !transformedBoundsQuad.IsRectilinear()) | 131 if (clipped || !transformedBoundsQuad.IsRectilinear()) |
| 133 return Region(); | 132 return Region(); |
| 134 | 133 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 int shrinkRight = occlusionRect.right() == affectedArea.right() ? 0 : -e
xpandedPixel.x(); | 174 int shrinkRight = occlusionRect.right() == affectedArea.right() ? 0 : -e
xpandedPixel.x(); |
| 176 int shrinkBottom = occlusionRect.bottom() == affectedArea.bottom() ? 0 :
-expandedPixel.y(); | 175 int shrinkBottom = occlusionRect.bottom() == affectedArea.bottom() ? 0 :
-expandedPixel.y(); |
| 177 | 176 |
| 178 occlusionRect.Inset(shrinkLeft, shrinkTop, shrinkRight, shrinkBottom); | 177 occlusionRect.Inset(shrinkLeft, shrinkTop, shrinkRight, shrinkBottom); |
| 179 | 178 |
| 180 occlusion.Union(occlusionRect); | 179 occlusion.Union(occlusionRect); |
| 181 } | 180 } |
| 182 } | 181 } |
| 183 | 182 |
| 184 template<typename LayerType> | 183 template<typename LayerType> |
| 185 static void reduceOcclusionBelowSurface(LayerType* contributingLayer, const gfx:
:Rect& surfaceRect, const WebTransformationMatrix& surfaceTransform, LayerType*
renderTarget, Region& occlusionInTarget, Region& occlusionInScreen) | 184 static void reduceOcclusionBelowSurface(LayerType* contributingLayer, const gfx:
:Rect& surfaceRect, const gfx::Transform& surfaceTransform, LayerType* renderTar
get, Region& occlusionInTarget, Region& occlusionInScreen) |
| 186 { | 185 { |
| 187 if (surfaceRect.IsEmpty()) | 186 if (surfaceRect.IsEmpty()) |
| 188 return; | 187 return; |
| 189 | 188 |
| 190 gfx::Rect boundsInTarget = gfx::ToEnclosingRect(MathUtil::mapClippedRect(sur
faceTransform, gfx::RectF(surfaceRect))); | 189 gfx::Rect boundsInTarget = gfx::ToEnclosingRect(MathUtil::mapClippedRect(sur
faceTransform, gfx::RectF(surfaceRect))); |
| 191 if (!contributingLayer->renderSurface()->clipRect().IsEmpty()) | 190 if (!contributingLayer->renderSurface()->clipRect().IsEmpty()) |
| 192 boundsInTarget.Intersect(contributingLayer->renderSurface()->clipRect())
; | 191 boundsInTarget.Intersect(contributingLayer->renderSurface()->clipRect())
; |
| 193 | 192 |
| 194 int outsetTop, outsetRight, outsetBottom, outsetLeft; | 193 int outsetTop, outsetRight, outsetBottom, outsetLeft; |
| 195 contributingLayer->backgroundFilters().getOutsets(outsetTop, outsetRight, ou
tsetBottom, outsetLeft); | 194 contributingLayer->backgroundFilters().getOutsets(outsetTop, outsetRight, ou
tsetBottom, outsetLeft); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 241 |
| 243 if (oldTarget->backgroundFilters().hasFilterThatMovesPixels()) { | 242 if (oldTarget->backgroundFilters().hasFilterThatMovesPixels()) { |
| 244 reduceOcclusionBelowSurface(oldTarget, unoccludedSurfaceRect, oldSurface
->drawTransform(), newTarget, m_stack.back().occlusionInTarget, m_stack.back().o
cclusionInScreen); | 243 reduceOcclusionBelowSurface(oldTarget, unoccludedSurfaceRect, oldSurface
->drawTransform(), newTarget, m_stack.back().occlusionInTarget, m_stack.back().o
cclusionInScreen); |
| 245 if (oldTarget->hasReplica()) | 244 if (oldTarget->hasReplica()) |
| 246 reduceOcclusionBelowSurface(oldTarget, unoccludedReplicaRect, oldSur
face->replicaDrawTransform(), newTarget, m_stack.back().occlusionInTarget, m_sta
ck.back().occlusionInScreen); | 245 reduceOcclusionBelowSurface(oldTarget, unoccludedReplicaRect, oldSur
face->replicaDrawTransform(), newTarget, m_stack.back().occlusionInTarget, m_sta
ck.back().occlusionInScreen); |
| 247 } | 246 } |
| 248 } | 247 } |
| 249 | 248 |
| 250 // FIXME: Remove usePaintTracking when paint tracking is on for paint culling. | 249 // FIXME: Remove usePaintTracking when paint tracking is on for paint culling. |
| 251 template<typename LayerType> | 250 template<typename LayerType> |
| 252 static inline void addOcclusionBehindLayer(Region& region, const LayerType* laye
r, const WebTransformationMatrix& transform, const Region& opaqueContents, const
gfx::Rect& clipRectInTarget, const gfx::Size& minimumTrackingSize, std::vector<
gfx::Rect>* occludingScreenSpaceRects, std::vector<gfx::Rect>* nonOccludingScree
nSpaceRects) | 251 static inline void addOcclusionBehindLayer(Region& region, const LayerType* laye
r, const gfx::Transform& transform, const Region& opaqueContents, const gfx::Rec
t& clipRectInTarget, const gfx::Size& minimumTrackingSize, std::vector<gfx::Rect
>* occludingScreenSpaceRects, std::vector<gfx::Rect>* nonOccludingScreenSpaceRec
ts) |
| 253 { | 252 { |
| 254 DCHECK(layer->visibleContentRect().Contains(opaqueContents.bounds())); | 253 DCHECK(layer->visibleContentRect().Contains(opaqueContents.bounds())); |
| 255 | 254 |
| 256 bool clipped; | 255 bool clipped; |
| 257 gfx::QuadF visibleTransformedQuad = MathUtil::mapQuad(transform, gfx::QuadF(
layer->visibleContentRect()), clipped); | 256 gfx::QuadF visibleTransformedQuad = MathUtil::mapQuad(transform, gfx::QuadF(
layer->visibleContentRect()), clipped); |
| 258 // FIXME: Find a rect interior to each transformed quad. | 257 // FIXME: Find a rect interior to each transformed quad. |
| 259 if (clipped || !visibleTransformedQuad.IsRectilinear()) | 258 if (clipped || !visibleTransformedQuad.IsRectilinear()) |
| 260 return; | 259 return; |
| 261 | 260 |
| 262 for (Region::Iterator opaqueContentRects(opaqueContents); opaqueContentRects
.has_rect(); opaqueContentRects.next()) { | 261 for (Region::Iterator opaqueContentRects(opaqueContents); opaqueContentRects
.has_rect(); opaqueContentRects.next()) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 return; | 301 return; |
| 303 | 302 |
| 304 gfx::Rect clipRectInTarget = layerClipRectInTarget(layer); | 303 gfx::Rect clipRectInTarget = layerClipRectInTarget(layer); |
| 305 if (layerTransformsToTargetKnown(layer)) | 304 if (layerTransformsToTargetKnown(layer)) |
| 306 addOcclusionBehindLayer<LayerType>(m_stack.back().occlusionInTarget, lay
er, layer->drawTransform(), opaqueContents, clipRectInTarget, m_minimumTrackingS
ize, 0, 0); | 305 addOcclusionBehindLayer<LayerType>(m_stack.back().occlusionInTarget, lay
er, layer->drawTransform(), opaqueContents, clipRectInTarget, m_minimumTrackingS
ize, 0, 0); |
| 307 | 306 |
| 308 // We must clip the occlusion within the layer's clipRectInTarget within scr
een space as well. If the clip rect can't be moved to screen space and | 307 // We must clip the occlusion within the layer's clipRectInTarget within scr
een space as well. If the clip rect can't be moved to screen space and |
| 309 // remain rectilinear, then we don't add any occlusion in screen space. | 308 // remain rectilinear, then we don't add any occlusion in screen space. |
| 310 | 309 |
| 311 if (layerTransformsToScreenKnown(layer)) { | 310 if (layerTransformsToScreenKnown(layer)) { |
| 312 WebTransformationMatrix targetToScreenTransform = m_stack.back().target-
>renderSurface()->screenSpaceTransform(); | 311 gfx::Transform targetToScreenTransform = m_stack.back().target->renderSu
rface()->screenSpaceTransform(); |
| 313 bool clipped; | 312 bool clipped; |
| 314 gfx::QuadF clipQuadInScreen = MathUtil::mapQuad(targetToScreenTransform,
gfx::QuadF(clipRectInTarget), clipped); | 313 gfx::QuadF clipQuadInScreen = MathUtil::mapQuad(targetToScreenTransform,
gfx::QuadF(clipRectInTarget), clipped); |
| 315 // FIXME: Find a rect interior to the transformed clip quad. | 314 // FIXME: Find a rect interior to the transformed clip quad. |
| 316 if (clipped || !clipQuadInScreen.IsRectilinear()) | 315 if (clipped || !clipQuadInScreen.IsRectilinear()) |
| 317 return; | 316 return; |
| 318 gfx::Rect clipRectInScreen = gfx::IntersectRects(m_rootTargetRect, gfx::
ToEnclosedRect(clipQuadInScreen.BoundingBox())); | 317 gfx::Rect clipRectInScreen = gfx::IntersectRects(m_rootTargetRect, gfx::
ToEnclosedRect(clipQuadInScreen.BoundingBox())); |
| 319 addOcclusionBehindLayer<LayerType>(m_stack.back().occlusionInScreen, lay
er, layer->screenSpaceTransform(), opaqueContents, clipRectInScreen, m_minimumTr
ackingSize, m_occludingScreenSpaceRects, m_nonOccludingScreenSpaceRects); | 318 addOcclusionBehindLayer<LayerType>(m_stack.back().occlusionInScreen, lay
er, layer->screenSpaceTransform(), opaqueContents, clipRectInScreen, m_minimumTr
ackingSize, m_occludingScreenSpaceRects, m_nonOccludingScreenSpaceRects); |
| 320 } | 319 } |
| 321 } | 320 } |
| 322 | 321 |
| 323 static inline bool testContentRectOccluded(const gfx::Rect& contentRect, const W
ebTransformationMatrix& contentSpaceTransform, const gfx::Rect& clipRectInTarget
, const Region& occlusion) | 322 static inline bool testContentRectOccluded(const gfx::Rect& contentRect, const g
fx::Transform& contentSpaceTransform, const gfx::Rect& clipRectInTarget, const R
egion& occlusion) |
| 324 { | 323 { |
| 325 gfx::RectF transformedRect = MathUtil::mapClippedRect(contentSpaceTransform,
gfx::RectF(contentRect)); | 324 gfx::RectF transformedRect = MathUtil::mapClippedRect(contentSpaceTransform,
gfx::RectF(contentRect)); |
| 326 // Take the gfx::ToEnclosingRect, as we want to include partial pixels in th
e test. | 325 // Take the gfx::ToEnclosingRect, as we want to include partial pixels in th
e test. |
| 327 gfx::Rect targetRect = gfx::IntersectRects(gfx::ToEnclosingRect(transformedR
ect), clipRectInTarget); | 326 gfx::Rect targetRect = gfx::IntersectRects(gfx::ToEnclosingRect(transformedR
ect), clipRectInTarget); |
| 328 return occlusion.Contains(targetRect); | 327 return occlusion.Contains(targetRect); |
| 329 } | 328 } |
| 330 | 329 |
| 331 template<typename LayerType, typename RenderSurfaceType> | 330 template<typename LayerType, typename RenderSurfaceType> |
| 332 bool OcclusionTrackerBase<LayerType, RenderSurfaceType>::occluded(const LayerTyp
e* renderTarget, const gfx::Rect& contentRect, const WebKit::WebTransformationMa
trix& drawTransform, bool implDrawTransformIsUnknown, const gfx::Rect& clippedRe
ctInTarget, bool* hasOcclusionFromOutsideTargetSurface) const | 331 bool OcclusionTrackerBase<LayerType, RenderSurfaceType>::occluded(const LayerTyp
e* renderTarget, const gfx::Rect& contentRect, const gfx::Transform& drawTransfo
rm, bool implDrawTransformIsUnknown, const gfx::Rect& clippedRectInTarget, bool*
hasOcclusionFromOutsideTargetSurface) const |
| 333 { | 332 { |
| 334 if (hasOcclusionFromOutsideTargetSurface) | 333 if (hasOcclusionFromOutsideTargetSurface) |
| 335 *hasOcclusionFromOutsideTargetSurface = false; | 334 *hasOcclusionFromOutsideTargetSurface = false; |
| 336 | 335 |
| 337 DCHECK(!m_stack.empty()); | 336 DCHECK(!m_stack.empty()); |
| 338 if (m_stack.empty()) | 337 if (m_stack.empty()) |
| 339 return false; | 338 return false; |
| 340 if (contentRect.IsEmpty()) | 339 if (contentRect.IsEmpty()) |
| 341 return true; | 340 return true; |
| 342 | 341 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 361 static inline gfx::Rect rectSubtractRegion(const gfx::Rect& rect, const Region&
region) | 360 static inline gfx::Rect rectSubtractRegion(const gfx::Rect& rect, const Region&
region) |
| 362 { | 361 { |
| 363 if (region.IsEmpty()) | 362 if (region.IsEmpty()) |
| 364 return rect; | 363 return rect; |
| 365 | 364 |
| 366 Region rectRegion(rect); | 365 Region rectRegion(rect); |
| 367 rectRegion.Subtract(region); | 366 rectRegion.Subtract(region); |
| 368 return rectRegion.bounds(); | 367 return rectRegion.bounds(); |
| 369 } | 368 } |
| 370 | 369 |
| 371 static inline gfx::Rect computeUnoccludedContentRect(const gfx::Rect& contentRec
t, const WebTransformationMatrix& contentSpaceTransform, const gfx::Rect& clipRe
ctInTarget, const Region& occlusion) | 370 static inline gfx::Rect computeUnoccludedContentRect(const gfx::Rect& contentRec
t, const gfx::Transform& contentSpaceTransform, const gfx::Rect& clipRectInTarge
t, const Region& occlusion) |
| 372 { | 371 { |
| 373 if (!contentSpaceTransform.isInvertible()) | 372 if (!contentSpaceTransform.IsInvertible()) |
| 374 return contentRect; | 373 return contentRect; |
| 375 | 374 |
| 376 // Take the ToEnclosingRect at each step, as we want to contain any unocclud
ed partial pixels in the resulting Rect. | 375 // Take the ToEnclosingRect at each step, as we want to contain any unocclud
ed partial pixels in the resulting Rect. |
| 377 gfx::RectF transformedRect = MathUtil::mapClippedRect(contentSpaceTransform,
gfx::RectF(contentRect)); | 376 gfx::RectF transformedRect = MathUtil::mapClippedRect(contentSpaceTransform,
gfx::RectF(contentRect)); |
| 378 gfx::Rect shrunkRect = rectSubtractRegion(gfx::IntersectRects(gfx::ToEnclosi
ngRect(transformedRect), clipRectInTarget), occlusion); | 377 gfx::Rect shrunkRect = rectSubtractRegion(gfx::IntersectRects(gfx::ToEnclosi
ngRect(transformedRect), clipRectInTarget), occlusion); |
| 379 gfx::Rect unoccludedRect = gfx::ToEnclosingRect(MathUtil::projectClippedRect
(contentSpaceTransform.inverse(), gfx::RectF(shrunkRect))); | 378 gfx::Rect unoccludedRect = gfx::ToEnclosingRect(MathUtil::projectClippedRect
(MathUtil::inverse(contentSpaceTransform), gfx::RectF(shrunkRect))); |
| 380 // The rect back in content space is a bounding box and may extend outside o
f the original contentRect, so clamp it to the contentRectBounds. | 379 // The rect back in content space is a bounding box and may extend outside o
f the original contentRect, so clamp it to the contentRectBounds. |
| 381 return gfx::IntersectRects(unoccludedRect, contentRect); | 380 return gfx::IntersectRects(unoccludedRect, contentRect); |
| 382 } | 381 } |
| 383 | 382 |
| 384 template<typename LayerType, typename RenderSurfaceType> | 383 template<typename LayerType, typename RenderSurfaceType> |
| 385 gfx::Rect OcclusionTrackerBase<LayerType, RenderSurfaceType>::unoccludedContentR
ect(const LayerType* renderTarget, const gfx::Rect& contentRect, const WebKit::W
ebTransformationMatrix& drawTransform, bool implDrawTransformIsUnknown, const gf
x::Rect& clippedRectInTarget, bool* hasOcclusionFromOutsideTargetSurface) const | 384 gfx::Rect OcclusionTrackerBase<LayerType, RenderSurfaceType>::unoccludedContentR
ect(const LayerType* renderTarget, const gfx::Rect& contentRect, const gfx::Tran
sform& drawTransform, bool implDrawTransformIsUnknown, const gfx::Rect& clippedR
ectInTarget, bool* hasOcclusionFromOutsideTargetSurface) const |
| 386 { | 385 { |
| 387 DCHECK(!m_stack.empty()); | 386 DCHECK(!m_stack.empty()); |
| 388 if (m_stack.empty()) | 387 if (m_stack.empty()) |
| 389 return contentRect; | 388 return contentRect; |
| 390 if (contentRect.IsEmpty()) | 389 if (contentRect.IsEmpty()) |
| 391 return contentRect; | 390 return contentRect; |
| 392 | 391 |
| 393 DCHECK(renderTarget->renderTarget() == renderTarget); | 392 DCHECK(renderTarget->renderTarget() == renderTarget); |
| 394 DCHECK(renderTarget->renderSurface()); | 393 DCHECK(renderTarget->renderSurface()); |
| 395 DCHECK(renderTarget == m_stack.back().target); | 394 DCHECK(renderTarget == m_stack.back().target); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 gfx::Rect surfaceClipRect = surface->clipRect(); | 431 gfx::Rect surfaceClipRect = surface->clipRect(); |
| 433 if (surfaceClipRect.IsEmpty()) { | 432 if (surfaceClipRect.IsEmpty()) { |
| 434 const LayerType* contributingSurfaceRenderTarget = layer->parent()->rend
erTarget(); | 433 const LayerType* contributingSurfaceRenderTarget = layer->parent()->rend
erTarget(); |
| 435 surfaceClipRect = gfx::IntersectRects(contributingSurfaceRenderTarget->r
enderSurface()->contentRect(), gfx::ToEnclosingRect(surface->drawableContentRect
())); | 434 surfaceClipRect = gfx::IntersectRects(contributingSurfaceRenderTarget->r
enderSurface()->contentRect(), gfx::ToEnclosingRect(surface->drawableContentRect
())); |
| 436 } | 435 } |
| 437 | 436 |
| 438 // A contributing surface doesn't get occluded by things inside its own surf
ace, so only things outside the surface can occlude it. That occlusion is | 437 // A contributing surface doesn't get occluded by things inside its own surf
ace, so only things outside the surface can occlude it. That occlusion is |
| 439 // found just below the top of the stack (if it exists). | 438 // found just below the top of the stack (if it exists). |
| 440 bool hasOcclusion = m_stack.size() > 1; | 439 bool hasOcclusion = m_stack.size() > 1; |
| 441 | 440 |
| 442 const WebTransformationMatrix& transformToScreen = forReplica ? surface->rep
licaScreenSpaceTransform() : surface->screenSpaceTransform(); | 441 const gfx::Transform& transformToScreen = forReplica ? surface->replicaScree
nSpaceTransform() : surface->screenSpaceTransform(); |
| 443 const WebTransformationMatrix& transformToTarget = forReplica ? surface->rep
licaDrawTransform() : surface->drawTransform(); | 442 const gfx::Transform& transformToTarget = forReplica ? surface->replicaDrawT
ransform() : surface->drawTransform(); |
| 444 | 443 |
| 445 gfx::Rect unoccludedInScreen = contentRect; | 444 gfx::Rect unoccludedInScreen = contentRect; |
| 446 if (surfaceTransformsToScreenKnown(surface)) { | 445 if (surfaceTransformsToScreenKnown(surface)) { |
| 447 if (hasOcclusion) { | 446 if (hasOcclusion) { |
| 448 const StackObject& secondLast = m_stack[m_stack.size() - 2]; | 447 const StackObject& secondLast = m_stack[m_stack.size() - 2]; |
| 449 unoccludedInScreen = computeUnoccludedContentRect(contentRect, trans
formToScreen, m_rootTargetRect, secondLast.occlusionInScreen); | 448 unoccludedInScreen = computeUnoccludedContentRect(contentRect, trans
formToScreen, m_rootTargetRect, secondLast.occlusionInScreen); |
| 450 } else | 449 } else |
| 451 unoccludedInScreen = computeUnoccludedContentRect(contentRect, trans
formToScreen, m_rootTargetRect, Region()); | 450 unoccludedInScreen = computeUnoccludedContentRect(contentRect, trans
formToScreen, m_rootTargetRect, Region()); |
| 452 } | 451 } |
| 453 | 452 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 472 // FIXME: we could remove this helper function, but unit tests currently ove
rride this | 471 // FIXME: we could remove this helper function, but unit tests currently ove
rride this |
| 473 // function, and they need to be verified/adjusted before this can be
removed. | 472 // function, and they need to be verified/adjusted before this can be
removed. |
| 474 return layer->drawableContentRect(); | 473 return layer->drawableContentRect(); |
| 475 } | 474 } |
| 476 | 475 |
| 477 // Instantiate (and export) templates here for the linker. | 476 // Instantiate (and export) templates here for the linker. |
| 478 template class OcclusionTrackerBase<Layer, RenderSurface>; | 477 template class OcclusionTrackerBase<Layer, RenderSurface>; |
| 479 template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>; | 478 template class OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>; |
| 480 | 479 |
| 481 } // namespace cc | 480 } // namespace cc |
| OLD | NEW |