diff --git a/libhwcomposer/hwcomposer.cpp b/libhwcomposer/hwcomposer.cpp index 517ae82..5eec149 100755 --- a/libhwcomposer/hwcomposer.cpp +++ b/libhwcomposer/hwcomposer.cpp @@ -54,12 +54,6 @@ enum { COMPOSITION_TYPE_DYN = 0x8 }; -enum HWCCompositionType { - HWC_USE_GPU = HWC_FRAMEBUFFER, // This layer is to be handled by Surfaceflinger - HWC_USE_OVERLAY = HWC_OVERLAY, // This layer is to be handled by the overlay - HWC_USE_COPYBIT // This layer is to be handled by copybit -}; - enum HWCLayerType{ HWC_SINGLE_VIDEO = 0x1, HWC_ORIG_RESOLUTION = 0x2, diff --git a/libqcomui/qcom_ui.cpp b/libqcomui/qcom_ui.cpp index 9de00e7..24995e6 100644 --- a/libqcomui/qcom_ui.cpp +++ b/libqcomui/qcom_ui.cpp @@ -291,3 +291,23 @@ int getPerFrameFlags(int hwclFlags, int layerFlags) { return flags; } + +/* + * Checks if FB is updated by this composition type + * + * @param: composition type + * @return: true if FB is updated, false if not + */ + +bool isUpdatingFB(HWCCompositionType compositionType) +{ + switch(compositionType) + { + case HWC_USE_COPYBIT: + return true; + default: + LOGE("%s: invalid composition type(%d)", __FUNCTION__, compositionType); + return false; + }; +} + diff --git a/libqcomui/qcom_ui.h b/libqcomui/qcom_ui.h index 6744edf..0909365 100644 --- a/libqcomui/qcom_ui.h +++ b/libqcomui/qcom_ui.h @@ -32,6 +32,7 @@ #include #include +#include using android::sp; using android::GraphicBuffer; @@ -68,6 +69,12 @@ enum { HWC_COMP_BYPASS = 0x40000000, }; +enum HWCCompositionType { + HWC_USE_GPU = HWC_FRAMEBUFFER, // This layer is to be handled by Surfaceflinger + HWC_USE_OVERLAY = HWC_OVERLAY, // This layer is to be handled by the overlay + HWC_USE_COPYBIT // This layer is to be handled by copybit +}; + /* * Structure to hold the buffer geometry */ @@ -155,4 +162,13 @@ int updateLayerQcomFlags(eLayerAttrib attribute, bool enable, int& currentFlags) */ int getPerFrameFlags(int hwclFlags, int layerFlags); +/* + * Checks if FB is updated by this composition type + * + * @param: composition type + * @return: true if FB is updated, false if not + */ + +bool isUpdatingFB(HWCCompositionType compositionType); + #endif // INCLUDE_LIBQCOM_UI