| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/occlusion_tracker.h" | 7 #include "cc/occlusion_tracker.h" |
| 8 | 8 |
| 9 #include "CCLayerImpl.h" | 9 #include "CCLayerImpl.h" |
| 10 #include "cc/layer.h" | 10 #include "cc/layer.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 template<typename LayerType, typename RenderSurfaceType> | 94 template<typename LayerType, typename RenderSurfaceType> |
| 95 void OcclusionTrackerBase<LayerType, RenderSurfaceType>::finishedRenderTarget(co
nst LayerType* finishedTarget) | 95 void OcclusionTrackerBase<LayerType, RenderSurfaceType>::finishedRenderTarget(co
nst LayerType* finishedTarget) |
| 96 { | 96 { |
| 97 // Make sure we know about the target surface. | 97 // Make sure we know about the target surface. |
| 98 enterRenderTarget(finishedTarget); | 98 enterRenderTarget(finishedTarget); |
| 99 | 99 |
| 100 RenderSurfaceType* surface = finishedTarget->renderSurface(); | 100 RenderSurfaceType* surface = finishedTarget->renderSurface(); |
| 101 | 101 |
| 102 // If the occlusion within the surface can not be applied to things outside
of the surface's subtree, then clear the occlusion here so it won't be used. | 102 // If the occlusion within the surface can not be applied to things outside
of the surface's subtree, then clear the occlusion here so it won't be used. |
| 103 if (finishedTarget->maskLayer() || !surfaceOpacityKnown(surface) || surface-
>drawOpacity() < 1 || finishedTarget->filters().hasFilterThatAffectsOpacity()) { | 103 // TODO(senorblanco): Make this smarter for SkImageFilter case: once |
| 104 // SkImageFilters can report affectsOpacity(), call that. |
| 105 if (finishedTarget->maskLayer() || !surfaceOpacityKnown(surface) || surface-
>drawOpacity() < 1 || finishedTarget->filters().hasFilterThatAffectsOpacity() ||
finishedTarget->filter()) { |
| 104 m_stack.last().occlusionInScreen = Region(); | 106 m_stack.last().occlusionInScreen = Region(); |
| 105 m_stack.last().occlusionInTarget = Region(); | 107 m_stack.last().occlusionInTarget = Region(); |
| 106 } else { | 108 } else { |
| 107 if (!surfaceTransformsToTargetKnown(surface)) | 109 if (!surfaceTransformsToTargetKnown(surface)) |
| 108 m_stack.last().occlusionInTarget = Region(); | 110 m_stack.last().occlusionInTarget = Region(); |
| 109 if (!surfaceTransformsToScreenKnown(surface)) | 111 if (!surfaceTransformsToScreenKnown(surface)) |
| 110 m_stack.last().occlusionInScreen = Region(); | 112 m_stack.last().occlusionInScreen = Region(); |
| 111 } | 113 } |
| 112 } | 114 } |
| 113 | 115 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::finishedRender
Target(const LayerImpl* finishedTarget); | 472 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::finishedRender
Target(const LayerImpl* finishedTarget); |
| 471 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::leaveToRenderT
arget(const LayerImpl* newTarget); | 473 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::leaveToRenderT
arget(const LayerImpl* newTarget); |
| 472 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::markOccludedBe
hindLayer(const LayerImpl*); | 474 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::markOccludedBe
hindLayer(const LayerImpl*); |
| 473 template bool OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::occluded(const
LayerImpl*, const IntRect& contentRect, bool* hasOcclusionFromOutsideTargetSurf
ace) const; | 475 template bool OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::occluded(const
LayerImpl*, const IntRect& contentRect, bool* hasOcclusionFromOutsideTargetSurf
ace) const; |
| 474 template IntRect OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::unoccludedC
ontentRect(const LayerImpl*, const IntRect& contentRect, bool* hasOcclusionFromO
utsideTargetSurface) const; | 476 template IntRect OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::unoccludedC
ontentRect(const LayerImpl*, const IntRect& contentRect, bool* hasOcclusionFromO
utsideTargetSurface) const; |
| 475 template IntRect OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::unoccludedC
ontributingSurfaceContentRect(const LayerImpl*, bool forReplica, const IntRect&
contentRect, bool* hasOcclusionFromOutsideTargetSurface) const; | 477 template IntRect OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::unoccludedC
ontributingSurfaceContentRect(const LayerImpl*, bool forReplica, const IntRect&
contentRect, bool* hasOcclusionFromOutsideTargetSurface) const; |
| 476 template IntRect OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::layerClipRe
ctInTarget(const LayerImpl*) const; | 478 template IntRect OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::layerClipRe
ctInTarget(const LayerImpl*) const; |
| 477 | 479 |
| 478 | 480 |
| 479 } // namespace cc | 481 } // namespace cc |
| OLD | NEW |