ndk code style bugfix

Signed-off-by: yutanqi <yutanqi@huawei.com>
Change-Id: I00dc21e2efd82763aa051470c7de9a8a8f8b369c
This commit is contained in:
yutanqi 2022-02-18 10:35:21 +08:00
parent 82b06714fc
commit 06a7c92af6
14 changed files with 20 additions and 44 deletions

View File

@ -61,18 +61,18 @@ void OH_Drawing_BrushSetAntiAlias(OH_Drawing_Brush*, bool);
*
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
* @param OH_Drawing_Brush a pointer to OH_Drawing_Brush object
* @return OH_Drawing_Brush fill color
* @return OH_Drawing_Brush fill color, a 32-bit ARGB quantity
*/
OH_Drawing_Color OH_Drawing_BrushGetColor(const OH_Drawing_Brush*);
uint32_t OH_Drawing_BrushGetColor(const OH_Drawing_Brush*);
/**
* @brief Sets OH_Drawing_Brush fill color, that is a 32-bit ARGB quantity.
*
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
* @param OH_Drawing_Brush a pointer to OH_Drawing_Brush object
* @param OH_Drawing_Color a 32-bit ARGB quantity
* @param color a 32-bit ARGB quantity
*/
void OH_Drawing_BrushSetColor(OH_Drawing_Brush*, OH_Drawing_Color);
void OH_Drawing_BrushSetColor(OH_Drawing_Brush*, uint32_t color);
#ifdef __cplusplus
}

View File

@ -123,9 +123,9 @@ void OH_Drawing_CanvasDrawPath(OH_Drawing_Canvas*, const OH_Drawing_Path*);
*
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
* @param OH_Drawing_Canvas a pointer to OH_Drawing_Canvas object
* @param OH_Drawing_Color a 32-bit ARGB color quantity
* @param color a 32-bit ARGB color quantity
*/
void OH_Drawing_CanvasClear(OH_Drawing_Canvas*, OH_Drawing_Color);
void OH_Drawing_CanvasClear(OH_Drawing_Canvas*, uint32_t color);
#ifdef __cplusplus
}

View File

@ -32,7 +32,7 @@ extern "C" {
* @param blue blue, which range is 0x00~0xFF
* @return a 32-bit ARGB color quantity
*/
OH_Drawing_Color OH_Drawing_ColorSetArgb(uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue);
uint32_t OH_Drawing_ColorSetArgb(uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue);
#ifdef __cplusplus
}

View File

@ -61,18 +61,18 @@ void OH_Drawing_PenSetAntiAlias(OH_Drawing_Pen*, bool);
*
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
* @param OH_Drawing_Pen a pointer to OH_Drawing_Pen object
* @return OH_Drawing_Pen stroke color
* @return OH_Drawing_Pen stroke color, a 32-bit ARGB quantity
*/
OH_Drawing_Color OH_Drawing_PenGetColor(const OH_Drawing_Pen*);
uint32_t OH_Drawing_PenGetColor(const OH_Drawing_Pen*);
/**
* @brief Sets OH_Drawing_Pen stroke color, that is a 32-bit ARGB quantity.
*
* @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
* @param OH_Drawing_Pen a pointer to OH_Drawing_Pen object
* @param OH_Drawing_Color a 32-bit ARGB quantity
* @param color a 32-bit ARGB quantity
*/
void OH_Drawing_PenSetColor(OH_Drawing_Pen*, OH_Drawing_Color);
void OH_Drawing_PenSetColor(OH_Drawing_Pen*, uint32_t color);
/**
* @brief Returns OH_Drawing_Pen stroke width.

View File

@ -22,11 +22,6 @@
extern "C" {
#endif
/**
* @brief OH_Drawing_Color is a 32-bit ARGB color quantity.
*/
typedef uint32_t OH_Drawing_Color;
/**
* @brief OH_Drawing_Canvas contains the current state of the rendering,
* used to draw some destination such as shapes, bitmap.

View File

@ -51,12 +51,12 @@ void OH_Drawing_BrushSetAntiAlias(OH_Drawing_Brush* cBrush, bool aa)
CastToBrush(cBrush)->SetAntiAlias(aa);
}
OH_Drawing_Color OH_Drawing_BrushGetColor(const OH_Drawing_Brush* cBrush)
uint32_t OH_Drawing_BrushGetColor(const OH_Drawing_Brush* cBrush)
{
return CastToBrush(*cBrush).GetColor().CastToColorQuad();
}
void OH_Drawing_BrushSetColor(OH_Drawing_Brush* cBrush, OH_Drawing_Color c)
void OH_Drawing_BrushSetColor(OH_Drawing_Brush* cBrush, uint32_t color)
{
CastToBrush(cBrush)->SetColor(c);
CastToBrush(cBrush)->SetColor(color);
}

View File

@ -103,7 +103,7 @@ void OH_Drawing_CanvasDrawPath(OH_Drawing_Canvas* cCanvas, const OH_Drawing_Path
CastToCanvas(cCanvas)->DrawPath(CastToPath(*cPath));
}
void OH_Drawing_CanvasClear(OH_Drawing_Canvas* cCanvas, OH_Drawing_Color c)
void OH_Drawing_CanvasClear(OH_Drawing_Canvas* cCanvas, uint32_t color)
{
CastToCanvas(cCanvas)->Clear(c);
CastToCanvas(cCanvas)->Clear(color);
}

View File

@ -15,7 +15,7 @@
#include "c/drawing_color.h"
OH_Drawing_Color OH_Drawing_ColorSetArgb(uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue)
uint32_t OH_Drawing_ColorSetArgb(uint32_t alpha, uint32_t red, uint32_t green, uint32_t blue)
{
// alpha left-shifted 24, red left-shifted 16, green left-shifted 8, blue left-shifted 0
return ((alpha & 0xffu) << 24) | ((red & 0xffu) << 16) | ((green & 0xffu) << 8) | ((blue & 0xffu) << 0);

View File

@ -127,14 +127,14 @@ void OH_Drawing_PenSetAntiAlias(OH_Drawing_Pen* cPen, bool aa)
CastToPen(cPen)->SetAntiAlias(aa);
}
OH_Drawing_Color OH_Drawing_PenGetColor(const OH_Drawing_Pen* cPen)
uint32_t OH_Drawing_PenGetColor(const OH_Drawing_Pen* cPen)
{
return CastToPen(*cPen).GetColor().CastToColorQuad();
}
void OH_Drawing_PenSetColor(OH_Drawing_Pen* cPen, OH_Drawing_Color c)
void OH_Drawing_PenSetColor(OH_Drawing_Pen* cPen, uint32_t color)
{
CastToPen(cPen)->SetColor(c);
CastToPen(cPen)->SetColor(color);
}
float OH_Drawing_PenGetWidth(const OH_Drawing_Pen* cPen)

View File

@ -15,9 +15,6 @@
#include "core_canvas.h"
#include <iostream>
#include <string>
#include "impl_factory.h"
namespace OHOS {
@ -122,11 +119,6 @@ void CoreCanvas::DrawPicture(const Picture& picture)
impl_->DrawPicture(picture);
}
void CoreCanvas::DrawText(const Text& text)
{
impl_->DrawText(text);
}
void CoreCanvas::ClipRect(const Rect& rect, ClipOp op)
{
impl_->ClipRect(rect, op);

View File

@ -57,9 +57,6 @@ public:
void DrawImageRect(const Image& image, const Rect& dst, const SamplingOptions& sampling);
void DrawPicture(const Picture& picture);
// text
void DrawText(const Text& text); // TODO...
// clip
void ClipRect(const Rect& rect, ClipOp op);
void ClipRoundRect(const RoundRect& roundRect, ClipOp op);

View File

@ -81,9 +81,6 @@ public:
virtual void DrawImageRect(const Image& image, const Rect& dst, const SamplingOptions& sampling) = 0;
virtual void DrawPicture(const Picture& picture) = 0;
// text
virtual void DrawText(const Text& text) = 0; // TODO...
// clip
virtual void ClipRect(const Rect& rect, ClipOp op) = 0;
virtual void ClipRoundRect(const RoundRect& roundRect, ClipOp op) = 0;

View File

@ -407,8 +407,6 @@ void SkiaCanvas::DrawPicture(const Picture& picture)
LOGI("------- DrawPicture");
}
void SkiaCanvas::DrawText(const Text& text) {} // TODO...
void SkiaCanvas::ClipRect(const Rect& rect, ClipOp op)
{
SkRect clipRect = SkRect::MakeLTRB(rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom());

View File

@ -73,9 +73,6 @@ public:
void DrawImageRect(const Image& image, const Rect& dst, const SamplingOptions& sampling) override;
void DrawPicture(const Picture& picture) override;
// text
void DrawText(const Text& text) override; // TODO...
// clip
void ClipRect(const Rect& rect, ClipOp op) override;
void ClipRoundRect(const RoundRect& roundRect, ClipOp op) override;