本文整理汇总了C++中FloatQuad::setP4方法的典型用法代码示例。如果您正苦于以下问题:C++ FloatQuad::setP4方法的具体用法?C++ FloatQuad::setP4怎么用?C++ FloatQuad::setP4使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FloatQuad
的用法示例。
在下文中一共展示了FloatQuad::setP4方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertTargetSpaceQuadToCompositedLayer
static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpaceQuad, LayoutObject* targetRenderer, const LayoutBoxModelObject* paintInvalidationContainer, FloatQuad& compositedSpaceQuad)
{
ASSERT(targetRenderer);
ASSERT(paintInvalidationContainer);
for (unsigned i = 0; i < 4; ++i) {
IntPoint point;
switch (i) {
case 0: point = roundedIntPoint(targetSpaceQuad.p1()); break;
case 1: point = roundedIntPoint(targetSpaceQuad.p2()); break;
case 2: point = roundedIntPoint(targetSpaceQuad.p3()); break;
case 3: point = roundedIntPoint(targetSpaceQuad.p4()); break;
}
// FIXME: this does not need to be absolute, just in the paint invalidation container's space.
point = targetRenderer->frame()->view()->contentsToRootFrame(point);
point = paintInvalidationContainer->frame()->view()->rootFrameToContents(point);
FloatPoint floatPoint = paintInvalidationContainer->absoluteToLocal(point, UseTransforms);
DeprecatedPaintLayer::mapPointToPaintBackingCoordinates(paintInvalidationContainer, floatPoint);
switch (i) {
case 0: compositedSpaceQuad.setP1(floatPoint); break;
case 1: compositedSpaceQuad.setP2(floatPoint); break;
case 2: compositedSpaceQuad.setP3(floatPoint); break;
case 3: compositedSpaceQuad.setP4(floatPoint); break;
}
}
}
示例2: convertTargetSpaceQuadToCompositedLayer
static void convertTargetSpaceQuadToCompositedLayer(const FloatQuad& targetSpaceQuad, RenderObject* targetRenderer, RenderObject* compositedRenderer, FloatQuad& compositedSpaceQuad)
{
ASSERT(targetRenderer);
ASSERT(compositedRenderer);
for (unsigned i = 0; i < 4; ++i) {
IntPoint point;
switch (i) {
case 0: point = roundedIntPoint(targetSpaceQuad.p1()); break;
case 1: point = roundedIntPoint(targetSpaceQuad.p2()); break;
case 2: point = roundedIntPoint(targetSpaceQuad.p3()); break;
case 3: point = roundedIntPoint(targetSpaceQuad.p4()); break;
}
point = targetRenderer->frame()->view()->contentsToWindow(point);
point = compositedRenderer->frame()->view()->windowToContents(point);
FloatPoint floatPoint = compositedRenderer->absoluteToLocal(point, UseTransforms);
switch (i) {
case 0: compositedSpaceQuad.setP1(floatPoint); break;
case 1: compositedSpaceQuad.setP2(floatPoint); break;
case 2: compositedSpaceQuad.setP3(floatPoint); break;
case 3: compositedSpaceQuad.setP4(floatPoint); break;
}
}
}
示例3: projectQuad
FloatQuad TransformationMatrix::projectQuad(const FloatQuad& q) const
{
FloatQuad projectedQuad;
projectedQuad.setP1(projectPoint(q.p1()));
projectedQuad.setP2(projectPoint(q.p2()));
projectedQuad.setP3(projectPoint(q.p3()));
projectedQuad.setP4(projectPoint(q.p4()));
return projectedQuad;
}
示例4: contentsQuadToCoordinateSystem
static void contentsQuadToCoordinateSystem(const FrameView* mainView, const FrameView* view, FloatQuad& quad, InspectorOverlay::CoordinateSystem coordinateSystem)
{
quad.setP1(view->contentsToRootView(roundedIntPoint(quad.p1())));
quad.setP2(view->contentsToRootView(roundedIntPoint(quad.p2())));
quad.setP3(view->contentsToRootView(roundedIntPoint(quad.p3())));
quad.setP4(view->contentsToRootView(roundedIntPoint(quad.p4())));
if (coordinateSystem == InspectorOverlay::CoordinateSystem::View)
quad += mainView->scrollOffset();
}
示例5: getTransformedRect
static FloatQuad getTransformedRect(const IntSize& bounds, const IntRect& rect, const TransformationMatrix& drawTransform)
{
float x = -bounds.width() / 2.0 + rect.x();
float y = -bounds.height() / 2.0 + rect.y();
float w = rect.width();
float h = rect.height();
FloatQuad result;
result.setP1(drawTransform.mapPoint(FloatPoint(x, y)));
result.setP2(drawTransform.mapPoint(FloatPoint(x, y + h)));
result.setP3(drawTransform.mapPoint(FloatPoint(x + w, y + h)));
result.setP4(drawTransform.mapPoint(FloatPoint(x + w, y)));
return result;
}
示例6:
FloatQuad LayerGLES2::getTransformedHolePunchRect() const
{
float x = -m_bounds.width()/2.0 + m_holePunchRect.x();
float y = -m_bounds.height()/2.0 + m_holePunchRect.y();
float w = m_holePunchRect.width();
float h = m_holePunchRect.height();
FloatQuad result;
result.setP1(m_drawTransform.mapPoint(FloatPoint(x, y)));
result.setP2(m_drawTransform.mapPoint(FloatPoint(x, y+h)));
result.setP3(m_drawTransform.mapPoint(FloatPoint(x+w, y+h)));
result.setP4(m_drawTransform.mapPoint(FloatPoint(x+w, y)));
return result;
}
示例7: drawRect
FloatRect LayerRendererSurface::drawRect() const
{
float bx = m_size.width() / 2.0;
float by = m_size.height() / 2.0;
FloatQuad transformedBounds;
transformedBounds.setP1(m_drawTransform.mapPoint(FloatPoint(-bx, -by)));
transformedBounds.setP2(m_drawTransform.mapPoint(FloatPoint(-bx, by)));
transformedBounds.setP3(m_drawTransform.mapPoint(FloatPoint(bx, by)));
transformedBounds.setP4(m_drawTransform.mapPoint(FloatPoint(bx, -by)));
FloatRect rect = transformedBounds.boundingBox();
if (m_ownerLayer->replicaLayer()) {
FloatQuad bounds;
bounds.setP1(m_replicaDrawTransform.mapPoint(FloatPoint(-bx, -by)));
bounds.setP2(m_replicaDrawTransform.mapPoint(FloatPoint(-bx, by)));
bounds.setP3(m_replicaDrawTransform.mapPoint(FloatPoint(bx, by)));
bounds.setP4(m_replicaDrawTransform.mapPoint(FloatPoint(bx, -by)));
rect.unite(bounds.boundingBox());
}
return rect;
}
示例8: mapQuad
FloatQuad AffineTransform::mapQuad(const FloatQuad& q) const
{
if (isIdentityOrTranslation()) {
FloatQuad mappedQuad(q);
mappedQuad.move(narrowPrecisionToFloat(m_transform[4]), narrowPrecisionToFloat(m_transform[5]));
return mappedQuad;
}
FloatQuad result;
result.setP1(mapPoint(q.p1()));
result.setP2(mapPoint(q.p2()));
result.setP3(mapPoint(q.p3()));
result.setP4(mapPoint(q.p4()));
return result;
}
示例9: mapRect
FloatRect AffineTransform::mapRect(const FloatRect& rect) const
{
if (isIdentityOrTranslation()) {
FloatRect mappedRect(rect);
mappedRect.move(narrowPrecisionToFloat(m_transform[4]), narrowPrecisionToFloat(m_transform[5]));
return mappedRect;
}
FloatQuad result;
result.setP1(mapPoint(rect.location()));
result.setP2(mapPoint(FloatPoint(rect.right(), rect.y())));
result.setP3(mapPoint(FloatPoint(rect.right(), rect.bottom())));
result.setP4(mapPoint(FloatPoint(rect.x(), rect.bottom())));
return result.boundingBox();
}
示例10: projectQuad
static FloatQuad projectQuad(const TransformationMatrix& transform, const FloatQuad& q, bool& clamped)
{
FloatQuad projectedQuad;
bool clampedPoint;
projectedQuad.setP1(transform.projectPoint(q.p1(), &clampedPoint));
clamped = clampedPoint;
projectedQuad.setP2(transform.projectPoint(q.p2(), &clampedPoint));
clamped |= clampedPoint;
projectedQuad.setP3(transform.projectPoint(q.p3(), &clampedPoint));
clamped |= clampedPoint;
projectedQuad.setP4(transform.projectPoint(q.p4(), &clampedPoint));
clamped |= clampedPoint;
return projectedQuad;
}
示例11: mapQuad
FloatQuad TransformationMatrix::mapQuad(const FloatQuad& q) const
{
if (isIdentityOrTranslation()) {
FloatQuad mappedQuad(q);
mappedQuad.move(static_cast<float>(m_matrix[3][0]), static_cast<float>(m_matrix[3][1]));
return mappedQuad;
}
FloatQuad result;
result.setP1(mapPoint(q.p1()));
result.setP2(mapPoint(q.p2()));
result.setP3(mapPoint(q.p3()));
result.setP4(mapPoint(q.p4()));
return result;
}