コード例 #1
0
void RenderGeometryMap::pushMappingsToAncestor(const RenderLayer* layer, const RenderLayer* ancestorLayer)
{
    const RenderObject& renderer = layer->renderer();

    // We have to visit all the renderers to detect flipped blocks. This might defeat the gains
    // from mapping via layers.
    bool canConvertInLayerTree = ancestorLayer ? canMapBetweenRenderers(layer->renderer(), ancestorLayer->renderer()) : false;

//    fprintf(stderr, "RenderGeometryMap::pushMappingsToAncestor from layer %p to layer %p, canConvertInLayerTree=%d\n", layer, ancestorLayer, canConvertInLayerTree);

    if (canConvertInLayerTree) {
        LayoutPoint layerOffset;
        layer->convertToLayerCoords(ancestorLayer, layerOffset);
        
        // The RenderView must be pushed first.
        if (!m_mapping.size()) {
            ASSERT(ancestorLayer->renderer().isRenderView());
            pushMappingsToAncestor(&ancestorLayer->renderer(), 0);
        }

        TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size());
        push(&renderer, toLayoutSize(layerOffset), /*accumulatingTransform*/ true, /*isNonUniform*/ false, /*isFixedPosition*/ false, /*hasTransform*/ false);
        return;
    }
    const RenderLayerModelObject* ancestorRenderer = ancestorLayer ? &ancestorLayer->renderer() : 0;
    pushMappingsToAncestor(&renderer, ancestorRenderer);
}
コード例 #2
0
void RenderGeometryMap::pushMappingsToAncestor(
    const RenderLayer* layer,
    const RenderLayer* ancestorLayer) {
  const RenderObject* renderer = layer->renderer();

  bool crossDocument = false;
  ASSERT(!crossDocument || m_mapCoordinatesFlags & TraverseDocumentBoundaries);

  // We have to visit all the renderers to detect flipped blocks. This might
  // defeat the gains from mapping via layers.
  bool canConvertInLayerTree =
      (ancestorLayer && !crossDocument)
          ? canMapBetweenRenderers(layer->renderer(), ancestorLayer->renderer())
          : false;

  //    fprintf(stderr, "RenderGeometryMap::pushMappingsToAncestor from layer %p
  //    to layer %p, canConvertInLayerTree=%d\n", layer, ancestorLayer,
  //    canConvertInLayerTree);

  if (canConvertInLayerTree) {
    LayoutPoint layerOffset;
    layer->convertToLayerCoords(ancestorLayer, layerOffset);

    // The RenderView must be pushed first.
    if (!m_mapping.size()) {
      ASSERT(ancestorLayer->renderer()->isRenderView());
      pushMappingsToAncestor(ancestorLayer->renderer(), 0);
    }

    TemporaryChange<size_t> positionChange(m_insertionPosition,
                                           m_mapping.size());
    bool accumulatingTransform =
        layer->renderer()->style()->preserves3D() ||
        ancestorLayer->renderer()->style()->preserves3D();
    push(renderer, toLayoutSize(layerOffset), accumulatingTransform,
         /*isNonUniform*/ false, /*hasTransform*/ false);
    return;
  }
  const RenderBox* ancestorRenderer =
      ancestorLayer ? ancestorLayer->renderer() : 0;
  pushMappingsToAncestor(renderer, ancestorRenderer);
}