本文整理汇总了C++中GraphicsContext::concat3DTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsContext::concat3DTransform方法的具体用法?C++ GraphicsContext::concat3DTransform怎么用?C++ GraphicsContext::concat3DTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsContext
的用法示例。
在下文中一共展示了GraphicsContext::concat3DTransform方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: beginClip
void TextureMapperImageBuffer::beginClip(const TransformationMatrix& matrix, const FloatRect& rect)
{
GraphicsContext* context = currentContext();
if (!context)
return;
#if ENABLE(3D_RENDERING)
TransformationMatrix previousTransform = context->get3DTransform();
#else
AffineTransform previousTransform = context->getCTM();
#endif
context->save();
#if ENABLE(3D_RENDERING)
context->concat3DTransform(matrix);
#else
context->concatCTM(matrix.toAffineTransform());
#endif
context->clip(rect);
#if ENABLE(3D_RENDERING)
context->set3DTransform(previousTransform);
#else
context->setCTM(previousTransform);
#endif
}
示例2: drawTexture
void TextureMapperImageBuffer::drawTexture(const BitmapTexture& texture, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity, const BitmapTexture* maskTexture, unsigned /* exposedEdges */)
{
GraphicsContext* context = currentContext();
if (!context)
return;
const BitmapTextureImageBuffer& textureImageBuffer = static_cast<const BitmapTextureImageBuffer&>(texture);
ImageBuffer* image = textureImageBuffer.m_image.get();
OwnPtr<ImageBuffer> maskedImage;
if (maskTexture && maskTexture->isValid()) {
const BitmapTextureImageBuffer* mask = static_cast<const BitmapTextureImageBuffer*>(maskTexture);
maskedImage = ImageBuffer::create(maskTexture->contentSize());
GraphicsContext* maskContext = maskedImage->context();
maskContext->drawImageBuffer(image, ColorSpaceDeviceRGB, IntPoint::zero(), CompositeCopy);
if (opacity < 1) {
maskContext->setAlpha(opacity);
opacity = 1;
}
maskContext->drawImageBuffer(mask->m_image.get(), ColorSpaceDeviceRGB, IntPoint::zero(), CompositeDestinationIn);
image = maskedImage.get();
}
context->save();
context->setAlpha(opacity);
#if ENABLE(3D_RENDERING)
context->concat3DTransform(matrix);
#else
context->concatCTM(matrix.toAffineTransform());
#endif
context->drawImageBuffer(image, ColorSpaceDeviceRGB, targetRect);
context->restore();
}
示例3: drawSolidColor
void TextureMapperImageBuffer::drawSolidColor(const FloatRect& rect, const TransformationMatrix& matrix, const Color& color)
{
GraphicsContext* context = currentContext();
if (!context)
return;
context->save();
#if ENABLE(3D_RENDERING)
context->concat3DTransform(matrix);
#else
context->concatCTM(matrix.toAffineTransform());
#endif
context->fillRect(rect, color, ColorSpaceDeviceRGB);
context->restore();
}
示例4: drawTexture
void TextureMapperImageBuffer::drawTexture(const BitmapTexture& texture, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity, unsigned /* exposedEdges */)
{
GraphicsContext* context = currentContext();
if (!context)
return;
const BitmapTextureImageBuffer& textureImageBuffer = static_cast<const BitmapTextureImageBuffer&>(texture);
ImageBuffer* image = textureImageBuffer.m_image.get();
context->save();
context->setCompositeOperation(isInMaskMode() ? CompositeDestinationIn : CompositeSourceOver);
context->setAlpha(opacity);
#if ENABLE(3D_RENDERING)
context->concat3DTransform(matrix);
#else
context->concatCTM(matrix.toAffineTransform());
#endif
context->drawImageBuffer(image, ColorSpaceDeviceRGB, targetRect);
context->restore();
}