未验证 提交 17629005 编写于 作者: O openharmony_ci 提交者: Gitee

!778 代码告警处理#2

Merge pull request !778 from youbing54/master
...@@ -707,8 +707,8 @@ void OnBlendDrawGradient(ListNode<UICanvas::DrawCmd>* curDraw, ...@@ -707,8 +707,8 @@ void OnBlendDrawGradient(ListNode<UICanvas::DrawCmd>* curDraw,
DrawCanvas::BuildLineGradientMatrix(drawCmd.paint, gradientMatrix, transform, distance); DrawCanvas::BuildLineGradientMatrix(drawCmd.paint, gradientMatrix, transform, distance);
GradientLinearCalculate gradientLinearCalculate; GradientLinearCalculate gradientLinearCalculate;
FillGradient span(interpolatorType, gradientLinearCalculate, gradientColorMode, 0, distance); FillGradient span(interpolatorType, gradientLinearCalculate, gradientColorMode, 0, distance);
UICanvas::BlendRaster(drawCmd.paint, drawCmd.param, blendRasterizer, rasterizer, renBase, transform, span, trunc, UICanvas::BlendRaster(drawCmd.paint, drawCmd.param, blendRasterizer, rasterizer, renBase,
pathParamBlend->isStroke); transform, span, trunc, pathParamBlend->isStroke);
} }
if (curDraw->data_.paint.GetGradient() == Paint::Radial) { if (curDraw->data_.paint.GetGradient() == Paint::Radial) {
Paint::RadialGradientPoint radialPoint = drawCmd.paint.GetRadialGradientPoint(); Paint::RadialGradientPoint radialPoint = drawCmd.paint.GetRadialGradientPoint();
...@@ -718,8 +718,8 @@ void OnBlendDrawGradient(ListNode<UICanvas::DrawCmd>* curDraw, ...@@ -718,8 +718,8 @@ void OnBlendDrawGradient(ListNode<UICanvas::DrawCmd>* curDraw,
GradientRadialCalculate gradientRadialCalculate(endRadius, radialPoint.x0 - radialPoint.x1, GradientRadialCalculate gradientRadialCalculate(endRadius, radialPoint.x0 - radialPoint.x1,
radialPoint.y0 - radialPoint.y1); radialPoint.y0 - radialPoint.y1);
FillGradient span(interpolatorType, gradientRadialCalculate, gradientColorMode, startRadius, endRadius); FillGradient span(interpolatorType, gradientRadialCalculate, gradientColorMode, startRadius, endRadius);
UICanvas::BlendRaster(drawCmd.paint, drawCmd.param, blendRasterizer, rasterizer, renBase, transform, span, trunc, UICanvas::BlendRaster(drawCmd.paint, drawCmd.param, blendRasterizer, rasterizer, renBase,
pathParamBlend->isStroke); transform, span, trunc, pathParamBlend->isStroke);
} }
} }
#endif #endif
...@@ -1015,7 +1015,7 @@ void UICanvas::DoDrawImage(BufferInfo& gfxDstBuffer, ...@@ -1015,7 +1015,7 @@ void UICanvas::DoDrawImage(BufferInfo& gfxDstBuffer,
imageView->SetPosition(start.x, start.y); imageView->SetPosition(start.x, start.y);
if (!paint.GetTransAffine().IsIdentity()) { if (!paint.GetTransAffine().IsIdentity()) {
float angle = paint.GetRotateAngle(); float angle = paint.GetRotateAngle();
imageView->Rotate(MATH_ROUND(angle),Vector2<float>(0, 0)); imageView->Rotate(MATH_ROUND(angle), Vector2<float>(0, 0));
imageView->Translate(Vector3<int16_t>(paint.GetTranslateX(), paint.GetTranslateY(), 1)); imageView->Translate(Vector3<int16_t>(paint.GetTranslateX(), paint.GetTranslateY(), 1));
Vector2<float> scale(static_cast<float>(paint.GetScaleX()), static_cast<float>(paint.GetScaleY())); Vector2<float> scale(static_cast<float>(paint.GetScaleX()), static_cast<float>(paint.GetScaleY()));
imageView->Scale(scale, Vector2<float>(0, 0)); imageView->Scale(scale, Vector2<float>(0, 0));
......
...@@ -53,7 +53,7 @@ public: ...@@ -53,7 +53,7 @@ public:
const Style& style, const Style& style,
const bool& isStroke); const bool& isStroke);
#if GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG #if defined(GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG) && GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
static void DoDrawShadow(BufferInfo& gfxDstBuffer, static void DoDrawShadow(BufferInfo& gfxDstBuffer,
void* param, void* param,
const Paint& paint, const Paint& paint,
...@@ -76,7 +76,7 @@ public: ...@@ -76,7 +76,7 @@ public:
TransAffine& transform, TransAffine& transform,
const bool& isStroke); const bool& isStroke);
#if GRAPHIC_ENABLE_GRADIENT_FILL_FLAG #if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
/** /**
* Render gradient * Render gradient
*/ */
...@@ -113,7 +113,7 @@ public: ...@@ -113,7 +113,7 @@ public:
float& endRadius); float& endRadius);
#endif // GRAPHIC_ENABLE_GRADIENT_FILL_FLAG #endif // GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
#if GRAPHIC_ENABLE_PATTERN_FILL_FLAG #if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
/** /**
* Render pattern mode * Render pattern mode
*/ */
...@@ -154,10 +154,10 @@ public: ...@@ -154,10 +154,10 @@ public:
template <class LineStyle> static void LineStyleCalc(DepictStroke<LineStyle>& strokeLineStyle, const Paint& paint) template <class LineStyle> static void LineStyleCalc(DepictStroke<LineStyle>& strokeLineStyle, const Paint& paint)
{ {
strokeLineStyle.SetWidth(paint.GetStrokeWidth()); // Line style related strokeLineStyle.SetWidth(paint.GetStrokeWidth()); // Line style related
#if GRAPHIC_ENABLE_LINECAP_FLAG #if defined(GRAPHIC_ENABLE_LINECAP_FLAG) && GRAPHIC_ENABLE_LINECAP_FLAG
strokeLineStyle.SetLineCap(paint.GetLineCap()); strokeLineStyle.SetLineCap(paint.GetLineCap());
#endif #endif
#if GRAPHIC_ENABLE_LINEJOIN_FLAG #if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
strokeLineStyle.SetLineJoin(paint.GetLineJoin()); strokeLineStyle.SetLineJoin(paint.GetLineJoin());
if (paint.GetMiterLimit() > 0) { if (paint.GetMiterLimit() > 0) {
strokeLineStyle.SetMiterLimit(paint.GetMiterLimit()); strokeLineStyle.SetMiterLimit(paint.GetMiterLimit());
...@@ -165,7 +165,7 @@ public: ...@@ -165,7 +165,7 @@ public:
#endif #endif
}; };
#if GRAPHIC_ENABLE_DASH_GENERATE_FLAG #if defined(GRAPHIC_ENABLE_DASH_GENERATE_FLAG) && GRAPHIC_ENABLE_DASH_GENERATE_FLAG
/** /**
* Set linedash style * Set linedash style
*/ */
......
...@@ -346,8 +346,8 @@ void DrawUtils::DrawNormalLetter(BufferInfo& gfxDstBuffer, ...@@ -346,8 +346,8 @@ void DrawUtils::DrawNormalLetter(BufferInfo& gfxDstBuffer,
} }
if (letterInfo.havebackgroundColor) { if (letterInfo.havebackgroundColor) {
Rect backgroundRect(posX, letterInfo.mask.GetTop(), Rect backgroundRect(posX, letterInfo.mask.GetTop(), posX + letterW + letterInfo.letterSpace_ - 1,
posX + letterW + letterInfo.letterSpace_ - 1, letterInfo.mask.GetBottom() - letterInfo.lineSpace_); letterInfo.mask.GetBottom() - letterInfo.lineSpace_);
Style style; Style style;
style.bgColor_ = letterInfo.backgroundColor; style.bgColor_ = letterInfo.backgroundColor;
BaseGfxEngine::GetInstance()->DrawRect(gfxDstBuffer, backgroundRect, BaseGfxEngine::GetInstance()->DrawRect(gfxDstBuffer, backgroundRect,
......
...@@ -74,7 +74,7 @@ struct LabelLineInfo { ...@@ -74,7 +74,7 @@ struct LabelLineInfo {
UITextLanguageDirect direct; UITextLanguageDirect direct;
uint32_t* codePoints; uint32_t* codePoints;
bool baseLine; bool baseLine;
#if ENABLE_VECTOR_FONT #if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
TextStyle* textStyles; TextStyle* textStyles;
#endif #endif
List<BackgroundColor>* backgroundColor; List<BackgroundColor>* backgroundColor;
...@@ -97,7 +97,7 @@ struct LabelLetterInfo { ...@@ -97,7 +97,7 @@ struct LabelLetterInfo {
uint8_t fontId; uint8_t fontId;
uint8_t shapingId; uint8_t shapingId;
uint8_t fontSize; uint8_t fontSize;
#if ENABLE_VECTOR_FONT #if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
TextStyle textStyle; TextStyle textStyle;
#endif #endif
bool baseLine; bool baseLine;
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
namespace OHOS { namespace OHOS {
bool UIFont::setFontAllocFlag_ = false; bool UIFont::setFontAllocFlag_ = false;
UIFont::UIFont() : instance_(nullptr), defaultInstance_(nullptr){} UIFont::UIFont() : instance_(nullptr), defaultInstance_(nullptr) {}
UIFont::~UIFont(){} UIFont::~UIFont() {}
UIFont* UIFont::GetInstance() UIFont* UIFont::GetInstance()
{ {
......
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
ListHead lruHead; ListHead lruHead;
uint8_t fontId; uint8_t fontId;
uint32_t unicode; uint32_t unicode;
#if ENABLE_VECTOR_FONT #if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
TextStyle textStyle; TextStyle textStyle;
#endif #endif
uint8_t data[]; uint8_t data[];
......
...@@ -144,7 +144,7 @@ uint8_t UIFontVector::RegisterFontInfo(const UITextLanguageFontParam* fontsTable ...@@ -144,7 +144,7 @@ uint8_t UIFontVector::RegisterFontInfo(const UITextLanguageFontParam* fontsTable
return count; return count;
} }
/* Note: when use ttc font file, freetype should export FT_Stream_New/FT_Stream_Free function*/ // Note: when use ttc font file, freetype should export FT_Stream_New/FT_Stream_Free function
uint8_t UIFontVector::RegisterTtcFontInfo(const char* ttcName, TtfInfo* ttfInfo, uint8_t count) uint8_t UIFontVector::RegisterTtcFontInfo(const char* ttcName, TtfInfo* ttfInfo, uint8_t count)
{ {
if ((ttcName == nullptr) || !freeTypeInited_) { if ((ttcName == nullptr) || !freeTypeInited_) {
......
...@@ -60,7 +60,7 @@ protected: ...@@ -60,7 +60,7 @@ protected:
private: private:
uint8_t* SearchInFont(uint32_t unicode, GlyphNode& glyphNode, uint8_t fontId); uint8_t* SearchInFont(uint32_t unicode, GlyphNode& glyphNode, uint8_t fontId);
int16_t GetWidthInFontId(uint32_t unicode, uint8_t fontId); int16_t GetWidthInFontId(uint32_t unicode, uint8_t fontId);
#if ENABLE_MULTI_FONT #if defined(ENABLE_MULTI_FONT) && ENABLE_MULTI_FONT
int8_t GetMultiGlyphNode(uint32_t unicode, GlyphNode& glyphNode, uint8_t fontId); int8_t GetMultiGlyphNode(uint32_t unicode, GlyphNode& glyphNode, uint8_t fontId);
#endif #endif
void CloseFontFd(); void CloseFontFd();
......
...@@ -87,17 +87,17 @@ private: ...@@ -87,17 +87,17 @@ private:
}; };
TtcInfo ttcInfos_[FONT_ID_MAX] = {}; TtcInfo ttcInfos_[FONT_ID_MAX] = {};
void SetFace(FaceInfo& faceInfo, uint32_t unicode) const; void SetFace(FaceInfo& faceInfo, uint32_t unicode) const;
#if ENABLE_VECTOR_FONT #if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
void SetFace(FaceInfo& faceInfo, uint32_t unicode, TextStyle textStyle) const; void SetFace(FaceInfo& faceInfo, uint32_t unicode, TextStyle textStyle) const;
#endif #endif
uint8_t GetFontId(uint32_t unicode) const; uint8_t GetFontId(uint32_t unicode) const;
uint32_t GetKey(uint8_t fontId, uint32_t size); uint32_t GetKey(uint8_t fontId, uint32_t size);
int8_t LoadGlyphIntoFace(uint8_t& fontId, uint32_t unicode, FT_Face face); int8_t LoadGlyphIntoFace(uint8_t& fontId, uint32_t unicode, FT_Face face);
#if ENABLE_VECTOR_FONT #if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
int8_t LoadGlyphIntoFace(uint8_t& fontId, uint32_t unicode, FT_Face face, TextStyle textStyle); int8_t LoadGlyphIntoFace(uint8_t& fontId, uint32_t unicode, FT_Face face, TextStyle textStyle);
#endif #endif
uint8_t IsGlyphFont(uint32_t unicode); uint8_t IsGlyphFont(uint32_t unicode);
#if ENABLE_VECTOR_FONT #if defined(ENABLE_VECTOR_FONT) && ENABLE_VECTOR_FONT
void SetItaly(FT_GlyphSlot slot); void SetItaly(FT_GlyphSlot slot);
void SetBold(uint8_t fontId); void SetBold(uint8_t fontId);
#endif #endif
......
...@@ -58,7 +58,7 @@ namespace OHOS { ...@@ -58,7 +58,7 @@ namespace OHOS {
#define PNG_24_RGB_IMAGE_PATH (IMAGE_DIR "png_24_rgb.png") #define PNG_24_RGB_IMAGE_PATH (IMAGE_DIR "png_24_rgb.png")
#define PNG_32_RGB_ALPHA_IMAGE_PATH (IMAGE_DIR "png_32_rgba.png") #define PNG_32_RGB_ALPHA_IMAGE_PATH (IMAGE_DIR "png_32_rgba.png")
#define GIF_IMAGE_PATH (IMAGE_DIR "gifImage.gif") #define GIF_IMAGE_PATH (IMAGE_DIR "gifImage.gif")
#if (ENABLE_GIF == 1) #if defined(ENABLE_GIF) && (ENABLE_GIF == 1)
#define GIF_IMAGE_PATH1 (IMAGE_DIR "gif_image1.gif") #define GIF_IMAGE_PATH1 (IMAGE_DIR "gif_image1.gif")
#define GIF_IMAGE_PATH2 (IMAGE_DIR "gif_image2.gif") #define GIF_IMAGE_PATH2 (IMAGE_DIR "gif_image2.gif")
#define GIF_IMAGE_PATH_ERROR (IMAGE_DIR "gif_error.gif") #define GIF_IMAGE_PATH_ERROR (IMAGE_DIR "gif_error.gif")
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "dock/key_input_device.h" #include "dock/key_input_device.h"
namespace OHOS { namespace OHOS {
#if USE_KEY #if defined(USE_KEY) && USE_KEY
class KeyInput : public KeyInputDevice { class KeyInput : public KeyInputDevice {
public: public:
KeyInput() : leftButtonDown_(false), lastX_(0), lastY_(0) {} KeyInput() : leftButtonDown_(false), lastX_(0), lastY_(0) {}
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "dock/pointer_input_device.h" #include "dock/pointer_input_device.h"
namespace OHOS { namespace OHOS {
#if USE_MOUSE #if defined(USE_MOUSE) && USE_MOUSE
class MouseInput : public PointerInputDevice { class MouseInput : public PointerInputDevice {
public: public:
MouseInput() : leftButtonDown_(false), lastX_(0), lastY_(0) {} MouseInput() : leftButtonDown_(false), lastX_(0), lastY_(0) {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册