本文整理汇总了C++中nsIntRegion::GetNumRects方法的典型用法代码示例。如果您正苦于以下问题:C++ nsIntRegion::GetNumRects方法的具体用法?C++ nsIntRegion::GetNumRects怎么用?C++ nsIntRegion::GetNumRects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsIntRegion
的用法示例。
在下文中一共展示了nsIntRegion::GetNumRects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: screenIter
void
Compositor::DrawDiagnostics(DiagnosticFlags aFlags,
const nsIntRegion& aVisibleRegion,
const gfx::Rect& aClipRect,
const gfx::Matrix4x4& aTransform,
uint32_t aFlashCounter)
{
if (!ShouldDrawDiagnostics(aFlags)) {
return;
}
if (aVisibleRegion.GetNumRects() > 1) {
nsIntRegionRectIterator screenIter(aVisibleRegion);
while (const gfx::IntRect* rect = screenIter.Next())
{
DrawDiagnostics(aFlags | DiagnosticFlags::REGION_RECT,
IntRectToRect(*rect), aClipRect, aTransform,
aFlashCounter);
}
}
DrawDiagnostics(aFlags, IntRectToRect(aVisibleRegion.GetBounds()),
aClipRect, aTransform, aFlashCounter);
}
示例2:
static bool
IsClippingCheap(gfxContext* aTarget, const nsIntRegion& aRegion)
{
// Assume clipping is cheap if the context just has an integer
// translation, and the visible region is simple.
return !aTarget->CurrentMatrix().HasNonIntegerTranslation() &&
aRegion.GetNumRects() <= 1;
}
示例3: DrawDiagnostics
void
Compositor::DrawDiagnostics(DiagnosticFlags aFlags,
const nsIntRegion& aVisibleRegion,
const gfx::IntRect& aClipRect,
const gfx::Matrix4x4& aTransform,
uint32_t aFlashCounter)
{
if (!ShouldDrawDiagnostics(aFlags)) {
return;
}
if (aVisibleRegion.GetNumRects() > 1) {
for (auto iter = aVisibleRegion.RectIter(); !iter.Done(); iter.Next()) {
DrawDiagnostics(aFlags | DiagnosticFlags::REGION_RECT,
IntRectToRect(iter.Get()), aClipRect, aTransform,
aFlashCounter);
}
}
DrawDiagnostics(aFlags, IntRectToRect(aVisibleRegion.GetBounds()),
aClipRect, aTransform, aFlashCounter);
}
示例4: Commit
//.........这里部分代码省略.........
// | 0 1 | | 0 -1 | | 0 -1 |
//
hwcLayer.transform = HWC_TRANSFORM_ROT_180;
LOGD("Layer rotated 180 degrees");
}
} else {
if (rotation._22 < 0) {
// Vertical reflection
//
// | 1 0 |
// | 0 -1 |
//
hwcLayer.transform = HWC_TRANSFORM_FLIP_V;
LOGD("Layer rotated 180 degrees");
}
else {
// No rotation or reflection
//
// | 1 0 |
// | 0 1 |
//
hwcLayer.transform = 0;
}
}
const bool needsYFlip = state.OriginBottomLeft() ? true
: false;
if (needsYFlip) {
// Invert vertical reflection flag if it was already set
hwcLayer.transform ^= HWC_TRANSFORM_FLIP_V;
}
hwc_region_t region;
if (visibleRegion.GetNumRects() > 1) {
mVisibleRegions.push_back(HwcUtils::RectVector());
HwcUtils::RectVector* visibleRects = &(mVisibleRegions.back());
bool isVisible = false;
if(!HwcUtils::PrepareVisibleRegion(visibleRegion,
layerTransform,
layerBufferTransform,
clip,
bufferRect,
visibleRects,
isVisible)) {
LOGD("A region of layer is too small to be rendered by HWC");
return false;
}
if (!isVisible) {
// Layer is not visible, no need to render it
return true;
}
region.numRects = visibleRects->size();
region.rects = &((*visibleRects)[0]);
} else {
region.numRects = 1;
region.rects = &(hwcLayer.displayFrame);
}
hwcLayer.visibleRegionScreen = region;
} else {
hwcLayer.flags |= HwcUtils::HWC_COLOR_FILL;
ColorLayer* colorLayer = aLayer->AsColorLayer();
if (colorLayer->GetColor().a < 1.0) {
LOGD("Color layer has semitransparency which is unsupported");
return false;
}
hwcLayer.transform = colorLayer->GetColor().ToABGR();