CanvasRenderer: Add Gradient, LinearGradient, RadialGradient classes 17/261217/15
authorJunsuChoi <jsuya.choi@samsung.com>
Tue, 13 Jul 2021 06:12:31 +0000 (15:12 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Fri, 6 Aug 2021 06:49:05 +0000 (15:49 +0900)
commit4e60fdcb83d1d9760e06b45099e65f3f25097897
tree7c2ca34fb5d1cce83b4b8e2fc2cda00fd3d6d2bf
parent76218765bf6ceab55f19a81d8e0d06ac50f452ea
CanvasRenderer: Add Gradient, LinearGradient, RadialGradient classes

Add Gradient, LinearGradient, and RadialGradient classes that
implement Linear and Radial Gradient features.
Each Gradient can be applied to Fill and Stroke of Shape after
setting Bounds and ColorStop suitable for style.

ex)
//Radial Gradient with Fill color
Dali::CanvasRenderer::RadialGradient radial = Dali::CanvasRenderer::RadialGradient::New();
Dali::Vector<Dali::CanvasRenderer::Gradient::ColorStop> stops;
stops.PushBack( {0.0f, Vector4(1.0f, 0.0f, 1.0f, 1.0f)} );
stops.PushBack( {1.0f, Vector4(0.5f, 1.0f, 0.0f, 1.0f)} );

radial.SetBounds(Vector2(110, 100), 50);
radial.SetColorStops(stops);
shape.SetFillGradient(radial);

//Linear Gradient with Stroke color
Dali::CanvasRenderer::LinearGradient linear = Dali::CanvasRenderer::LinearGradient::New();
Dali::Vector<Dali::CanvasRenderer::Gradient::ColorStop> stops;
stops.PushBack( {0.0f, Vector4(1.0f, 0.0f, 1.0f, 1.0f)} );
stops.PushBack( {1.0f, Vector4(0.5f, 1.0f, 0.0f, 1.0f)} );

linear.SetBounds(Vector2(10, 10), Vector2(100, 100));
linear.SetColorStops(stops);
shape.SetStrokeGradient(linear);

Change-Id: I747614bf1c6bcd59f30a74a23c4001cfdfe19d1a
55 files changed:
dali/devel-api/adaptor-framework/canvas-renderer-gradient.cpp [new file with mode: 0644]
dali/devel-api/adaptor-framework/canvas-renderer-gradient.h [new file with mode: 0644]
dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.cpp [new file with mode: 0644]
dali/devel-api/adaptor-framework/canvas-renderer-linear-gradient.h [new file with mode: 0644]
dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.cpp [new file with mode: 0644]
dali/devel-api/adaptor-framework/canvas-renderer-radial-gradient.h [new file with mode: 0644]
dali/devel-api/adaptor-framework/canvas-renderer-shape.cpp
dali/devel-api/adaptor-framework/canvas-renderer-shape.h
dali/devel-api/adaptor-framework/canvas-renderer.h
dali/devel-api/file.list
dali/internal/canvas-renderer/common/gradient-factory.h [new file with mode: 0644]
dali/internal/canvas-renderer/common/gradient-impl.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/common/gradient-impl.h [new file with mode: 0644]
dali/internal/canvas-renderer/common/linear-gradient-factory.h [new file with mode: 0644]
dali/internal/canvas-renderer/common/linear-gradient-impl.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/common/linear-gradient-impl.h [new file with mode: 0644]
dali/internal/canvas-renderer/common/radial-gradient-factory.h [new file with mode: 0644]
dali/internal/canvas-renderer/common/radial-gradient-impl.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/common/radial-gradient-impl.h [new file with mode: 0644]
dali/internal/canvas-renderer/common/shape-impl.cpp
dali/internal/canvas-renderer/common/shape-impl.h
dali/internal/canvas-renderer/file.list
dali/internal/canvas-renderer/generic/gradient-factory-generic.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/generic/gradient-impl-generic.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/generic/gradient-impl-generic.h [new file with mode: 0644]
dali/internal/canvas-renderer/generic/linear-gradient-factory-generic.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/generic/linear-gradient-impl-generic.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/generic/linear-gradient-impl-generic.h [new file with mode: 0644]
dali/internal/canvas-renderer/generic/radial-gradient-factory-generic.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/generic/radial-gradient-impl-generic.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/generic/radial-gradient-impl-generic.h [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/canvas-renderer-impl-tizen.cpp
dali/internal/canvas-renderer/tizen/gradient-factory-tizen.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/gradient-impl-tizen.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/gradient-impl-tizen.h [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/linear-gradient-factory-tizen.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/linear-gradient-impl-tizen.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/linear-gradient-impl-tizen.h [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/radial-gradient-factory-tizen.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/radial-gradient-impl-tizen.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/radial-gradient-impl-tizen.h [new file with mode: 0644]
dali/internal/canvas-renderer/tizen/shape-impl-tizen.cpp
dali/internal/canvas-renderer/tizen/shape-impl-tizen.h
dali/internal/canvas-renderer/ubuntu/canvas-renderer-impl-ubuntu.cpp
dali/internal/canvas-renderer/ubuntu/gradient-factory-ubuntu.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/ubuntu/gradient-impl-ubuntu.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/ubuntu/gradient-impl-ubuntu.h [new file with mode: 0644]
dali/internal/canvas-renderer/ubuntu/linear-gradient-factory-ubuntu.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/ubuntu/linear-gradient-impl-ubuntu.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/ubuntu/linear-gradient-impl-ubuntu.h [new file with mode: 0644]
dali/internal/canvas-renderer/ubuntu/radial-gradient-factory-ubuntu.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/ubuntu/radial-gradient-impl-ubuntu.cpp [new file with mode: 0644]
dali/internal/canvas-renderer/ubuntu/radial-gradient-impl-ubuntu.h [new file with mode: 0644]
dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.cpp
dali/internal/canvas-renderer/ubuntu/shape-impl-ubuntu.h