提交 fb4f9f1f 编写于 作者: W wangtiantian

IssueNo:#I3R5CP

Description:fix codestyle
Sig:graphic
Feature or Bugfix:Bugfix
Binary Source:No
上级 91376559
......@@ -687,7 +687,7 @@ void UICanvas::DoDrawImage(BufferInfo& gfxDstBuffer,
cordsTmp.SetPosition(start.x, start.y);
cordsTmp.SetHeight(imageParam->height);
cordsTmp.SetWidth(imageParam->width);
DrawImage::DrawCommon(gfxDstBuffer,cordsTmp, invalidatedArea,
DrawImage::DrawCommon(gfxDstBuffer, cordsTmp, invalidatedArea,
imageParam->image->GetPath(), style, paint.GetOpacity());
}
......
......@@ -746,8 +746,7 @@ void UIChartPolyline::DrawGradientColor(BufferInfo& gfxDstBuffer,
}
start.y = enableReverse_ ? (start.y - startY) : (startY - start.y);
end.y = enableReverse_ ? (end.y - startY) : (startY - end.y);
polyLine.start = start;
polyLine.end = end;
polyLine = { start, end };
FindCrossPoints(linePoints, polyLine, cross);
if (cross.firstFind && cross.secondFind) {
cross.first.y = enableReverse_ ? (cross.first.y + startY) : (startY - cross.first.y);
......@@ -760,8 +759,7 @@ void UIChartPolyline::DrawGradientColor(BufferInfo& gfxDstBuffer,
}
if (cross.firstFind && !cross.secondFind) {
cross.second.x = limitPoints.end.x;
cross.second.y = y;
cross.second = { limitPoints.end.x, y };
cross.first.y = y;
BaseGfxEngine::GetInstance()->DrawLine(gfxDstBuffer, cross.first, cross.second,
invalidatedArea, 1, data->GetFillColor(), mixData_[mixScale]);
......
......@@ -156,15 +156,21 @@ void UICheckBox::SelectedStateSoftwareDrawing(BufferInfo& gfxDstBuffer,
styleSelect.lineOpa_ = backgroundOpacity_;
uint8_t opa = DrawUtils::GetMixOpacity(opaScale_, backgroundOpacity_);
BaseGfxEngine::GetInstance()->DrawArc(gfxDstBuffer, arcInfoLeft, trunc, styleSelect, opaScale_, CapType::CAP_NONE);
// 2 : double
BaseGfxEngine::GetInstance()->DrawLine(gfxDstBuffer, start, mid, trunc, rectLineWidth * 2, Color::White(),
opa); // 2 : double
opa);
BaseGfxEngine::GetInstance()->DrawArc(gfxDstBuffer, arcInfoMid, trunc, styleSelect, opaScale_, CapType::CAP_NONE);
// 2 : double
BaseGfxEngine::GetInstance()->DrawLine(gfxDstBuffer, mid, end, trunc, rectLineWidth * 2, Color::White(),
opa); // 2 : double
opa);
BaseGfxEngine::GetInstance()->DrawArc(gfxDstBuffer, arcInfoRight, trunc, styleSelect, opaScale_, CapType::CAP_NONE);
}
void UICheckBox::UnSelectedStateSoftwareDrawing(BufferInfo& gfxDstBuffer, Rect rect, Rect trunc, int16_t borderRadius, int16_t rectLineWidth)
void UICheckBox::UnSelectedStateSoftwareDrawing(BufferInfo& gfxDstBuffer,
Rect rect,
Rect trunc,
int16_t borderRadius,
int16_t rectLineWidth)
{
Rect contentRect = GetContentRect();
Style styleUnSelect = StyleDefault::GetBackgroundTransparentStyle();
......
......@@ -69,15 +69,16 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
rectMid.SetRect(x, y, x + rectWidth_, y + (corner_ << 1) + 1);
Rect trunc = invalidatedArea;
bool isIntersect = trunc.Intersect(trunc, contentRect);
if (isIntersect == false) {
return;
}
switch (state_) {
case SELECTED: {
Style styleSelect = StyleDefault::GetBackgroundTransparentStyle();
styleSelect.borderRadius_ = corner_;
styleSelect.bgColor_ = Color::GetColorFromRGB(DEFAULT_BG_RED, DEFAULT_BG_GREEN, DEFAULT_BG_BLUE);
styleSelect.bgOpa_ = OPA_OPAQUE;
if (isIntersect) {
BaseGfxEngine::GetInstance()->DrawRect(gfxDstBuffer, rectMid, trunc, styleSelect, opaScale_);
}
BaseGfxEngine::GetInstance()->DrawRect(gfxDstBuffer, rectMid, trunc, styleSelect, opaScale_);
ArcInfo arcInfoRight = {
{ static_cast<int16_t>(x + rectWidth_ - corner_), static_cast<int16_t>(y + corner_) }, { 0 },
radius_, 0, CIRCLE_IN_DEGREE, nullptr
......@@ -85,10 +86,8 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
styleSelect.bgColor_ = Color::White();
styleSelect.lineWidth_ = radius_;
styleSelect.lineColor_ = Color::White();
if (isIntersect) {
BaseGfxEngine::GetInstance()->DrawArc(gfxDstBuffer, arcInfoRight, trunc,
styleSelect, OPA_OPAQUE, CapType::CAP_NONE);
}
BaseGfxEngine::GetInstance()->DrawArc(gfxDstBuffer, arcInfoRight, trunc,
styleSelect, OPA_OPAQUE, CapType::CAP_NONE);
break;
}
case UNSELECTED: {
......@@ -96,19 +95,15 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
styleUnSelect.bgColor_ = Color::White();
styleUnSelect.bgOpa_ = DEFAULT_UNSELECTED_OPA;
styleUnSelect.borderRadius_ = corner_;
if (isIntersect) {
BaseGfxEngine::GetInstance()->DrawRect(gfxDstBuffer, rectMid, trunc, styleUnSelect, opaScale_);
}
BaseGfxEngine::GetInstance()->DrawRect(gfxDstBuffer, rectMid, trunc, styleUnSelect, opaScale_);
ArcInfo arcInfoLeft = {
{ static_cast<int16_t>(x + corner_), static_cast<int16_t>(y + corner_) }, { 0 }, radius_, 0,
CIRCLE_IN_DEGREE, nullptr
};
styleUnSelect.lineColor_ = Color::White();
styleUnSelect.lineWidth_ = radius_;
if (isIntersect) {
BaseGfxEngine::GetInstance()->DrawArc(gfxDstBuffer, arcInfoLeft, trunc,
styleUnSelect, OPA_OPAQUE, CapType::CAP_NONE);
}
BaseGfxEngine::GetInstance()->DrawArc(gfxDstBuffer, arcInfoLeft, trunc,
styleUnSelect, OPA_OPAQUE, CapType::CAP_NONE);
break;
}
default:
......
......@@ -197,7 +197,11 @@ void DrawArc::DrawCircleNoEndpoint(BufferInfo& gfxDstBuffer,
}
}
void DrawArc::DrawAxisLine(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, const Rect& mask, const Style& style, uint8_t opa)
void DrawArc::DrawAxisLine(BufferInfo& gfxDstBuffer,
ArcInfo& arcInfo,
const Rect& mask,
const Style& style,
uint8_t opa)
{
int16_t lineWidth = 0;
int16_t outRadius = outRadius_ - 1;
......@@ -209,22 +213,22 @@ void DrawArc::DrawAxisLine(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, const Rec
lineWidth = outRadius - inRadius;
if (isCircle_ || (IS_IN_DEGREERANE(THREE_QUARTER_IN_DEGREE, arcInfo.startAngle, arcInfo.endAngle))) {
DrawHorLine(gfxDstBuffer, Point{static_cast<int16_t>(arcInfo.center.x - outRadius), arcInfo.center.y},
DrawHorLine(gfxDstBuffer, Point { static_cast<int16_t>(arcInfo.center.x - outRadius), arcInfo.center.y },
arcInfo.imgPos, mask, lineWidth, style, opa, arcInfo.imgSrc);
}
if (isCircle_ || (IS_IN_DEGREERANE(QUARTER_IN_DEGREE, arcInfo.startAngle, arcInfo.endAngle))) {
DrawHorLine(gfxDstBuffer, Point{static_cast<int16_t>(arcInfo.center.x + inRadius), arcInfo.center.y},
DrawHorLine(gfxDstBuffer, Point { static_cast<int16_t>(arcInfo.center.x + inRadius), arcInfo.center.y },
arcInfo.imgPos, mask, lineWidth, style, opa, arcInfo.imgSrc);
}
if (isCircle_ || (IS_IN_DEGREERANE(0, arcInfo.startAngle, arcInfo.endAngle))) {
DrawVerLine(gfxDstBuffer, Point{arcInfo.center.x, static_cast<int16_t>(arcInfo.center.y - outRadius)},
DrawVerLine(gfxDstBuffer, Point { arcInfo.center.x, static_cast<int16_t>(arcInfo.center.y - outRadius) },
arcInfo.imgPos, mask, lineWidth, style, opa, arcInfo.imgSrc);
}
if (isCircle_ || (IS_IN_DEGREERANE(SEMICIRCLE_IN_DEGREE, arcInfo.startAngle, arcInfo.endAngle))) {
DrawVerLine(gfxDstBuffer, Point{arcInfo.center.x, static_cast<int16_t>(arcInfo.center.y + inRadius)},
DrawVerLine(gfxDstBuffer, Point { arcInfo.center.x, static_cast<int16_t>(arcInfo.center.y + inRadius) },
arcInfo.imgPos, mask, lineWidth, style, opa, arcInfo.imgSrc);
}
}
......@@ -240,9 +244,9 @@ void DrawArc::DrawLineWithDegree(BufferInfo& gfxDstBuffer,
uint8_t quadrant)
{
if (isCircle_) {
DrawHorLine(gfxDstBuffer, Point{static_cast<int16_t>(arcInfo.center.x + start),
static_cast<int16_t>(arcInfo.center.y + y)}, arcInfo.imgPos,
mask, end - start, style, opaScale, arcInfo.imgSrc);
DrawHorLine(gfxDstBuffer,
Point {static_cast<int16_t>(arcInfo.center.x + start), static_cast<int16_t>(arcInfo.center.y + y)},
arcInfo.imgPos, mask, end - start, style, opaScale, arcInfo.imgSrc);
return;
}
uint16_t degreeStart = GetDegreeInQuadrant(CalculateTanDegree(MATH_ABS(start), MATH_ABS(y)), quadrant);
......@@ -260,7 +264,7 @@ void DrawArc::DrawLineWithDegree(BufferInfo& gfxDstBuffer,
return;
case IN_DEGREE_RANG:
DrawHorLine(gfxDstBuffer,
Point{static_cast<int16_t>(arcInfo.center.x + start), static_cast<int16_t>(arcInfo.center.y + y)},
Point { static_cast<int16_t>(arcInfo.center.x + start), static_cast<int16_t>(arcInfo.center.y + y) },
arcInfo.imgPos, mask, end - start, style, opaScale, arcInfo.imgSrc);
return;
case INTERSECT:
......@@ -306,7 +310,7 @@ int16_t DrawArc::DrawLineWithDegreeInner(BufferInfo& gfxDstBuffer,
}
if ((drawStart != COORD_MIN) && (drawEnd != COORD_MIN)) {
DrawHorLine(gfxDstBuffer,
Point{static_cast<int16_t>(arcInfo.center.x + drawStart), static_cast<int16_t>(arcInfo.center.y + y)},
Point { static_cast<int16_t>(arcInfo.center.x + drawStart), static_cast<int16_t>(arcInfo.center.y + y) },
arcInfo.imgPos, mask, drawEnd - drawStart, style, opaScale, arcInfo.imgSrc);
}
return drawEnd;
......@@ -367,22 +371,22 @@ void DrawArc::DrawPointAnti(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, int16_t
if (isCircle_ || (IS_IN_DEGREERANE(CIRCLE_IN_DEGREE - degreeBase, arcInfo.startAngle, arcInfo.endAngle))) {
startX = arcInfo.center.x + x;
starty = arcInfo.center.y + y_;
DrawHorLine(gfxDstBuffer, Point{startX, starty}, arcInfo.imgPos, mask, 0, style, antiOpa, arcInfo.imgSrc);
DrawHorLine(gfxDstBuffer, Point { startX, starty }, arcInfo.imgPos, mask, 0, style, antiOpa, arcInfo.imgSrc);
}
if (isCircle_ || (IS_IN_DEGREERANE(SEMICIRCLE_IN_DEGREE + degreeBase, arcInfo.startAngle, arcInfo.endAngle))) {
startX = arcInfo.center.x + x;
starty = arcInfo.center.y - y_;
DrawHorLine(gfxDstBuffer, Point{startX, starty}, arcInfo.imgPos, mask, 0, style, antiOpa, arcInfo.imgSrc);
DrawHorLine(gfxDstBuffer, Point { startX, starty }, arcInfo.imgPos, mask, 0, style, antiOpa, arcInfo.imgSrc);
}
if (isCircle_ || (IS_IN_DEGREERANE(degreeBase, arcInfo.startAngle, arcInfo.endAngle))) {
startX = arcInfo.center.x - x;
starty = arcInfo.center.y + y_;
DrawHorLine(gfxDstBuffer, Point{startX, starty}, arcInfo.imgPos, mask, 0, style, antiOpa, arcInfo.imgSrc);
DrawHorLine(gfxDstBuffer, Point { startX, starty }, arcInfo.imgPos, mask, 0, style, antiOpa, arcInfo.imgSrc);
}
if (isCircle_ || (IS_IN_DEGREERANE(SEMICIRCLE_IN_DEGREE - degreeBase, arcInfo.startAngle, arcInfo.endAngle))) {
startX = arcInfo.center.x - x;
starty = arcInfo.center.y - y_;
DrawHorLine(gfxDstBuffer, Point{startX, starty}, arcInfo.imgPos, mask, 0, style, antiOpa, arcInfo.imgSrc);
DrawHorLine(gfxDstBuffer, Point { startX, starty }, arcInfo.imgPos, mask, 0, style, antiOpa, arcInfo.imgSrc);
}
}
#endif
......
......@@ -113,7 +113,8 @@ private:
int16_t GetDrawAngle(int16_t angle);
void DrawCircleNoEndpoint(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, const Rect& mask, const Style& style, uint8_t opa, bool anti);
void DrawCircleNoEndpoint(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, const Rect& mask, const Style& style,
uint8_t opa, bool anti);
void DrawAxisLine(BufferInfo& gfxDstBuffer, ArcInfo& arcInfo, const Rect& mask, const Style& style, uint8_t opa);
......
......@@ -115,7 +115,7 @@ void DrawLabel::DrawArcText(BufferInfo& gfxDstBuffer,
TypedText::GetArcLetterPos(arcCenter, arcTextInfo.radius, angle, posX, posY);
angle += incrementAngle;
DrawLetterWithRotate(gfxDstBuffer, mask, fontId, letter, Point{MATH_ROUND(posX), MATH_ROUND(posY)},
DrawLetterWithRotate(gfxDstBuffer, mask, fontId, letter, Point { MATH_ROUND(posX), MATH_ROUND(posY) },
static_cast<int16_t>(rotateAngle), style.textColor_, opaScale);
}
}
......@@ -165,7 +165,7 @@ void DrawLabel::DrawLetterWithRotate(BufferInfo& gfxDstBuffer,
transMap.Rotate(rotateAngle, Vector2<float>(-node.left, node.top - head.ascender));
TransformDataInfo letterTranDataInfo = {ImageHeader{colorMode, 0, 0, 0, node.cols, node.rows}, fontMap, fontWeight,
BlurLevel::LEVEL0};
BaseGfxEngine::GetInstance()->DrawTransform(gfxDstBuffer, mask, Point{0, 0}, color, opaScale, transMap,
BaseGfxEngine::GetInstance()->DrawTransform(gfxDstBuffer, mask, Point { 0, 0 }, color, opaScale, transMap,
letterTranDataInfo);
}
} // namespace OHOS
......@@ -181,7 +181,7 @@ void DrawLine::DrawWuLine(BufferInfo& gfxDstBuffer, const Point& start, const Po
// width is longer than distance between start point and end point, need swap direction of line.
if (dx * dx + dy * dy < width * width) {
if ((dx == 1) && (dy == 1)) {
DrawThinWuLine(gfxDstBuffer, { x0Int, y0Int }, { x3Int, y3Int }, mask, 2, color, opacity); // 2 : width of line
DrawThinWuLine(gfxDstBuffer, { x0Int, y0Int }, { x3Int, y3Int }, mask, 2, color, opacity); // 2 : line width
return;
}
dx = MATH_ABS(x0Int - x1Int);
......
......@@ -562,7 +562,7 @@ void DrawUtils::BlendWithSoftWare(const uint8_t* src1,
uint8_t* dest = dst + destStride * y;
dest += destByteSize * x;
uint8_t pxByteSize = GetPxSizeByColorMode(srcMode) >> 3;
uint8_t pxByteSize = GetPxSizeByColorMode(srcMode) >> 3; // 3 : right shift 3 bits
uint8_t* src = const_cast<uint8_t*>(src1) + srcStride * srcRect.GetY() + pxByteSize * srcRect.GetX();
uint32_t width = srcRect.GetWidth();
uint32_t height = srcRect.GetHeight();
......@@ -862,7 +862,7 @@ void DrawUtils::DrawTriangleTrueColorBilinear888(const TriangleScanInfo& in, con
static void DrawTriangleTrueColorBilinear8888Inner(const TriangleScanInfo& in,
uint8_t* screenBuffer,
int16_t len,
const ColorMode bufferMode,
const ColorMode bufferMode,
int32_t u,
int32_t v)
{
......
......@@ -376,38 +376,5 @@ struct FileCommonHeader {
uint32_t fileLength;
};
#pragma pack()
/**
* @brief Get the Text Lang Fonts Table
* @param uint8_t langFontId [in] the font id
* @return UITextLanguageFontParam* the font table, definition is in font tool
*/
UITextLanguageFontParam* GetTextLangFontsTable(uint8_t langFontId);
/**
* @brief Get the Total Lang Id
* @return uint8_t the total Lang id, definition is in font tool
*/
uint8_t GetTotalLangId();
/**
* @brief Get the Total Font Id
* @return uint8_t the total font id, definition is in font tool
*/
uint8_t GetTotalFontId();
uint8_t GetBitmapFontIdMax();
/**
* @brief Get the Total Text Id
* @return uint8_t the total text id, definition is in font tool
*/
uint16_t GetTotalTextId();
/**
* @brief Get the Lang Text default param table
* @return LangTextParam* the param table, definition is in font tool
*/
LangTextParam* GetLangTextDefaultParamTable();
} // namespace OHOS
#endif /* UI_FONT_HEADER_H */
\ No newline at end of file
......@@ -16,6 +16,7 @@
#ifndef UI_TEST_VIEW_SCALE_ROTATE_H
#define UI_TEST_VIEW_SCALE_ROTATE_H
#include <cstdio>
#include "components/ui_arc_label.h"
#include "components/ui_box_progress.h"
#include "components/ui_button.h"
......@@ -27,10 +28,9 @@
#include "components/ui_scroll_view.h"
#include "components/ui_slider.h"
#include "components/ui_swipe_view.h"
#include "layout/list_layout.h"
#include "gfx_utils/sys_info.h"
#include "layout/list_layout.h"
#include "ui_test.h"
#include <stdio.h>
namespace OHOS {
class UITestViewScaleRotate : public UITest, public AnimatorCallback {
......
......@@ -72,7 +72,8 @@ BufferInfo* Monitor::GetBufferInfo()
bufferInfo->mode = ARGB8888;
bufferInfo->color = 0x44;
bufferInfo->phyAddr = bufferInfo->virAddr = tftFb_;
bufferInfo->stride = HORIZONTAL_RESOLUTION * (DrawUtils::GetPxSizeByColorMode(bufferInfo->mode) >> 3); // 3: Shift right 3 bits
// 3: Shift right 3 bits
bufferInfo->stride = HORIZONTAL_RESOLUTION * (DrawUtils::GetPxSizeByColorMode(bufferInfo->mode) >> 3);
bufferInfo->width = HORIZONTAL_RESOLUTION;
bufferInfo->height = VERTICAL_RESOLUTION;
}
......
......@@ -16,9 +16,10 @@
#ifndef GRAPHIC_LITE_MONITOR_H
#define GRAPHIC_LITE_MONITOR_H
#include <QtCore/qobject.h>
#include "engines/gfx/gfx_engine_manager.h"
#include "font/ui_font_header.h"
#include <QtCore/qobject.h>
namespace OHOS {
class Monitor : public QObject, public BaseGfxEngine {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册