本文整理汇总了C++中LayerRenderState::FormatRBSwapped方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerRenderState::FormatRBSwapped方法的具体用法?C++ LayerRenderState::FormatRBSwapped怎么用?C++ LayerRenderState::FormatRBSwapped使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerRenderState
的用法示例。
在下文中一共展示了LayerRenderState::FormatRBSwapped方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Commit
//.........这里部分代码省略.........
#if ANDROID_VERSION >= 21
if (state.GetSidebandStream().IsValid()) {
handle = state.GetSidebandStream().GetRawNativeHandle();
} else if (state.GetGrallocBuffer()) {
handle = state.GetGrallocBuffer()->getNativeBuffer()->handle;
}
#else
if (state.GetGrallocBuffer()) {
handle = state.GetGrallocBuffer()->getNativeBuffer()->handle;
}
#endif
hwcLayer.handle = handle;
hwcLayer.flags = 0;
hwcLayer.hints = 0;
hwcLayer.blending = isOpaque ? HWC_BLENDING_NONE : HWC_BLENDING_PREMULT;
#if ANDROID_VERSION >= 17
hwcLayer.compositionType = HWC_FRAMEBUFFER;
#if ANDROID_VERSION >= 21
if (state.GetSidebandStream().IsValid()) {
hwcLayer.compositionType = HWC_SIDEBAND;
}
#endif
hwcLayer.acquireFenceFd = -1;
hwcLayer.releaseFenceFd = -1;
#if ANDROID_VERSION >= 18
hwcLayer.planeAlpha = opacity;
#endif
#else
hwcLayer.compositionType = HwcUtils::HWC_USE_COPYBIT;
#endif
if (!fillColor) {
if (state.FormatRBSwapped()) {
if (!mRBSwapSupport) {
LOGD("No R/B swap support in H/W Composer");
return false;
}
hwcLayer.flags |= HwcUtils::HWC_FORMAT_RB_SWAP;
}
// Translation and scaling have been addressed in PrepareLayerRects().
// Given the above and that we checked for PreservesAxisAlignedRectangles()
// the only possible transformations left to address are
// square angle rotation and horizontal/vertical reflection.
//
// The rotation and reflection permutations total 16 but can be
// reduced to 8 transformations after eliminating redundancies.
//
// All matrices represented here are in the form
//
// | xx xy |
// | yx yy |
//
// And ignore scaling.
//
// Reflection is applied before rotation
gfx::Matrix rotation = layerTransform;
// Compute fuzzy zero like PreservesAxisAlignedRectangles()
if (fabs(rotation._11) < 1e-6) {
if (rotation._21 < 0) {
if (rotation._12 > 0) {
// 90 degree rotation
//
// | 0 -1 |
// | 1 0 |
示例2: LOGD
//.........这里部分代码省略.........
bufferRect = nsIntRect(0, 0, state.mSize.width, state.mSize.height);
}
}
HwcLayer& hwcLayer = mList->hwLayers[current];
if(!HwcUtils::PrepareLayerRects(visibleRect,
transform * aGLWorldTransform,
clip,
bufferRect,
&(hwcLayer.sourceCrop),
&(hwcLayer.displayFrame)))
{
return true;
}
buffer_handle_t handle = fillColor ? nullptr : state.mSurface->getNativeBuffer()->handle;
hwcLayer.handle = handle;
hwcLayer.flags = 0;
hwcLayer.hints = 0;
hwcLayer.blending = HWC_BLENDING_PREMULT;
#if ANDROID_VERSION >= 18
hwcLayer.compositionType = HWC_FRAMEBUFFER;
hwcLayer.acquireFenceFd = -1;
hwcLayer.releaseFenceFd = -1;
hwcLayer.planeAlpha = opacity;
#else
hwcLayer.compositionType = HwcUtils::HWC_USE_COPYBIT;
#endif
if (!fillColor) {
if (state.FormatRBSwapped()) {
if (!mRBSwapSupport) {
LOGD("No R/B swap support in H/W Composer");
return false;
}
hwcLayer.flags |= HwcUtils::HWC_FORMAT_RB_SWAP;
}
// Translation and scaling have been addressed in PrepareLayerRects().
// Given the above and that we checked for PreservesAxisAlignedRectangles()
// the only possible transformations left to address are
// square angle rotation and horizontal/vertical reflection.
//
// The rotation and reflection permutations total 16 but can be
// reduced to 8 transformations after eliminating redundancies.
//
// All matrices represented here are in the form
//
// | xx xy |
// | yx yy |
//
// And ignore scaling.
//
// Reflection is applied before rotation
gfxMatrix rotation = transform * aGLWorldTransform;
// Compute fuzzy zero like PreservesAxisAlignedRectangles()
if (fabs(rotation.xx) < 1e-6) {
if (rotation.xy < 0) {
if (rotation.yx > 0) {
// 90 degree rotation
//
// | 0 -1 |
// | 1 0 |
示例3: LOGD
//.........这里部分代码省略.........
mHwcLayerMap.Clear();
}
}
if (!mList || current >= mMaxLayerCount) {
if (!ReallocLayerList() || current >= mMaxLayerCount) {
LOGE("PrepareLayerList failed! Could not increase the maximum layer count");
return false;
}
}
HwcLayer& hwcLayer = mList->hwLayers[current];
hwcLayer.displayFrame = displayFrame;
setCrop(&hwcLayer, sourceCrop);
buffer_handle_t handle = fillColor ? nullptr : state.mSurface->getNativeBuffer()->handle;
hwcLayer.handle = handle;
hwcLayer.flags = 0;
hwcLayer.hints = 0;
hwcLayer.blending = isOpaque ? HWC_BLENDING_NONE : HWC_BLENDING_PREMULT;
#if ANDROID_VERSION >= 17
hwcLayer.compositionType = HWC_FRAMEBUFFER;
hwcLayer.acquireFenceFd = -1;
hwcLayer.releaseFenceFd = -1;
#if ANDROID_VERSION >= 18
hwcLayer.planeAlpha = opacity;
#endif
#else
hwcLayer.compositionType = HwcUtils::HWC_USE_COPYBIT;
#endif
if (!fillColor) {
if (state.FormatRBSwapped()) {
if (!mRBSwapSupport) {
LOGD("No R/B swap support in H/W Composer");
return false;
}
hwcLayer.flags |= HwcUtils::HWC_FORMAT_RB_SWAP;
}
// Translation and scaling have been addressed in PrepareLayerRects().
// Given the above and that we checked for PreservesAxisAlignedRectangles()
// the only possible transformations left to address are
// square angle rotation and horizontal/vertical reflection.
//
// The rotation and reflection permutations total 16 but can be
// reduced to 8 transformations after eliminating redundancies.
//
// All matrices represented here are in the form
//
// | xx xy |
// | yx yy |
//
// And ignore scaling.
//
// Reflection is applied before rotation
gfx::Matrix rotation = layerTransform;
// Compute fuzzy zero like PreservesAxisAlignedRectangles()
if (fabs(rotation._11) < 1e-6) {
if (rotation._21 < 0) {
if (rotation._12 > 0) {
// 90 degree rotation
//
// | 0 -1 |
// | 1 0 |