本文整理汇总了C++中ShapeValue::image方法的典型用法代码示例。如果您正苦于以下问题:C++ ShapeValue::image方法的具体用法?C++ ShapeValue::image怎么用?C++ ShapeValue::image使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShapeValue
的用法示例。
在下文中一共展示了ShapeValue::image方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isEnabledFor
bool ShapeOutsideInfo::isEnabledFor(const RenderBox& box)
{
ShapeValue* shapeValue = box.style()->shapeOutside();
if (!box.isFloating() || !shapeValue)
return false;
switch (shapeValue->type()) {
case ShapeValue::Shape:
return shapeValue->shape();
case ShapeValue::Image:
return shapeValue->isImageValid() && checkShapeImageOrigin(box.document(), *(shapeValue->image()));
case ShapeValue::Box:
return true;
}
return false;
}
示例2: getShapeImageAndRect
static void getShapeImageAndRect(const ShapeValue& shapeValue, const RenderBox& renderBox, const LayoutSize& referenceBoxSize, Image*& image, LayoutRect& rect)
{
ASSERT(shapeValue.isImageValid());
StyleImage* styleImage = shapeValue.image();
const LayoutSize& imageSize = renderBox.calculateImageIntrinsicDimensions(styleImage, roundedIntSize(referenceBoxSize), RenderImage::ScaleByEffectiveZoom);
styleImage->setContainerSizeForRenderer(&renderBox, imageSize, renderBox.style().effectiveZoom());
image = nullptr;
if (styleImage->isCachedImage() || styleImage->isCachedImageSet())
image = styleImage->cachedImage()->imageForRenderer(&renderBox);
else if (styleImage->isGeneratedImage())
image = styleImage->image(const_cast<RenderBox*>(&renderBox), imageSize).get();
if (renderBox.isRenderImage())
rect = toRenderImage(&renderBox)->replacedContentRect(renderBox.intrinsicSize());
else
rect = LayoutRect(LayoutPoint(), imageSize);
}
示例3: isEnabledFor
bool ShapeInsideInfo::isEnabledFor(const RenderBlock* renderer)
{
ShapeValue* shapeValue = renderer->style()->resolvedShapeInside();
if (!shapeValue)
return false;
switch (shapeValue->type()) {
case ShapeValue::Shape:
return shapeValue->shape() && shapeValue->shape()->type() != BasicShape::BasicShapeInsetRectangleType && shapeValue->shape()->type() != BasicShape::BasicShapeInsetType;
case ShapeValue::Image:
return shapeValue->isImageValid() && checkShapeImageOrigin(renderer->document(), *(shapeValue->image()->cachedImage()));
case ShapeValue::Box:
return true;
case ShapeValue::Outside:
return false;
}
return false;
}