提交 df62e453 编写于 作者: Z Zhouyj_zju

Description: add xgrb8888 for screen bitmap

IssueNo: https://gitee.com/openharmony/graphic_ui/issues/I64WV4
Feature or Bugfix: Bugfix
Binary Source:No
Signed-off-by: Nzhouyj <zhouyuanjie1@huawei.com>
上级 cd6f9ca9
...@@ -39,11 +39,14 @@ uint16_t Screen::GetHeight() ...@@ -39,11 +39,14 @@ uint16_t Screen::GetHeight()
bool Screen::GetCurrentScreenBitmap(ImageInfo& info) bool Screen::GetCurrentScreenBitmap(ImageInfo& info)
{ {
#if defined ENABLE_WINDOW && ENABLE_WINDOW
return false;
#else
BufferInfo* bufferInfo = BaseGfxEngine::GetInstance()->GetFBBufferInfo(); BufferInfo* bufferInfo = BaseGfxEngine::GetInstance()->GetFBBufferInfo();
if (bufferInfo == nullptr) { if (bufferInfo == nullptr) {
return false; return false;
} }
uint16_t screenWidth = BaseGfxEngine::GetInstance()->GetScreenWidth(); uint16_t screenWidth = BaseGfxEngine::GetInstance()->GetFBBufferInfo()->width;
uint16_t screenHeight = BaseGfxEngine::GetInstance()->GetScreenHeight(); uint16_t screenHeight = BaseGfxEngine::GetInstance()->GetScreenHeight();
info.header.colorMode = ARGB8888; info.header.colorMode = ARGB8888;
info.dataSize = screenWidth * screenHeight * DrawUtils::GetByteSizeByColorMode(info.header.colorMode); info.dataSize = screenWidth * screenHeight * DrawUtils::GetByteSizeByColorMode(info.header.colorMode);
...@@ -60,6 +63,7 @@ bool Screen::GetCurrentScreenBitmap(ImageInfo& info) ...@@ -60,6 +63,7 @@ bool Screen::GetCurrentScreenBitmap(ImageInfo& info)
Point dstPos = {0, 0}; Point dstPos = {0, 0};
BlendOption blendOption; BlendOption blendOption;
blendOption.opacity = OPA_OPAQUE; blendOption.opacity = OPA_OPAQUE;
blendOption.mode = BLEND_SRC;
BufferInfo dstBufferInfo; BufferInfo dstBufferInfo;
dstBufferInfo.rect = screenRect; dstBufferInfo.rect = screenRect;
...@@ -72,6 +76,7 @@ bool Screen::GetCurrentScreenBitmap(ImageInfo& info) ...@@ -72,6 +76,7 @@ bool Screen::GetCurrentScreenBitmap(ImageInfo& info)
BaseGfxEngine::GetInstance()->Blit(dstBufferInfo, dstPos, *bufferInfo, screenRect, blendOption); BaseGfxEngine::GetInstance()->Blit(dstBufferInfo, dstPos, *bufferInfo, screenRect, blendOption);
return true; return true;
#endif
} }
ScreenShape Screen::GetScreenShape() ScreenShape Screen::GetScreenShape()
......
...@@ -301,7 +301,9 @@ const UIView* UITestViewBitmap::GetTestView() ...@@ -301,7 +301,9 @@ const UIView* UITestViewBitmap::GetTestView()
UIKitBitmapTestGetViewBitmap002(); UIKitBitmapTestGetViewBitmap002();
UIKitBitmapTestGetViewBitmap003(); UIKitBitmapTestGetViewBitmap003();
UIKitBitmapTestGetViewBitmap004(); UIKitBitmapTestGetViewBitmap004();
#if !(defined ENABLE_WINDOW && ENABLE_WINDOW)
UIKitBitmapTestGetScreenBitmap001(); UIKitBitmapTestGetScreenBitmap001();
#endif
return container_; return container_;
} }
...@@ -373,6 +375,7 @@ void UITestViewBitmap::UIKitBitmapTestGetViewBitmap004() ...@@ -373,6 +375,7 @@ void UITestViewBitmap::UIKitBitmapTestGetViewBitmap004()
btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE);
} }
#if !(defined ENABLE_WINDOW && ENABLE_WINDOW)
void UITestViewBitmap::UIKitBitmapTestGetScreenBitmap001() void UITestViewBitmap::UIKitBitmapTestGetScreenBitmap001()
{ {
UILabelButton* btn = new UILabelButton(); UILabelButton* btn = new UILabelButton();
...@@ -390,4 +393,5 @@ void UITestViewBitmap::UIKitBitmapTestGetScreenBitmap001() ...@@ -390,4 +393,5 @@ void UITestViewBitmap::UIKitBitmapTestGetScreenBitmap001()
btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE);
btn->SetViewId(UI_TEST_FULL_SCREEN_CAPTURE); btn->SetViewId(UI_TEST_FULL_SCREEN_CAPTURE);
} }
#endif
} // namespace OHOS } // namespace OHOS
...@@ -35,7 +35,9 @@ public: ...@@ -35,7 +35,9 @@ public:
void UIKitBitmapTestGetViewBitmap002(); void UIKitBitmapTestGetViewBitmap002();
void UIKitBitmapTestGetViewBitmap003(); void UIKitBitmapTestGetViewBitmap003();
void UIKitBitmapTestGetViewBitmap004(); void UIKitBitmapTestGetViewBitmap004();
#if !(defined ENABLE_WINDOW && ENABLE_WINDOW)
void UIKitBitmapTestGetScreenBitmap001(); void UIKitBitmapTestGetScreenBitmap001();
#endif
private: private:
UIScrollView* container_ = nullptr; UIScrollView* container_ = nullptr;
UIImageView* viewBitmap_ = nullptr; UIImageView* viewBitmap_ = nullptr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册