OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 // Compute the transformation matrix used to draw the replica of the ren
der | 427 // Compute the transformation matrix used to draw the replica of the ren
der |
428 // surface. | 428 // surface. |
429 if (layer->replicaLayer()) { | 429 if (layer->replicaLayer()) { |
430 TransformationMatrix replicaDrawTransform = renderSurface->originTra
nsform(); | 430 TransformationMatrix replicaDrawTransform = renderSurface->originTra
nsform(); |
431 replicaDrawTransform.translate3d(layer->replicaLayer()->position().x
(), layer->replicaLayer()->position().y(), 0); | 431 replicaDrawTransform.translate3d(layer->replicaLayer()->position().x
(), layer->replicaLayer()->position().y(), 0); |
432 replicaDrawTransform.multiply(layer->replicaLayer()->transform()); | 432 replicaDrawTransform.multiply(layer->replicaLayer()->transform()); |
433 replicaDrawTransform.translate3d(surfaceCenter.x() - anchorPoint.x()
* bounds.width(), surfaceCenter.y() - anchorPoint.y() * bounds.height(), 0); | 433 replicaDrawTransform.translate3d(surfaceCenter.x() - anchorPoint.x()
* bounds.width(), surfaceCenter.y() - anchorPoint.y() * bounds.height(), 0); |
434 renderSurface->setReplicaDrawTransform(replicaDrawTransform); | 434 renderSurface->setReplicaDrawTransform(replicaDrawTransform); |
435 } | 435 } |
436 | 436 |
437 // If a render surface has no layer list, then it and none of its | 437 // If a render surface has no layer list, then it and none of its childr
en needed to get drawn. |
438 // children needed to get drawn. Therefore, it should be the last layer | |
439 // in the render surface list and we can trivially remove it. | |
440 if (!layer->renderSurface()->layerList().size()) { | 438 if (!layer->renderSurface()->layerList().size()) { |
| 439 // FIXME: Originally we asserted that this layer was already at the
end of the |
| 440 // list, and only needed to remove that layer. For now, we re
move the |
| 441 // entire subtree of surfaces to fix a crash bug. The root ca
use is |
| 442 // https://bugs.webkit.org/show_bug.cgi?id=74147 and we shoul
d be able |
| 443 // to put the original assert after fixing that. |
| 444 while (renderSurfaceLayerList.last() != layer) { |
| 445 renderSurfaceLayerList.last()->clearRenderSurface(); |
| 446 renderSurfaceLayerList.removeLast(); |
| 447 } |
441 ASSERT(renderSurfaceLayerList.last() == layer); | 448 ASSERT(renderSurfaceLayerList.last() == layer); |
442 renderSurfaceLayerList.removeLast(); | 449 renderSurfaceLayerList.removeLast(); |
443 layer->clearRenderSurface(); | 450 layer->clearRenderSurface(); |
444 return false; | 451 return false; |
445 } | 452 } |
446 } | 453 } |
447 | 454 |
448 // If neither this layer nor any of its children were added, early out. | 455 // If neither this layer nor any of its children were added, early out. |
449 if (sortingStartIndex == descendants.size()) | 456 if (sortingStartIndex == descendants.size()) |
450 return false; | 457 return false; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 walkLayersAndCalculateVisibleLayerRects<LayerChromium, RenderSurfaceChromium
>(renderSurfaceLayerList); | 490 walkLayersAndCalculateVisibleLayerRects<LayerChromium, RenderSurfaceChromium
>(renderSurfaceLayerList); |
484 } | 491 } |
485 | 492 |
486 void CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(CCLayerImpl* la
yer, CCLayerImpl* rootLayer, const TransformationMatrix& parentMatrix, const Tra
nsformationMatrix& fullHierarchyMatrix, Vector<RefPtr<CCLayerImpl> >& renderSurf
aceLayerList, Vector<RefPtr<CCLayerImpl> >& layerList, CCLayerSorter* layerSorte
r, int maxTextureSize) | 493 void CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(CCLayerImpl* la
yer, CCLayerImpl* rootLayer, const TransformationMatrix& parentMatrix, const Tra
nsformationMatrix& fullHierarchyMatrix, Vector<RefPtr<CCLayerImpl> >& renderSurf
aceLayerList, Vector<RefPtr<CCLayerImpl> >& layerList, CCLayerSorter* layerSorte
r, int maxTextureSize) |
487 { | 494 { |
488 calculateDrawTransformsAndVisibilityInternal<CCLayerImpl, CCRenderSurface, C
CLayerSorter>(layer, rootLayer, parentMatrix, fullHierarchyMatrix, renderSurface
LayerList, layerList, layerSorter, maxTextureSize); | 495 calculateDrawTransformsAndVisibilityInternal<CCLayerImpl, CCRenderSurface, C
CLayerSorter>(layer, rootLayer, parentMatrix, fullHierarchyMatrix, renderSurface
LayerList, layerList, layerSorter, maxTextureSize); |
489 walkLayersAndCalculateVisibleLayerRects<CCLayerImpl, CCRenderSurface>(render
SurfaceLayerList); | 496 walkLayersAndCalculateVisibleLayerRects<CCLayerImpl, CCRenderSurface>(render
SurfaceLayerList); |
490 } | 497 } |
491 | 498 |
492 } // namespace WebCore | 499 } // namespace WebCore |
OLD | NEW |