本文整理汇总了C++中LayerRenderState::GetSidebandStream方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerRenderState::GetSidebandStream方法的具体用法?C++ LayerRenderState::GetSidebandStream怎么用?C++ LayerRenderState::GetSidebandStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerRenderState
的用法示例。
在下文中一共展示了LayerRenderState::GetSidebandStream方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Commit
bool
HwcComposer2D::PrepareLayerList(Layer* aLayer,
const nsIntRect& aClip,
const Matrix& aParentTransform,
bool aFindSidebandStreams)
{
// NB: we fall off this path whenever there are container layers
// that require intermediate surfaces. That means all the
// GetEffective*() coordinates are relative to the framebuffer.
bool fillColor = false;
const nsIntRegion visibleRegion = aLayer->GetLocalVisibleRegion().ToUnknownRegion();
if (visibleRegion.IsEmpty()) {
return true;
}
uint8_t opacity = std::min(0xFF, (int)(aLayer->GetEffectiveOpacity() * 256.0));
if (opacity == 0) {
LOGD("%s Layer has zero opacity; skipping", aLayer->Name());
return true;
}
if (!mHal->SupportTransparency() && opacity < 0xFF && !aFindSidebandStreams) {
LOGD("%s Layer has planar semitransparency which is unsupported by hwcomposer", aLayer->Name());
return false;
}
if (aLayer->GetMaskLayer() && !aFindSidebandStreams) {
LOGD("%s Layer has MaskLayer which is unsupported by hwcomposer", aLayer->Name());
return false;
}
nsIntRect clip;
nsIntRect layerClip = aLayer->GetLocalClipRect().valueOr(ParentLayerIntRect()).ToUnknownRect();
nsIntRect* layerClipPtr = aLayer->GetLocalClipRect() ? &layerClip : nullptr;
if (!HwcUtils::CalculateClipRect(aParentTransform,
layerClipPtr,
aClip,
&clip))
{
LOGD("%s Clip rect is empty. Skip layer", aLayer->Name());
return true;
}
// HWC supports only the following 2D transformations:
//
// Scaling via the sourceCrop and displayFrame in HwcLayer
// Translation via the sourceCrop and displayFrame in HwcLayer
// Rotation (in square angles only) via the HWC_TRANSFORM_ROT_* flags
// Reflection (horizontal and vertical) via the HWC_TRANSFORM_FLIP_* flags
//
// A 2D transform with PreservesAxisAlignedRectangles() has all the attributes
// above
Matrix layerTransform;
if (!aLayer->GetEffectiveTransform().Is2D(&layerTransform) ||
!layerTransform.PreservesAxisAlignedRectangles()) {
LOGD("Layer EffectiveTransform has a 3D transform or a non-square angle rotation");
return false;
}
Matrix layerBufferTransform;
if (!aLayer->GetEffectiveTransformForBuffer().Is2D(&layerBufferTransform) ||
!layerBufferTransform.PreservesAxisAlignedRectangles()) {
LOGD("Layer EffectiveTransformForBuffer has a 3D transform or a non-square angle rotation");
return false;
}
if (ContainerLayer* container = aLayer->AsContainerLayer()) {
if (container->UseIntermediateSurface() && !aFindSidebandStreams) {
LOGD("Container layer needs intermediate surface");
return false;
}
AutoTArray<Layer*, 12> children;
container->SortChildrenBy3DZOrder(children);
for (uint32_t i = 0; i < children.Length(); i++) {
if (!PrepareLayerList(children[i], clip, layerTransform, aFindSidebandStreams) &&
!aFindSidebandStreams) {
return false;
}
}
return true;
}
LayerRenderState state = aLayer->GetRenderState();
#if ANDROID_VERSION >= 21
if (!state.GetGrallocBuffer() && !state.GetSidebandStream().IsValid()) {
#else
if (!state.GetGrallocBuffer()) {
#endif
if (aLayer->AsColorLayer() && mColorFill) {
fillColor = true;
} else {
LOGD("%s Layer doesn't have a gralloc buffer", aLayer->Name());
return false;
}
}
//.........这里部分代码省略.........