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

!778 代码告警处理#2

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