本文整理汇总了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;
}
示例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;
}
示例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;
}