Chromium Code Reviews| 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 <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 | 21 |
| 22 template<typename LayerType, typename RenderSurfaceType> | 22 template<typename LayerType, typename RenderSurfaceType> |
| 23 OcclusionTrackerBase<LayerType, RenderSurfaceType>::OcclusionTrackerBase(gfx::Re ct rootTargetRect, bool recordMetricsForFrame) | 23 OcclusionTrackerBase<LayerType, RenderSurfaceType>::OcclusionTrackerBase(gfx::Re ct rootTargetRect, bool recordMetricsForFrame) |
| 24 : m_rootTargetRect(rootTargetRect) | 24 : m_rootTargetRect(rootTargetRect) |
| 25 , m_overdrawMetrics(OverdrawMetrics::create(recordMetricsForFrame)) | 25 , m_overdrawMetrics(OverdrawMetrics::create(recordMetricsForFrame)) |
| 26 , m_occludingScreenSpaceRects(0) | 26 , m_occludingScreenSpaceRects(0) |
| 27 { | 27 { |
| 28 } | 28 } |
| 29 | 29 |
| 30 template<typename LayerType, typename RenderSurfaceType> | 30 template<typename LayerType, typename RenderSurfaceType> |
| 31 OcclusionTrackerBase<LayerType, RenderSurfaceType>::~OcclusionTrackerBase() | |
| 32 { | |
| 33 } | |
| 34 | |
| 35 template<typename LayerType, typename RenderSurfaceType> | |
| 31 void OcclusionTrackerBase<LayerType, RenderSurfaceType>::enterLayer(const LayerI teratorPosition<LayerType>& layerIterator) | 36 void OcclusionTrackerBase<LayerType, RenderSurfaceType>::enterLayer(const LayerI teratorPosition<LayerType>& layerIterator) |
| 32 { | 37 { |
| 33 LayerType* renderTarget = layerIterator.targetRenderSurfaceLayer; | 38 LayerType* renderTarget = layerIterator.targetRenderSurfaceLayer; |
| 34 | 39 |
| 35 if (layerIterator.representsItself) | 40 if (layerIterator.representsItself) |
| 36 enterRenderTarget(renderTarget); | 41 enterRenderTarget(renderTarget); |
| 37 else if (layerIterator.representsTargetRenderSurface) | 42 else if (layerIterator.representsTargetRenderSurface) |
| 38 finishedRenderTarget(renderTarget); | 43 finishedRenderTarget(renderTarget); |
| 39 } | 44 } |
| 40 | 45 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 451 } | 456 } |
| 452 | 457 |
| 453 template<typename LayerType, typename RenderSurfaceType> | 458 template<typename LayerType, typename RenderSurfaceType> |
| 454 gfx::Rect OcclusionTrackerBase<LayerType, RenderSurfaceType>::layerClipRectInTar get(const LayerType* layer) const | 459 gfx::Rect OcclusionTrackerBase<LayerType, RenderSurfaceType>::layerClipRectInTar get(const LayerType* layer) const |
| 455 { | 460 { |
| 456 // FIXME: we could remove this helper function, but unit tests currently ove rride this | 461 // FIXME: we could remove this helper function, but unit tests currently ove rride this |
| 457 // function, and they need to be verified/adjusted before this can be removed. | 462 // function, and they need to be verified/adjusted before this can be removed. |
| 458 return layer->drawableContentRect(); | 463 return layer->drawableContentRect(); |
| 459 } | 464 } |
| 460 | 465 |
| 461 // Declare the possible functions here for the linker. | 466 // Declare the possible functions here for the linker. |
|
danakj
2012/11/01 22:58:24
Comment is wrong now. This is much simpler.. did t
piman
2012/11/02 00:13:37
Done.
| |
| 462 template OcclusionTrackerBase<Layer, RenderSurface>::OcclusionTrackerBase(gfx::R ect rootTargetRect, bool recordMetricsForFrame); | 467 template class CC_EXPORT OcclusionTrackerBase<Layer, RenderSurface>; |
| 463 template void OcclusionTrackerBase<Layer, RenderSurface>::enterLayer(const Layer IteratorPosition<Layer>&); | 468 template class CC_EXPORT OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>; |
| 464 template void OcclusionTrackerBase<Layer, RenderSurface>::leaveLayer(const Layer IteratorPosition<Layer>&); | |
| 465 template void OcclusionTrackerBase<Layer, RenderSurface>::enterRenderTarget(cons t Layer* newTarget); | |
| 466 template void OcclusionTrackerBase<Layer, RenderSurface>::finishedRenderTarget(c onst Layer* finishedTarget); | |
| 467 template void OcclusionTrackerBase<Layer, RenderSurface>::leaveToRenderTarget(co nst Layer* newTarget); | |
| 468 template void OcclusionTrackerBase<Layer, RenderSurface>::markOccludedBehindLaye r(const Layer*); | |
| 469 template bool OcclusionTrackerBase<Layer, RenderSurface>::occluded(const Layer*, const gfx::Rect& contentRect, const WebKit::WebTransformationMatrix& drawTransf orm, bool implDrawTransformIsUnknown, const gfx::Rect& clippedRectInTarget, bool * hasOcclusionFromOutsideTargetSurface) const; | |
| 470 template gfx::Rect OcclusionTrackerBase<Layer, RenderSurface>::unoccludedContent Rect(const Layer*, const gfx::Rect& contentRect, const WebKit::WebTransformation Matrix& drawTransform, bool implDrawTransformIsUnknown, const gfx::Rect& clipped RectInTarget, bool* hasOcclusionFromOutsideTargetSurface) const; | |
| 471 template gfx::Rect OcclusionTrackerBase<Layer, RenderSurface>::unoccludedContrib utingSurfaceContentRect(const Layer*, bool forReplica, const gfx::Rect& contentR ect, bool* hasOcclusionFromOutsideTargetSurface) const; | |
| 472 template gfx::Rect OcclusionTrackerBase<Layer, RenderSurface>::layerClipRectInTa rget(const Layer*) const; | |
| 473 | |
| 474 template OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::OcclusionTrackerBas e(gfx::Rect rootTargetRect, bool recordMetricsForFrame); | |
| 475 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::enterLayer(con st LayerIteratorPosition<LayerImpl>&); | |
| 476 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::leaveLayer(con st LayerIteratorPosition<LayerImpl>&); | |
| 477 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::enterRenderTar get(const LayerImpl* newTarget); | |
| 478 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::finishedRender Target(const LayerImpl* finishedTarget); | |
| 479 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::leaveToRenderT arget(const LayerImpl* newTarget); | |
| 480 template void OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::markOccludedBe hindLayer(const LayerImpl*); | |
| 481 template bool OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::occluded(const LayerImpl*, const gfx::Rect& contentRect, const WebKit::WebTransformationMatrix & drawTransform, bool implDrawTransformIsUnknown, const gfx::Rect& clippedRectIn Target, bool* hasOcclusionFromOutsideTargetSurface) const; | |
| 482 template gfx::Rect OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::unocclude dContentRect(const LayerImpl*, const gfx::Rect& contentRect, const WebKit::WebTr ansformationMatrix& drawTransform, bool implDrawTransformIsUnknown, const gfx::R ect& clippedRectInTarget, bool* hasOcclusionFromOutsideTargetSurface) const; | |
| 483 template gfx::Rect OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::unocclude dContributingSurfaceContentRect(const LayerImpl*, bool forReplica, const gfx::Re ct& contentRect, bool* hasOcclusionFromOutsideTargetSurface) const; | |
| 484 template gfx::Rect OcclusionTrackerBase<LayerImpl, RenderSurfaceImpl>::layerClip RectInTarget(const LayerImpl*) const; | |
| 485 | |
| 486 | 469 |
| 487 } // namespace cc | 470 } // namespace cc |
| OLD | NEW |