Simplify factory and renderer APIs

Some good idea, perhaps for the future, but for now we don't take advantage of (nor does canvas2d support) ...
- local matrix on gradients or images
- tiling modes on gradients or images
- patterns (i.e. image->makeShader())
... so removing these (speculative) APIs from our porting layers.

If we decide to support some of these in the future, easy to add them back (but for now, we never used or tested them).

Diffs=
034d4f833 Simplify factory and renderer APIs
This commit is contained in:
mikerreed
2022-07-25 18:22:44 +00:00
parent 5774edcab9
commit 52f10f8179
17 changed files with 29 additions and 124 deletions

View File

@@ -24,18 +24,14 @@ namespace rive {
float ey,
const ColorInt colors[], // [count]
const float stops[], // [count]
size_t count,
RenderTileMode,
const Mat2D* localMatrix = nullptr) override;
size_t count) override;
rcp<RenderShader> makeRadialGradient(float cx,
float cy,
float radius,
const ColorInt colors[], // [count]
const float stops[], // [count]
size_t count,
RenderTileMode,
const Mat2D* localMatrix = nullptr) override;
size_t count) override;
// Returns a full-formed RenderPath -- can be treated as immutable
std::unique_ptr<RenderPath>

View File

@@ -17,10 +17,6 @@ namespace rive {
public:
SokolRenderImage(sg_image image);
sg_image image() const { return m_Image; }
rcp<RenderShader> makeShader(RenderTileMode, RenderTileMode, const Mat2D*) const override {
return nullptr;
}
};
class SokolTessRenderer : public TessRenderer {

View File

@@ -35,9 +35,7 @@ rcp<RenderShader> SokolFactory::makeLinearGradient(float sx,
float ey,
const ColorInt colors[], // [count]
const float stops[], // [count]
size_t count,
RenderTileMode,
const Mat2D* localMatrix) {
size_t count) {
return nullptr;
}
@@ -46,9 +44,7 @@ rcp<RenderShader> SokolFactory::makeRadialGradient(float cx,
float radius,
const ColorInt colors[], // [count]
const float stops[], // [count]
size_t count,
RenderTileMode,
const Mat2D* localMatrix) {
size_t count) {
return nullptr;
}