当前位置: 首页>>代码示例>>C++>>正文


C++ LayoutObject::frame方法代码示例

本文整理汇总了C++中LayoutObject::frame方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutObject::frame方法的具体用法?C++ LayoutObject::frame怎么用?C++ LayoutObject::frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LayoutObject的用法示例。


在下文中一共展示了LayoutObject::frame方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: updateAutoscrollLayoutObject

void AutoscrollController::updateAutoscrollLayoutObject() {
  if (!m_autoscrollLayoutObject)
    return;

  LayoutObject* layoutObject = m_autoscrollLayoutObject;

  if (RuntimeEnabledFeatures::middleClickAutoscrollEnabled()) {
    HitTestResult hitTest =
        layoutObject->frame()->eventHandler().hitTestResultAtPoint(
            m_middleClickAutoscrollStartPos,
            HitTestRequest::ReadOnly | HitTestRequest::Active);

    if (Node* nodeAtPoint = hitTest.innerNode())
      layoutObject = nodeAtPoint->layoutObject();
  }

  while (layoutObject &&
         !(layoutObject->isBox() && toLayoutBox(layoutObject)->canAutoscroll()))
    layoutObject = layoutObject->parent();

  m_autoscrollLayoutObject = layoutObject && layoutObject->isBox()
                                 ? toLayoutBox(layoutObject)
                                 : nullptr;

  if (m_autoscrollType != NoAutoscroll && !m_autoscrollLayoutObject)
    m_autoscrollType = NoAutoscroll;
}
开发者ID:,项目名称:,代码行数:27,代码来源:

示例2: updateAutoscrollLayoutObject

void AutoscrollController::updateAutoscrollLayoutObject()
{
    if (!m_autoscrollLayoutObject)
        return;

    LayoutObject* layoutObject = m_autoscrollLayoutObject;

#if OS(WIN)
    HitTestResult hitTest = layoutObject->frame()->eventHandler().hitTestResultAtPoint(m_panScrollStartPos, HitTestRequest::ReadOnly | HitTestRequest::Active);

    if (Node* nodeAtPoint = hitTest.innerNode())
        layoutObject = nodeAtPoint->layoutObject();
#endif

    while (layoutObject && !(layoutObject->isBox() && toLayoutBox(layoutObject)->canAutoscroll()))
        layoutObject = layoutObject->parent();
    m_autoscrollLayoutObject = layoutObject && layoutObject->isBox() ? toLayoutBox(layoutObject) : nullptr;
}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:18,代码来源:AutoscrollController.cpp

示例3: shouldPaintAtLowQuality

bool ImageQualityController::shouldPaintAtLowQuality(
    const LayoutObject& object,
    Image* image,
    const void* layer,
    const LayoutSize& layoutSize,
    double lastFrameTimeMonotonic) {
    // If the image is not a bitmap image, then none of this is relevant and we
    // just paint at high quality.
    if (!image || !image->isBitmapImage())
        return false;

    if (!layer)
        return false;

    if (object.style()->imageRendering() == ImageRenderingOptimizeContrast)
        return true;

    if (LocalFrame* frame = object.frame()) {
        if (frame->settings() &&
                frame->settings()->useDefaultImageInterpolationQuality())
            return false;
    }

    // Look ourselves up in the hashtables.
    ObjectLayerSizeMap::iterator i = m_objectLayerSizeMap.find(&object);
    LayerSizeMap* innerMap = nullptr;
    bool objectIsResizing = false;
    if (i != m_objectLayerSizeMap.end()) {
        innerMap = &i->value.layerSizeMap;
        objectIsResizing = i->value.isResizing;
    }
    LayoutSize oldSize;
    bool isFirstResize = true;
    if (innerMap) {
        LayerSizeMap::iterator j = innerMap->find(layer);
        if (j != innerMap->end()) {
            isFirstResize = false;
            oldSize = j->value;
        }
    }

    if (layoutSize == image->size()) {
        // There is no scale in effect. If we had a scale in effect before, we can
        // just remove this object from the list.
        removeLayer(object, innerMap, layer);
        return false;
    }

    // If an animated resize is active for this object, paint in low quality and
    // kick the timer ahead.
    if (objectIsResizing) {
        bool sizesChanged = oldSize != layoutSize;
        set(object, innerMap, layer, layoutSize, sizesChanged);
        if (sizesChanged)
            restartTimer(lastFrameTimeMonotonic);
        return true;
    }
    // If this is the first time resizing this image, or its size is the
    // same as the last resize, draw at high res, but record the paint
    // size and set the timer.
    if (isFirstResize || oldSize == layoutSize) {
        restartTimer(lastFrameTimeMonotonic);
        set(object, innerMap, layer, layoutSize, false);
        return false;
    }
    // If the timer is no longer active, draw at high quality and don't
    // set the timer.
    if (!m_timer->isActive()) {
        removeLayer(object, innerMap, layer);
        return false;
    }
    // This object has been resized to two different sizes while the timer
    // is active, so draw at low quality, set the flag for animated resizes and
    // the object to the list for high quality redraw.
    set(object, innerMap, layer, layoutSize, true);
    restartTimer(lastFrameTimeMonotonic);
    return true;
}
开发者ID:mirror,项目名称:chromium,代码行数:78,代码来源:ImageQualityController.cpp


注:本文中的LayoutObject::frame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。