Initial scene graph (SkSG)
Sketching a thin (as in close-to-skia-semantics) scene graph API, focused on
external animation, inval tracking and minimal repaint.
Only a few concrete classes/features so far:
* Rect/Color/Transform/Group
* basic inval tracking
* a trivial animated sample with inval visualization
Pretty much everything (especially naming) is volatile, so treat accordingly.
The interesting bits to review are likely in Node.{h,cpp} for inval and
SampleSGInval.cpp for usage.
Initial class hierarchy:
* Node: invalidation/ancestors tracking
|
-- * RenderNode: onRender(SkCanvas)
| |
| -- * Draw (concrete): rendering a [geometry, paint] tuple
| |
| -- * Group (concrete): grouping multiple RenderNodes
| |
| -- * EffectNode: single-descendant effect wrapper
| |
| -- * Transform (concrete): transform effect
|
-- * PaintNode: onMakePaint()
| |
| -- * Color (concrete): SkColor paint wrapper
|
-- * GeometryNode: onComputeBounds(), onDraw(SkCanvas, SkPaint)
|
-- * Rect (concrete): SkRect wrapper
TBR=
Change-Id: Iacf9b773c181a7582ecd31ee968562f179d1aa1b
Reviewed-on: https://skia-review.googlesource.com/85502
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 3f1ce7f..69bcb68 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -1278,6 +1278,7 @@
public_include_dirs = [ "gm" ]
sources = gm_sources
deps = [
+ ":experimental_sksg",
":flags",
":gpu_tool_utils",
":skia",
@@ -1293,6 +1294,7 @@
sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
}
deps = [
+ ":experimental_sksg",
":experimental_svg_model",
":flags",
":skia",
@@ -1350,6 +1352,31 @@
]
}
+ test_lib("experimental_sksg") {
+ public_include_dirs = [
+ "experimental/sksg",
+ "experimental/sksg/effects",
+ "experimental/sksg/geometry",
+ "experimental/sksg/paint",
+ ]
+ sources = [
+ "experimental/sksg/SkSGDraw.cpp",
+ "experimental/sksg/SkSGEffectNode.cpp",
+ "experimental/sksg/SkSGGeometryNode.cpp",
+ "experimental/sksg/SkSGGroup.cpp",
+ "experimental/sksg/SkSGInvalidationController.cpp",
+ "experimental/sksg/SkSGNode.cpp",
+ "experimental/sksg/SkSGPaintNode.cpp",
+ "experimental/sksg/SkSGRenderNode.cpp",
+ "experimental/sksg/effects/SkSGTransform.cpp",
+ "experimental/sksg/geometry/SkSGRect.cpp",
+ "experimental/sksg/paint/SkSGColor.cpp",
+ ]
+ deps = [
+ ":skia",
+ ]
+ }
+
if (target_cpu != "wasm") {
test_lib("views") {
public_include_dirs = [ "include/views" ]
@@ -1432,6 +1459,7 @@
"src/core/SkThreadedBMPDevice.h",
]
deps = [
+ ":experimental_sksg",
":experimental_svg_model",
":flags",
":gm",
@@ -1459,6 +1487,7 @@
include_dirs = [ "tests" ]
deps = [
":common_flags",
+ ":experimental_sksg",
":experimental_svg_model",
":flags",
":gm",
@@ -1497,6 +1526,7 @@
deps = [
":bench",
":common_flags",
+ ":experimental_sksg",
":experimental_svg_model",
":flags",
":gm",