Updated the spec file so that it builds for tizen devel/vulkan
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 17 May 2024 15:12:04 +0000 (16:12 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 17 May 2024 15:12:04 +0000 (16:12 +0100)
Change-Id: I5012e7a454df2d1e8e93dd28a62edebf83ed03bd

656 files changed:
.gitignore
.travis.yml
README.md
automated-tests/README.md
automated-tests/coverage.sh
automated-tests/execute.sh
automated-tests/patch-coverage.pl
automated-tests/src/dali-graphics/CMakeLists.txt [deleted file]
automated-tests/src/dali-graphics/graphics-test-implementation/graphics-test-implementation.cpp [deleted file]
automated-tests/src/dali-graphics/graphics-test-implementation/graphics-test-implementation.h [deleted file]
automated-tests/src/dali-graphics/tct-dali-graphics-core.cpp [deleted file]
automated-tests/src/dali-graphics/utc-Dali-Graphics-API.cpp [deleted file]
automated-tests/src/dali-graphics/utc-Dali-Graphics-Object-Owner.cpp [deleted file]
automated-tests/src/dali-graphics/utc-Dali-Graphics-Utility-Queue.cpp [deleted file]
automated-tests/src/dali-internal/CMakeLists.txt
automated-tests/src/dali-internal/utc-Dali-Internal-Core.cpp
automated-tests/src/dali-internal/utc-Dali-Internal-FrustumCulling.cpp
automated-tests/src/dali-internal/utc-Dali-Internal-OwnerPointer.cpp [new file with mode: 0644]
automated-tests/src/dali/CMakeLists.txt
automated-tests/src/dali/TestBreakdown.txt [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.cpp
automated-tests/src/dali/dali-test-suite-utils/dali-test-suite-utils.h
automated-tests/src/dali/dali-test-suite-utils/test-actor-utils.cpp
automated-tests/src/dali/dali-test-suite-utils/test-actor-utils.h
automated-tests/src/dali/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali/dali-test-suite-utils/test-application.h
automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.cpp
automated-tests/src/dali/dali-test-suite-utils/test-custom-actor.h
automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer-factory.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer-factory.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer-factory.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer-factory.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer.cpp [moved from automated-tests/src/dali-graphics/utc-Dali-Graphics-Manager.cpp with 51% similarity]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline-factory.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline-factory.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline.cpp [moved from dali/integration-api/graphics/vulkan/vulkan-hpp-wrapper.h with 54% similarity]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-render-command.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-render-command.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler-factory.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler-factory.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler.cpp [moved from dali/graphics/vulkan/vulkan-debug.cpp with 62% similarity]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader-factory.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader-factory.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture-factory.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture-factory.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-harness.cpp
automated-tests/src/dali/dali-test-suite-utils/test-harness.h
automated-tests/src/dali/dali-test-suite-utils/test-native-image.cpp
automated-tests/src/dali/dali-test-suite-utils/test-native-image.h
automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp
automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.h
automated-tests/src/dali/dali-test-suite-utils/test-render-surface.cpp [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-render-surface.h [new file with mode: 0644]
automated-tests/src/dali/dali-test-suite-utils/test-trace-call-stack.cpp
automated-tests/src/dali/dali-test-suite-utils/test-trace-call-stack.h
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-Animation.cpp
automated-tests/src/dali/utc-Dali-BaseHandle.cpp
automated-tests/src/dali/utc-Dali-BufferImage.cpp
automated-tests/src/dali/utc-Dali-CameraActor.cpp
automated-tests/src/dali/utc-Dali-Constrainer.cpp
automated-tests/src/dali/utc-Dali-Constraint.cpp
automated-tests/src/dali/utc-Dali-Context.cpp
automated-tests/src/dali/utc-Dali-Core.cpp [moved from automated-tests/src/dali-graphics/utc-Dali-Graphics-API-texture.cpp with 59% similarity]
automated-tests/src/dali/utc-Dali-CustomActor.cpp
automated-tests/src/dali/utc-Dali-FrameBuffer.cpp
automated-tests/src/dali/utc-Dali-FrameBufferImage.cpp
automated-tests/src/dali/utc-Dali-FrameCallbackInterface.cpp [new file with mode: 0644]
automated-tests/src/dali/utc-Dali-Geometry.cpp
automated-tests/src/dali/utc-Dali-GestureDetector.cpp
automated-tests/src/dali/utc-Dali-Handle.cpp
automated-tests/src/dali/utc-Dali-HitTestAlgorithm.cpp
automated-tests/src/dali/utc-Dali-HoverProcessing.cpp
automated-tests/src/dali/utc-Dali-Image.cpp
automated-tests/src/dali/utc-Dali-KeyEvent.cpp
automated-tests/src/dali/utc-Dali-Layer.cpp
automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp
automated-tests/src/dali/utc-Dali-NativeImage.cpp
automated-tests/src/dali/utc-Dali-PanGesture.cpp
automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp
automated-tests/src/dali/utc-Dali-Path.cpp
automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp
automated-tests/src/dali/utc-Dali-Processors.cpp
automated-tests/src/dali/utc-Dali-PropertyBuffer.cpp
automated-tests/src/dali/utc-Dali-RenderTask.cpp
automated-tests/src/dali/utc-Dali-Renderer.cpp
automated-tests/src/dali/utc-Dali-Sampler.cpp
automated-tests/src/dali/utc-Dali-Scene.cpp [new file with mode: 0644]
automated-tests/src/dali/utc-Dali-Scripting.cpp
automated-tests/src/dali/utc-Dali-Shader.cpp
automated-tests/src/dali/utc-Dali-Stage.cpp
automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp
automated-tests/src/dali/utc-Dali-Texture.cpp
automated-tests/src/dali/utc-Dali-TextureSet.cpp
automated-tests/src/dali/utc-Dali-TouchDataProcessing.cpp [changed mode: 0644->0755]
automated-tests/src/dali/utc-Dali-TouchProcessing.cpp [changed mode: 0644->0755]
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
build/scripts/dali_env
build/scripts/f1-reconf.py
build/tizen-cmake/CMakeLists.txt [deleted file]
build/tizen-cmake/dali-core.pc.in [deleted file]
build/tizen/.gitignore
build/tizen/CMakeLists.txt [new file with mode: 0644]
build/tizen/Makefile.am [deleted file]
build/tizen/configure.ac [deleted file]
build/tizen/dali-core-cxx03.pc.in [deleted file]
build/tizen/dali-core.pc.in
build/tizen/dali-core/Makefile.am [deleted file]
build/tizen/dali-core/graphics/Makefile.am [deleted file]
build/tizen/linker-test.cpp [moved from build/tizen/dali-core/linker-test.cpp with 81% similarity]
build/tizen/rename-cov-data [new file with mode: 0755]
dali/devel-api/CMakeLists.txt [deleted file]
dali/devel-api/actors/actor-devel.cpp
dali/devel-api/actors/actor-devel.h
dali/devel-api/common/bitwise-enum.h [new file with mode: 0644]
dali/devel-api/common/map-wrapper.h
dali/devel-api/common/set-wrapper.h
dali/devel-api/common/stage-devel.cpp
dali/devel-api/common/stage-devel.h [changed mode: 0644->0755]
dali/devel-api/events/hit-test-algorithm.cpp
dali/devel-api/events/hit-test-algorithm.h
dali/devel-api/events/touch-data-devel.cpp [new file with mode: 0755]
dali/devel-api/events/touch-data-devel.h [moved from dali/graphics/vulkan/vulkan-hpp-wrapper.h with 53% similarity, mode: 0755]
dali/devel-api/file.list [changed mode: 0644->0755]
dali/devel-api/images/distance-field.cpp [changed mode: 0644->0755]
dali/devel-api/images/distance-field.h
dali/devel-api/images/native-image-interface-extension.h
dali/devel-api/images/nine-patch-image.cpp
dali/devel-api/images/pixel-data-devel.cpp
dali/devel-api/images/pixel-data-devel.h
dali/devel-api/images/texture-set-image.cpp
dali/devel-api/object/csharp-type-registry.cpp
dali/devel-api/rendering/renderer-devel.h
dali/devel-api/rendering/shader-devel.cpp
dali/devel-api/rendering/shader-devel.h
dali/devel-api/scripting/enum-helper.h
dali/devel-api/scripting/scripting.cpp
dali/devel-api/scripting/scripting.h
dali/devel-api/threading/conditional-wait.h [changed mode: 0644->0755]
dali/devel-api/threading/mutex.h [changed mode: 0644->0755]
dali/devel-api/threading/thread-pool.cpp [new file with mode: 0644]
dali/devel-api/threading/thread-pool.h [new file with mode: 0644]
dali/devel-api/update/frame-callback-interface.cpp [moved from dali/graphics/vulkan/vulkan-fence.h with 51% similarity]
dali/devel-api/update/frame-callback-interface.h [new file with mode: 0644]
dali/devel-api/update/update-proxy.cpp [new file with mode: 0644]
dali/devel-api/update/update-proxy.h [new file with mode: 0644]
dali/graphics-api/file.list
dali/graphics-api/graphics-api-accessor.h [deleted file]
dali/graphics-api/graphics-api-base-factory.h
dali/graphics-api/graphics-api-base-object-owner.h [deleted file]
dali/graphics-api/graphics-api-buffer-factory.h
dali/graphics-api/graphics-api-buffer.h
dali/graphics-api/graphics-api-controller.h
dali/graphics-api/graphics-api-framebuffer-factory.h
dali/graphics-api/graphics-api-framebuffer.h
dali/graphics-api/graphics-api-pipeline-factory.h
dali/graphics-api/graphics-api-pipeline.h
dali/graphics-api/graphics-api-render-command.h
dali/graphics-api/graphics-api-sampler-factory.h [new file with mode: 0644]
dali/graphics-api/graphics-api-sampler.h
dali/graphics-api/graphics-api-shader-details.h
dali/graphics-api/graphics-api-shader-factory.h
dali/graphics-api/graphics-api-shader.h
dali/graphics-api/graphics-api-texture-details.h
dali/graphics-api/graphics-api-texture-factory.h
dali/graphics-api/graphics-api-texture.h
dali/graphics-api/graphics-api-types-debug.h [new file with mode: 0644]
dali/graphics-api/graphics-api-types.h
dali/graphics-api/graphics-api-utility.h [deleted file]
dali/graphics-api/utility/graphics-asserts.h [deleted file]
dali/graphics-api/utility/utility-builder.h [deleted file]
dali/graphics-api/utility/utility-memory-pool.h [deleted file]
dali/graphics-api/utility/utility-queue.h [deleted file]
dali/graphics-api/utility/utility-strong-type.h [deleted file]
dali/graphics-api/utility/utility-synchronized.h [deleted file]
dali/graphics-api/utility/utility-traits.h [deleted file]
dali/graphics/file.list [deleted file]
dali/graphics/graphics-object-owner.h [deleted file]
dali/graphics/graphics-texture.h [deleted file]
dali/graphics/vulkan/api/internal/vulkan-api-pipeline-impl.cpp [deleted file]
dali/graphics/vulkan/api/internal/vulkan-api-pipeline-impl.h [deleted file]
dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.cpp [deleted file]
dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.h [deleted file]
dali/graphics/vulkan/api/internal/vulkan-ubo-manager.cpp [deleted file]
dali/graphics/vulkan/api/internal/vulkan-ubo-manager.h [deleted file]
dali/graphics/vulkan/api/internal/vulkan-ubo-pool.cpp [deleted file]
dali/graphics/vulkan/api/internal/vulkan-ubo-pool.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-buffer-factory.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-buffer-factory.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-buffer.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-buffer.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-controller.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-controller.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-pipeline-factory.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-pipeline-factory.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-pipeline.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-pipeline.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-render-command.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-render-command.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-shader-factory.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-shader-factory.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-shader.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-shader.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-texture-factory.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-texture-factory.h [deleted file]
dali/graphics/vulkan/api/vulkan-api-texture.cpp [deleted file]
dali/graphics/vulkan/api/vulkan-api-texture.h [deleted file]
dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h [deleted file]
dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.cpp [deleted file]
dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h [deleted file]
dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.cpp [deleted file]
dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h [deleted file]
dali/graphics/vulkan/scripts/glsl2vk-compile.sh [deleted file]
dali/graphics/vulkan/spirv/spirv.h [deleted file]
dali/graphics/vulkan/spirv/vulkan-spirv-opcode.h [deleted file]
dali/graphics/vulkan/spirv/vulkan-spirv.cpp [deleted file]
dali/graphics/vulkan/spirv/vulkan-spirv.h [deleted file]
dali/graphics/vulkan/tests/texture-test.cpp [deleted file]
dali/graphics/vulkan/vulkan-buffer.cpp [deleted file]
dali/graphics/vulkan/vulkan-buffer.h [deleted file]
dali/graphics/vulkan/vulkan-command-buffer.cpp [deleted file]
dali/graphics/vulkan/vulkan-command-buffer.h [deleted file]
dali/graphics/vulkan/vulkan-command-pool.cpp [deleted file]
dali/graphics/vulkan/vulkan-command-pool.h [deleted file]
dali/graphics/vulkan/vulkan-descriptor-set.cpp [deleted file]
dali/graphics/vulkan/vulkan-descriptor-set.h [deleted file]
dali/graphics/vulkan/vulkan-fence.cpp [deleted file]
dali/graphics/vulkan/vulkan-framebuffer.cpp [deleted file]
dali/graphics/vulkan/vulkan-framebuffer.h [deleted file]
dali/graphics/vulkan/vulkan-graphics-texture.cpp [deleted file]
dali/graphics/vulkan/vulkan-graphics-texture.h [deleted file]
dali/graphics/vulkan/vulkan-graphics.cpp [deleted file]
dali/graphics/vulkan/vulkan-graphics.h [deleted file]
dali/graphics/vulkan/vulkan-image-view.cpp [deleted file]
dali/graphics/vulkan/vulkan-image-view.h [deleted file]
dali/graphics/vulkan/vulkan-image.cpp [deleted file]
dali/graphics/vulkan/vulkan-image.h [deleted file]
dali/graphics/vulkan/vulkan-pipeline.cpp [deleted file]
dali/graphics/vulkan/vulkan-pipeline.h [deleted file]
dali/graphics/vulkan/vulkan-queue.cpp [deleted file]
dali/graphics/vulkan/vulkan-queue.h [deleted file]
dali/graphics/vulkan/vulkan-resource-cache.cpp [deleted file]
dali/graphics/vulkan/vulkan-resource-cache.h [deleted file]
dali/graphics/vulkan/vulkan-sampler.cpp [deleted file]
dali/graphics/vulkan/vulkan-sampler.h [deleted file]
dali/graphics/vulkan/vulkan-shader.cpp [deleted file]
dali/graphics/vulkan/vulkan-shader.h [deleted file]
dali/graphics/vulkan/vulkan-standalone-test.cpp [deleted file]
dali/graphics/vulkan/vulkan-surface.cpp [deleted file]
dali/graphics/vulkan/vulkan-surface.h [deleted file]
dali/graphics/vulkan/vulkan-swapchain.cpp [deleted file]
dali/graphics/vulkan/vulkan-swapchain.h [deleted file]
dali/graphics/vulkan/vulkan-types.h [deleted file]
dali/integration-api/CMakeLists.txt [deleted file]
dali/integration-api/bitmap.h
dali/integration-api/core-enumerations.h
dali/integration-api/core.cpp
dali/integration-api/core.h
dali/integration-api/debug.h [changed mode: 0644->0755]
dali/integration-api/events/key-event-integ.cpp
dali/integration-api/events/key-event-integ.h
dali/integration-api/events/multi-point-event-integ.cpp
dali/integration-api/events/multi-point-event-integ.h
dali/integration-api/events/point.cpp [changed mode: 0644->0755]
dali/integration-api/events/point.h [changed mode: 0644->0755]
dali/integration-api/file.list
dali/integration-api/graphics/file.list [deleted file]
dali/integration-api/graphics/graphics.cpp [deleted file]
dali/integration-api/graphics/graphics.h [deleted file]
dali/integration-api/graphics/vulkan/vk-surface-factory.h [deleted file]
dali/integration-api/lockless-buffer.cpp
dali/integration-api/lockless-buffer.h
dali/integration-api/platform-abstraction.h
dali/integration-api/processor-interface.h [moved from dali/integration-api/graphics/surface-factory.h with 50% similarity]
dali/integration-api/profiling.cpp
dali/integration-api/profiling.h
dali/integration-api/render-surface.h [new file with mode: 0644]
dali/integration-api/render-task-list-integ.cpp [moved from dali/integration-api/system-overlay.cpp with 50% similarity, mode: 0755]
dali/integration-api/render-task-list-integ.h [new file with mode: 0755]
dali/integration-api/scene.cpp [new file with mode: 0644]
dali/integration-api/scene.h [new file with mode: 0644]
dali/integration-api/system-overlay.h [deleted file]
dali/internal/CMakeLists.txt
dali/internal/common/buffer-index.h
dali/internal/common/core-impl.cpp
dali/internal/common/core-impl.h
dali/internal/common/fixed-size-memory-pool.cpp
dali/internal/common/image-attributes.cpp [changed mode: 0644->0755]
dali/internal/common/image-attributes.h
dali/internal/common/message-buffer.cpp
dali/internal/common/message-buffer.h
dali/internal/common/message.h
dali/internal/common/owner-pointer.h
dali/internal/common/shader-data.h
dali/internal/common/type-abstraction-enums.h
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h [changed mode: 0644->0755]
dali/internal/event/actors/camera-actor-impl.cpp
dali/internal/event/actors/camera-actor-impl.h
dali/internal/event/actors/custom-actor-internal.cpp
dali/internal/event/actors/custom-actor-internal.h
dali/internal/event/actors/layer-impl.cpp
dali/internal/event/actors/layer-impl.h
dali/internal/event/actors/layer-list.cpp
dali/internal/event/actors/layer-list.h
dali/internal/event/animation/animation-impl.cpp
dali/internal/event/animation/animation-impl.h
dali/internal/event/animation/animator-connector-base.h
dali/internal/event/animation/animator-connector.h
dali/internal/event/animation/constrainer.cpp
dali/internal/event/animation/constrainer.h
dali/internal/event/animation/constraint-base.cpp
dali/internal/event/animation/constraint-base.h
dali/internal/event/animation/constraint-impl.h
dali/internal/event/animation/key-frames-impl.cpp
dali/internal/event/animation/key-frames-impl.h
dali/internal/event/animation/linear-constrainer-impl.cpp
dali/internal/event/animation/linear-constrainer-impl.h
dali/internal/event/animation/path-constrainer-impl.cpp
dali/internal/event/animation/path-constrainer-impl.h
dali/internal/event/animation/path-impl.cpp
dali/internal/event/animation/path-impl.h
dali/internal/event/animation/progress-value.h
dali/internal/event/animation/property-constraint.h
dali/internal/event/animation/property-input-accessor.h
dali/internal/event/animation/property-input-indexer.h
dali/internal/event/common/demangler-unix.cpp [new file with mode: 0644]
dali/internal/event/common/demangler-windows.cpp [moved from dali/internal/common/text-vertex-2d.h with 58% similarity]
dali/internal/event/common/demangler.cpp [deleted file]
dali/internal/event/common/demangler.h
dali/internal/event/common/event-thread-services.cpp
dali/internal/event/common/event-thread-services.h
dali/internal/event/common/object-impl-helper.h [deleted file]
dali/internal/event/common/object-impl.cpp
dali/internal/event/common/object-impl.h
dali/internal/event/common/projection.cpp
dali/internal/event/common/property-buffer-impl.cpp
dali/internal/event/common/property-buffer-impl.h
dali/internal/event/common/property-helper.cpp
dali/internal/event/common/property-helper.h
dali/internal/event/common/property-metadata.cpp
dali/internal/event/common/property-metadata.h
dali/internal/event/common/property-notification-impl.cpp
dali/internal/event/common/scene-impl.cpp [new file with mode: 0644]
dali/internal/event/common/scene-impl.h [new file with mode: 0644]
dali/internal/event/common/stage-impl.cpp
dali/internal/event/common/stage-impl.h
dali/internal/event/common/system-overlay-impl.cpp [deleted file]
dali/internal/event/common/system-overlay-impl.h [deleted file]
dali/internal/event/common/thread-local-storage.cpp
dali/internal/event/common/thread-local-storage.h
dali/internal/event/common/type-info-impl.cpp
dali/internal/event/common/type-info-impl.h
dali/internal/event/common/type-registry-impl.cpp
dali/internal/event/common/type-registry-impl.h
dali/internal/event/effects/shader-factory.cpp
dali/internal/event/events/event-processor.cpp
dali/internal/event/events/event-processor.h
dali/internal/event/events/gesture-detector-impl.cpp
dali/internal/event/events/gesture-detector-impl.h
dali/internal/event/events/gesture-event-processor.cpp
dali/internal/event/events/gesture-event-processor.h
dali/internal/event/events/gesture-processor.cpp
dali/internal/event/events/gesture-processor.h
dali/internal/event/events/hit-test-algorithm-impl.cpp
dali/internal/event/events/hit-test-algorithm-impl.h
dali/internal/event/events/hover-event-processor.cpp
dali/internal/event/events/hover-event-processor.h
dali/internal/event/events/key-event-impl.cpp
dali/internal/event/events/key-event-impl.h
dali/internal/event/events/key-event-processor.cpp
dali/internal/event/events/key-event-processor.h
dali/internal/event/events/long-press-gesture-processor.cpp
dali/internal/event/events/long-press-gesture-processor.h
dali/internal/event/events/pan-gesture-detector-impl.cpp
dali/internal/event/events/pan-gesture-detector-impl.h
dali/internal/event/events/pan-gesture-processor.cpp
dali/internal/event/events/pan-gesture-processor.h
dali/internal/event/events/pinch-gesture-processor.cpp
dali/internal/event/events/pinch-gesture-processor.h
dali/internal/event/events/tap-gesture-processor.cpp
dali/internal/event/events/tap-gesture-processor.h
dali/internal/event/events/touch-data-impl.cpp [changed mode: 0644->0755]
dali/internal/event/events/touch-data-impl.h [changed mode: 0644->0755]
dali/internal/event/events/touch-event-processor.cpp
dali/internal/event/events/touch-event-processor.h
dali/internal/event/events/wheel-event-processor.cpp
dali/internal/event/events/wheel-event-processor.h
dali/internal/event/images/bitmap-compressed.cpp
dali/internal/event/images/bitmap-compressed.h
dali/internal/event/images/bitmap-packed-pixel.cpp
dali/internal/event/images/bitmap-packed-pixel.h
dali/internal/event/images/buffer-image-impl.cpp
dali/internal/event/images/encoded-buffer-image-impl.cpp
dali/internal/event/images/frame-buffer-image-impl.cpp
dali/internal/event/images/image-impl.cpp
dali/internal/event/images/image-impl.h
dali/internal/event/images/native-image-impl.cpp
dali/internal/event/images/nine-patch-image-impl.cpp
dali/internal/event/images/pixel-data-impl.cpp
dali/internal/event/images/pixel-data-impl.h
dali/internal/event/images/resource-image-impl.cpp
dali/internal/event/images/resource-image-impl.h
dali/internal/event/object/custom-object-internal.cpp [deleted file]
dali/internal/event/object/custom-object-internal.h [deleted file]
dali/internal/event/object/default-property-metadata.h [new file with mode: 0644]
dali/internal/event/render-tasks/render-task-impl.cpp
dali/internal/event/render-tasks/render-task-impl.h
dali/internal/event/render-tasks/render-task-list-impl.cpp [changed mode: 0644->0755]
dali/internal/event/render-tasks/render-task-list-impl.h
dali/internal/event/rendering/frame-buffer-impl.cpp
dali/internal/event/rendering/frame-buffer-impl.h
dali/internal/event/rendering/geometry-impl.cpp
dali/internal/event/rendering/geometry-impl.h
dali/internal/event/rendering/renderer-impl.cpp
dali/internal/event/rendering/renderer-impl.h [changed mode: 0644->0755]
dali/internal/event/rendering/sampler-impl.cpp
dali/internal/event/rendering/sampler-impl.h
dali/internal/event/rendering/shader-impl.cpp
dali/internal/event/rendering/shader-impl.h
dali/internal/event/rendering/texture-impl.cpp
dali/internal/event/rendering/texture-set-impl.cpp
dali/internal/event/rendering/texture-set-impl.h
dali/internal/event/size-negotiation/relayout-controller-impl.cpp
dali/internal/event/size-negotiation/relayout-controller-impl.h
dali/internal/event/update/frame-callback-interface-impl.h [new file with mode: 0644]
dali/internal/file-unix.list [new file with mode: 0644]
dali/internal/file-windows.list [new file with mode: 0644]
dali/internal/file.list
dali/internal/render/renderers/render-surface-frame-buffer.cpp [new file with mode: 0644]
dali/internal/render/renderers/render-surface-frame-buffer.h [new file with mode: 0644]
dali/internal/render/renderers/render-texture-frame-buffer.h [new file with mode: 0644]
dali/internal/update/animation/property-accessor.h
dali/internal/update/animation/property-component-accessor.h
dali/internal/update/animation/scene-graph-animation.cpp
dali/internal/update/animation/scene-graph-animation.h
dali/internal/update/animation/scene-graph-animator.h
dali/internal/update/animation/scene-graph-constraint-base.cpp
dali/internal/update/animation/scene-graph-constraint-base.h
dali/internal/update/animation/scene-graph-constraint.h
dali/internal/update/common/animatable-property.h
dali/internal/update/common/discard-queue.cpp
dali/internal/update/common/discard-queue.h
dali/internal/update/common/double-buffered.h
dali/internal/update/common/inherited-property.h
dali/internal/update/common/property-condition-functions.cpp
dali/internal/update/common/property-condition-step-functions.cpp
dali/internal/update/common/property-condition-variable-step-functions.cpp
dali/internal/update/common/property-owner-messages.h
dali/internal/update/common/property-owner.h
dali/internal/update/common/property-resetter.h
dali/internal/update/common/property-vector3.h [deleted file]
dali/internal/update/common/scene-graph-buffers.h
dali/internal/update/common/uniform-map.cpp
dali/internal/update/common/uniform-map.h
dali/internal/update/gestures/scene-graph-pan-gesture.cpp
dali/internal/update/graphics/graphics-algorithms.cpp
dali/internal/update/graphics/graphics-algorithms.h
dali/internal/update/graphics/graphics-buffer-manager.cpp [new file with mode: 0644]
dali/internal/update/graphics/graphics-buffer-manager.h [new file with mode: 0644]
dali/internal/update/manager/frame-callback-processor.cpp [new file with mode: 0644]
dali/internal/update/manager/frame-callback-processor.h [new file with mode: 0644]
dali/internal/update/manager/free-list.h
dali/internal/update/manager/render-instruction-processor.cpp
dali/internal/update/manager/render-task-processor.cpp
dali/internal/update/manager/render-task-processor.h
dali/internal/update/manager/scene-graph-frame-callback.cpp [new file with mode: 0644]
dali/internal/update/manager/scene-graph-frame-callback.h [new file with mode: 0644]
dali/internal/update/manager/transform-manager-property.h
dali/internal/update/manager/transform-manager.cpp
dali/internal/update/manager/transform-manager.h
dali/internal/update/manager/update-algorithms.cpp
dali/internal/update/manager/update-algorithms.h
dali/internal/update/manager/update-manager.cpp
dali/internal/update/manager/update-manager.h
dali/internal/update/manager/update-proxy-impl.cpp [new file with mode: 0644]
dali/internal/update/manager/update-proxy-impl.h [new file with mode: 0644]
dali/internal/update/manager/update-proxy-property-modifier.h [new file with mode: 0644]
dali/internal/update/nodes/node-declarations.h
dali/internal/update/nodes/node-messages.h
dali/internal/update/nodes/node.cpp [changed mode: 0644->0755]
dali/internal/update/nodes/node.h [changed mode: 0644->0755]
dali/internal/update/nodes/scene-graph-layer.cpp [changed mode: 0644->0755]
dali/internal/update/nodes/scene-graph-layer.h [changed mode: 0644->0755]
dali/internal/update/queue/update-message-queue.cpp
dali/internal/update/queue/update-message-queue.h
dali/internal/update/render-tasks/scene-graph-camera.cpp
dali/internal/update/render-tasks/scene-graph-camera.h
dali/internal/update/render-tasks/scene-graph-render-task-debug.h [changed mode: 0644->0755]
dali/internal/update/render-tasks/scene-graph-render-task-list.cpp
dali/internal/update/render-tasks/scene-graph-render-task-list.h
dali/internal/update/render-tasks/scene-graph-render-task.cpp
dali/internal/update/render-tasks/scene-graph-render-task.h
dali/internal/update/rendering/data-providers/node-data-provider.h [deleted file]
dali/internal/update/rendering/data-providers/property-buffer-data-provider.h [deleted file]
dali/internal/update/rendering/data-providers/render-data-provider.cpp [deleted file]
dali/internal/update/rendering/data-providers/render-data-provider.h [deleted file]
dali/internal/update/rendering/data-providers/uniform-map-data-provider.h [deleted file]
dali/internal/update/rendering/render-command-container.h [new file with mode: 0644]
dali/internal/update/rendering/render-command.h [new file with mode: 0644]
dali/internal/update/rendering/render-instruction-container.cpp
dali/internal/update/rendering/render-instruction-container.h
dali/internal/update/rendering/render-instruction.cpp
dali/internal/update/rendering/render-instruction.h
dali/internal/update/rendering/render-item.cpp
dali/internal/update/rendering/render-item.h
dali/internal/update/rendering/render-list.h
dali/internal/update/rendering/scene-graph-frame-buffer.cpp
dali/internal/update/rendering/scene-graph-frame-buffer.h
dali/internal/update/rendering/scene-graph-geometry.cpp
dali/internal/update/rendering/scene-graph-geometry.h
dali/internal/update/rendering/scene-graph-property-buffer.cpp
dali/internal/update/rendering/scene-graph-property-buffer.h
dali/internal/update/rendering/scene-graph-renderer.cpp
dali/internal/update/rendering/scene-graph-renderer.h [changed mode: 0644->0755]
dali/internal/update/rendering/scene-graph-sampler.h
dali/internal/update/rendering/scene-graph-shader.cpp
dali/internal/update/rendering/scene-graph-shader.h
dali/internal/update/rendering/scene-graph-texture-set.cpp
dali/internal/update/rendering/scene-graph-texture-set.h
dali/internal/update/rendering/scene-graph-texture.cpp
dali/internal/update/rendering/scene-graph-texture.h
dali/internal/update/rendering/shader-cache.cpp
dali/internal/update/rendering/shader-cache.h
dali/public-api/CMakeLists.txt [deleted file]
dali/public-api/actors/actor-enumerations.h
dali/public-api/actors/actor.cpp
dali/public-api/actors/actor.h
dali/public-api/actors/camera-actor.h
dali/public-api/actors/custom-actor-impl.h
dali/public-api/actors/custom-actor.h
dali/public-api/actors/draw-mode.h
dali/public-api/actors/layer.cpp
dali/public-api/actors/layer.h
dali/public-api/actors/sampling.h
dali/public-api/animation/alpha-function.cpp [changed mode: 0644->0755]
dali/public-api/animation/alpha-function.h [changed mode: 0644->0755]
dali/public-api/animation/animation.cpp
dali/public-api/animation/animation.h
dali/public-api/animation/constraint.cpp
dali/public-api/animation/constraint.h
dali/public-api/animation/path.cpp
dali/public-api/common/dali-common.cpp
dali/public-api/common/dali-common.h
dali/public-api/common/dali-vector.cpp
dali/public-api/common/dali-vector.h
dali/public-api/common/stage.cpp
dali/public-api/common/stage.h
dali/public-api/common/vector-wrapper.h
dali/public-api/common/view-mode.h
dali/public-api/dali-core-version.cpp
dali/public-api/dali-core-version.h
dali/public-api/dali-core.h
dali/public-api/events/gesture-detector.h
dali/public-api/events/gesture.h
dali/public-api/events/hover-event.cpp
dali/public-api/events/hover-event.h
dali/public-api/events/key-event.cpp
dali/public-api/events/key-event.h
dali/public-api/events/long-press-gesture-detector.cpp
dali/public-api/events/long-press-gesture-detector.h
dali/public-api/events/long-press-gesture.h
dali/public-api/events/mouse-button.h [moved from dali/graphics/vulkan/vulkan-debug.h with 51% similarity, mode: 0755]
dali/public-api/events/pan-gesture-detector.cpp
dali/public-api/events/pan-gesture-detector.h
dali/public-api/events/pan-gesture.h
dali/public-api/events/tap-gesture-detector.cpp
dali/public-api/events/tap-gesture-detector.h
dali/public-api/events/tap-gesture.h
dali/public-api/events/touch-data.cpp [changed mode: 0644->0755]
dali/public-api/events/touch-data.h [changed mode: 0644->0755]
dali/public-api/events/touch-event.cpp
dali/public-api/events/touch-event.h
dali/public-api/events/touch-point.cpp
dali/public-api/events/touch-point.h
dali/public-api/events/wheel-event.cpp
dali/public-api/events/wheel-event.h
dali/public-api/file.list
dali/public-api/images/buffer-image.cpp
dali/public-api/images/buffer-image.h
dali/public-api/images/encoded-buffer-image.h
dali/public-api/images/frame-buffer-image.cpp
dali/public-api/images/frame-buffer-image.h
dali/public-api/images/image.cpp
dali/public-api/images/image.h
dali/public-api/images/native-image-interface.h
dali/public-api/images/pixel-data.cpp
dali/public-api/images/pixel-data.h
dali/public-api/images/pixel.cpp
dali/public-api/images/pixel.h
dali/public-api/math/math-utils.h
dali/public-api/math/matrix.cpp
dali/public-api/math/matrix.h [changed mode: 0644->0755]
dali/public-api/math/matrix3.cpp
dali/public-api/math/matrix3.h [changed mode: 0644->0755]
dali/public-api/math/quaternion.cpp
dali/public-api/math/random.h
dali/public-api/math/vector2.h
dali/public-api/math/vector3.h
dali/public-api/math/vector4.h
dali/public-api/math/viewport.h
dali/public-api/object/any.h
dali/public-api/object/base-handle.h
dali/public-api/object/base-object.cpp
dali/public-api/object/handle.cpp
dali/public-api/object/handle.h
dali/public-api/object/property-array.cpp
dali/public-api/object/property-array.h [changed mode: 0644->0755]
dali/public-api/object/property-map.cpp
dali/public-api/object/property-map.h [changed mode: 0644->0755]
dali/public-api/object/property-types.cpp
dali/public-api/object/property-value.cpp
dali/public-api/object/property-value.h [changed mode: 0644->0755]
dali/public-api/object/property.cpp
dali/public-api/object/property.h
dali/public-api/object/ref-object.cpp
dali/public-api/object/ref-object.h
dali/public-api/object/type-info.cpp
dali/public-api/object/type-info.h
dali/public-api/object/type-registry.cpp
dali/public-api/object/type-registry.h
dali/public-api/render-tasks/render-task-list.cpp
dali/public-api/render-tasks/render-task-list.h
dali/public-api/render-tasks/render-task.cpp
dali/public-api/render-tasks/render-task.h
dali/public-api/rendering/frame-buffer.cpp
dali/public-api/rendering/frame-buffer.h
dali/public-api/rendering/geometry.cpp
dali/public-api/rendering/geometry.h
dali/public-api/rendering/property-buffer.cpp
dali/public-api/rendering/property-buffer.h
dali/public-api/rendering/renderer.cpp
dali/public-api/rendering/shader.h
dali/public-api/rendering/texture-set.cpp
dali/public-api/rendering/texture.cpp
dali/public-api/rendering/texture.h
dali/public-api/signals/base-signal.cpp
dali/public-api/signals/base-signal.h [changed mode: 0644->0755]
dali/public-api/signals/connection-tracker.h
dali/public-api/signals/slot-delegate.h
doc/CMakeLists.txt [new file with mode: 0644]
doc/file.list
docs/coding-convention.html
docs/uml/allocate-descriptor-sets-action-diagram.puml [new file with mode: 0644]
packaging/dali.spec

index f79ec09..b9135cd 100644 (file)
@@ -12,6 +12,8 @@ dali.info
 install_manifest.txt
 libdali-core.so.0
 libdali-core.so.0.1.1
+libdali2-core.so.2
+libdali2-core.so.2.0.0
 *~
 *.pc
 *.o
@@ -45,3 +47,8 @@ libdali-core.so.0.1.1
 /build/desktop
 /packaging/home*
 compile_commands.json
+.idea
+build/tizen-cmake/cmake-build-debug/
+build/tizen-cmake/cmake-build-release/
+build/tizen/.lineno
+build/tizen/vk_build_debug.sh
index 9fcfc79..04f43d6 100644 (file)
@@ -29,7 +29,7 @@ script:
   - autoreconf --install
   - export CXXFLAGS="--coverage "
   - export LD_LIBRARY_PATH=/usr/local/lib
-  - ./configure --enable-profile=UBUNTU --enable-gles=20 --enable-debug
+  - ./configure --enable-profile=UBUNTU --enable-debug
   - make -j7
   - sudo make install
   - popd
index 220f0ba..b374d3a 100644 (file)
--- a/README.md
+++ b/README.md
 
 ## 1. Building for Ubuntu desktop
 
-### Minimum Requirements
+### Requirements
 
  - Ubuntu 14.04 or later
+ - GCC version 6
+
+DALi requires a compiler supporting C++11 features.
+Ubuntu 16.04 is the first version to offer this by default (GCC v5.4.0).
+
+GCC version 6 is recommended since it has fixes for issues in version 5
+e.g. it avoids spurious 'defined but not used' warnings in header files.
+
 
 ### Creating a DALi Environment
 
@@ -61,21 +69,6 @@ Then run the following commands:
          $ ./configure --prefix=$DESKTOP_PREFIX
          $ make install -j8
 
-### Build target options
-
-OpenGL ES context:
-
-When building, the OpenGL ES version of the target should be specified.
-
-Valid version options are 20, 30, 31
-
-With configure:
-Add: *--enable-gles=X*
-
-With gbs:
-Add to the gbs build line: *--define "%target_gles_version X"*
-
-
 ### Building and executing test cases
 
 See the README.md in dali-core/automated-tests.
index 8beb8b0..454a431 100644 (file)
@@ -177,7 +177,6 @@ If you are adding test cases to existing files, then all you need to do is creat
       END_TEST;
     }
 
-
 Note that **there must be no extra whitespace in the method signature** (i.e., it must violate our coding convention and follow __exactly__ this pattern: `int UtcDaliMyTestcaseName(void)`), as it's parsed by an awk script to auto-generate the testcase arrays in the main header file.
 
 You can contine to use the TET api, e.g. `tet_infoline`, `tet_result` and our test check methods `DALI_TEST_CHECK`, `DALI_TEST_EQUALS`, etc.
@@ -187,6 +186,41 @@ If you need any non-test methods or variables, ensure they are wrapped in an ano
 If you are adding new test files, then you need to add the filename to the SET(TC_SOURCES...
 section of CMakeLists.txt (this is also parsed by an awk script prior to building)
 
+Good Practices
+--------------
+Use DALI_TEST_EQUALS to test actual value against expected value, like this:
+
+    DALI_TEST_EQUALS( actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), 0.9f, TEST_LOCATION );
+
+This will speed up debugging in case the test some day fails. There is also a variant to test that value is greater than expected:
+
+    DALI_TEST_GREATER( textureBindIndex[1], textureBindIndex[2], TEST_LOCATION );
+
+When doing negative tests where your code uses DALI_ASSERT_ALWAYS, use the DALI_TEST_ASSERTION macro, like below:
+
+    DALI_TEST_ASSERTION(
+    {
+        animation.AnimateTo( Property( actor, Actor::Property::PARENT_ORIGIN ), targetParentOrigin );
+    }, "IsPropertyAnimatable( index )" );
+
+This macro will catch the DALi Exception and check that the correct assert message was included. It will also fail the test in case the assert did not occur. It also reduces the amount of false positive error logging whilst the  is being thrown making it easier to see the real errors.
+
+Note, DALI_ASSERT_DEBUG cannot be tested as tests execute against release version of the code.
+
+Use additional scope to control the life of stack allocated objects, such as DALi handles
+
+    // try reparenting an orphaned child
+    {
+        Actor temporaryParent = Actor::New();
+        temporaryParent.Add( child );
+        DALI_TEST_EQUALS( parent2.GetChildCount(), 0u, TEST_LOCATION );
+    }
+    // temporaryParent has now died, reparent the orphaned child
+    parent2.Add( child );
+    DALI_TEST_EQUALS( parent2.GetChildCount(), 1u, TEST_LOCATION );
+
+Always test the output of your test by making your code fail!!!
+
 Debugging
 =========
 
index a4cad67..96c3740 100755 (executable)
@@ -5,7 +5,18 @@ if [ $1 == -n ] ; then
   opt_genhtml=false
 fi
 
-( cd ../build/tizen ; make cov_data )
+BUILD_DIR_NAME=tizen
+function MakeCovData()
+{
+    (  cd ../build/$BUILD_DIR_NAME ; make cov_data )
+}
+
+MakeCovData
+if [[ $? -ne 0 ]]
+then
+    BUILD_DIR_NAME=tizen-cmake
+    MakeCovData
+fi
 
 # From lcov version 1.10 onwards, branch coverage is off by default and earlier versions do not support the rc option
 LCOV_OPTS=`if [ \`printf "\\\`lcov --version | cut -d' ' -f4\\\`\n1.10\n" | sort -V | head -n 1\` = 1.10 ] ; then echo "--rc lcov_branch_coverage=1" ; fi`
@@ -30,7 +41,7 @@ done
 (
     if [ $opt_genhtml == true ] ; then
         cd .. ;
-        genhtml $LCOV_OPTS -o build/tizen/doc/coverage `find . -name dali.info`
-        echo "Coverage output: ../build/tizen/doc/coverage/index.html"
+        genhtml $LCOV_OPTS -o build/$BUILD_DIR_NAME/doc/coverage `find . -name dali.info`
+        echo "Coverage output: ../build/$BUILD_DIR_NAME/doc/coverage/index.html"
     fi
 )
index 902ba11..7703340 100755 (executable)
@@ -77,9 +77,8 @@ fi
 rm -f tct*core-tests.xml
 
 # Clean up old coverage data
-if [ -d ../build/tizen ] ; then
-    rm -f ../build/tizen/dali/.libs/*.gcda
-fi
+[ -d ../build/tizen ] && rm -f ../build/tizen/dali/.libs/*.gcda
+[ -d ../build/tizen-cmake ] && find ../build/tizen-cmake/ -name \*.gcda -exec rm {} \;
 
 find build \( -name "*.gcda" \) -exec rm '{}' \;
 
index c19953b..bc0bc78 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 #
-# Copyright (c) 2016 Samsung Electronics Co., Ltd.
+# Copyright (c) 2018 Samsung Electronics Co., Ltd.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -19,8 +19,10 @@ use strict;
 use Git;
 use Getopt::Long;
 use Error qw(:try);
+use HTML::Element;
 use Pod::Usage;
 use File::Basename;
+#use Data::Dumper;
 use File::stat;
 use Scalar::Util qw /looks_like_number/;
 use Cwd qw /getcwd/;
@@ -488,21 +490,17 @@ sub patch_html_output
 {
     my $filesref = shift;
 
-    open( my $filehandle, ">", $opt_output ) || die "Can't open $opt_output for writing:$!\n";
+    my $html = HTML::Element->new('html');
+    my $head = HTML::Element->new('head');
+    my $title = HTML::Element->new('title');
+    $title->push_content("Patch Coverage");
+    $head->push_content($title, "\n");
+    $html->push_content($head, "\n");
 
-    my $OUTPUT_FH = select;
-    select $filehandle;
-    print <<EOH;
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-"http://www.w3.org/TR/REC-html40/loose.dtd">
-<html>
-<head>
-<title>Patch Coverage</title>
-</head>
-<body bgcolor="white">
-EOH
+    my $body = HTML::Element->new('body');
+    $body->attr('bgcolor', "white");
 
-    foreach my $file (keys(%$filesref))
+    foreach my $file (sort(keys(%$filesref)))
     {
         my ($name, $path, $suffix) = fileparse($file, qr{\.[^.]*$});
         next if($path !~ /^dali/);
@@ -510,33 +508,47 @@ EOH
         my $patchref = $filesref->{$file}->{"patch"};
         my $b_lines_ref = $filesref->{$file}->{"b_lines"};
         my $coverage_ref = $filesref->{$file}->{"coverage"};
-        print "<h2>$file</h2>\n";
 
+        my $header = HTML::Element->new('h2');
+        $header->push_content($file);
+        $body->push_content($header);
+        $body->push_content("\n");
         if($coverage_ref)
         {
             if( $coverage_ref->{"covered_lines"} > 0
                 ||
                 $coverage_ref->{"uncovered_lines"} > 0 )
             {
-                print "<p style=\"color:green;\">Covered: " .
-                    $coverage_ref->{"covered_lines"} . "<p>" .
-                    "<p style=\"color:red;\">Uncovered: " .
-                    $coverage_ref->{"uncovered_lines"} . "</span></p>";
+                my $para = HTML::Element->new('p');
+                my $covered = HTML::Element->new('span');
+                $covered->attr('style', "color:green;");
+                $covered->push_content("Covered: " . $coverage_ref->{"covered_lines"} );
+                $para->push_content($covered);
+
+                my $para2 = HTML::Element->new('p');
+                my $uncovered = HTML::Element->new('span');
+                $uncovered->attr('style', "color:red;");
+                $uncovered->push_content("Uncovered: " . $coverage_ref->{"uncovered_lines"} );
+                $para2->push_content($uncovered);
+                $body->push_content($para, $para2);
+            }
+            else
+            {
+                #print "coverage ref exists for $file:\n" . Data::Dumper::Dumper($coverage_ref) . "\n";
             }
         }
         else
         {
-            print "<p>";
-            my $span=0;
+            my $para = HTML::Element->new('p');
+            my $span = HTML::Element->new('span');
             if($suffix eq ".cpp" || $suffix eq ".c" || $suffix eq ".h")
             {
-                print "<span style=\"color:red;\">";
-                $span=1;
+                $span->attr('style', "color:red;");
             }
-            print "No coverage found";
-            print "</span>" if $span;
+            $span->push_content("No coverage found");
+            $para->push_content($span);
+            $body->push_content($para);
         }
-        print "</p>";
 
         for my $patch (@$patchref)
         {
@@ -545,53 +557,71 @@ EOH
             {
                 $hunkstr .= " - " . ($patch->[0]+$patch->[1]-1);
             }
-            print "<p style=\"font-weight:bold;\">" . $hunkstr . "</p>";
 
-            print "<pre>";
+            my $para = HTML::Element->new('p');
+            my $span = HTML::Element->new('span');
+            $span->attr('style', "font-weight:bold;");
+            $span->push_content($hunkstr);
+            $para->push_content($span);
+            $body->push_content($para);
+
+            my $codeHunk = HTML::Element->new('pre');
             for(my $i = 0; $i < $patch->[1]; $i++ )
             {
                 my $line = $i + $patch->[0];
                 my $num_line_digits=log($line)/log(10);
                 for $i (0..(6-$num_line_digits-1))
                 {
-                    print " ";
+                    $codeHunk->push_content(" ");
                 }
-                print "$line  ";
 
+                $codeHunk->push_content("$line  ");
+
+                my $srcLine = HTML::Element->new('span');
                 if($coverage_ref)
                 {
                     my $color;
+
                     if($coverage_ref->{"covered"}->{$line})
                     {
-                        print("<span style=\"color:green;\">");
+                        $srcLine->attr('style', "color:green;");
                     }
                     elsif($coverage_ref->{"uncovered"}->{$line})
                     {
-                        print("<span style=\"color:red;font-weight:bold;\">");
+                        $srcLine->attr('style', "color:red;font-weight:bold;");
                     }
                     else
                     {
-                        #print("<span style=\"color:black;font-weight:normal;\">");
+                        $srcLine->attr('style', "color:black;font-weight:normal;");
                     }
                     my $src=$coverage_ref->{"src"}->{$line};
                     chomp($src);
-                    #print $color, "$src\n", RESET;
-                    print "$src</span>\n";
+                    $srcLine->push_content($src);
                 }
                 else
                 {
                     # We don't have coverage data, so print it from the patch instead.
                     my $src = $b_lines_ref->{$line};
-                    print "$src\n";
+                    $srcLine->attr('style', "color:black;font-weight:normal;");
+                    $srcLine->push_content($src);
                 }
+                $codeHunk->push_content($srcLine, "\n");
             }
-            print "<\pre>\n";
+            $body->push_content($codeHunk, "\n");
         }
     }
+    $body->push_content(HTML::Element->new('hr'));
+    $html->push_content($body, "\n");
+
+    open( my $filehandle, ">", $opt_output ) || die "Can't open $opt_output for writing:$!\n";
 
-    print $filehandle "<hr>\n</body>\n</html>\n";
+    print $filehandle <<EOH;
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+"http://www.w3.org/TR/REC-html40/loose.dtd">
+EOH
+;
+    print $filehandle $html->as_HTML();
     close $filehandle;
-    select $OUTPUT_FH;
 }
 
 
diff --git a/automated-tests/src/dali-graphics/CMakeLists.txt b/automated-tests/src/dali-graphics/CMakeLists.txt
deleted file mode 100644 (file)
index 82c94a2..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-SET(PKG_NAME "dali-graphics")
-
-SET(EXEC_NAME "tct-${PKG_NAME}-core")
-SET(RPM_NAME "core-${PKG_NAME}-tests")
-
-SET(CAPI_LIB "dali-internal")
-
-SET(TC_SOURCES
-  utc-Dali-Graphics-API.cpp
-  utc-Dali-Graphics-Object-Owner.cpp
-  utc-Dali-Graphics-Utility-Queue.cpp
-)
-
-LIST(APPEND TC_SOURCES
-  graphics-test-implementation/graphics-test-implementation.cpp
-)
-
-LIST(APPEND TC_SOURCES
-        ../dali/dali-test-suite-utils/mesh-builder.cpp
-        ../dali/dali-test-suite-utils/test-harness.cpp
-        ../dali/dali-test-suite-utils/test-actor-utils.cpp
-        ../dali/dali-test-suite-utils/dali-test-suite-utils.cpp
-        ../dali/dali-test-suite-utils/test-application.cpp
-        ../dali/dali-test-suite-utils/test-gesture-manager.cpp
-        ../dali/dali-test-suite-utils/test-gl-abstraction.cpp
-        ../dali/dali-test-suite-utils/test-gl-sync-abstraction.cpp
-        ../dali/dali-test-suite-utils/test-native-image.cpp
-        ../dali/dali-test-suite-utils/test-platform-abstraction.cpp
-        ../dali/dali-test-suite-utils/test-render-controller.cpp
-        ../dali/dali-test-suite-utils/test-trace-call-stack.cpp
-)
-
-PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
-     dali-core
-)
-
-SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${${CAPI_LIB}_CFLAGS_OTHER} -O0 -ggdb --coverage -Wall -Werror -std=c++14 ")
-
-FOREACH(directory ${${CAPI_LIB}_LIBRARY_DIRS})
-    SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${directory}")
-ENDFOREACH(directory ${CAPI_LIB_LIBRARY_DIRS})
-
-INCLUDE_DIRECTORIES(
-    ../../..
-    .
-    ${${CAPI_LIB}_INCLUDE_DIRS}
-    ../dali/dali-test-suite-utils
-    ../dali-devel
-)
-
-ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
-TARGET_LINK_LIBRARIES(${EXEC_NAME}
-    ${${CAPI_LIB}_LIBRARIES}
-)
-
-INSTALL(PROGRAMS ${EXEC_NAME}
-    DESTINATION ${BIN_DIR}/${EXEC_NAME}
-)
diff --git a/automated-tests/src/dali-graphics/graphics-test-implementation/graphics-test-implementation.cpp b/automated-tests/src/dali-graphics/graphics-test-implementation/graphics-test-implementation.cpp
deleted file mode 100644 (file)
index 41281b7..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include "graphics-test-implementation.h"
-
-namespace Dali
-{
-
-namespace Graphics
-{
-namespace Test
-{
-
-API::Accessor< API::Shader > Controller::CreateShader(
-    const API::BaseFactory< API::Shader >& factory)
-{
-  auto handle = mShaders.CreateObject(factory);
-  return API::Accessor< API::Shader >{mShaders, handle};
-}
-
-API::Accessor< API::Texture > Controller::CreateTexture(
-    const API::BaseFactory< API::Texture >& factory)
-{
-  auto handle = mTextures.CreateObject(factory);
-  return API::Accessor< API::Texture >{mTextures, handle};
-}
-
-API::Accessor< API::TextureSet > Controller::CreateTextureSet(
-    const API::BaseFactory< API::TextureSet >& factory)
-{
-  auto handle = mTextureSets.CreateObject(factory);
-  return API::Accessor< API::TextureSet >{mTextureSets, handle};
-}
-
-API::Accessor< API::DynamicBuffer > Controller::CreateDynamicBuffer(
-    const API::BaseFactory< API::DynamicBuffer >& factory)
-{
-  auto handle = mDynamicBuffers.CreateObject(factory);
-  return API::Accessor< API::DynamicBuffer >{mDynamicBuffers, handle};
-}
-
-API::Accessor< API::StaticBuffer > Controller::CreateStaticBuffer(
-    const API::BaseFactory< API::StaticBuffer >& factory)
-{
-  auto handle = mStaticBuffers.CreateObject(factory);
-  return API::Accessor< API::StaticBuffer >{mStaticBuffers, handle};
-}
-
-API::Accessor< API::Sampler > Controller::CreateSampler(
-    const API::BaseFactory< API::Sampler >& factory)
-{
-  auto handle = mSamplers.CreateObject(factory);
-  return API::Accessor< API::Sampler >{mSamplers, handle};
-}
-
-API::Accessor< API::Framebuffer > Controller::CreateFramebuffer(
-    const API::BaseFactory< API::Framebuffer >& factory)
-{
-  auto handle = mFramebuffers.CreateObject(factory);
-  return API::Accessor< API::Framebuffer >{mFramebuffers, handle};
-}
-
-void Controller::GetRenderItemList()
-{
-}
-
-} // namespace Test
-} // namespace Graphics
-} // namespace Dali
diff --git a/automated-tests/src/dali-graphics/graphics-test-implementation/graphics-test-implementation.h b/automated-tests/src/dali-graphics/graphics-test-implementation/graphics-test-implementation.h
deleted file mode 100644 (file)
index 36f5a2e..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#ifndef DALI_GRAPHICS_TEST_IMPLEMENTATION_H
-#define DALI_GRAPHICS_TEST_IMPLEMENTATION_H
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics-api/graphics-api-base-factory.h>
-#include <dali/graphics-api/graphics-api-controller.h>
-#include <dali/graphics/graphics-object-owner.h>
-
-namespace Dali
-{
-
-namespace Graphics
-{
-namespace Test
-{
-
-template< typename T, typename BaseT >
-struct FactoryImpl : public API::BaseFactory< BaseT >
-{
-  FactoryImpl() = default;
-
-  virtual typename API::BaseFactory< BaseT >::PointerType Create() const override
-  {
-    return typename API::BaseFactory< BaseT >::PointerType{new T{}};
-  }
-
-  FactoryImpl(const FactoryImpl&) = delete;
-  FactoryImpl& operator=(const FactoryImpl&) = delete;
-
-  FactoryImpl(FactoryImpl&&) = default;
-  FactoryImpl& operator=(FactoryImpl&&) = default;
-
-  virtual ~FactoryImpl() = default;
-};
-
-struct Shader final : public API::Shader
-{
-};
-using ShaderFactory = FactoryImpl< Shader, API::Shader >;
-
-struct Texture final : public API::Texture
-{
-};
-using TextureFactory = FactoryImpl< Texture, API::Texture >;
-
-struct TextureSet final : public API::TextureSet
-{
-  virtual void AddTexture(const API::Accessor<API::Texture>& ) override {}
-};
-using TextureSetFactory = FactoryImpl< TextureSet, API::TextureSet >;
-
-struct DynamicBuffer final : public API::DynamicBuffer
-{
-};
-using DynamicBufferFactory = FactoryImpl< DynamicBuffer, API::DynamicBuffer >;
-
-struct StaticBuffer final : public API::StaticBuffer
-{
-};
-using StaticBufferFactory = FactoryImpl< StaticBuffer, API::StaticBuffer >;
-
-struct Sampler final : public API::Sampler
-{
-};
-using SamplerFactory = FactoryImpl< Sampler, API::Sampler >;
-
-struct Framebuffer final : public API::Framebuffer
-{
-};
-using FramebufferFactory = FactoryImpl< Framebuffer, API::Framebuffer >;
-
-class Controller final : public API::Controller
-{
-public:
-  virtual API::Accessor< API::Shader > CreateShader(
-      const API::BaseFactory< API::Shader >& factory) override;
-
-  virtual API::Accessor< API::Texture > CreateTexture(
-      const API::BaseFactory< API::Texture >& factory) override;
-
-  virtual API::Accessor< API::TextureSet > CreateTextureSet(
-      const API::BaseFactory< API::TextureSet >& factory) override;
-
-  virtual API::Accessor< API::DynamicBuffer > CreateDynamicBuffer(
-      const API::BaseFactory< API::DynamicBuffer >& factory) override;
-
-  virtual API::Accessor< API::StaticBuffer > CreateStaticBuffer(
-      const API::BaseFactory< API::StaticBuffer >& factory) override;
-
-  virtual API::Accessor< API::Sampler > CreateSampler(
-      const API::BaseFactory< API::Sampler >& factory) override;
-
-  virtual API::Accessor< API::Framebuffer > CreateFramebuffer(
-      const API::BaseFactory< API::Framebuffer >& factory) override;
-
-  virtual void GetRenderItemList() override;
-
-private:
-  ObjectOwner< API::Shader >        mShaders;
-  ObjectOwner< API::Texture >       mTextures;
-  ObjectOwner< API::TextureSet >    mTextureSets;
-  ObjectOwner< API::DynamicBuffer > mDynamicBuffers;
-  ObjectOwner< API::StaticBuffer >  mStaticBuffers;
-  ObjectOwner< API::Sampler >       mSamplers;
-  ObjectOwner< API::Framebuffer >   mFramebuffers;
-};
-
-} // namespace Test
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_TEST_IMPLEMENTATION_H
diff --git a/automated-tests/src/dali-graphics/tct-dali-graphics-core.cpp b/automated-tests/src/dali-graphics/tct-dali-graphics-core.cpp
deleted file mode 100644 (file)
index e0fe720..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "tct-dali-graphics-core.h"
-#include <getopt.h>
-#include <stdlib.h>
-#include <string.h>
-#include <test-harness.h>
-
-int main(int argc, char* const argv[])
-{
-  int result = TestHarness::EXIT_STATUS_BAD_ARGUMENT;
-
-  const char* optString = "rs";
-  bool        optRerunFailed(true);
-  bool        optRunSerially(false);
-
-  int nextOpt = 0;
-  do
-  {
-    nextOpt = getopt(argc, argv, optString);
-    switch(nextOpt)
-    {
-    case 'r':
-      optRerunFailed = true;
-      break;
-    case 's':
-      optRunSerially = true;
-      break;
-    case '?':
-      TestHarness::Usage(argv[0]);
-      exit(TestHarness::EXIT_STATUS_BAD_ARGUMENT);
-      break;
-    }
-  } while(nextOpt != -1);
-
-  if(optind == argc) // no testcase name in argument list
-  {
-    if(optRunSerially)
-    {
-      result = TestHarness::RunAll(argv[0], tc_array);
-    }
-    else
-    {
-      result = TestHarness::RunAllInParallel(argv[0], tc_array, optRerunFailed);
-    }
-  }
-  else
-  {
-    // optind is index of next argument - interpret as testcase name
-    result = TestHarness::FindAndRunTestCase(tc_array, argv[optind]);
-  }
-  return result;
-}
diff --git a/automated-tests/src/dali-graphics/utc-Dali-Graphics-API.cpp b/automated-tests/src/dali-graphics/utc-Dali-Graphics-API.cpp
deleted file mode 100644 (file)
index 24a5906..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali-test-suite-utils.h>
-
-#include "graphics-test-implementation/graphics-test-implementation.h"
-
-using namespace Dali::Graphics::Test;
-
-void utc_dali_graphics_api_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_graphics_api_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-int UtcDaliGraphicsAPI(void)
-{
-  auto controller = Controller{};
-
-  // Just test construction of controller
-  DALI_TEST_CHECK(true);
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsAPICreateShader(void)
-{
-  auto controller = Controller {};
-
-  auto factory = ShaderFactory {};
-  auto accessor = controller.CreateShader(factory);
-  DALI_TEST_CHECK(accessor.Exists());
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsAPICreateTexture(void)
-{
-  auto controller = Controller {};
-
-  auto factory = TextureFactory {};
-  auto accessor = controller.CreateTexture(factory);
-  DALI_TEST_CHECK(accessor.Exists());
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsAPICreateTextureSet(void)
-{
-  auto controller = Controller {};
-
-  auto factory = TextureSetFactory {};
-  auto accessor = controller.CreateTextureSet(factory);
-  DALI_TEST_CHECK(accessor.Exists());
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsAPICreateDynamicBuffer(void)
-{
-  auto controller = Controller {};
-
-  auto factory = DynamicBufferFactory {};
-  auto accessor = controller.CreateDynamicBuffer(factory);
-  DALI_TEST_CHECK(accessor.Exists());
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsAPICreateStaticBuffer(void)
-{
-  auto controller = Controller {};
-
-  auto factory = StaticBufferFactory {};
-  auto accessor = controller.CreateStaticBuffer(factory);
-  DALI_TEST_CHECK(accessor.Exists());
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsAPICreateSampler(void)
-{
-  auto controller = Controller {};
-
-  auto factory = SamplerFactory {};
-  auto accessor = controller.CreateSampler(factory);
-  DALI_TEST_CHECK(accessor.Exists());
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsAPICreateFramebuffer(void)
-{
-  auto controller = Controller {};
-
-  auto factory = FramebufferFactory {};
-  auto accessor = controller.CreateFramebuffer(factory);
-  DALI_TEST_CHECK(accessor.Exists());
-
-  END_TEST;
-}
diff --git a/automated-tests/src/dali-graphics/utc-Dali-Graphics-Object-Owner.cpp b/automated-tests/src/dali-graphics/utc-Dali-Graphics-Object-Owner.cpp
deleted file mode 100644 (file)
index 5c2f3c9..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <memory>
-
-#include <dali-test-suite-utils.h>
-#include <dali/graphics/graphics-object-owner.h>
-
-using namespace Dali::Graphics;
-
-void utc_dali_graphics_api_handle_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_graphics_api_handle_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-namespace
-{
-
-struct TestType final
-{
-  /**
-   * @brief default constructor
-   */
-  TestType() = default;
-
-  /**
-   * @brief constructor
-   */
-  constexpr TestType(int value) : mValue(value)
-  {
-  }
-
-  //data
-  int mValue = 0;
-};
-
-struct TestTypeFactory final : public API::BaseFactory< TestType >
-{
-  virtual typename API::BaseFactory< TestType >::PointerType Create() const override
-  {
-    return typename API::BaseFactory< TestType >::PointerType{new TestType{42}};
-  }
-};
-
-} // namespace
-
-int UtcDaliGraphicsAPIHandle(void)
-{
-  ObjectOwner< TestType > objectOwner;
-
-  auto handle = objectOwner.CreateObject(TestTypeFactory{});
-  DALI_TEST_EQUALS(handle, 0, TEST_LOCATION);
-
-  auto value = objectOwner[handle].mValue;
-
-  DALI_TEST_CHECK(value == 42);
-
-  END_TEST;
-}
diff --git a/automated-tests/src/dali-graphics/utc-Dali-Graphics-Utility-Queue.cpp b/automated-tests/src/dali-graphics/utc-Dali-Graphics-Utility-Queue.cpp
deleted file mode 100644 (file)
index 1c9ccc1..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali-test-suite-utils.h>
-#include <dali/graphics/utility/utility-queue.h>
-
-using namespace Dali::Graphics::Utility;
-
-void utc_dali_graphics_utility_queue_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_graphics_utility_queue_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-namespace
-{
-struct Tracker
-{
-  Tracker() = delete;
-
-  Tracker(size_t& ctrCount, size_t& dtrCount)
-  : mCtrCount(ctrCount), mDtrCount(dtrCount)
-  {
-    ++mCtrCount;
-  }
-
-  Tracker(const Tracker&) = delete;
-  Tracker& operator=(const Tracker&) = delete;
-
-  Tracker(Tracker&& t) : Tracker(t.mCtrCount, t.mDtrCount)
-  {
-  }
-  Tracker& operator=(Tracker&&) = delete;
-
-  ~Tracker()
-  {
-    ++mDtrCount;
-  }
-  size_t& mCtrCount;
-  size_t& mDtrCount;
-
-};
-
-} // namespace
-
-int UtcDaliGraphicsUtilityQueueSimple(void)
-{
-  auto queue = Queue<int>{};
-
-  queue.Enqueue(42);
-  auto value = queue.Dequeue();
-
-  DALI_TEST_EQUALS(value, 42, TEST_LOCATION);
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsUtilityQueueMultiple(void)
-{
-  auto queue = Queue<int>{};
-
-  queue.Enqueue(42);
-  for(int i=0; i<42; ++i)
-  {
-    queue.Enqueue(i);
-  }
-
-  auto value = queue.Dequeue();
-
-  DALI_TEST_EQUALS(value, 42, TEST_LOCATION);
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsUtilityQueueLongRun(void)
-{
-  auto queue = Queue<int>{};
-
-  queue.Enqueue(0);
-
-  for(int i=0; i<1000; ++i)
-  {
-    queue.Enqueue(i+1);
-    auto value = queue.Dequeue();
-    DALI_TEST_EQUALS(value, i, TEST_LOCATION);
-  }
-  DALI_TEST_EQUALS(queue.Count(), 1, TEST_LOCATION);
-  queue.Dequeue();
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsUtilityQueueLongRunTracker(void)
-{
-  auto ctrCounter = size_t{};
-  auto dtrCounter = size_t{};
-
-  auto queue = Queue< Tracker >{};
-
-  queue.EnqueueEmplace(ctrCounter, dtrCounter);
-
-  for(int i = 0; i < 1000; ++i)
-  {
-    {
-      queue.EnqueueEmplace(ctrCounter, dtrCounter);
-      queue.Dequeue();
-    }
-    DALI_TEST_EQUALS(ctrCounter, dtrCounter + 1, TEST_LOCATION);
-  }
-  DALI_TEST_EQUALS(queue.Count(), 1, TEST_LOCATION);
-  queue.Dequeue();
-
-  DALI_TEST_EQUALS(ctrCounter, dtrCounter, TEST_LOCATION);
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsUtilityQueueCapacityCheck(void)
-{
-  auto queue = Queue< int >{};
-
-  DALI_TEST_EQUALS(queue.GetCapacity(), 0, TEST_LOCATION);
-
-  queue.EnqueueEmplace(1);
-  DALI_TEST_EQUALS(queue.GetCapacity(), 255, TEST_LOCATION);
-
-  queue.Dequeue();
-  DALI_TEST_EQUALS(queue.GetCapacity(), 0, TEST_LOCATION);
-
-  END_TEST;
-}
-
-int UtcDaliGraphicsUtilityQueueTrackerDeletion(void)
-{
-  auto ctrCounter = size_t{};
-  auto dtrCounter = size_t{};
-
-  {
-    auto queue = Queue< Tracker >{};
-
-    DALI_TEST_EQUALS(queue.GetCapacity(), 0, TEST_LOCATION);
-    queue.EnqueueEmplace(ctrCounter, dtrCounter);
-    for(int i = 0; i < 10; ++i)
-    {
-      queue.EnqueueEmplace(ctrCounter, dtrCounter);
-    }
-    DALI_TEST_EQUALS(queue.GetCapacity(), 63, TEST_LOCATION);
-  }
-  DALI_TEST_EQUALS(ctrCounter, dtrCounter, TEST_LOCATION);
-
-  END_TEST;
-}
-
-
-int UtcDaliGraphicsUtilityQueueReduceCapacity(void)
-{
-  auto ctrCounter = size_t{};
-  auto dtrCounter = size_t{};
-
-  {
-    auto queue = Queue< Tracker >{};
-
-    DALI_TEST_EQUALS(queue.GetCapacity(), 0, TEST_LOCATION);
-    queue.EnqueueEmplace(ctrCounter, dtrCounter);
-    for(int i = 0; i < 1000; ++i)
-    {
-      queue.EnqueueEmplace(ctrCounter, dtrCounter);
-    }
-    DALI_TEST_EQUALS(queue.GetCapacity(), 1023, TEST_LOCATION);
-    DALI_TEST_EQUALS(queue.Count(), 1001, TEST_LOCATION);
-  }
-  DALI_TEST_EQUALS(ctrCounter, dtrCounter, TEST_LOCATION);
-
-  END_TEST;
-}
index 5fc4d99..82c5ab7 100644 (file)
@@ -7,10 +7,11 @@ SET(CAPI_LIB "dali-internal")
 
 SET(TC_SOURCES
         utc-Dali-Internal-Core.cpp
-        utc-Dali-Internal-Handles.cpp
         utc-Dali-Internal-FixedSizeMemoryPool.cpp
-        utc-Dali-Internal-MemoryPoolObjectAllocator.cpp
         utc-Dali-Internal-FrustumCulling.cpp
+        utc-Dali-Internal-Handles.cpp
+        utc-Dali-Internal-MemoryPoolObjectAllocator.cpp
+        utc-Dali-Internal-OwnerPointer.cpp
 )
 
 LIST(APPEND TC_SOURCES
@@ -20,16 +21,29 @@ LIST(APPEND TC_SOURCES
         ../dali/dali-test-suite-utils/dali-test-suite-utils.cpp
         ../dali/dali-test-suite-utils/test-application.cpp
         ../dali/dali-test-suite-utils/test-gesture-manager.cpp
-        ../dali/dali-test-suite-utils/test-gl-abstraction.cpp
-        ../dali/dali-test-suite-utils/test-gl-sync-abstraction.cpp
         ../dali/dali-test-suite-utils/test-native-image.cpp
         ../dali/dali-test-suite-utils/test-platform-abstraction.cpp
+        ../dali/dali-test-suite-utils/test-graphics-buffer.cpp
+        ../dali/dali-test-suite-utils/test-graphics-buffer-factory.cpp
+        ../dali/dali-test-suite-utils/test-graphics-controller.cpp
+        ../dali/dali-test-suite-utils/test-graphics-framebuffer.cpp
+        ../dali/dali-test-suite-utils/test-graphics-framebuffer-factory.cpp
+        ../dali/dali-test-suite-utils/test-graphics-pipeline.cpp
+        ../dali/dali-test-suite-utils/test-graphics-pipeline-factory.cpp
+        ../dali/dali-test-suite-utils/test-graphics-render-command.cpp
+        ../dali/dali-test-suite-utils/test-graphics-sampler.cpp
+        ../dali/dali-test-suite-utils/test-graphics-sampler-factory.cpp
+        ../dali/dali-test-suite-utils/test-graphics-shader.cpp
+        ../dali/dali-test-suite-utils/test-graphics-shader-factory.cpp
+        ../dali/dali-test-suite-utils/test-graphics-texture.cpp
+        ../dali/dali-test-suite-utils/test-graphics-texture-factory.cpp
         ../dali/dali-test-suite-utils/test-render-controller.cpp
+        ../dali/dali-test-suite-utils/test-render-surface.cpp
         ../dali/dali-test-suite-utils/test-trace-call-stack.cpp
 )
 
 PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
-     dali-core
+     dali-core-vk
 )
 
 ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
index 4c70f80..6335c7c 100644 (file)
@@ -66,35 +66,6 @@ public:
 
 } // anonymous namespace
 
-int UtcDaliCoreTopMargin(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::Integration::Core::SetTopMargin");
-
-  Stage stage = Stage::GetCurrent();
-
-  // Test Stage size without top-margin
-
-  const unsigned int initialWidth(  stage.GetSize().width );
-  const unsigned int initialHeight( stage.GetSize().height );
-
-  DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_WIDTH,  initialWidth,  TEST_LOCATION );
-  DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_HEIGHT, initialHeight, TEST_LOCATION );
-
-  // Retest with top-margin
-
-  unsigned int margin( 10 );
-  application.SetTopMargin( margin );
-
-  const unsigned int newWidth(  stage.GetSize().width );
-  const unsigned int newHeight( stage.GetSize().height );
-
-  DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_WIDTH,             newWidth,  TEST_LOCATION );
-  DALI_TEST_EQUALS( (TestApplication::DEFAULT_SURFACE_HEIGHT - margin), newHeight, TEST_LOCATION );
-
-  END_TEST;
-}
-
 int UtcDaliCoreProcessEvents(void)
 {
   TestApplication application;
index aa4f298..eb6367f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -110,6 +110,9 @@ bool GetCameraDepths( TestApplication& application, float& nearPlane, float& far
 int UtcFrustumCullN(void)
 {
   TestApplication application;
+  tet_infoline("UtcFrustumCullN");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -121,13 +124,15 @@ int UtcFrustumCullN(void)
   application.Render( 16 );
 
   DALI_TEST_CHECK( drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumLeftCullP(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -146,13 +151,15 @@ int UtcFrustumLeftCullP(void)
 
   // This will be sphere culled
   DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumLeftCullN(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -165,13 +172,15 @@ int UtcFrustumLeftCullN(void)
   application.Render( 16 );
 
   DALI_TEST_CHECK( drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumRightCullP(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -191,13 +200,15 @@ int UtcFrustumRightCullP(void)
 
   // This will be sphere culled
   DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumRightCullN(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -210,13 +221,15 @@ int UtcFrustumRightCullN(void)
   application.Render( 16 );
 
   DALI_TEST_CHECK( drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumTopCullP(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -236,13 +249,15 @@ int UtcFrustumTopCullP(void)
 
   // This will be sphere culled
   DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumTopCullN(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -256,13 +271,15 @@ int UtcFrustumTopCullN(void)
 
   // This will be box culled
   DALI_TEST_CHECK( drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumBottomCullP(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -282,13 +299,15 @@ int UtcFrustumBottomCullP(void)
 
   // This will be sphere culled
   DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumBottomCullN(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -301,13 +320,15 @@ int UtcFrustumBottomCullN(void)
   application.Render( 16 );
 
   DALI_TEST_CHECK( drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumNearCullP(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -329,13 +350,16 @@ int UtcFrustumNearCullP(void)
 
   // This will be sphere culled
   DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumNearCullN(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -355,13 +379,15 @@ int UtcFrustumNearCullN(void)
   application.Render( 16 );
 
   DALI_TEST_CHECK( drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumFarCullP(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -383,13 +409,15 @@ int UtcFrustumFarCullP(void)
 
   // This will be sphere culled
   DALI_TEST_CHECK( !drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumFarCullN(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -409,13 +437,15 @@ int UtcFrustumFarCullN(void)
   application.Render( 16 );
 
   DALI_TEST_CHECK( drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
 int UtcFrustumCullDisabledP(void)
 {
   TestApplication application;
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
   drawTrace.Enable( true );
@@ -428,6 +458,6 @@ int UtcFrustumCullDisabledP(void)
 
   // This should not be culled
   DALI_TEST_CHECK( drawTrace.FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
diff --git a/automated-tests/src/dali-internal/utc-Dali-Internal-OwnerPointer.cpp b/automated-tests/src/dali-internal/utc-Dali-Internal-OwnerPointer.cpp
new file mode 100644 (file)
index 0000000..1452895
--- /dev/null
@@ -0,0 +1,361 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <utility>
+
+// INTERNAL INCLUDES
+#include <dali-test-suite-utils.h>
+#include <dali/internal/common/owner-pointer.h>
+
+using namespace Dali::Internal;
+
+void utc_dali_internal_owner_pointer_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_internal_owner_pointer_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+namespace
+{
+
+/// Takes in a reference to a bool which is set to true when the destructor is called
+class OwnedClass
+{
+public:
+
+  OwnedClass( bool& destructorCalled )
+  : mDestructorCalled( destructorCalled )
+  {
+    mDestructorCalled = false;
+  }
+
+  ~OwnedClass()
+  {
+    mDestructorCalled = true;
+  }
+
+private:
+
+  bool& mDestructorCalled;
+};
+
+/// Just a simple class with a function that marks a member boolean to true if that function is called
+class ClassWithFunction
+{
+public:
+  ClassWithFunction() = default;
+
+  void MyFunction()
+  {
+    functionCalled = true;
+  }
+
+  bool functionCalled{ false };
+};
+
+} // anon namespace
+
+///////////////////////////////////////////////////////////////////////////////
+
+int UtcDaliOwnerPointerEnsureDeletion(void)
+{
+  // Ensure that the object owned by the owner-pointer is deleted.
+
+  bool deleted = false;
+
+  {
+    OwnerPointer< OwnedClass > pointer( new OwnedClass( deleted ) );
+    DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+  }
+
+  // OwnerPointer out-of-scope, object should be deleted.
+
+  DALI_TEST_EQUALS( deleted, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerDefaultConstructor(void)
+{
+  // Ensure the default constructor is created as expected.
+
+  OwnerPointer< OwnedClass > pointer;
+  DALI_TEST_CHECK( pointer.Get() == nullptr );
+
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerCopy(void)
+{
+  // Call copy constructor and assignment operator
+
+  bool deleted = false;
+  OwnedClass* owned = new OwnedClass( deleted );
+
+  OwnerPointer< OwnedClass > first( owned );
+  DALI_TEST_CHECK( first.Get() == owned );
+
+  {
+    // Copy constructor, first should have a nullptr now, no object deletion
+    OwnerPointer< OwnedClass > second( first );
+    DALI_TEST_CHECK( first.Get() == nullptr );
+    DALI_TEST_CHECK( second.Get() == owned);
+    DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+
+    // Self assignment, nothing should change or be deleted.
+    first = first;
+    second = second;
+    DALI_TEST_CHECK( first.Get() == nullptr );
+    DALI_TEST_CHECK( second.Get() == owned );
+    DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+
+    // Assign second to first, no deletion, second should have a nullptr now
+    first = second;
+    DALI_TEST_CHECK( first.Get() == owned );
+    DALI_TEST_CHECK( second.Get() == nullptr );
+    DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+  }
+
+  // second is out-of-scope now, no object deletion
+  DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+
+  // Assign to an empty pointer, owned object should be deleted
+  OwnerPointer< OwnedClass > empty;
+  first = empty;
+  DALI_TEST_EQUALS( deleted, true, TEST_LOCATION );
+  DALI_TEST_CHECK( first.Get() == nullptr );
+  DALI_TEST_CHECK( empty.Get() == nullptr );
+
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerMove(void)
+{
+  // Call move constructor and move assignment operator
+
+  bool deleted = false;
+  OwnedClass* owned = new OwnedClass( deleted );
+
+  OwnerPointer< OwnedClass > first( owned );
+  DALI_TEST_CHECK( first.Get() == owned );
+
+  {
+    // Move constructor, first should have a nullptr now, no object deletion
+    OwnerPointer< OwnedClass > second( std::move( first ) );
+    DALI_TEST_CHECK( first.Get() == nullptr );
+    DALI_TEST_CHECK( second.Get() == owned);
+    DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+
+    // Self assignment, nothing should change or be deleted.
+    first = std::move( first );
+    second = std::move( second );
+    DALI_TEST_CHECK( first.Get() == nullptr );
+    DALI_TEST_CHECK( second.Get() == owned );
+    DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+
+    // Assign second to first, no deletion, second should have a nullptr now
+    first = std::move( second );
+    DALI_TEST_CHECK( first.Get() == owned );
+    DALI_TEST_CHECK( second.Get() == nullptr );
+    DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+  }
+
+  // second is out-of-scope now, no object deletion
+  DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+
+  // Assign to an empty pointer, owned object should be deleted
+  OwnerPointer< OwnedClass > empty;
+  first = std::move( empty );
+  DALI_TEST_EQUALS( deleted, true, TEST_LOCATION );
+  DALI_TEST_CHECK( first.Get() == nullptr );
+  DALI_TEST_CHECK( empty.Get() == nullptr );
+
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerIndirection(void)
+{
+  // Check the indirection operators
+
+  using Ptr = OwnerPointer< int >;
+
+  {
+    int* rawIntPtr( new int( 200 ) );
+    Ptr nonConstPtr( rawIntPtr );
+    DALI_TEST_CHECK( rawIntPtr == &( *nonConstPtr ) );
+    DALI_TEST_EQUALS( *nonConstPtr, 200, TEST_LOCATION );
+  }
+
+  {
+    int* rawIntPtr2( new int( 300 ) );
+    const Ptr constPtr( rawIntPtr2 );
+    DALI_TEST_CHECK( rawIntPtr2 == &( *constPtr ) );
+    DALI_TEST_EQUALS( *constPtr, 300, TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerPointerOperator(void)
+{
+  // Check the pointer operators
+
+  using Ptr = OwnerPointer< ClassWithFunction >;
+
+  // Check if function is called as expected when using a const OwnerPointer
+  {
+    ClassWithFunction* rawPtr( new ClassWithFunction );
+    Ptr nonConstPtr( rawPtr );
+    DALI_TEST_EQUALS( rawPtr->functionCalled, false, TEST_LOCATION );
+    nonConstPtr->MyFunction();
+    DALI_TEST_EQUALS( rawPtr->functionCalled, true, TEST_LOCATION );
+  }
+
+
+  // Check if function is called as expected when using a const OwnerPointer
+  {
+    ClassWithFunction* rawPtr2( new ClassWithFunction );
+    const Ptr constPtr( rawPtr2 );
+    DALI_TEST_EQUALS( rawPtr2->functionCalled, false, TEST_LOCATION );
+    constPtr->MyFunction();
+    DALI_TEST_EQUALS( rawPtr2->functionCalled, true, TEST_LOCATION );
+  }
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerComparisonOperator(void)
+{
+  // Check the comparison operator
+
+  using Ptr = OwnerPointer< int >;
+
+  int* rawIntPtr( new int( 200 ) );
+  Ptr ownerPtr( rawIntPtr );
+  DALI_TEST_CHECK( ownerPtr == rawIntPtr );
+  DALI_TEST_CHECK( ! ( ownerPtr == nullptr ) );
+
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerReset(void)
+{
+  // Ensure that calling Reset deletes the object and sets the owner-pointer to NULL
+
+  bool deleted = false;
+
+  OwnerPointer< OwnedClass > pointer( new OwnedClass( deleted ) );
+  DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+  pointer.Reset();
+  DALI_TEST_EQUALS( deleted, true, TEST_LOCATION );
+  DALI_TEST_CHECK( pointer.Get() == nullptr );
+
+  // Reset the empty pointer, should have no effect but there shouldn't be any crash
+  pointer.Reset();
+  DALI_TEST_CHECK( pointer.Get() == nullptr );
+
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerRelease(void)
+{
+  // Ensure that calling Release does NOT delete the object but still sets the owner-pointer to NULL
+
+  bool deleted = false;
+
+  OwnedClass* rawPtr = new OwnedClass( deleted );
+  OwnerPointer< OwnedClass > pointer( rawPtr );
+
+  DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+  DALI_TEST_CHECK( pointer.Release() == rawPtr );
+  DALI_TEST_EQUALS( deleted, false, TEST_LOCATION );
+  DALI_TEST_CHECK( pointer.Get() == nullptr );
+
+  // Release the empty pointer, should have no effect but there shouldn't be any crash
+  DALI_TEST_CHECK( pointer.Release() == nullptr );
+  DALI_TEST_CHECK( pointer.Get() == nullptr );
+
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerGet(void)
+{
+  // Check the Get method
+
+  using Ptr = OwnerPointer< int >;
+
+  int* rawIntPtr( new int( 200 ) );
+  Ptr ownerPtr( rawIntPtr );
+  DALI_TEST_CHECK( ownerPtr.Get() == rawIntPtr );
+
+  END_TEST;
+}
+
+int UtcDaliOwnerPointerSwap(void)
+{
+  // Ensure the Swap method swaps the pointers and doesn't delete any objects
+
+  using Ptr = OwnerPointer< OwnedClass >;
+
+  bool firstObjectDeleted = false;
+  bool secondObjectDeleted = false;
+
+  OwnedClass* firstRawPtr = new OwnedClass( firstObjectDeleted );
+  OwnedClass* secondRawPtr = new OwnedClass( secondObjectDeleted );
+
+  Ptr firstPtr( firstRawPtr );
+  Ptr secondPtr( secondRawPtr );
+
+  // Check initial values
+  DALI_TEST_EQUALS( firstObjectDeleted, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( secondObjectDeleted, false, TEST_LOCATION );
+  DALI_TEST_CHECK( firstPtr == firstRawPtr );
+  DALI_TEST_CHECK( secondPtr == secondRawPtr );
+
+  // Call Swap on first and ensure swap is done and there's no deletion
+  firstPtr.Swap( secondPtr );
+  DALI_TEST_EQUALS( firstObjectDeleted, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( secondObjectDeleted, false, TEST_LOCATION );
+  DALI_TEST_CHECK( firstPtr == secondRawPtr );
+  DALI_TEST_CHECK( secondPtr == firstRawPtr );
+
+  // Swap back using second, again no deletion
+  secondPtr.Swap( firstPtr );
+  DALI_TEST_EQUALS( firstObjectDeleted, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( secondObjectDeleted, false, TEST_LOCATION );
+  DALI_TEST_CHECK( firstPtr == firstRawPtr );
+  DALI_TEST_CHECK( secondPtr == secondRawPtr );
+
+  // Swap with self, nothing should change or be deleted
+  firstPtr.Swap( firstPtr );
+  DALI_TEST_EQUALS( firstObjectDeleted, false, TEST_LOCATION );
+  DALI_TEST_CHECK( firstPtr == firstRawPtr );
+
+  // Swap with an empty OwnerPointer, no deletion but firstPtr should be empty now
+  Ptr emptyPtr;
+  firstPtr.Swap( emptyPtr );
+  DALI_TEST_EQUALS( firstObjectDeleted, false, TEST_LOCATION );
+  DALI_TEST_CHECK( firstPtr == nullptr );
+  DALI_TEST_CHECK( emptyPtr == firstRawPtr );
+
+  END_TEST;
+}
index 6fdf651..a95cace 100644 (file)
@@ -23,6 +23,7 @@ SET(TC_SOURCES
         utc-Dali-Constraints.cpp
         utc-Dali-ConstraintSource.cpp
         utc-Dali-Context.cpp
+        utc-Dali-Core.cpp
         utc-Dali-CustomActor.cpp
         utc-Dali-Degree.cpp
         utc-Dali-DistanceField.cpp
@@ -30,6 +31,7 @@ SET(TC_SOURCES
         utc-Dali-Extents.cpp
         utc-Dali-FrameBuffer.cpp
         utc-Dali-FrameBufferImage.cpp
+        utc-Dali-FrameCallbackInterface.cpp
         utc-Dali-Geometry.cpp
         utc-Dali-Gesture.cpp
         utc-Dali-GestureDetector.cpp
@@ -75,6 +77,7 @@ SET(TC_SOURCES
         utc-Dali-RenderTaskList.cpp
         utc-Dali-ResourceImage.cpp
         utc-Dali-Sampler.cpp
+        utc-Dali-Scene.cpp
         utc-Dali-Scripting.cpp
         utc-Dali-Shader.cpp
         utc-Dali-SignalDelegate.cpp
@@ -108,16 +111,29 @@ LIST(APPEND TC_SOURCES
         dali-test-suite-utils/test-harness.cpp
         dali-test-suite-utils/test-application.cpp
         dali-test-suite-utils/test-gesture-manager.cpp
-        dali-test-suite-utils/test-gl-abstraction.cpp
-        dali-test-suite-utils/test-gl-sync-abstraction.cpp
+        dali-test-suite-utils/test-graphics-buffer.cpp
+        dali-test-suite-utils/test-graphics-buffer-factory.cpp
+        dali-test-suite-utils/test-graphics-controller.cpp
+        dali-test-suite-utils/test-graphics-framebuffer.cpp
+        dali-test-suite-utils/test-graphics-framebuffer-factory.cpp
+        dali-test-suite-utils/test-graphics-pipeline.cpp
+        dali-test-suite-utils/test-graphics-pipeline-factory.cpp
+        dali-test-suite-utils/test-graphics-render-command.cpp
+        dali-test-suite-utils/test-graphics-sampler.cpp
+        dali-test-suite-utils/test-graphics-sampler-factory.cpp
+        dali-test-suite-utils/test-graphics-shader.cpp
+        dali-test-suite-utils/test-graphics-shader-factory.cpp
+        dali-test-suite-utils/test-graphics-texture.cpp
+        dali-test-suite-utils/test-graphics-texture-factory.cpp
         dali-test-suite-utils/test-native-image.cpp
         dali-test-suite-utils/test-platform-abstraction.cpp
         dali-test-suite-utils/test-render-controller.cpp
+        dali-test-suite-utils/test-render-surface.cpp
         dali-test-suite-utils/test-trace-call-stack.cpp
 )
 
 PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
-     dali-core
+     dali-core-vk
 )
 
 ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
diff --git a/automated-tests/src/dali/TestBreakdown.txt b/automated-tests/src/dali/TestBreakdown.txt
new file mode 100644 (file)
index 0000000..e652a32
--- /dev/null
@@ -0,0 +1,20 @@
+UtcDaliActorSetDrawModeOverlayRender            texture ids
+UtcDaliActorPropertyClippingActor               color mask
+UtcDaliActorPropertyClippingActorEnableThenDisable    Trace, : glEnable, glStencil... glDisable, color mask
+UtcDaliActorPropertyClippingNestedChildren            "
+UtcDaliActorPropertyClippingActorDrawOrder            Trace: glEnable, glDisable
+UtcDaliActorPropertyScissorClippingActor              Trace: glEnable, glDisable, Scissor
+UtcDaliActorPropertyScissorClippingActorSiblings      Trace: glEnable, Scissor
+UtcDaliActorPropertyScissorClippingActorNested01      "
+UtcDaliActorPropertyScissorClippingActorNested02      "
+UtcDaliActorPropertyClippingActorWithRendererOverride ", color mask
+UtcDaliActorRaiseToTop                                Trace: SetUniform for a specific uniform & value ><  (Could use texture handles instead)
+UtcDaliActorRaiseAbove                                "
+UtcDaliActorLowerBelow                                "
+UtcDaliBufferImageUpdate01                            Trace: TexImage2D
+UtcDaliBufferImageUpdate02                            "
+UtcDaliCameraActorModelView                           UniformValue   - Can't do this any more
+UtcDaliCameraActorReadProjectionMatrix                UniformValue s - Can't do this any more
+UtcDaliContextVertexAttribStartup                     EnableVertexAttribArray (With index) (Not thru trace)
+UtcDaliContextVertexAttribImageRendering              EnableVertexAttribArray (With index) (Not thru trace)
+UtcDaliFramebufferNew01                               framebuffer attachments
index cf97813..b9c8245 100644 (file)
@@ -26,9 +26,9 @@
 
 using namespace Dali;
 
-int test_return_value = TET_UNDEF;
+int32_t test_return_value = TET_UNDEF;
 
-void tet_result(int value)
+void tet_result(int32_t value)
 {
   // First TET_PASS should set to zero
   // first TET_FAIL should prevent any further TET_PASS from setting back to zero
@@ -81,14 +81,14 @@ void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHand
   DALI_TEST_EQUALS< const BaseHandle& >( baseHandle1, baseHandle2, location );
 }
 
-void DALI_TEST_EQUALS( const size_t value1, const unsigned int value2, const char* location )
+void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* location )
 {
-  DALI_TEST_EQUALS< unsigned int>( ( unsigned int )( value1 ), value2, location );
+  DALI_TEST_EQUALS< uint32_t >( ( uint32_t )( value1 ), value2, location );
 }
 
-void DALI_TEST_EQUALS( const unsigned int value1, const size_t value2, const char* location )
+void DALI_TEST_EQUALS( const uint32_t value1, const size_t value2, const char* location )
 {
-  DALI_TEST_EQUALS< unsigned int >( value1, ( unsigned int )( value2 ), location );
+  DALI_TEST_EQUALS< uint32_t >( value1, ( uint32_t )( value2 ), location );
 }
 
 void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const char* location)
@@ -97,7 +97,7 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const cha
   const float* m2 = matrix2.AsFloat();
   bool equivalent = true;
 
-  for (int i=0;i<9;++i)
+  for (int32_t i=0;i<9;++i)
   {
     if( ! (fabsf(m1[i] - m2[i])< GetRangedEpsilon(m1[i], m2[i])) )
     {
@@ -132,7 +132,7 @@ void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, float eps
   const float* m2 = matrix2.AsFloat();
   bool equivalent = true;
 
-  for (int i=0;i<9;++i)
+  for (int32_t i=0;i<9;++i)
   {
     equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
   }
@@ -164,7 +164,7 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, const char*
   const float* m2 = matrix2.AsFloat();
   bool identical = true;
 
-  int i;
+  int32_t i;
   for (i=0;i<16;++i)
   {
     if(m1[i] != m2[i])
@@ -203,7 +203,7 @@ void DALI_TEST_EQUALS( const Matrix& matrix1, const Matrix& matrix2, float epsil
   const float* m2 = matrix2.AsFloat();
   bool equivalent = true;
 
-  for (int i=0;i<16;++i)
+  for (int32_t i=0;i<16;++i)
   {
     equivalent &= (fabsf(m1[i] - m2[i])<epsilon);
   }
@@ -328,7 +328,7 @@ void ConstraintAppliedCheck::CheckSignalNotReceived()
   }
 }
 
-BufferImage CreateBufferImage(int width, int height, const Vector4& color)
+BufferImage CreateBufferImage(int32_t width, int32_t height, const Vector4& color)
 {
   BufferImage image = BufferImage::New(width, height, Pixel::RGBA8888);
 
@@ -352,15 +352,15 @@ BufferImage CreateBufferImage()
   return CreateBufferImage(4, 4, Color::WHITE);
 }
 
-void PrepareResourceImage( TestApplication& application, unsigned int imageWidth, unsigned int imageHeight, Pixel::Format pixelFormat )
+void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat )
 {
   TestPlatformAbstraction& platform = application.GetPlatform();
   platform.SetClosestImageSize(Vector2( imageWidth, imageHeight));
 
   Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
   Integration::PixelBuffer* pixbuffer = bitmap->GetPackedPixelsProfile()->ReserveBuffer( pixelFormat, imageWidth, imageHeight, imageWidth, imageHeight );
-  unsigned int bytesPerPixel = GetBytesPerPixel(  pixelFormat );
-  unsigned int initialColor = 0xFF;
+  uint32_t bytesPerPixel = GetBytesPerPixel(  pixelFormat );
+  uint32_t initialColor = 0xFF;
   memset( pixbuffer, initialColor, imageHeight*imageWidth*bytesPerPixel);
 
   Integration::ResourcePointer resourcePtr(bitmap);
index 4f71920..11cf038 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TEST_SUITE_UTILS_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -64,9 +64,9 @@ constexpr int32_t basenameIndex( const char * const path, const int32_t index =
 #define TET_FAIL 1
 #define TET_PASS 0
 
-extern int test_return_value;
+extern int32_t test_return_value;
 
-void tet_result(int value);
+void tet_result(int32_t value);
 
 #define END_TEST \
   return ((test_return_value>0)?1:0)
@@ -199,20 +199,20 @@ inline void DALI_TEST_EQUALS<TimePeriod>( TimePeriod value1, TimePeriod value2,
 void DALI_TEST_EQUALS( const BaseHandle& baseHandle1, const BaseHandle& baseHandle2, const char* location );
 
 /**
- * Test whether a size_t value and an unsigned int are equal.
+ * Test whether a size_t value and an uint32_t are equal.
  * @param[in] value1 The first value
  * @param[in] value2 The second value
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const size_t value1, const unsigned int value2, const char* location );
+void DALI_TEST_EQUALS( const size_t value1, const uint32_t value2, const char* location );
 
 /**
- * Test whether an unsigned int and a size_t value and are equal.
+ * Test whether an uint32_t and a size_t value and are equal.
  * @param[in] value1 The first value
  * @param[in] value2 The second value
  * @param[in] location The TEST_LOCATION macro should be used here
  */
-void DALI_TEST_EQUALS( const unsigned int value1, const size_t value2, const char* location );
+void DALI_TEST_EQUALS( const uint32_t value1, const size_t value2, const char* location );
 
 /**
  * Test whether two Matrix3 objects are equal.
@@ -344,6 +344,27 @@ inline void DALI_TEST_PRINT_ASSERT( DaliException& e )
   tet_printf("Assertion %s failed at %s\n", e.condition, e.location );
 }
 
+/**
+ * Test that given piece of code triggers the right assertion
+ * Fails the test if the assert didn't occur.
+ * Turns off logging during the execution of the code to avoid excessive false positive log output from the assertions
+ * @param expressions code to execute
+ * @param assertstring the substring expected in the assert
+ */
+#define DALI_TEST_ASSERTION( expressions, assertstring ) \
+try \
+{ \
+  TestApplication::EnableLogging( false ); \
+  expressions; \
+  TestApplication::EnableLogging( true ); \
+  fprintf(stderr, "Test failed in %s, expected assert: '%s' didn't occur\n", __FILELINE__, assertstring ); \
+  tet_result(TET_FAIL); \
+  throw("TET_FAIL"); } \
+catch( Dali::DaliException& e ) \
+{ \
+  DALI_TEST_ASSERT( e, assertstring, TEST_LOCATION ); \
+}
+
 // Functor to test whether an Applied signal is emitted
 struct ConstraintAppliedCheck
 {
@@ -374,11 +395,11 @@ struct DefaultFunctionCoverage
 
 // Helper to Create buffer image
 BufferImage CreateBufferImage();
-BufferImage CreateBufferImage(int width, int height, const Vector4& color);
+BufferImage CreateBufferImage(int32_t width, int32_t height, const Vector4& color);
 
 
 // Prepare a resource image to be loaded. Should be called before creating the ResourceImage
-void PrepareResourceImage( TestApplication& application, unsigned int imageWidth, unsigned int imageHeight, Pixel::Format pixelFormat );
+void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat );
 
 // Test namespace to prevent pollution of Dali namespace, add Test helper functions here
 namespace Test
index 38eb0b2..0d99524 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
 #include <dali/devel-api/images/texture-set-image.h>
+#include <dali/devel-api/rendering/shader-devel.h>
 
 // INTERNAL INCLUDES
 #include "mesh-builder.h"
@@ -31,47 +32,131 @@ namespace Dali
 namespace
 {
 
-const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
-  attribute mediump vec2 aPosition;\n
-  uniform mediump mat4 uMvpMatrix;\n
-  uniform mediump vec3 uSize;\n
-  \n
-  void main()\n
-  {\n
-    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
-    vertexPosition.xyz *= uSize;\n
-    gl_Position = uMvpMatrix * vertexPosition;\n
-  }\n
-);
-
-const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
-  uniform lowp vec4 uColor;\n
-  \n
-  void main()\n
-  {\n
-    gl_FragColor = uColor;\n
-  }\n
-);
+std::vector<uint32_t> SHADER_BASIC_SHADER_FRAG = {
+  0x07230203,0x00010000,0x00080001,0x00000019,0x00000000,0x00020011,0x00000001,0x0006000b,
+  0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
+  0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000009,0x00000011,0x00000015,
+  0x00030010,0x00000004,0x00000007,0x00030003,0x00000002,0x000001ae,0x00040005,0x00000004,
+  0x6e69616d,0x00000000,0x00050005,0x00000009,0x4374756f,0x726f6c6f,0x00000000,0x00050005,
+  0x0000000d,0x78655473,0x65727574,0x00000000,0x00050005,0x00000011,0x6f437675,0x7364726f,
+  0x00000000,0x00050005,0x00000015,0x43697274,0x726f6c6f,0x00000000,0x00050005,0x00000018,
+  0x78655473,0x65727574,0x00000032,0x00040047,0x00000009,0x0000001e,0x00000000,0x00040047,
+  0x0000000d,0x00000022,0x00000000,0x00040047,0x0000000d,0x00000021,0x00000004,0x00040047,
+  0x00000011,0x0000001e,0x00000001,0x00040047,0x00000015,0x0000001e,0x00000000,0x00040047,
+  0x00000018,0x00000022,0x00000000,0x00040047,0x00000018,0x00000021,0x00000002,0x00020013,
+  0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,
+  0x00000007,0x00000006,0x00000004,0x00040020,0x00000008,0x00000003,0x00000007,0x0004003b,
+  0x00000008,0x00000009,0x00000003,0x00090019,0x0000000a,0x00000006,0x00000001,0x00000000,
+  0x00000000,0x00000000,0x00000001,0x00000000,0x0003001b,0x0000000b,0x0000000a,0x00040020,
+  0x0000000c,0x00000000,0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000000,0x00040017,
+  0x0000000f,0x00000006,0x00000002,0x00040020,0x00000010,0x00000001,0x0000000f,0x0004003b,
+  0x00000010,0x00000011,0x00000001,0x00040020,0x00000014,0x00000001,0x00000007,0x0004003b,
+  0x00000014,0x00000015,0x00000001,0x0004003b,0x0000000c,0x00000018,0x00000000,0x00050036,
+  0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000b,
+  0x0000000e,0x0000000d,0x0004003d,0x0000000f,0x00000012,0x00000011,0x00050057,0x00000007,
+  0x00000013,0x0000000e,0x00000012,0x0004003d,0x00000007,0x00000016,0x00000015,0x00050085,
+  0x00000007,0x00000017,0x00000013,0x00000016,0x0003003e,0x00000009,0x00000017,0x000100fd,
+  0x00010038
+};
+
+std::vector<uint32_t> SHADER_BASIC_SHADER_VERT = {
+  0x07230203,0x00010000,0x00080001,0x0000003b,0x00000000,0x00020011,0x00000001,0x0006000b,
+  0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
+  0x0009000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000000d,0x0000001f,0x00000030,
+  0x00000036,0x00030003,0x00000002,0x000001ae,0x00040005,0x00000004,0x6e69616d,0x00000000,
+  0x00060005,0x0000000b,0x505f6c67,0x65567265,0x78657472,0x00000000,0x00060006,0x0000000b,
+  0x00000000,0x505f6c67,0x7469736f,0x006e6f69,0x00070006,0x0000000b,0x00000001,0x505f6c67,
+  0x746e696f,0x657a6953,0x00000000,0x00070006,0x0000000b,0x00000002,0x435f6c67,0x4470696c,
+  0x61747369,0x0065636e,0x00030005,0x0000000d,0x00000000,0x00050005,0x00000011,0x70696c63,
+  0x66696e55,0x006d726f,0x00050006,0x00000011,0x00000000,0x70696c63,0x00000000,0x00030005,
+  0x00000013,0x00000000,0x00040005,0x00000018,0x6c726f77,0x00000064,0x00040006,0x00000018,
+  0x00000000,0x0070766d,0x00050006,0x00000018,0x00000001,0x6f6c6f63,0x00000072,0x00050006,
+  0x00000018,0x00000002,0x657a6973,0x00000000,0x00030005,0x0000001a,0x00000000,0x00050005,
+  0x0000001f,0x736f5061,0x6f697469,0x0000006e,0x00050005,0x00000030,0x6f437675,0x7364726f,
+  0x00000000,0x00050005,0x00000036,0x43697274,0x726f6c6f,0x00000000,0x00050048,0x0000000b,
+  0x00000000,0x0000000b,0x00000000,0x00050048,0x0000000b,0x00000001,0x0000000b,0x00000001,
+  0x00050048,0x0000000b,0x00000002,0x0000000b,0x00000003,0x00030047,0x0000000b,0x00000002,
+  0x00040048,0x00000011,0x00000000,0x00000005,0x00050048,0x00000011,0x00000000,0x00000023,
+  0x00000000,0x00050048,0x00000011,0x00000000,0x00000007,0x00000010,0x00030047,0x00000011,
+  0x00000002,0x00040047,0x00000013,0x00000022,0x00000000,0x00040047,0x00000013,0x00000021,
+  0x00000001,0x00040048,0x00000018,0x00000000,0x00000005,0x00050048,0x00000018,0x00000000,
+  0x00000023,0x00000000,0x00050048,0x00000018,0x00000000,0x00000007,0x00000010,0x00050048,
+  0x00000018,0x00000001,0x00000023,0x00000040,0x00050048,0x00000018,0x00000002,0x00000023,
+  0x00000050,0x00030047,0x00000018,0x00000002,0x00040047,0x0000001a,0x00000022,0x00000000,
+  0x00040047,0x0000001a,0x00000021,0x00000000,0x00040047,0x0000001f,0x0000001e,0x00000000,
+  0x00040047,0x00000030,0x0000001e,0x00000001,0x00040047,0x00000036,0x0000001e,0x00000000,
+  0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,
+  0x00040017,0x00000007,0x00000006,0x00000004,0x00040015,0x00000008,0x00000020,0x00000000,
+  0x0004002b,0x00000008,0x00000009,0x00000001,0x0004001c,0x0000000a,0x00000006,0x00000009,
+  0x0005001e,0x0000000b,0x00000007,0x00000006,0x0000000a,0x00040020,0x0000000c,0x00000003,
+  0x0000000b,0x0004003b,0x0000000c,0x0000000d,0x00000003,0x00040015,0x0000000e,0x00000020,
+  0x00000001,0x0004002b,0x0000000e,0x0000000f,0x00000000,0x00040018,0x00000010,0x00000007,
+  0x00000004,0x0003001e,0x00000011,0x00000010,0x00040020,0x00000012,0x00000002,0x00000011,
+  0x0004003b,0x00000012,0x00000013,0x00000002,0x00040020,0x00000014,0x00000002,0x00000010,
+  0x00040017,0x00000017,0x00000006,0x00000003,0x0005001e,0x00000018,0x00000010,0x00000007,
+  0x00000017,0x00040020,0x00000019,0x00000002,0x00000018,0x0004003b,0x00000019,0x0000001a,
+  0x00000002,0x00040020,0x0000001e,0x00000001,0x00000017,0x0004003b,0x0000001e,0x0000001f,
+  0x00000001,0x0004002b,0x0000000e,0x00000021,0x00000002,0x00040020,0x00000022,0x00000002,
+  0x00000017,0x0004002b,0x00000006,0x00000026,0x3f800000,0x00040020,0x0000002c,0x00000003,
+  0x00000007,0x00040017,0x0000002e,0x00000006,0x00000002,0x00040020,0x0000002f,0x00000003,
+  0x0000002e,0x0004003b,0x0000002f,0x00000030,0x00000003,0x0004002b,0x00000006,0x00000033,
+  0x3f000000,0x0005002c,0x0000002e,0x00000034,0x00000033,0x00000033,0x0004003b,0x0000002c,
+  0x00000036,0x00000003,0x0004002b,0x0000000e,0x00000037,0x00000001,0x00040020,0x00000038,
+  0x00000002,0x00000007,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,
+  0x00000005,0x00050041,0x00000014,0x00000015,0x00000013,0x0000000f,0x0004003d,0x00000010,
+  0x00000016,0x00000015,0x00050041,0x00000014,0x0000001b,0x0000001a,0x0000000f,0x0004003d,
+  0x00000010,0x0000001c,0x0000001b,0x00050092,0x00000010,0x0000001d,0x00000016,0x0000001c,
+  0x0004003d,0x00000017,0x00000020,0x0000001f,0x00050041,0x00000022,0x00000023,0x0000001a,
+  0x00000021,0x0004003d,0x00000017,0x00000024,0x00000023,0x00050085,0x00000017,0x00000025,
+  0x00000020,0x00000024,0x00050051,0x00000006,0x00000027,0x00000025,0x00000000,0x00050051,
+  0x00000006,0x00000028,0x00000025,0x00000001,0x00050051,0x00000006,0x00000029,0x00000025,
+  0x00000002,0x00070050,0x00000007,0x0000002a,0x00000027,0x00000028,0x00000029,0x00000026,
+  0x00050091,0x00000007,0x0000002b,0x0000001d,0x0000002a,0x00050041,0x0000002c,0x0000002d,
+  0x0000000d,0x0000000f,0x0003003e,0x0000002d,0x0000002b,0x0004003d,0x00000017,0x00000031,
+  0x0000001f,0x0007004f,0x0000002e,0x00000032,0x00000031,0x00000031,0x00000000,0x00000001,
+  0x00050081,0x0000002e,0x00000035,0x00000032,0x00000034,0x0003003e,0x00000030,0x00000035,
+  0x00050041,0x00000038,0x00000039,0x0000001a,0x00000037,0x0004003d,0x00000007,0x0000003a,
+  0x00000039,0x0003003e,0x00000036,0x0000003a,0x000100fd,0x00010038
+};
 
 } // unnamed namespace
 
 Actor CreateRenderableActor()
 {
-  return CreateRenderableActor( Image(), VERTEX_SHADER, FRAGMENT_SHADER );
+  return CreateRenderableActor( Image(), SHADER_BASIC_SHADER_VERT, SHADER_BASIC_SHADER_FRAG );
 }
 
 Actor CreateRenderableActor( Image texture )
 {
-  return CreateRenderableActor( texture, VERTEX_SHADER, FRAGMENT_SHADER );
+  return CreateRenderableActor( texture, SHADER_BASIC_SHADER_VERT, SHADER_BASIC_SHADER_FRAG );
 }
 
-Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader )
+Actor CreateRenderableActor( TextureSet textures )
+{
+  return CreateRenderableActor( textures, SHADER_BASIC_SHADER_VERT, SHADER_BASIC_SHADER_FRAG );
+}
+
+Actor CreateRenderableActor( Image texture, std::vector<uint32_t>& vertexShader, std::vector<uint32_t>& fragmentShader )
+{
+  // If we a texture, then create a texture-set and add to renderer
+  TextureSet textureSet = TextureSet::New();
+  if( texture )
+  {
+    TextureSetImage( textureSet, 0u, texture );
+  }
+
+  return CreateRenderableActor( textureSet, vertexShader, fragmentShader );
+}
+
+Actor CreateRenderableActor( TextureSet textures, std::vector<uint32_t>& vertexShader, std::vector<uint32_t>& fragmentShader )
 {
   // Create the geometry
   Geometry geometry = CreateQuadGeometry();
 
   // Create Shader
-  Shader shader = Shader::New( vertexShader, fragmentShader );
+  Shader shader = DevelShader::New<uint32_t>( vertexShader, fragmentShader,
+                                              DevelShader::ShaderLanguage::SPIRV_1_0,
+                                              Property::Map(), Shader::Hint::NONE );
 
   // Create renderer from geometry and material
   Renderer renderer = Renderer::New( geometry, shader );
@@ -80,18 +165,22 @@ Actor CreateRenderableActor( Image texture, const std::string& vertexShader, con
   Actor actor = Actor::New();
   actor.AddRenderer( renderer );
 
-  // If we a texture, then create a texture-set and add to renderer
-  if( texture )
-  {
-    TextureSet textureSet = TextureSet::New();
-    TextureSetImage( textureSet, 0u, texture );
-    renderer.SetTextures( textureSet );
+  renderer.SetTextures( textures );
 
-    // Set actor to the size of the texture if set
+  // Set actor to the size of the texture if set
+  if( textures && textures.GetTextureCount() > 0 )
+  {
+    auto texture = textures.GetTexture( 0 );
     actor.SetSize( texture.GetWidth(), texture.GetHeight() );
   }
+  else
+  {
+    actor.SetSize( 25, 25 );
+  }
 
   return actor;
 }
 
+
+
 } // namespace Dali
index a62dcca..2f31fae 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_ACTOR_UTILS_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,9 @@
  */
 
 // EXTERNAL INCLUDES
-#include <string>
+
+#include <vector>
+#include <dali/public-api/rendering/texture-set.h>
 
 namespace Dali
 {
@@ -39,6 +41,7 @@ Actor CreateRenderableActor();
  * @return An actor with a renderer.
  */
 Actor CreateRenderableActor( Image texture );
+Actor CreateRenderableActor( TextureSet texture );
 
 /**
  * @brief Creates a renderable-actor with a texture and custom shaders.
@@ -47,7 +50,9 @@ Actor CreateRenderableActor( Image texture );
  * @param[in] fragmentShader The fragment-shader.
  * @return An actor with a renderer.
  */
-Actor CreateRenderableActor( Image texture, const std::string& vertexShader, const std::string& fragmentShader );
+Actor CreateRenderableActor( Image texture, std::vector<uint32_t>& vertexShader, std::vector<uint32_t>& fragmentShader );
+
+Actor CreateRenderableActor( TextureSet textures, std::vector<uint32_t>& vertexShader, std::vector<uint32_t>& fragmentShader );
 
 } // namespace Dali
 
index 971592e..47b48eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,40 +21,24 @@ namespace Dali
 {
 
 
-TestApplication::TestApplication( size_t surfaceWidth,
-                                  size_t surfaceHeight,
-                                  float  horizontalDpi,
-                                  float  verticalDpi,
-                                  ResourcePolicy::DataRetention policy)
-: mCore( NULL ),
-  mSurfaceWidth( surfaceWidth ),
-  mSurfaceHeight( surfaceHeight ),
-  mFrame( 0u ),
-  mDpi( horizontalDpi, verticalDpi ),
-  mLastVSyncTime(0u),
-  mDataRetentionPolicy( policy )
-{
-  Initialize();
-}
+bool TestApplication::mLoggingEnabled = true;
 
-TestApplication::TestApplication( bool   initialize,
-                                  size_t surfaceWidth,
-                                  size_t surfaceHeight,
-                                  float  horizontalDpi,
-                                  float  verticalDpi,
+TestApplication::TestApplication( uint32_t surfaceWidth,
+                                  uint32_t surfaceHeight,
+                                  uint32_t  horizontalDpi,
+                                  uint32_t  verticalDpi,
                                   ResourcePolicy::DataRetention policy)
 : mCore( NULL ),
   mSurfaceWidth( surfaceWidth ),
   mSurfaceHeight( surfaceHeight ),
   mFrame( 0u ),
-  mDpi( horizontalDpi, verticalDpi ),
+  mDpi{ horizontalDpi, verticalDpi },
   mLastVSyncTime(0u),
   mDataRetentionPolicy( policy )
 {
-  if ( initialize )
-  {
-    Initialize();
-  }
+  mGraphicsController = std::unique_ptr<Test::GraphicsController>( new Test::GraphicsController() );
+
+  Initialize();
 }
 
 void TestApplication::Initialize()
@@ -64,25 +48,26 @@ void TestApplication::Initialize()
 
   mCore = Dali::Integration::Core::New( mRenderController,
                                         mPlatformAbstraction,
-                                        mGraphics,
+                                        *mGraphicsController,
                                         mGestureManager,
                                         mDataRetentionPolicy,
                                         Integration::RenderToFrameBuffer::FALSE,
-                                        Integration::DepthBufferAvailable::TRUE,
-                                        Integration::StencilBufferAvailable::TRUE );
-
-  mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
-  mCore->SetDpi( mDpi.x, mDpi.y );
+                                        Integration::DepthBufferAvailable::FALSE,
+                                        Integration::StencilBufferAvailable::FALSE );
 
   Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
   Dali::Integration::Log::InstallLogFunction(logFunction);
 
-  Dali::Integration::Trace::LogContextFunction logContextFunction(&TestApplication::LogContext);
-  Dali::Integration::Trace::InstallLogContextFunction( logContextFunction );
+  mRenderSurface = new TestRenderSurface( Dali::PositionSize( 0, 0, mSurfaceWidth, mSurfaceHeight ) );
+  mScene = Dali::Integration::Scene::New( Vector2( static_cast<float>( mSurfaceWidth ), static_cast<float>( mSurfaceHeight ) ) );
+  mScene.SetSurface( *mRenderSurface );
+
+  mScene.SetDpi( Vector2( static_cast<float>( mDpi.x ), static_cast<float>( mDpi.y ) ) );
 
-  Dali::Integration::Trace::LogContext( true, "Test" );
+  mCore->SurfaceResized( mRenderSurface );
 
   mCore->SceneCreated();
+  mCore->Initialize();
 }
 
 TestApplication::~TestApplication()
@@ -95,30 +80,33 @@ void TestApplication::LogContext( bool start, const char* tag )
 {
   if( start )
   {
-    fprintf(stderr, "INFO: Trace Start: %s", tag);
+    fprintf(stderr, "INFO: Trace Start: %s\n", tag);
   }
   else
   {
-    fprintf(stderr, "INFO: Trace End: %s", tag);
+    fprintf(stderr, "INFO: Trace End: %s\n", tag);
   }
 }
 
 void TestApplication::LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
 {
-  switch(level)
+  if( mLoggingEnabled )
   {
-    case Dali::Integration::Log::DebugInfo:
-      fprintf(stderr, "INFO: %s", message.c_str());
-      break;
-    case Dali::Integration::Log::DebugWarning:
-      fprintf(stderr, "WARN: %s", message.c_str());
-      break;
-    case Dali::Integration::Log::DebugError:
-      fprintf(stderr, "ERROR: %s", message.c_str());
-      break;
-    default:
-      fprintf(stderr, "DEFAULT: %s", message.c_str());
-      break;
+    switch(level)
+    {
+      case Dali::Integration::Log::DebugInfo:
+        fprintf(stderr, "INFO: %s", message.c_str());
+        break;
+      case Dali::Integration::Log::DebugWarning:
+        fprintf(stderr, "WARN: %s", message.c_str());
+        break;
+      case Dali::Integration::Log::DebugError:
+        fprintf(stderr, "ERROR: %s", message.c_str());
+        break;
+      default:
+        fprintf(stderr, "DEFAULT: %s", message.c_str());
+        break;
+    }
   }
 }
 
@@ -132,6 +120,11 @@ TestPlatformAbstraction& TestApplication::GetPlatform()
   return mPlatformAbstraction;
 }
 
+Test::GraphicsController& TestApplication::GetGraphicsController()
+{
+  return *mGraphicsController.get();
+}
+
 TestRenderController& TestApplication::GetRenderController()
 {
   return mRenderController;
@@ -153,20 +146,7 @@ void TestApplication::SendNotification()
   mCore->ProcessEvents();
 }
 
-void TestApplication::SetSurfaceWidth( unsigned int width, unsigned height )
-{
-  mSurfaceWidth = width;
-  mSurfaceHeight = height;
-
-  mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
-}
-
-void TestApplication::SetTopMargin( unsigned int margin )
-{
-  mCore->SetTopMargin( margin );
-}
-
-void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* location )
+void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* location )
 {
   if( GetUpdateStatus() == 0 &&
       mRenderStatus.NeedsUpdate() == false &&
@@ -175,8 +155,8 @@ void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* l
     fprintf(stderr, "WARNING - Update not required :%s\n", location==NULL?"NULL":location);
   }
 
-  unsigned int nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
-  float elapsedSeconds = intervalMilliseconds / 1e3f;
+  uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds;
+  float elapsedSeconds = static_cast<float>( intervalMilliseconds ) * 0.001f;
 
   mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false );
 
@@ -185,22 +165,21 @@ void TestApplication::DoUpdate( unsigned int intervalMilliseconds, const char* l
   mLastVSyncTime = nextVSyncTime;
 }
 
-bool TestApplication::Render( unsigned int intervalMilliseconds, const char* location )
+bool TestApplication::Render( uint32_t intervalMilliseconds, const char* location )
 {
   DoUpdate( intervalMilliseconds, location );
-  mCore->Render( mRenderStatus, false );
 
   mFrame++;
 
   return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
 }
 
-unsigned int TestApplication::GetUpdateStatus()
+uint32_t TestApplication::GetUpdateStatus()
 {
   return mStatus.KeepUpdating();
 }
 
-bool TestApplication::UpdateOnly( unsigned int intervalMilliseconds  )
+bool TestApplication::UpdateOnly( uint32_t intervalMilliseconds  )
 {
   DoUpdate( intervalMilliseconds );
   return mStatus.KeepUpdating();
@@ -221,11 +200,11 @@ bool TestApplication::RenderOnly( )
   return mRenderStatus.NeedsUpdate();
 }
 
-unsigned int TestApplication::Wait( unsigned int durationToWait )
+uint32_t TestApplication::Wait( uint32_t durationToWait )
 {
   int time = 0;
 
-  for(unsigned int i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++)
+  for(uint32_t i = 0; i <= ( durationToWait / RENDER_FRAME_INTERVAL); i++)
   {
     SendNotification();
     Render(RENDER_FRAME_INTERVAL);
index e289855..ea0c008 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TEST_APPLICATION_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <test-platform-abstraction.h>
 #include "test-gesture-manager.h"
 #include "test-render-controller.h"
+#include "test-graphics-controller.h"
+#include "test-render-surface.h"
+#include <dali/integration-api/scene.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/signals/connection-tracker.h>
 #include <dali/integration-api/core.h>
-#include <dali/integration-api/graphics/graphics.h>
 #include <dali/integration-api/resource-policies.h>
 #include <dali/integration-api/trace.h>
 
@@ -37,32 +39,25 @@ class DALI_CORE_API TestApplication : public ConnectionTracker
 public:
 
   // Default values derived from H2 device.
-  static const unsigned int DEFAULT_SURFACE_WIDTH = 480;
-  static const unsigned int DEFAULT_SURFACE_HEIGHT = 800;
+  static const uint32_t DEFAULT_SURFACE_WIDTH = 480;
+  static const uint32_t DEFAULT_SURFACE_HEIGHT = 800;
 
 #ifdef _CPP11
-  static constexpr float DEFAULT_HORIZONTAL_DPI = 220.0f;
-  static constexpr float DEFAULT_VERTICAL_DPI   = 217.0f;
+  static constexpr uint32_t DEFAULT_HORIZONTAL_DPI = 220;
+  static constexpr uint32_t DEFAULT_VERTICAL_DPI   = 217;
 #else
-  static const float DEFAULT_HORIZONTAL_DPI = 220.0f;
-  static const float DEFAULT_VERTICAL_DPI   = 217.0f;
+  static const uint32_t DEFAULT_HORIZONTAL_DPI = 220;
+  static const uint32_t DEFAULT_VERTICAL_DPI   = 217;
 #endif
 
-  static const unsigned int DEFAULT_RENDER_INTERVAL = 1;
+  static const uint32_t DEFAULT_RENDER_INTERVAL = 1;
 
-  static const unsigned int RENDER_FRAME_INTERVAL = 16;
+  static const uint32_t RENDER_FRAME_INTERVAL = 16;
 
-  TestApplication( size_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
-                   size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
-                   float  horizontalDpi = DEFAULT_HORIZONTAL_DPI,
-                   float  verticalDpi   = DEFAULT_VERTICAL_DPI,
-                   ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA);
-
-  TestApplication( bool   initialize,
-                   size_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
-                   size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
-                   float  horizontalDpi = DEFAULT_HORIZONTAL_DPI,
-                   float  verticalDpi   = DEFAULT_VERTICAL_DPI,
+  TestApplication( uint32_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
+                   uint32_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
+                   uint32_t horizontalDpi = DEFAULT_HORIZONTAL_DPI,
+                   uint32_t verticalDpi   = DEFAULT_VERTICAL_DPI,
                    ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA);
 
   void Initialize();
@@ -71,41 +66,50 @@ public:
   static void LogContext( bool start, const char* tag );
   Dali::Integration::Core& GetCore();
   TestPlatformAbstraction& GetPlatform();
+  Test::GraphicsController& GetGraphicsController();
   TestRenderController& GetRenderController();
   TestGestureManager& GetGestureManager();
   void ProcessEvent(const Integration::Event& event);
   void SendNotification();
-  void SetSurfaceWidth( unsigned int width, unsigned height );
-  void SetTopMargin( unsigned int margin );
-  bool Render( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
-  unsigned int GetUpdateStatus();
-  bool UpdateOnly( unsigned int intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
+  bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
+  uint32_t GetUpdateStatus();
+  bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
   bool RenderOnly( );
   void ResetContext();
   bool GetRenderNeedsUpdate();
-  unsigned int Wait( unsigned int durationToWait );
-
+  uint32_t Wait( uint32_t durationToWait );
+  static void EnableLogging( bool enabled )
+  {
+    mLoggingEnabled = enabled;
+  }
+
+  Integration::Scene GetScene() const
+  {
+    return mScene;
+  }
 private:
-  void DoUpdate( unsigned int intervalMilliseconds, const char* location=NULL );
+  void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL );
 
 protected:
   TestPlatformAbstraction             mPlatformAbstraction;
-  Integration::Graphics::Graphics     mGraphics;
+  std::unique_ptr<Test::GraphicsController> mGraphicsController;
   TestRenderController                mRenderController;
   TestGestureManager                  mGestureManager;
+  TestRenderSurface*        mRenderSurface;
 
   Integration::UpdateStatus mStatus;
   Integration::RenderStatus mRenderStatus;
 
   Integration::Core* mCore;
+  Dali::Integration::Scene mScene;
+  uint32_t mSurfaceWidth;
+  uint32_t mSurfaceHeight;
+  uint32_t mFrame;
 
-  unsigned int mSurfaceWidth;
-  unsigned int mSurfaceHeight;
-  unsigned int mFrame;
-
-  Vector2 mDpi;
-  unsigned int mLastVSyncTime;
+  struct { uint32_t x; uint32_t y; } mDpi;
+  uint32_t mLastVSyncTime;
   ResourcePolicy::DataRetention mDataRetentionPolicy;
+  static bool mLoggingEnabled;
 };
 
 } // Dali
index 758579e..d300568 100644 (file)
@@ -200,7 +200,7 @@ bool TestCustomActor::TestRelayoutDependentOnChildrenBase( Dimension::Type dimen
   return GetImpl().TestRelayoutDependentOnChildrenBase( dimension );
 }
 
-unsigned int TestCustomActor::GetDepth()
+uint32_t TestCustomActor::GetDepth()
 {
   return GetImpl().mDepth;
 }
index 8af0693..e10b28b 100644 (file)
@@ -67,7 +67,7 @@ public:
   float TestGetWidthForHeightBase( float height );
   float TestCalculateChildSizeBase( const Dali::Actor& child, Dali::Dimension::Type dimension );
   bool TestRelayoutDependentOnChildrenBase( Dali::Dimension::Type dimension );
-  unsigned int GetDepth();
+  uint32_t GetDepth();
 
 private:
   TestCustomActor( Impl::TestCustomActor& impl );
@@ -148,7 +148,7 @@ public:
   Dali::Vector3         mSizeSet;
   Dali::Vector3         mTargetSize;
   bool                  mNego;
-  unsigned int          mDepth;
+  uint32_t          mDepth;
 
   float         prop1;
   Dali::Vector4 prop2;
@@ -218,7 +218,7 @@ struct TestCustomActorVariant2 : public TestCustomActor
     TestCustomActor::OnStageConnection( depth );
 
     // Remove all the children
-    for( unsigned int i=0, num=Self().GetChildCount(); i<num; ++i )
+    for( uint32_t i=0, num=Self().GetChildCount(); i<num; ++i )
     {
       Self().Remove( Self().GetChildAt(0) );
     }
@@ -270,7 +270,7 @@ struct TestCustomActorVariant4 : public TestCustomActor
     TestCustomActor::OnStageDisconnection();
 
     // Remove all the children
-    for( unsigned int i=0, num=Self().GetChildCount(); i<num; ++i )
+    for( uint32_t i=0, num=Self().GetChildCount(); i<num; ++i )
     {
       Self().Remove( Self().GetChildAt(0) );
     }
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer-factory.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer-factory.cpp
new file mode 100644 (file)
index 0000000..58e81c0
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "test-graphics-buffer-factory.h"
+#include "test-graphics-buffer.h"
+
+namespace Test
+{
+
+GraphicsBufferFactory::GraphicsBufferFactory(GraphicsController* controller)
+: mController(*controller)
+{
+}
+
+GraphicsBufferFactory::~GraphicsBufferFactory()=default;
+
+
+Dali::Graphics::BufferFactory& GraphicsBufferFactory::SetUsageFlags( Dali::Graphics::BufferUsageFlags usage )
+{
+  mUsageFlags = usage;
+  return *this;
+}
+
+Dali::Graphics::BufferFactory& GraphicsBufferFactory::SetSize( uint32_t size )
+{
+  mSize = size;
+  return *this;
+}
+
+Dali::Graphics::BufferFactory::PointerType GraphicsBufferFactory::Create() const
+{
+  auto buffer = std::make_unique< GraphicsBuffer >( mController, mUsageFlags, mSize );
+  return buffer;
+}
+
+} // Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer-factory.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer-factory.h
new file mode 100644 (file)
index 0000000..8de0a4f
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef TEST_GRAPHICS_BUFFER_FACTORY_H
+#define TEST_GRAPHICS_BUFFER_FACTORY_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/graphics-api/graphics-api-buffer-factory.h>
+
+namespace Test
+{
+class GraphicsController;
+
+class GraphicsBufferFactory : public Dali::Graphics::BufferFactory
+{
+public:
+  GraphicsBufferFactory(GraphicsController* controller);
+  ~GraphicsBufferFactory();
+
+  Dali::Graphics::BufferFactory& SetUsageFlags( Dali::Graphics::BufferUsageFlags usage )  override;
+  Dali::Graphics::BufferFactory& SetSize( uint32_t size ) override;
+  Dali::Graphics::BufferFactory::PointerType Create() const override;
+
+public:
+  GraphicsController& mController;
+  Dali::Graphics::BufferUsageFlags mUsageFlags;
+  uint32_t mSize;
+};
+
+} // Test
+
+#endif //TEST_GRAPHICS_BUFFER_FACTORY_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.cpp
new file mode 100644 (file)
index 0000000..bf7c513
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "test-graphics-buffer.h"
+#include "dali-test-suite-utils.h"
+#include <cstring>
+
+namespace Test
+{
+
+GraphicsBuffer::GraphicsBuffer( GraphicsController& controller, Dali::Graphics::BufferUsageFlags usage, uint32_t size )
+: mController( controller )
+{
+  if( size > 0 )
+  {
+    mBuffer.resize(size);
+  }
+}
+
+GraphicsBuffer::~GraphicsBuffer()
+{
+}
+
+void* GraphicsBuffer::Map()
+{
+  mController.mBufferTrace.PushCall("Map");
+  return &mBuffer[0];
+}
+
+void GraphicsBuffer::Unmap()
+{
+  mController.mBufferTrace.PushCall("Unmap");
+}
+
+void GraphicsBuffer::Write( void* src, uint32_t srcSize, uint32_t dstOffset )
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["src"] = Dali::Any( src );
+  namedParams["srcSize"] = Dali::Any( srcSize );
+  namedParams["dstOffset"] = Dali::Any( dstOffset );
+  mController.mShaderTrace.PushCall("Write", namedParams);
+
+  if( dstOffset + srcSize > mBuffer.size() )
+  {
+    // Only write up to maximum of current buffer size. Notify user
+    srcSize = uint32_t(mBuffer.size()) - dstOffset;
+    fprintf(stderr, "Attempting to write past end of buffer.");
+  }
+
+  memcpy( &mBuffer[dstOffset], src, srcSize);
+}
+
+void GraphicsBuffer::Flush()
+{
+  mController.mBufferTrace.PushCall("Flush");
+}
+
+void GraphicsBuffer::DestroyNow()
+{
+  mController.mBufferTrace.PushCall("DestroyNow");
+}
+
+} // Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-buffer.h
new file mode 100644 (file)
index 0000000..f57cbbb
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef TEST_GRAPHICS_BUFFER_H
+#define TEST_GRAPHICS_BUFFER_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/graphics-api/graphics-api-buffer.h>
+#include <dali/graphics-api/graphics-api-types.h>
+#include <vector>
+
+namespace Test
+{
+class GraphicsController;
+
+class GraphicsBuffer : public Dali::Graphics::Buffer
+{
+public:
+  GraphicsBuffer( GraphicsController& controller, Dali::Graphics::BufferUsageFlags usage, uint32_t size );
+  ~GraphicsBuffer();
+
+  void* Map() override;
+
+  void Unmap() override;
+
+  void Write( void* src, uint32_t srcSize, uint32_t dstOffset ) override;
+
+  void Flush() override;
+
+  void DestroyNow() override;
+
+public:
+  GraphicsController& mController;
+  std::vector<uint8_t> mBuffer;
+};
+
+} // Test
+
+#endif //TEST_GRAPHICS_BUFFER_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.cpp
new file mode 100644 (file)
index 0000000..06b5925
--- /dev/null
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "test-graphics-controller.h"
+#include "test-graphics-render-command.h"
+#include <algorithm>
+
+namespace Test
+{
+
+GraphicsController::GraphicsController()
+: mTextureFactory(this),
+  mShaderFactory(this),
+  mFramebufferFactory(this),
+  mBufferFactory(this),
+  mPipelineFactory(this),
+  mSamplerFactory(this)
+{
+}
+
+GraphicsController::~GraphicsController() = default;
+
+
+std::unique_ptr< Dali::Graphics::Shader > GraphicsController::CreateShader( const Dali::Graphics::BaseFactory< Dali::Graphics::Shader >& factory )
+{
+  mControllerTrace.PushCall("CreateShader");
+  std::unique_ptr< Dali::Graphics::Shader > shader = std::move(factory.Create());
+  //mShaders.push_back(shader.get());
+  return shader;
+}
+
+std::unique_ptr< Dali::Graphics::Texture > GraphicsController::CreateTexture( const Dali::Graphics::BaseFactory< Dali::Graphics::Texture >& factory )
+{
+  mControllerTrace.PushCall("CreateTexture");
+  std::unique_ptr< Dali::Graphics::Texture > texture = std::move(factory.Create());
+  mTextures.push_back(texture.get()); // Idea is to allow test cases to use index in this array instead of GL ID's
+  return texture;
+}
+
+std::unique_ptr< Dali::Graphics::Buffer > GraphicsController::CreateBuffer( const Dali::Graphics::BaseFactory< Dali::Graphics::Buffer >& factory )
+{
+  mControllerTrace.PushCall("CreateBuffer");
+  std::unique_ptr< Dali::Graphics::Buffer > buffer = std::move(factory.Create());
+  //mBuffers.push_back(buffer.get());
+  return buffer;
+}
+
+std::unique_ptr< Dali::Graphics::Sampler > GraphicsController::CreateSampler( const Dali::Graphics::BaseFactory< Dali::Graphics::Sampler >& factory )
+{
+  mControllerTrace.PushCall("CreateSampler");
+  std::unique_ptr< Dali::Graphics::Sampler > sampler = std::move(factory.Create());
+  //mSamplers.push_back(sampler.get());
+  return sampler;
+}
+
+std::unique_ptr< Dali::Graphics::Pipeline > GraphicsController::CreatePipeline( const Dali::Graphics::PipelineFactory& factory )
+{
+  mControllerTrace.PushCall("CreatePipeline");
+  auto& pipelineFactory = const_cast<Dali::Graphics::PipelineFactory&>(dynamic_cast<const Dali::Graphics::PipelineFactory&>( factory ));
+
+  std::unique_ptr< Dali::Graphics::Pipeline > pipeline = std::move(pipelineFactory.Create());
+  return pipeline;
+}
+
+std::unique_ptr< Dali::Graphics::Framebuffer > GraphicsController::CreateFramebuffer( const Dali::Graphics::BaseFactory< Dali::Graphics::Framebuffer >& factory )
+{
+  mControllerTrace.PushCall("CreateFramebuffer");
+  std::unique_ptr< Dali::Graphics::Framebuffer > framebuffer = std::move(factory.Create());
+  //mFramebuffers.push_back(framebuffer.get());
+  return framebuffer;
+}
+
+Dali::Graphics::TextureFactory& GraphicsController::GetTextureFactory() const
+{
+  const_cast<Test::TraceCallStack&>(mControllerTrace).PushCall("GetTextureFactory");
+  return *(const_cast<GraphicsTextureFactory*>(&mTextureFactory));
+}
+
+Dali::Graphics::ShaderFactory& GraphicsController::GetShaderFactory() const
+{
+  const_cast<Test::TraceCallStack&>(mControllerTrace).PushCall("GetShaderFactory");
+  return *(const_cast<GraphicsShaderFactory*>(&mShaderFactory));
+}
+
+Dali::Graphics::BufferFactory& GraphicsController::GetBufferFactory() const
+{
+  const_cast<Test::TraceCallStack&>(mControllerTrace).PushCall("GetBufferFactory");
+  return *(const_cast<GraphicsBufferFactory*>(&mBufferFactory));
+}
+
+Dali::Graphics::FramebufferFactory& GraphicsController::GetFramebufferFactory() const
+{
+  const_cast<Test::TraceCallStack&>(mControllerTrace).PushCall("GetFramebufferFactory");
+  return *(const_cast<GraphicsFramebufferFactory*>(&mFramebufferFactory));
+}
+
+Dali::Graphics::PipelineFactory& GraphicsController::GetPipelineFactory()
+{
+  mControllerTrace.PushCall("GetPipelineFactory");
+  return *(const_cast<GraphicsPipelineFactory*>(&mPipelineFactory));
+}
+
+Dali::Graphics::SamplerFactory& GraphicsController::GetSamplerFactory()
+{
+  mControllerTrace.PushCall("GetSamplerFactory");
+  return *(const_cast<GraphicsSamplerFactory*>(&mSamplerFactory));
+}
+
+std::unique_ptr< Dali::Graphics::RenderCommand > GraphicsController::AllocateRenderCommand()
+{
+  mControllerTrace.PushCall("AllocateRenderCommand");
+  return std::make_unique< GraphicsRenderCommand >();
+}
+
+void GraphicsController::SubmitCommands( std::vector< Dali::Graphics::RenderCommand* > commands )
+{
+  TraceCallStack::NamedParams namedParams;
+  int i=0;
+  for( auto cmd : commands )
+  {
+    std::ostringstream o;
+    o<<"commands["<<i++<<"].mDrawCommand.drawType";
+    namedParams[o.str()] = Dali::Any(int(cmd->mDrawCommand.drawType));
+  }
+  mControllerTrace.PushCall("SubmitCommands", namedParams);
+
+  // Copy the render commands to prevent any lifecycle problems interfering with the test.
+  mRenderCommands.clear();
+  mRenderCommands.reserve (commands.size());
+  for( auto cmd : commands )
+  {
+    auto testCmd = static_cast<Test::GraphicsRenderCommand*>(cmd);
+    mRenderCommands.emplace_back(*testCmd);
+  }
+}
+
+void GraphicsController::BeginFrame()
+{
+  mControllerTrace.PushCall("BeginFrame");
+}
+
+void GraphicsController::EndFrame()
+{
+  mControllerTrace.PushCall("EndFrame");
+}
+
+void GraphicsController::Pause()
+{
+  mControllerTrace.PushCall("Pause");
+}
+
+void GraphicsController::Resume()
+{
+  mControllerTrace.PushCall("Resume");
+}
+
+bool GraphicsController::EnableDepthStencilBuffer( bool enableDepth, bool enableStencil )
+{
+  TraceCallStack::NamedParams namedParams;
+  namedParams["enableDepth"] = Dali::Any(enableDepth);
+  namedParams["enableStencil"] = Dali::Any(enableStencil);
+  mControllerTrace.PushCall("EnableDepthStencilBuffer", namedParams);
+  return true;
+}
+
+void GraphicsController::RunGarbageCollector( size_t numberOfDiscardedRenderers )
+{
+  TraceCallStack::NamedParams namedParams;
+  namedParams["numberOfDiscardedRenderers"] = Dali::Any(numberOfDiscardedRenderers);
+  mControllerTrace.PushCall("EnableDepthStencilBuffer", namedParams);
+}
+
+void GraphicsController::DiscardUnusedResources()
+{
+  mControllerTrace.PushCall("DiscardUnusedResources");
+}
+
+bool GraphicsController::IsDiscardQueueEmpty()
+{
+  mControllerTrace.PushCall("IsDiscardQueueEmpty");
+  return true;
+}
+
+bool GraphicsController::IsDrawOnResumeRequired()
+{
+  mControllerTrace.PushCall("IsDrawOnResumeRequired");
+  return false;
+}
+
+void GraphicsController::WaitIdle()
+{
+  mControllerTrace.PushCall("WaitIdle");
+}
+
+void GraphicsController::SwapBuffers()
+{
+  mControllerTrace.PushCall("SwapBuffers");
+}
+
+void GraphicsController::UpdateTextures( const std::vector<Dali::Graphics::TextureUpdateInfo>& updateInfoList, const std::vector<Dali::Graphics::TextureUpdateSourceInfo>& sourceList )
+{
+}
+
+uint32_t GraphicsController::GetSwapchainBufferCount()
+{
+  mControllerTrace.PushCall("GetSwapchainBufferCount");
+  return 2;
+}
+
+void GraphicsController::DestroyShader( Dali::Graphics::Shader* shader )
+{
+}
+
+void GraphicsController::DestroyTexture( Dali::Graphics::Texture* texture )
+{
+  auto iter = std::find(mTextures.begin(), mTextures.end(), texture);
+  if( iter != mTextures.end() )
+  {
+    mTextures.erase(iter);
+  }
+}
+
+void GraphicsController::DestroyFramebuffer( Dali::Graphics::Framebuffer* framebuffer )
+{
+}
+void GraphicsController::DestroyBuffer( Dali::Graphics::Buffer* buffer )
+{
+}
+void GraphicsController::DestroySampler( Dali::Graphics::Sampler* sampler )
+{
+}
+void GraphicsController::DestroyPipeline( Dali::Graphics::Pipeline* pipeline )
+{
+}
+
+}
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-controller.h
new file mode 100644 (file)
index 0000000..ed6cbe9
--- /dev/null
@@ -0,0 +1,257 @@
+#ifndef TEST_GRAPHICS_CONTROLLER_H
+#define TEST_GRAPHICS_CONTROLLER_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/graphics-api/graphics-api-controller.h>
+#include "test-trace-call-stack.h"
+
+#include "test-graphics-texture-factory.h"
+#include "test-graphics-shader-factory.h"
+#include "test-graphics-buffer-factory.h"
+#include "test-graphics-framebuffer-factory.h"
+#include "test-graphics-sampler-factory.h"
+#include "test-graphics-pipeline-factory.h"
+#include "test-graphics-render-command.h"
+
+namespace Test
+{
+
+class GraphicsController : public Dali::Graphics::Controller
+{
+public:
+  explicit GraphicsController();
+
+  virtual ~GraphicsController();
+
+  /**
+   * @brief Create a new object
+   */
+  std::unique_ptr<Dali::Graphics::Shader> CreateShader( const Dali::Graphics::BaseFactory<Dali::Graphics::Shader>& factory ) override;
+
+  /**
+   * @brief Create a new object
+   */
+  std::unique_ptr<Dali::Graphics::Texture> CreateTexture( const Dali::Graphics::BaseFactory<Dali::Graphics::Texture>& factory ) override;
+
+  /**
+   * @brief Create a new object
+   */
+  std::unique_ptr<Dali::Graphics::Buffer> CreateBuffer( const Dali::Graphics::BaseFactory<Dali::Graphics::Buffer>& factory ) override;
+
+  /**
+   * @brief Create a new object
+   */
+  std::unique_ptr<Dali::Graphics::Sampler> CreateSampler( const Dali::Graphics::BaseFactory<Dali::Graphics::Sampler>& factory ) override;
+
+  /**
+   * @brief Create a new object
+   */
+  std::unique_ptr<Dali::Graphics::Framebuffer> CreateFramebuffer( const Dali::Graphics::BaseFactory<Dali::Graphics::Framebuffer>& factory ) override;
+
+  /**
+   * Creates new pipeline
+   */
+  std::unique_ptr<Dali::Graphics::Pipeline> CreatePipeline( const Dali::Graphics::PipelineFactory& factory ) override;
+
+  /**
+   * @brief Returns texture factory
+   * @return
+   */
+  Dali::Graphics::TextureFactory& GetTextureFactory() const override;
+
+  /**
+   * @brief Returns shader factory
+   * @return
+   */
+  Dali::Graphics::ShaderFactory& GetShaderFactory() const override;
+
+  /**
+   * @brief Returns Framebuffer factory
+   * @return
+   */
+  Dali::Graphics::FramebufferFactory& GetFramebufferFactory() const override;
+
+  /**
+   * @brief Returns shader factory
+   * @return
+   */
+  Dali::Graphics::BufferFactory& GetBufferFactory() const override;
+
+  /**
+   * @brief Returns pipeline factory
+   * @return
+   */
+  Dali::Graphics::PipelineFactory& GetPipelineFactory() override;
+
+  /**
+   * @brief Returns sampler factory
+   * @return
+   */
+  Dali::Graphics::SamplerFactory& GetSamplerFactory() override;
+
+  /**
+   * @brief alAllocates render command ( depends on implementation );
+   * @return
+   */
+  std::unique_ptr<Dali::Graphics::RenderCommand> AllocateRenderCommand() override;
+
+  /**
+   * @brief Submits a list of commands
+   * @param commands
+   */
+  void SubmitCommands( std::vector<Dali::Graphics::RenderCommand*> commands ) override;
+
+  /**
+   * @brief Mark the beginning of a frame
+   */
+  void BeginFrame() override;
+
+  /**
+   * @brief Mark the end of a frame
+   */
+  void EndFrame() override;
+
+  /**
+   * @brief Respond to pause lifecycle event
+   */
+  void Pause() override;
+
+  /**
+   * @brief Respond to resume lifecycle event
+   */
+  void Resume() override;
+
+  /**
+   * @brief Enables depth/stencil buffer if supported
+   *
+   * @return True if state changed, False otherwise
+   */
+  bool EnableDepthStencilBuffer( bool enableDepth, bool enableStencil ) override;
+
+  /**
+   * @brief Inform graphics backend if renderers have been discarded.
+   *
+   * @note The graphics backend does not have to run the GC if it is not overly fragmented
+   */
+  void RunGarbageCollector( size_t numberOfDiscardedRenderers ) override;
+
+  /**
+   * @brief Discards all the graphics resources by forcing full
+   * garbage collection.
+   */
+  void DiscardUnusedResources() override;
+
+  /**
+   * @brief Tests whether the graphics discard queue doesn't contain any resources
+   * to be released.
+   *
+   * @return True if queue is empty
+   */
+  bool IsDiscardQueueEmpty() override;
+
+  /**
+   * @brief Test if the graphics subsystem has resumed & should force a draw
+   *
+   * @return true if the graphics subsystem requires a re-draw
+   */
+  bool IsDrawOnResumeRequired() override;
+
+  /**
+   * @brief Waits until all previously submitted commands have been fully
+   * executed.
+   */
+  void WaitIdle() override;
+
+  /**
+   * @brief Swaps graphics buffers
+   */
+  void SwapBuffers() override;
+
+  /**
+   * Updates multiple textures
+   * @param updateInfoList list of update info structures
+   * @param sourceList  list of source info structures
+   */
+  void UpdateTextures( const std::vector<Dali::Graphics::TextureUpdateInfo>& updateInfoList, const std::vector<Dali::Graphics::TextureUpdateSourceInfo>& sourceList ) override;
+
+  /**
+   * Returns number of buffers allocated by the swapchain
+   * @return
+   */
+  uint32_t GetSwapchainBufferCount() override;
+
+public: // For test cases
+  std::vector<Test::GraphicsRenderCommand>& GetRenderCommands()
+  {
+    return mRenderCommands;
+  }
+  std::vector<Dali::Graphics::Texture*>& GetTextures()
+  {
+    return mTextures;
+  }
+
+public:
+  // not copyable
+  GraphicsController( const GraphicsController& ) = delete;
+  GraphicsController& operator=( const GraphicsController& ) = delete;
+
+protected:
+  // derived types should not be moved direcly to prevent slicing
+  GraphicsController( GraphicsController&& ) = default;
+  GraphicsController& operator=( GraphicsController&& ) = default;
+
+
+public: // For test framework
+  void DestroyShader( Dali::Graphics::Shader* shader );
+  void DestroyTexture( Dali::Graphics::Texture* texture );
+  void DestroyFramebuffer( Dali::Graphics::Framebuffer* framebuffer );
+  void DestroyBuffer( Dali::Graphics::Buffer* buffer );
+  void DestroySampler( Dali::Graphics::Sampler* sampler );
+  void DestroyPipeline( Dali::Graphics::Pipeline* pipeline );
+
+
+public:
+  GraphicsTextureFactory mTextureFactory;
+  GraphicsShaderFactory mShaderFactory;
+  GraphicsFramebufferFactory mFramebufferFactory;
+  GraphicsBufferFactory mBufferFactory;
+  GraphicsPipelineFactory mPipelineFactory;
+  GraphicsSamplerFactory mSamplerFactory;
+
+  TraceCallStack mTextureTrace;
+  TraceCallStack mShaderTrace;
+  TraceCallStack mBufferTrace;
+  TraceCallStack mControllerTrace;
+
+  std::vector<Dali::Graphics::Texture*> mTextures;
+
+  // Add these as needed
+  //std::vector<Dali::Graphics::Shader*> mShaders;
+  //std::vector<Dali::Graphics::Framebuffer*> mFramebuffers;
+  //std::vector<Dali::Graphics::Buffer*> mBuffers;
+  //std::vector<Dali::Graphics::Sampler*> mSampler;
+  //std::vector<Dali::Graphics::Pipeline*> mPipeline;
+
+  std::vector<Test::GraphicsRenderCommand> mRenderCommands;
+};
+
+} // namespace Test
+
+#endif // TEST_GRAPHICS_CONTROLLER_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer-factory.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer-factory.cpp
new file mode 100644 (file)
index 0000000..5bf74a9
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "test-graphics-framebuffer-factory.h"
+#include "test-graphics-framebuffer.h"
+
+namespace Test
+{
+GraphicsFramebufferFactory::GraphicsFramebufferFactory(GraphicsController* controller)
+: mController(*controller)
+{
+}
+
+GraphicsFramebufferFactory::~GraphicsFramebufferFactory() = default;
+
+Dali::Graphics::FramebufferFactory& GraphicsFramebufferFactory::SetSize( const Dali::Graphics::Extent2D& size )
+{
+  mSize = size;
+  return *this;
+}
+
+Dali::Graphics::FramebufferFactory& GraphicsFramebufferFactory::SetColorAttachment(
+  Dali::Graphics::TextureDetails::AttachmentId attachmentIndex,
+  const Dali::Graphics::Texture&               texture,
+  Dali::Graphics::TextureDetails::LayerId      layer,
+  Dali::Graphics::TextureDetails::LevelId      mipmapLevel )
+{
+  if( mColorAttachments.size() <= attachmentIndex )
+  {
+    mColorAttachments.resize( attachmentIndex+1 );
+  }
+  mColorAttachments[attachmentIndex].texture = &texture;
+  mColorAttachments[attachmentIndex].layer = layer;
+  mColorAttachments[attachmentIndex].mipmapLevel = mipmapLevel;
+  return *this;
+}
+
+Dali::Graphics::FramebufferFactory& GraphicsFramebufferFactory::SetDepthStencilAttachment(
+  const Dali::Graphics::Texture&                   texture,
+  Dali::Graphics::TextureDetails::LayerId          layer,
+  Dali::Graphics::TextureDetails::LevelId          level,
+  Dali::Graphics::TextureDetails::DepthStencilFlag depthStencilFlag )
+{
+  mDepthAttachment = DepthAttachment{ &texture, layer, level, depthStencilFlag };
+  return *this;
+}
+
+Dali::Graphics::FramebufferFactory::PointerType GraphicsFramebufferFactory::Create() const
+{
+  auto fb = std::make_unique<Test::GraphicsFramebuffer>( mController, mSize, mColorAttachments, mDepthAttachment );
+  return fb;
+}
+
+void GraphicsFramebufferFactory::TestReset()
+{
+  mColorAttachments.clear();
+  mDepthAttachment = GraphicsFramebufferFactory::DepthAttachment { };
+  mSize = { 0,0 };
+}
+
+
+} // Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer-factory.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer-factory.h
new file mode 100644 (file)
index 0000000..8f51396
--- /dev/null
@@ -0,0 +1,74 @@
+#ifndef TEST_GRAPHICS_FRAMEBUFFER_FACTORY_H
+#define TEST_GRAPHICS_FRAMEBUFFER_FACTORY_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/graphics-api/graphics-api-framebuffer-factory.h>
+
+namespace Test
+{
+class GraphicsController;
+
+class GraphicsFramebufferFactory : public Dali::Graphics::FramebufferFactory
+{
+public:
+  GraphicsFramebufferFactory(GraphicsController* controller);
+  virtual ~GraphicsFramebufferFactory();
+
+  Dali::Graphics::FramebufferFactory& SetSize( const Dali::Graphics::Extent2D& size ) override;
+
+  Dali::Graphics::FramebufferFactory& SetColorAttachment( Dali::Graphics::TextureDetails::AttachmentId attachmentIndex,
+                                                               const Dali::Graphics::Texture&               texture,
+                                                               Dali::Graphics::TextureDetails::LayerId      layer,
+                                                               Dali::Graphics::TextureDetails::LevelId      level ) override;
+
+  Dali::Graphics::FramebufferFactory& SetDepthStencilAttachment( const Dali::Graphics::Texture&                   texture,
+                                                                 Dali::Graphics::TextureDetails::LayerId          layer,
+                                                                 Dali::Graphics::TextureDetails::LevelId          level,
+                                                                 Dali::Graphics::TextureDetails::DepthStencilFlag depthStencilFlag ) override;
+
+  Dali::Graphics::FramebufferFactory::PointerType Create() const override;
+
+public: // test methods
+  void TestReset();
+
+public:
+  struct ColorAttachment
+  {
+    const Dali::Graphics::Texture*    texture;
+    Dali::Graphics::TextureDetails::LayerId layer;
+    Dali::Graphics::TextureDetails::LevelId mipmapLevel;
+  };
+
+  struct DepthAttachment
+  {
+    const Dali::Graphics::Texture*                   texture;
+    Dali::Graphics::TextureDetails::LayerId          layer;
+    Dali::Graphics::TextureDetails::LevelId          mipmapLevel;
+    Dali::Graphics::TextureDetails::DepthStencilFlag depthStencilFlag;
+  };
+
+public:
+  GraphicsController& mController;
+  Dali::Graphics::Extent2D mSize;
+  std::vector<ColorAttachment> mColorAttachments;
+  DepthAttachment mDepthAttachment;
+};
+
+} // Test
+
+#endif //TEST_GRAPHICS_FRAMEBUFFER_FACTORY_H
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 
-#include <dali-test-suite-utils.h>
-#include <dali/graphics/graphics-controller.h>
-
-using Dali::Graphics::Manager;
+#include "test-graphics-framebuffer.h"
 
-void utc_dali_graphics_manager_startup(void)
+namespace Test
 {
-  test_return_value = TET_UNDEF;
-}
 
-void utc_dali_graphics_manager_cleanup(void)
+GraphicsFramebuffer::GraphicsFramebuffer(
+  GraphicsController& controller,
+  Dali::Graphics::Extent2D size,
+  const std::vector<GraphicsFramebufferFactory::ColorAttachment>& colorAttachments,
+  const GraphicsFramebufferFactory::DepthAttachment& depthAttachment )
+: mController( controller ),
+  mSize ( size ),
+  mColorAttachments( colorAttachments ),
+  mDepthAttachment( depthAttachment )
 {
-  test_return_value = TET_PASS;
 }
 
-int UtcDaliGraphicsManagerCreation(void)
+GraphicsFramebuffer::~GraphicsFramebuffer()
 {
-  Manager manager;
-
-  END_TEST;
 }
 
-int UtcDaliGraphicsManagerCreateTexture(void)
-{
-  Manager manager;
-
-  //  auto texture = manager.CreateTexture();
-
-  END_TEST;
-}
+}//Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-framebuffer.h
new file mode 100644 (file)
index 0000000..ffedae7
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef TEST_GRAPHICS_FRAMEBUFFER_H
+#define TEST_GRAPHICS_FRAMEBUFFER_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/graphics-api/graphics-api-framebuffer.h>
+#include <test-graphics-framebuffer-factory.h>
+
+namespace Test
+{
+class GraphicsController;
+
+class GraphicsFramebuffer : public Dali::Graphics::Framebuffer
+{
+public:
+  explicit GraphicsFramebuffer( GraphicsController& mController,
+                                Dali::Graphics::Extent2D size,
+                                const std::vector<GraphicsFramebufferFactory::ColorAttachment>& colorAttachments,
+                                const GraphicsFramebufferFactory::DepthAttachment& depthAttachment );
+
+  ~GraphicsFramebuffer() override;
+
+public:
+  GraphicsController& mController;
+  Dali::Graphics::Extent2D mSize;
+  const std::vector<GraphicsFramebufferFactory::ColorAttachment>& mColorAttachments;
+  const GraphicsFramebufferFactory::DepthAttachment& mDepthAttachment;
+};
+
+} // namespace Test
+
+#endif // TEST_GRAPHICS_FRAMEBUFFER_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline-factory.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline-factory.cpp
new file mode 100644 (file)
index 0000000..4bdf8eb
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "test-graphics-pipeline-factory.h"
+
+namespace Test
+{
+
+GraphicsPipelineFactory::GraphicsPipelineFactory(GraphicsController* controller)
+: mController(*controller)
+{
+}
+GraphicsPipelineFactory::~GraphicsPipelineFactory() = default;
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetColorBlendState( const Dali::Graphics::ColorBlendState& state )
+{
+  mCreateInfo.mColorBlendState = state;
+  return *this;
+}
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetShaderState( const Dali::Graphics::ShaderState& state )
+{
+  mCreateInfo.mShaderState = state;
+  return *this;
+}
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetViewportState( const Dali::Graphics::ViewportState& state )
+{
+  mCreateInfo.mViewportState = state;
+  return *this;
+}
+
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetFramebufferState( const Dali::Graphics::FramebufferState& state )
+{
+  mCreateInfo.mFramebufferState = state;
+  return *this;
+}
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetBasePipeline( Dali::Graphics::Pipeline& pipeline )
+{
+  mBasePipeline = dynamic_cast<Test::GraphicsPipeline*>(&pipeline);
+  return *this;
+}
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetDepthStencilState( Dali::Graphics::DepthStencilState state )
+{
+  mCreateInfo.mDepthStencilState = state;
+  return *this;
+}
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetRasterizationState( const Dali::Graphics::RasterizationState& state )
+{
+  mCreateInfo.mRasterizationState = state;
+  return *this;
+}
+
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetVertexInputState( const Dali::Graphics::VertexInputState& state )
+{
+  mCreateInfo.mVertexInputState = state;
+  return *this;
+}
+
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetInputAssemblyState( const Dali::Graphics::InputAssemblyState& state )
+{
+  mCreateInfo.mInputAssemblyState = state;
+  return *this;
+}
+
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetDynamicStateMask( const Dali::Graphics::PipelineDynamicStateMask mask )
+{
+  mCreateInfo.mDynamicStateMask = mask;
+  return *this;
+}
+
+
+Dali::Graphics::PipelineFactory& GraphicsPipelineFactory::SetOldPipeline( std::unique_ptr<Dali::Graphics::Pipeline> oldPipeline )
+{
+  mOldPipeline = std::move(oldPipeline);
+  return *this;
+}
+
+
+std::unique_ptr<Dali::Graphics::Pipeline> GraphicsPipelineFactory::Create()
+{
+
+  if( mUseOldPipeline )
+  {
+    return std::move( mOldPipeline );
+  }
+  else
+  {
+    return std::unique_ptr< Dali::Graphics::Pipeline>( new GraphicsPipeline( mController, mCreateInfo ) );
+  }
+
+  return nullptr;
+}
+
+void GraphicsPipelineFactory::TestReset()
+{
+  mCreateInfo.mDepthStencilState = {};
+  mCreateInfo.mColorBlendState = {};
+  mCreateInfo.mShaderState = {};
+  mCreateInfo.mViewportState = {};
+  mCreateInfo.mFramebufferState = {};
+  mCreateInfo.mRasterizationState = {};
+  mCreateInfo.mVertexInputState = {};
+  mCreateInfo.mInputAssemblyState = {};
+  mCreateInfo.mDynamicStateMask = 0u;
+  mBasePipeline = nullptr;
+
+  if( mOldPipeline )
+  {
+    mOldPipeline.reset();
+  }
+}
+
+
+} // Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline-factory.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline-factory.h
new file mode 100644 (file)
index 0000000..91740c6
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef TEST_GRAPHICS_PIPELINE_FACTORY_H
+#define TEST_GRAPHICS_PIPELINE_FACTORY_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/graphics-api/graphics-api-pipeline-factory.h>
+#include "test-graphics-pipeline.h"
+
+namespace Test
+{
+class GraphicsController;
+class GraphicsPipeline;
+
+class GraphicsPipelineFactory : public Dali::Graphics::PipelineFactory
+{
+public:
+  GraphicsPipelineFactory( GraphicsController* controller );
+
+  virtual ~GraphicsPipelineFactory();
+
+  Dali::Graphics::PipelineFactory& SetColorBlendState( const Dali::Graphics::ColorBlendState& state ) override;
+
+  Dali::Graphics::PipelineFactory& SetShaderState( const Dali::Graphics::ShaderState& state ) override;
+
+  Dali::Graphics::PipelineFactory& SetViewportState( const Dali::Graphics::ViewportState& state ) override;
+
+  Dali::Graphics::PipelineFactory& SetFramebufferState( const Dali::Graphics::FramebufferState& state ) override;
+
+  Dali::Graphics::PipelineFactory& SetBasePipeline( Dali::Graphics::Pipeline& pipeline ) override;
+
+  Dali::Graphics::PipelineFactory& SetDepthStencilState( Dali::Graphics::DepthStencilState state ) override;
+
+  Dali::Graphics::PipelineFactory& SetRasterizationState( const Dali::Graphics::RasterizationState& state ) override;
+
+  Dali::Graphics::PipelineFactory& SetVertexInputState( const Dali::Graphics::VertexInputState& state ) override;
+
+  Dali::Graphics::PipelineFactory& SetInputAssemblyState( const Dali::Graphics::InputAssemblyState& state ) override;
+
+  Dali::Graphics::PipelineFactory& SetDynamicStateMask( const Dali::Graphics::PipelineDynamicStateMask mask ) override;
+
+  Dali::Graphics::PipelineFactory& SetOldPipeline( std::unique_ptr<Dali::Graphics::Pipeline> oldPipeline ) override;
+
+  std::unique_ptr<Dali::Graphics::Pipeline> Create() override;
+
+public: // Test methods
+  void TestSetUseOldPipeline( bool useOldPipeline )
+  {
+    mUseOldPipeline = useOldPipeline;
+  }
+  void TestReset();
+
+public:
+  GraphicsController& mController;
+  GraphicsPipelineCreateInfo mCreateInfo;
+  Dali::Graphics::Pipeline* mBasePipeline;
+  std::unique_ptr<Dali::Graphics::Pipeline> mOldPipeline;
+
+public: // Test configurations
+  bool mUseOldPipeline{false};
+};
+
+} // Test
+
+#endif //TEST_GRAPHICS_PIPELINE_FACTORY_H
@@ -1,8 +1,5 @@
-#ifndef DALI_GRAPHICS_VULKAN_HPP_WRAPPER_H
-#define DALI_GRAPHICS_VULKAN_HPP_WRAPPER_H
-
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 
-// Vulkan without exceptions
-#ifndef VULKAN_HPP_NO_EXCEPTIONS
-#define VULKAN_HPP_NO_EXCEPTIONS
-#endif
+#include "test-graphics-pipeline.h"
+
+namespace Test
+{
+
+GraphicsPipeline::GraphicsPipeline( GraphicsController& controller, const GraphicsPipelineCreateInfo& createInfo )
+: mController(controller),
+  mCreateInfo( createInfo )
+{
+}
+
+GraphicsPipeline::~GraphicsPipeline()
+{
+}
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wfloat-equal"
-#pragma GCC diagnostic ignored "-Wswitch-enum"
-#include <vulkan/vulkan.hpp>
-#pragma GCC diagnostic pop
+bool GraphicsPipeline::Equals( const Dali::Graphics::Pipeline& ) const
+{
+  // There is no caching - always false;
+  return false;
+}
 
-#endif // DALI_GRAPHICS_VULKAN_HPP_WRAPPER_H
+} // Test namespace
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-pipeline.h
new file mode 100644 (file)
index 0000000..f1d78a2
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef TEST_GRAPHICS_PIPELINE_H
+#define TEST_GRAPHICS_PIPELINE_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/graphics-api/graphics-api-pipeline.h>
+
+namespace Test
+{
+class GraphicsController;
+class GraphicsPipeline;
+
+
+struct GraphicsPipelineCreateInfo
+{
+  Dali::Graphics::ColorBlendState mColorBlendState;
+  Dali::Graphics::ShaderState mShaderState;
+  Dali::Graphics::ViewportState mViewportState;
+  Dali::Graphics::FramebufferState mFramebufferState;
+  Test::GraphicsPipeline* mBasePipeline;
+  Dali::Graphics::DepthStencilState mDepthStencilState;
+  Dali::Graphics::RasterizationState mRasterizationState;
+  Dali::Graphics::VertexInputState mVertexInputState;
+  Dali::Graphics::InputAssemblyState mInputAssemblyState;
+  Dali::Graphics::PipelineDynamicStateMask mDynamicStateMask;
+};
+
+class GraphicsPipeline : public Dali::Graphics::Pipeline
+{
+public:
+  explicit GraphicsPipeline( GraphicsController& controller, const GraphicsPipelineCreateInfo& createInfo ) ;
+
+  ~GraphicsPipeline() override;
+
+  bool Equals( const Dali::Graphics::Pipeline& ) const;
+
+public:
+  GraphicsController& mController;
+  GraphicsPipelineCreateInfo mCreateInfo;
+};
+
+} // namespace Test
+
+#endif // TEST_GRAPHICS_PIPELINE_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-render-command.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-render-command.cpp
new file mode 100644 (file)
index 0000000..6a998ab
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "test-graphics-render-command.h"
+
+namespace Test
+{
+
+GraphicsRenderCommand::GraphicsRenderCommand()
+{
+}
+
+GraphicsRenderCommand::~GraphicsRenderCommand()
+{
+}
+
+GraphicsRenderCommand::GraphicsRenderCommand( const GraphicsRenderCommand& rhs)
+: Dali::Graphics::RenderCommand()
+{
+  mVertexBufferBindings = rhs.mVertexBufferBindings;
+  mUniformBufferBindings = rhs.mUniformBufferBindings;
+  mTextureBindings = rhs.mTextureBindings;
+  mSamplerBindings = rhs.mSamplerBindings;
+  mIndexBufferBinding = rhs.mIndexBufferBinding;
+  mRenderTargetBinding = rhs.mRenderTargetBinding;
+  mDrawCommand = rhs.mDrawCommand;
+  mPushConstantsBindings = rhs.mPushConstantsBindings;
+  mPipeline = rhs.mPipeline;
+}
+
+GraphicsRenderCommand& GraphicsRenderCommand::operator=( const GraphicsRenderCommand& rhs)
+{
+  mVertexBufferBindings = rhs.mVertexBufferBindings;
+  mUniformBufferBindings = rhs.mUniformBufferBindings;
+  mTextureBindings = rhs.mTextureBindings;
+  mSamplerBindings = rhs.mSamplerBindings;
+  mIndexBufferBinding = rhs.mIndexBufferBinding;
+  mRenderTargetBinding = rhs.mRenderTargetBinding;
+  mDrawCommand = rhs.mDrawCommand;
+  mPushConstantsBindings = rhs.mPushConstantsBindings;
+  mPipeline = rhs.mPipeline;
+  return *this;
+}
+
+
+} // Test namespace
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-render-command.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-render-command.h
new file mode 100644 (file)
index 0000000..e3eaedb
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef TEST_GRAPHICS_RENDER_COMMAND_H
+#define TEST_GRAPHICS_RENDER_COMMAND_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/graphics-api/graphics-api-render-command.h>
+
+namespace Test
+{
+class GraphicsController;
+
+class GraphicsRenderCommand : public Dali::Graphics::RenderCommand
+{
+public:
+  explicit GraphicsRenderCommand();
+
+  ~GraphicsRenderCommand() override;
+
+  GraphicsRenderCommand( const GraphicsRenderCommand& );
+  GraphicsRenderCommand& operator=( const GraphicsRenderCommand& );
+
+  // Can't trace methods called on graphics api RenderCommand - they're all inlined.
+  // Instead, would need to check submitted commands, and check the mUpdateFlags.
+  // So, to check if a draw happens, look thru submitted commands, and check mUpdateFlags contains
+  // RENDER_COMMAND_UPDATE_DRAW_BIT, and see what the mDrawCommand type is.
+};
+
+} // namespace Test
+
+#endif // TEST_GRAPHICS_RENDER_COMMAND_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler-factory.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler-factory.cpp
new file mode 100644 (file)
index 0000000..2f547cc
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "test-graphics-sampler-factory.h"
+
+namespace Test
+{
+class GraphicsSampler;
+
+GraphicsSamplerFactory::GraphicsSamplerFactory(GraphicsController* controller)
+: mController(*controller)
+{
+}
+GraphicsSamplerFactory::~GraphicsSamplerFactory() = default;
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetAddressModeU( Dali::Graphics::SamplerAddressMode mode )
+{
+  mCreateInfo.mAddressModeU = mode;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetAddressModeV( Dali::Graphics::SamplerAddressMode mode )
+{
+  mCreateInfo.mAddressModeV = mode;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetAddressModeW( Dali::Graphics::SamplerAddressMode mode )
+{
+  mCreateInfo.mAddressModeW = mode;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetMinFilter( Dali::Graphics::SamplerFilter filter )
+{
+  mCreateInfo.mMinFilter = filter;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetMagFilter( Dali::Graphics::SamplerFilter filter )
+{
+  mCreateInfo.mMagFilter = filter;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetMipmapMode( Dali::Graphics::SamplerMipmapMode mipmapMode )
+{
+  mCreateInfo.mMipmapMode = mipmapMode;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetAnisotropyEnable( bool anisotropyEnable )
+{
+  mCreateInfo.mAnisotropyEnable = anisotropyEnable;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetMaxAnisotropy( float maxAnisotropy )
+{
+  mCreateInfo.mMaxAnisotropy = maxAnisotropy;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetMinLod( float minLod )
+{
+  mCreateInfo.mMinLod = minLod;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetMaxLod( float maxLod )
+{
+  mCreateInfo.mMaxLod = maxLod;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetUnnormalizeCoordinates( bool unnormalizedCoordinates )
+{
+  mCreateInfo.mUnnormalizedCoordinates = unnormalizedCoordinates;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetCompareEnable( bool compareEnable )
+{
+  mCreateInfo.mCompareEnable = compareEnable;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory& GraphicsSamplerFactory::SetCompareOp( Dali::Graphics::CompareOp compareOp )
+{
+  mCreateInfo.mCompareOp = compareOp;
+  return *this;
+}
+
+Dali::Graphics::SamplerFactory::PointerType GraphicsSamplerFactory::Create() const
+{
+  return std::unique_ptr<GraphicsSampler>( new GraphicsSampler( mController, mCreateInfo ) );
+};
+
+
+void GraphicsSamplerFactory::TestReset()
+{
+  mCreateInfo.mAddressModeU = Dali::Graphics::SamplerAddressMode{};
+  mCreateInfo.mAddressModeV = Dali::Graphics::SamplerAddressMode{};
+  mCreateInfo.mAddressModeW = Dali::Graphics::SamplerAddressMode{};
+  mCreateInfo.mMinFilter = Dali::Graphics::SamplerFilter{};
+  mCreateInfo.mMagFilter = Dali::Graphics::SamplerFilter{};
+  mCreateInfo.mMipmapMode = Dali::Graphics::SamplerMipmapMode{};
+  mCreateInfo.mCompareOp = Dali::Graphics::CompareOp{};
+  mCreateInfo.mMaxAnisotropy = 1.0f;
+  mCreateInfo.mMinLod = 0.0f;
+  mCreateInfo.mMaxLod = 0.0f;
+  mCreateInfo.mCompareEnable = false;
+  mCreateInfo.mAnisotropyEnable = false;
+  mCreateInfo.mUnnormalizedCoordinates = false;
+}
+
+
+} // Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler-factory.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler-factory.h
new file mode 100644 (file)
index 0000000..e3f3849
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef TEST_GRAPHICS_SAMPLER_FACTORY_H
+#define TEST_GRAPHICS_SAMPLER_FACTORY_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/graphics-api/graphics-api-sampler-factory.h>
+#include "test-graphics-sampler.h"
+
+namespace Test
+{
+class GraphicsController;
+
+class GraphicsSamplerFactory : public Dali::Graphics::SamplerFactory
+{
+public:
+  GraphicsSamplerFactory( GraphicsController* controller );
+  virtual ~GraphicsSamplerFactory();
+
+  Dali::Graphics::SamplerFactory& SetAddressModeU( Dali::Graphics::SamplerAddressMode mode ) override;
+
+  Dali::Graphics::SamplerFactory& SetAddressModeV( Dali::Graphics::SamplerAddressMode mode ) override;
+
+  Dali::Graphics::SamplerFactory& SetAddressModeW( Dali::Graphics::SamplerAddressMode mode ) override;
+
+  Dali::Graphics::SamplerFactory& SetMinFilter( Dali::Graphics::SamplerFilter filter ) override;
+
+  Dali::Graphics::SamplerFactory& SetMagFilter( Dali::Graphics::SamplerFilter filter ) override;
+
+  Dali::Graphics::SamplerFactory& SetMipmapMode( Dali::Graphics::SamplerMipmapMode mipmapMode ) override;
+
+  Dali::Graphics::SamplerFactory& SetAnisotropyEnable( bool anisotropyEnable ) override;
+
+  Dali::Graphics::SamplerFactory& SetMaxAnisotropy( float maxAnisotropy ) override;
+
+  Dali::Graphics::SamplerFactory& SetMinLod( float minLod ) override;
+
+  Dali::Graphics::SamplerFactory& SetMaxLod( float maxLod ) override;
+
+  Dali::Graphics::SamplerFactory& SetUnnormalizeCoordinates( bool unnormalizedCoordinates ) override;
+
+  Dali::Graphics::SamplerFactory& SetCompareEnable( bool compareEnable ) override;
+
+  Dali::Graphics::SamplerFactory& SetCompareOp( Dali::Graphics::CompareOp compareOp ) override;
+
+  Dali::Graphics::SamplerFactory::PointerType Create() const override;
+
+public: // Test configuration methods
+  void TestReset();
+
+public:
+  GraphicsController& mController;
+  GraphicsSamplerCreateInfo mCreateInfo;
+};
+
+} // Test
+
+#endif //TEST_GRAPHICS_SAMPLER_FACTORY_H
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
  */
 
-#include <dali/graphics/vulkan/vulkan-debug.h>
+#include <test-graphics-sampler.h>
+
+namespace Test
+{
 
-#if defined(DEBUG_ENABLED)
+GraphicsSampler::GraphicsSampler(GraphicsController& controller, GraphicsSamplerCreateInfo createInfo)
+: mController( controller ),
+  mCreateInfo( createInfo )
+{
+}
 
-const char* LOG_VULKAN( getenv( "LOG_VULKAN" ) );
+GraphicsSampler::~GraphicsSampler() = default;
 
-#endif
+} // namespace Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-sampler.h
new file mode 100644 (file)
index 0000000..3fc64e5
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef TEST_GRAPHICS_SAMPLER_H
+#define TEST_GRAPHICS_SAMPLER_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/graphics-api/graphics-api-sampler.h>
+#include <dali/graphics-api/graphics-api-types.h>
+
+namespace Test
+{
+class GraphicsController;
+
+struct GraphicsSamplerCreateInfo
+{
+  Dali::Graphics::SamplerAddressMode mAddressModeU {};
+  Dali::Graphics::SamplerAddressMode mAddressModeW {};
+  Dali::Graphics::SamplerAddressMode mAddressModeV {};
+  Dali::Graphics::SamplerFilter      mMinFilter {};
+  Dali::Graphics::SamplerFilter      mMagFilter {};
+  Dali::Graphics::SamplerMipmapMode  mMipmapMode {};
+  Dali::Graphics::CompareOp          mCompareOp {};
+  float                              mMaxAnisotropy { 0.0f };
+  float                              mMinLod { 0.0f };
+  float                              mMaxLod { 0.0f };
+  bool                               mCompareEnable {};
+  bool                               mAnisotropyEnable { false };
+  bool                               mUnnormalizedCoordinates { false };
+};
+
+class GraphicsSampler : public Dali::Graphics::Sampler
+{
+public:
+  explicit GraphicsSampler(GraphicsController& controller, GraphicsSamplerCreateInfo createInfo);
+
+  ~GraphicsSampler() override;
+
+public:
+  GraphicsController& mController;
+  GraphicsSamplerCreateInfo mCreateInfo;
+};
+
+} // namespace Test
+
+#endif // TEST_GRAPHICS_SAMPLER_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader-factory.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader-factory.cpp
new file mode 100644 (file)
index 0000000..8a3709c
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "test-graphics-shader-factory.h"
+
+namespace Test
+{
+GraphicsShaderFactory::GraphicsShaderFactory(GraphicsController* controller)
+: mController(*controller)
+{
+}
+GraphicsShaderFactory::~GraphicsShaderFactory() = default;
+
+Dali::Graphics::ShaderFactory& GraphicsShaderFactory::SetShaderModule(
+  Dali::Graphics::ShaderDetails::PipelineStage pipelineStage,
+  Dali::Graphics::ShaderDetails::Language language,
+  const Dali::Graphics::ShaderDetails::ShaderSource& source )
+{
+  mCreateInfo.mPipelineStage = pipelineStage;
+  mCreateInfo.mLanguage = language;
+  mCreateInfo.mSource = source;
+  return *this;
+}
+
+Dali::Graphics::ShaderFactory::PointerType GraphicsShaderFactory::Create() const
+{
+  return std::unique_ptr<GraphicsShader>(new GraphicsShader( mController, mCreateInfo));
+}
+
+void GraphicsShaderFactory::TestReset()
+{
+  mCreateInfo = GraphicsShaderCreateInfo { };
+}
+
+} // Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader-factory.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader-factory.h
new file mode 100644 (file)
index 0000000..18d28ce
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef TEST_GRAPHICS_SHADER_FACTORY_H
+#define TEST_GRAPHICS_SHADER_FACTORY_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/graphics-api/graphics-api-shader-factory.h>
+#include "test-graphics-shader.h"
+
+namespace Test
+{
+class GraphicsController;
+
+class GraphicsShaderFactory : public Dali::Graphics::ShaderFactory
+{
+public:
+  GraphicsShaderFactory(GraphicsController* controller);
+  ~GraphicsShaderFactory();
+
+  Dali::Graphics::ShaderFactory& SetShaderModule( Dali::Graphics::ShaderDetails::PipelineStage pipelineStage,
+                                                  Dali::Graphics::ShaderDetails::Language language,
+                                                  const Dali::Graphics::ShaderDetails::ShaderSource& source ) override;
+
+  Dali::Graphics::ShaderFactory::PointerType Create() const override;
+
+public:
+  void TestReset();
+
+public:
+  GraphicsController& mController;
+  GraphicsShaderCreateInfo mCreateInfo;
+};
+
+} // Test
+
+#endif //TEST_GRAPHICS_SHADER_FACTORY_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader.cpp
new file mode 100644 (file)
index 0000000..8202d82
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test-graphics-shader.h"
+#include "test-graphics-controller.h"
+
+namespace Test
+{
+
+GraphicsShader::GraphicsShader( GraphicsController& controller, const GraphicsShaderCreateInfo& createInfo )
+: mController(controller),
+  mCreateInfo(createInfo)
+{
+}
+
+GraphicsShader::~GraphicsShader() = default;
+
+bool GraphicsShader::IsReflectionSupported() const
+{
+  mController.mShaderTrace.PushCall("IsReflectionSupported");
+  return false;
+}
+
+uint32_t GraphicsShader::GetVertexAttributeLocation(const std::string &name) const
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["name"] = Dali::Any( name );
+  mController.mShaderTrace.PushCall("GetVertexAttributeLocation", namedParams);
+  return 0;
+}
+
+Dali::Graphics::ShaderDetails::VertexInputAttributeFormat GraphicsShader::GetVertexAttributeFormat( uint32_t location ) const
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["name"] = Dali::Any( location );
+  mController.mShaderTrace.PushCall("GetVertexAttributeLocation", namedParams);
+  return Dali::Graphics::ShaderDetails::VertexInputAttributeFormat{};
+};
+
+std::string GraphicsShader::GetVertexAttributeName(uint32_t location) const
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["location"] = Dali::Any( location );
+  mController.mShaderTrace.PushCall("GetVertexAttributeName", namedParams);
+
+  return "";
+}
+
+std::vector<uint32_t> GraphicsShader::GetVertexAttributeLocations() const
+{
+  mController.mShaderTrace.PushCall("GetVertexAttributeLocations");
+  std::vector<uint32_t> locs = {};
+  return locs;
+}
+
+std::vector<Dali::Graphics::ShaderDetails::UniformInfo> GraphicsShader::GetSamplers() const
+{
+  mController.mShaderTrace.PushCall("GetSamplers");
+  // Matches basic-shader.frag from test-actor-utils.cpp
+  std::vector<Dali::Graphics::ShaderDetails::UniformInfo> ui = {
+    {"sTexture", Dali::Graphics::ShaderDetails::UniformClass::SAMPLER, 4u, 0u, 0u, 0u},
+    {"sTexture2", Dali::Graphics::ShaderDetails::UniformClass::SAMPLER, 2u, 0u, 0u, 0u}};
+
+  return ui;
+}
+
+bool GraphicsShader::GetNamedUniform( const std::string& name, Dali::Graphics::ShaderDetails::UniformInfo& out ) const
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["name"] = Dali::Any( name );
+  mController.mShaderTrace.PushCall("GetNamedUniform", namedParams);
+  return false;
+}
+
+uint32_t GraphicsShader::GetUniformBlockCount() const
+{
+  mController.mShaderTrace.PushCall("GetUniformBlockCount");
+  return 0;
+}
+
+uint32_t GraphicsShader::GetUniformBlockBinding( uint32_t index ) const
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["index"] = Dali::Any( index );
+  mController.mShaderTrace.PushCall("GetUniformBlockBinding", namedParams);
+  return 0;
+}
+
+uint32_t GraphicsShader::GetUniformBlockSize( uint32_t index ) const
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["index"] = Dali::Any( index );
+  mController.mShaderTrace.PushCall("GetUniformBlockSize", namedParams);
+  return 0;
+}
+
+bool GraphicsShader::GetUniformBlock( uint32_t index, Dali::Graphics::ShaderDetails::UniformBlockInfo& out ) const
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["index"] = Dali::Any( index );
+  mController.mShaderTrace.PushCall("GetUniformBlock", namedParams);
+  return false;
+}
+
+
+} // namespace Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-shader.h
new file mode 100644 (file)
index 0000000..8e463d6
--- /dev/null
@@ -0,0 +1,78 @@
+#ifndef TEST_GRAPHICS_SHADER_H
+#define TEST_GRAPHICS_SHADER_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/graphics-api/graphics-api-shader.h>
+#include <dali/graphics-api/graphics-api-types.h>
+
+namespace Test
+{
+class GraphicsController;
+
+struct GraphicsShaderCreateInfo
+{
+  Dali::Graphics::ShaderDetails::PipelineStage mPipelineStage;
+  Dali::Graphics::ShaderDetails::Language      mLanguage;
+  Dali::Graphics::ShaderDetails::ShaderSource  mSource;
+
+  GraphicsShaderCreateInfo()
+  : mPipelineStage{},
+    mLanguage{},
+    mSource("")
+  {
+  }
+};
+
+class GraphicsShader : public Dali::Graphics::Shader
+{
+public:
+  explicit GraphicsShader( GraphicsController& controller, const GraphicsShaderCreateInfo& createInfo );
+
+  ~GraphicsShader() override;
+
+  bool IsReflectionSupported() const override;
+
+  uint32_t GetVertexAttributeLocation(const std::string &name) const override;
+
+  Dali::Graphics::ShaderDetails::VertexInputAttributeFormat GetVertexAttributeFormat( uint32_t location ) const override;
+
+  std::string GetVertexAttributeName(uint32_t location) const override;
+
+  std::vector<uint32_t> GetVertexAttributeLocations() const override;
+
+  std::vector<Dali::Graphics::ShaderDetails::UniformInfo> GetSamplers() const override;
+
+  bool GetNamedUniform( const std::string& name, Dali::Graphics::ShaderDetails::UniformInfo& out ) const override;
+
+  uint32_t GetUniformBlockCount() const override;
+
+  uint32_t GetUniformBlockBinding( uint32_t index ) const override;
+
+  uint32_t GetUniformBlockSize( uint32_t index ) const override;
+
+  bool GetUniformBlock( uint32_t index, Dali::Graphics::ShaderDetails::UniformBlockInfo& out ) const override;
+
+public:
+  GraphicsController& mController;
+  GraphicsShaderCreateInfo mCreateInfo;
+};
+
+} // namespace Test
+
+#endif // TEST_GRAPHICS_SHADER_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture-factory.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture-factory.cpp
new file mode 100644 (file)
index 0000000..39702d4
--- /dev/null
@@ -0,0 +1,86 @@
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "test-graphics-texture-factory.h"
+#include "test-graphics-texture.h"
+
+namespace Test
+{
+
+GraphicsTextureFactory::GraphicsTextureFactory(GraphicsController* controller)
+: mController(*controller)
+{
+}
+GraphicsTextureFactory::~GraphicsTextureFactory() = default;
+
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetType(Dali::Graphics::TextureDetails::Type type)
+{
+  mCreateInfo.type = type;
+  return *this;
+}
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetSize(const Dali::Graphics::Extent2D& size)
+{
+  mCreateInfo.size = size;
+  return *this;
+}
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetFormat(Dali::Graphics::TextureDetails::Format format)
+{
+  mCreateInfo.format = format;
+  return *this;
+}
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetMipMapFlag(Dali::Graphics::TextureDetails::MipMapFlag mipMapFlag)
+{
+  mCreateInfo.mipMapFlag = mipMapFlag;
+  return *this;
+}
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetUsage( Dali::Graphics::TextureDetails::Usage usage )
+{
+  mCreateInfo.usage = usage;
+  return *this;
+}
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetData( void* pData )
+{
+  mCreateInfo.pData = pData;
+  return *this;
+}
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetDataSize( uint32_t dataSizeInBytes )
+{
+  mCreateInfo.dataSizeInBytes = dataSizeInBytes;
+  return *this;
+}
+
+Dali::Graphics::TextureFactory::PointerType GraphicsTextureFactory::Create() const
+{
+  return std::unique_ptr<GraphicsTexture>( new GraphicsTexture( mController, mCreateInfo ) );
+}
+
+void GraphicsTextureFactory::TestReset()
+{
+  mCreateInfo = GraphicsTextureCreateInfo {};
+}
+
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetNativeImage( Dali::NativeImageInterfacePtr nativeImageInterface )
+{
+  return *this;
+}
+
+Dali::Graphics::TextureFactory& GraphicsTextureFactory::SetTiling( Dali::Graphics::TextureTiling tiling )
+{
+  return *this;
+}
+
+} // Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture-factory.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture-factory.h
new file mode 100644 (file)
index 0000000..299cff3
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef TEST_GRAPHICS_TEXTURE_FACTORY_H
+#define TEST_GRAPHICS_TEXTURE_FACTORY_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/graphics-api/graphics-api-texture-factory.h>
+#include "test-graphics-texture.h"
+
+namespace Test
+{
+class GraphicsController;
+
+class GraphicsTextureFactory : public Dali::Graphics::TextureFactory
+{
+public:
+  GraphicsTextureFactory(GraphicsController* controller);
+  virtual ~GraphicsTextureFactory();
+
+  Dali::Graphics::TextureFactory& SetType(Dali::Graphics::TextureDetails::Type type) override;
+  Dali::Graphics::TextureFactory& SetSize(const Dali::Graphics::Extent2D& size) override;
+  Dali::Graphics::TextureFactory& SetFormat(Dali::Graphics::TextureDetails::Format format) override;
+  Dali::Graphics::TextureFactory& SetMipMapFlag(Dali::Graphics::TextureDetails::MipMapFlag mipMapFlag) override;
+  Dali::Graphics::TextureFactory& SetUsage( Dali::Graphics::TextureDetails::Usage usage ) override;
+  Dali::Graphics::TextureFactory& SetData( void* pData ) override;
+  Dali::Graphics::TextureFactory& SetDataSize( uint32_t dataSizeInBytes ) override;
+  Dali::Graphics::TextureFactory::PointerType Create() const override;
+  Dali::Graphics::TextureFactory& SetNativeImage( Dali::NativeImageInterfacePtr nativeImageInterface ) override;
+  Dali::Graphics::TextureFactory& SetTiling( Dali::Graphics::TextureTiling tiling ) override;
+
+
+public: // Test Methods
+  void TestReset();
+
+
+public:
+  GraphicsController& mController;
+  GraphicsTextureCreateInfo mCreateInfo;
+};
+
+} // Test
+
+#endif //TEST_GRAPHICS_TEXTURE_FACTORY_H
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture.cpp
new file mode 100644 (file)
index 0000000..0c909fb
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test-graphics-texture.h"
+#include "test-graphics-controller.h"
+
+namespace Test
+{
+
+GraphicsTexture::GraphicsTexture(GraphicsController& controller, const GraphicsTextureCreateInfo& createInfo)
+: mController(controller),
+  mCreateInfo( createInfo )
+{
+}
+
+GraphicsTexture::~GraphicsTexture()
+{
+  mController.DestroyTexture(this);
+}
+
+void GraphicsTexture::CopyMemory(
+  const void *srcMemory, uint32_t srcMemorySize, Dali::Graphics::Extent2D srcExtent, Dali::Graphics::Offset2D dstOffset,
+  uint32_t layer, uint32_t level, Dali::Graphics::TextureDetails::UpdateMode updateMode )
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["srcMemory"] = Dali::Any(srcMemory);
+  namedParams["srcMemorySize"] = Dali::Any( srcMemorySize );
+  namedParams["srcExtent.width"] = Dali::Any( srcExtent.width );
+  namedParams["srcExtent.height"] = Dali::Any( srcExtent.height );
+  namedParams["dstOffset.x"] = Dali::Any( dstOffset.x );
+  namedParams["dstOffset.y"] = Dali::Any( dstOffset.y );
+  namedParams["layer"] = Dali::Any( layer );
+  namedParams["level"] = Dali::Any( level );
+  namedParams["updateMode"] = Dali::Any( int(updateMode) );
+  mController.mTextureTrace.PushCall("CopyMemory", namedParams);
+}
+
+void GraphicsTexture::CopyTexture(
+  const Dali::Graphics::Texture &srcTexture, Dali::Graphics::Rect2D srcRegion, Dali::Graphics::Offset2D dstOffset,
+  uint32_t layer, uint32_t level, Dali::Graphics::TextureDetails::UpdateMode updateMode )
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["srcRegion.width"] = Dali::Any( srcRegion.width );
+  namedParams["srcRegion.height"] = Dali::Any( srcRegion.height );
+  namedParams["srcRegion.x"] = Dali::Any( srcRegion.x );
+  namedParams["srcRegion.y"] = Dali::Any( srcRegion.y );
+  namedParams["dstOffset.x"] = Dali::Any( dstOffset.x );
+  namedParams["dstOffset.y"] = Dali::Any( dstOffset.y );
+  namedParams["layer"] = Dali::Any( layer );
+  namedParams["level"] = Dali::Any( level );
+  namedParams["updateMode"] = Dali::Any( int(updateMode) );
+  mController.mTextureTrace.PushCall("CopyMemory", namedParams);
+}
+
+
+void GraphicsTexture::CopyBuffer(
+  const Dali::Graphics::Buffer &srcBuffer,
+  uint32_t bufferOffset,
+  Dali::Graphics::Extent2D srcExtent,
+  Dali::Graphics::Offset2D dstOffset,
+  uint32_t layer,
+  uint32_t level,
+  Dali::Graphics::TextureUpdateFlags flags )
+{
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["bufferOffset"] = Dali::Any( bufferOffset );
+  namedParams["srcExtent.width"] = Dali::Any( srcExtent.width );
+  namedParams["srcExtent.height"] = Dali::Any( srcExtent.height );
+  namedParams["dstOffset.x"] = Dali::Any( dstOffset.x );
+  namedParams["dstOffset.y"] = Dali::Any( dstOffset.y );
+  namedParams["layer"] = Dali::Any( layer );
+  namedParams["level"] = Dali::Any( level );
+  namedParams["flags"] = Dali::Any( int(flags) );
+  mController.mTextureTrace.PushCall("CopyBuffer", namedParams);
+}
+
+Dali::Graphics::MemoryRequirements GraphicsTexture::GetMemoryRequirements() const
+{
+  Dali::Graphics::MemoryRequirements retval{};
+  retval.alignment = size_t(0u);
+  retval.size = size_t(0u);
+  return retval;
+}
+
+const Dali::Graphics::TextureProperties& GraphicsTexture::GetProperties()
+{
+  if(!mProperties)
+  {
+    mProperties = std::move(std::make_unique<Dali::Graphics::TextureProperties>());
+    mProperties->compressed = false;
+    mProperties->packed = true;
+    mProperties->emulated = false;
+    mProperties->format = Dali::Graphics::Format::R8G8B8A8_UNORM;
+    mProperties->format1 = Dali::Graphics::Format::R8G8B8A8_UNORM;
+    mProperties->extent2D = { 100, 100 };
+    mProperties->directWriteAccessEnabled = false;
+  }
+
+  return *mProperties;
+}
+
+
+
+} // namespace Test
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture.h b/automated-tests/src/dali/dali-test-suite-utils/test-graphics-texture.h
new file mode 100644 (file)
index 0000000..2ea6b39
--- /dev/null
@@ -0,0 +1,74 @@
+#ifndef TEST_GRAPHICS_TEXTURE_H
+#define TEST_GRAPHICS_TEXTURE_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/graphics-api/graphics-api-texture.h>
+#include <memory>
+
+namespace Test
+{
+class GraphicsController;
+
+struct GraphicsTextureCreateInfo
+{
+  Dali::Graphics::TextureDetails::Type type;
+  Dali::Graphics::Extent2D size;
+  Dali::Graphics::TextureDetails::Format format;
+  Dali::Graphics::TextureDetails::MipMapFlag mipMapFlag;
+  Dali::Graphics::TextureDetails::Usage usage;
+  void* pData;
+  uint32_t dataSizeInBytes;
+};
+
+class GraphicsTexture : public Dali::Graphics::Texture
+{
+public:
+  explicit GraphicsTexture(GraphicsController& controller, const GraphicsTextureCreateInfo& createInfo);
+
+  ~GraphicsTexture() override;
+
+  void CopyMemory( const void *srcMemory, uint32_t srcMemorySize, Dali::Graphics::Extent2D srcExtent,
+                   Dali::Graphics::Offset2D dstOffset, uint32_t layer, uint32_t level,
+                   Dali::Graphics::TextureDetails::UpdateMode updateMode ) override;
+
+  void CopyTexture( const Dali::Graphics::Texture &srcTexture, Dali::Graphics::Rect2D srcRegion,
+                    Dali::Graphics::Offset2D dstOffset, uint32_t layer, uint32_t level,
+                    Dali::Graphics::TextureDetails::UpdateMode updateMode ) override;
+
+  void CopyBuffer( const Dali::Graphics::Buffer &srcBuffer,
+                   uint32_t bufferOffset,
+                   Dali::Graphics::Extent2D srcExtent,
+                   Dali::Graphics::Offset2D dstOffset,
+                   uint32_t layer,
+                   uint32_t level,
+                   Dali::Graphics::TextureUpdateFlags flags ) override;
+
+  Dali::Graphics::MemoryRequirements GetMemoryRequirements() const override;
+
+  const Dali::Graphics::TextureProperties& GetProperties() override;
+
+public:
+  GraphicsController& mController;
+  GraphicsTextureCreateInfo mCreateInfo;
+  std::unique_ptr<Dali::Graphics::TextureProperties> mProperties;
+};
+
+} // namespace Test
+
+#endif // TEST_GRAPHICS_TEXTURE_H
index 645d74b..677e814 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
 namespace TestHarness
 {
 
-typedef std::map<int, TestCase> RunningTestCases;
+typedef std::map<int32_t, TestCase> RunningTestCases;
 
 const char* basename(const char* path)
 {
@@ -41,9 +41,9 @@ const char* basename(const char* path)
   return slash;
 }
 
-int RunTestCase( struct ::testcase_s& testCase )
+int32_t RunTestCase( struct ::testcase_s& testCase )
 {
-  int result = EXIT_STATUS_TESTCASE_FAILED;
+  int32_t result = EXIT_STATUS_TESTCASE_FAILED;
 
 // dont want to catch exception as we want to be able to get
 // gdb stack trace from the first error
@@ -69,11 +69,11 @@ int RunTestCase( struct ::testcase_s& testCase )
 }
 
 
-int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutput )
+int32_t RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutput )
 {
-  int testResult = EXIT_STATUS_TESTCASE_FAILED;
+  int32_t testResult = EXIT_STATUS_TESTCASE_FAILED;
 
-  int pid = fork();
+  int32_t pid = fork();
   if( pid == 0 ) // Child process
   {
     if( suppressOutput )
@@ -84,12 +84,12 @@ int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutpu
     else
     {
       printf("\n");
-      for(int i=0; i<80; ++i) printf("#");
+      for(int32_t i=0; i<80; ++i) printf("#");
       printf("\nTC: %s\n", testCase.name);
       fflush(stdout);
     }
 
-    int status = RunTestCase( testCase );
+    int32_t status = RunTestCase( testCase );
 
     if( ! suppressOutput )
     {
@@ -107,8 +107,8 @@ int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutpu
   }
   else // Parent process
   {
-    int status = 0;
-    int childPid = waitpid(pid, &status, 0);
+    int32_t status = 0;
+    int32_t childPid = waitpid(pid, &status, 0);
     if( childPid == -1 )
     {
       perror("waitpid");
@@ -127,7 +127,7 @@ int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutpu
     }
     else if(WIFSIGNALED(status) )
     {
-      int signal = WTERMSIG(status);
+      int32_t signal = WTERMSIG(status);
       testResult = EXIT_STATUS_TESTCASE_ABORTED;
       if( signal == SIGABRT )
       {
@@ -148,7 +148,7 @@ int RunTestCaseInChildProcess( struct ::testcase_s& testCase, bool suppressOutpu
   return testResult;
 }
 
-void OutputStatistics( const char* processName, int numPasses, int numFailures )
+void OutputStatistics( const char* processName, int32_t numPasses, int32_t numFailures )
 {
   FILE* fp=fopen("summary.xml", "a");
   if( fp != NULL )
@@ -175,15 +175,15 @@ void OutputStatistics( const char* processName, int numPasses, int numFailures )
   }
 }
 
-int RunAll( const char* processName, ::testcase tc_array[] )
+int32_t RunAll( const char* processName, ::testcase tc_array[] )
 {
-  int numFailures = 0;
-  int numPasses = 0;
+  int32_t numFailures = 0;
+  int32_t numPasses = 0;
 
   // Run test cases in child process( to kill output/handle signals ), but run serially.
-  for( unsigned int i=0; tc_array[i].name; i++)
+  for( uint32_t i=0; tc_array[i].name; i++)
   {
-    int result = RunTestCaseInChildProcess( tc_array[i], false );
+    int32_t result = RunTestCaseInChildProcess( tc_array[i], false );
     if( result == 0 )
     {
       numPasses++;
@@ -200,26 +200,26 @@ int RunAll( const char* processName, ::testcase tc_array[] )
 }
 
 // Constantly runs up to MAX_NUM_CHILDREN processes
-int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRunFailed)
+int32_t RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRunFailed)
 {
-  int numFailures = 0;
-  int numPasses = 0;
+  int32_t numFailures = 0;
+  int32_t numPasses = 0;
 
   RunningTestCases children;
-  std::vector<int> failedTestCases;
+  std::vector<int32_t> failedTestCases;
 
   // Fork up to MAX_NUM_CHILDREN processes, then
   // wait. As soon as a proc completes, fork the next.
 
-  int nextTestCase = 0;
-  int numRunningChildren = 0;
+  int32_t nextTestCase = 0;
+  int32_t numRunningChildren = 0;
 
   while( tc_array[nextTestCase].name || numRunningChildren > 0)
   {
     // Create more children (up to the max number or til the end of the array)
     while( numRunningChildren < MAX_NUM_CHILDREN && tc_array[nextTestCase].name )
     {
-      int pid = fork();
+      int32_t pid = fork();
       if( pid == 0 ) // Child process
       {
         close(STDOUT_FILENO);
@@ -242,8 +242,8 @@ int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRu
 
     // Wait for the next child to finish
 
-    int status=0;
-    int childPid = waitpid(-1, &status, 0);
+    int32_t status=0;
+    int32_t childPid = waitpid(-1, &status, 0);
     if( childPid == -1 )
     {
       perror("waitpid");
@@ -254,7 +254,7 @@ int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRu
     {
       if( childPid > 0 )
       {
-        int testResult = WEXITSTATUS(status);
+        int32_t testResult = WEXITSTATUS(status);
         if( testResult )
         {
           printf("Test case %s failed: %d\n", children[childPid].testCaseName, testResult);
@@ -296,12 +296,12 @@ int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRu
 
   if( reRunFailed )
   {
-    for( unsigned int i=0; i<failedTestCases.size(); i++)
+    for( uint32_t i=0; i<failedTestCases.size(); i++)
     {
       char* testCaseStrapline;
-      int numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name );
+      int32_t numChars = asprintf(&testCaseStrapline, "Test case %s", tc_array[failedTestCases[i]].name );
       printf("\n%s\n", testCaseStrapline);
-      for(int j=0; j<numChars; j++)
+      for(int32_t j=0; j<numChars; j++)
       {
         printf("=");
       }
@@ -315,11 +315,11 @@ int RunAllInParallel(  const char* processName, ::testcase tc_array[], bool reRu
 
 
 
-int FindAndRunTestCase(::testcase tc_array[], const char* testCaseName)
+int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName)
 {
-  int result = EXIT_STATUS_TESTCASE_NOT_FOUND;
+  int32_t result = EXIT_STATUS_TESTCASE_NOT_FOUND;
 
-  for( int i = 0; tc_array[i].name; i++ )
+  for( int32_t i = 0; tc_array[i].name; i++ )
   {
     if( !strcmp(testCaseName, tc_array[i].name) )
     {
index 53ac0b9..e40492c 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_HARNESS_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
 
 #include <stdio.h>
 #include <testcase.h>
+#include <cstdint>
 
 namespace TestHarness
 {
@@ -34,11 +35,11 @@ enum ExitStatus
   EXIT_STATUS_TESTCASE_NOT_FOUND    // 6
 };
 
-const int MAX_NUM_CHILDREN(16);
+const int32_t MAX_NUM_CHILDREN(16);
 
 struct TestCase
 {
-  int testCase;
+  int32_t testCase;
   const char* testCaseName;
 
   TestCase()
@@ -47,7 +48,7 @@ struct TestCase
   {
   }
 
-  TestCase(int tc, const char* name)
+  TestCase(int32_t tc, const char* name)
   : testCase(tc),
     testCaseName(name)
   {
@@ -70,7 +71,7 @@ struct TestCase
  * Run a test case
  * @param[in] testCase The Testkit-lite test case to run
  */
-int RunTestCase( struct testcase_s& testCase );
+int32_t RunTestCase( struct testcase_s& testCase );
 
 /**
  * Run all test cases in parallel
@@ -79,7 +80,7 @@ int RunTestCase( struct testcase_s& testCase );
  * @param[in] reRunFailed True if failed test cases should be re-run
  * @return 0 on success
  */
-int RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFailed);
+int32_t RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFailed);
 
 /**
  * Run all test cases in serial
@@ -87,7 +88,7 @@ int RunAllInParallel(const char* processName, testcase tc_array[], bool reRunFai
  * @param[in] tc_array The array of auto-generated testkit-lite test cases
  * @return 0 on success
  */
-int RunAll( const char* processName, testcase tc_array[] );
+int32_t RunAll( const char* processName, testcase tc_array[] );
 
 /**
  * Find the named test case in the given array, and run it
@@ -95,7 +96,7 @@ int RunAll( const char* processName, testcase tc_array[] );
  * @param[in] testCaseName the name of the test case to run
  * @return 0 on success
  */
-int FindAndRunTestCase(::testcase tc_array[], const char* testCaseName);
+int32_t FindAndRunTestCase(::testcase tc_array[], const char* testCaseName);
 
 /**
  * Display usage instructions for this program
index da4e7e8..ee6c17a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 namespace Dali
 {
 
-TestNativeImagePointer TestNativeImage::New(int width, int height)
+TestNativeImagePointer TestNativeImage::New(uint32_t width, uint32_t height)
 {
   return new TestNativeImage(width, height);
 }
 
-TestNativeImage::TestNativeImage(int width, int height)
+TestNativeImage::TestNativeImage(uint32_t width, uint32_t height)
 : mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
 {
   mExtension = new TestNativeImageExtension();
@@ -39,12 +39,12 @@ TestNativeImage::~TestNativeImage()
 }
 
 
-TestNativeImageNoExtPointer TestNativeImageNoExt::New(int width, int height)
+TestNativeImageNoExtPointer TestNativeImageNoExt::New(uint32_t width, uint32_t height)
 {
   return new TestNativeImageNoExt(width, height);
 }
 
-TestNativeImageNoExt::TestNativeImageNoExt(int width, int height)
+TestNativeImageNoExt::TestNativeImageNoExt(uint32_t width, uint32_t height)
 : mWidth(width), mHeight(height), mExtensionCreateCalls(0), mExtensionDestroyCalls(0), mTargetTextureCalls(0),createResult(true)
 {
 }
index 5cb4b27..3ae10bc 100644 (file)
@@ -2,7 +2,7 @@
 #define __TEST_NATIVE_IMAGE_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/images/native-image-interface.h>
 #include <dali/devel-api/images/native-image-interface-extension.h>
-#include <dali/integration-api/gl-defines.h>
+
 
 namespace Dali
 {
@@ -33,38 +33,41 @@ typedef IntrusivePtr<TestNativeImageNoExt> TestNativeImageNoExtPointer;
 class DALI_CORE_API TestNativeImageExtension: public Dali::NativeImageInterface::Extension
 {
 public:
+
   inline const char* GetCustomFragmentPreFix(){return "#extension GL_OES_EGL_image_external:require\n";}
   inline const char* GetCustomSamplerTypename(){return "samplerExternalOES";}
 
-  inline int GetEglImageTextureTarget(){return GL_TEXTURE_EXTERNAL_OES;}
+  inline int32_t GetEglImageTextureTarget(){return 0x8D65;} // GL_TEXTURE_EXTERNAL_OES
+  inline bool IsSetSource() const {return false;}
+  inline Any GetNativeImageHandle() const {return Dali::Any();}
 
 };
 
 class DALI_CORE_API TestNativeImage : public Dali::NativeImageInterface
 {
 public:
-  static TestNativeImagePointer New(int width, int height);
+  static TestNativeImagePointer New(uint32_t width, uint32_t height);
 
   inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
   inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
   inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
-  inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 0;};
+  inline virtual uint32_t TargetTexture() { ++mTargetTextureCalls; return 0;};
   inline virtual void PrepareTexture() {};
-  inline virtual unsigned int GetWidth() const {return mWidth;};
-  inline virtual unsigned int GetHeight() const {return mHeight;};
+  inline virtual uint32_t GetWidth() const {return mWidth;};
+  inline virtual uint32_t GetHeight() const {return mHeight;};
   inline virtual bool RequiresBlending() const {return true;};
   inline virtual Dali::NativeImageInterface::Extension* GetExtension() {return mExtension;}
 
 private:
-  TestNativeImage(int width, int height);
+  TestNativeImage(uint32_t width, uint32_t height);
   virtual ~TestNativeImage();
 
-  int mWidth;
-  int mHeight;
+  uint32_t mWidth;
+  uint32_t mHeight;
 public:
-  int mExtensionCreateCalls;
-  int mExtensionDestroyCalls;
-  int mTargetTextureCalls;
+  int32_t mExtensionCreateCalls;
+  int32_t mExtensionDestroyCalls;
+  int32_t mTargetTextureCalls;
 
   bool createResult;
   TestNativeImageExtension* mExtension;
@@ -74,30 +77,31 @@ public:
 class DALI_CORE_API TestNativeImageNoExt : public Dali::NativeImageInterface
 {
 public:
-  static TestNativeImageNoExtPointer New(int width, int height);
+  static TestNativeImageNoExtPointer New(uint32_t width, uint32_t height);
 
   inline void SetGlExtensionCreateResult(bool result){ createResult = result;}
   inline virtual bool GlExtensionCreate() { ++mExtensionCreateCalls; return createResult;};
   inline virtual void GlExtensionDestroy() { ++mExtensionDestroyCalls; };
-  inline virtual GLenum TargetTexture() { ++mTargetTextureCalls; return 1;};
+  inline virtual uint32_t TargetTexture() { ++mTargetTextureCalls; return 1;};
   inline virtual void PrepareTexture() {};
-  inline virtual unsigned int GetWidth() const {return mWidth;};
-  inline virtual unsigned int GetHeight() const {return mHeight;};
+  inline virtual uint32_t GetWidth() const {return mWidth;};
+  inline virtual uint32_t GetHeight() const {return mHeight;};
   inline virtual bool RequiresBlending() const {return true;};
 
 private:
-  TestNativeImageNoExt(int width, int height);
+  TestNativeImageNoExt(uint32_t width, uint32_t height);
   virtual ~TestNativeImageNoExt();
 
-  int mWidth;
-  int mHeight;
+  uint32_t mWidth;
+  uint32_t mHeight;
 public:
-  int mExtensionCreateCalls;
-  int mExtensionDestroyCalls;
-  int mTargetTextureCalls;
+  int32_t mExtensionCreateCalls;
+  int32_t mExtensionDestroyCalls;
+  int32_t mTargetTextureCalls;
   bool createResult;
 };
 
 } // Dali
 
+
 #endif
index cb0b39c..4244fdb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
 #include "test-platform-abstraction.h"
 #include "dali-test-suite-utils.h"
 #include <dali/integration-api/bitmap.h>
+#include "test-trace-call-stack.h"
 
 namespace Dali
 {
@@ -43,8 +44,14 @@ ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string&
                                                               SamplingMode::Type samplingMode,
                                                               bool orientationCorrection )
 {
-  ImageDimensions closestSize = ImageDimensions( mClosestSize.x, mClosestSize.y );
-  mTrace.PushCall("GetClosestImageSize", "");
+  ImageDimensions closestSize = ImageDimensions( mClosestSize );
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["filename"] = Dali::Any(filename);
+  namedParams["size"] = Dali::Any(size);
+  namedParams["fittingMode"] = Dali::Any(fittingMode);
+  namedParams["samplingMode"] = Dali::Any(samplingMode);
+  namedParams["orientationCorrection"] = Dali::Any(orientationCorrection);
+  mTrace.PushCall("GetClosestImageSize", namedParams);
   return closestSize;
 }
 
@@ -54,26 +61,35 @@ ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::Resou
                                                    SamplingMode::Type samplingMode,
                                                    bool orientationCorrection )
 {
-  ImageDimensions closestSize = ImageDimensions( mClosestSize.x, mClosestSize.y );
-  mTrace.PushCall("GetClosestImageSize", "");
+  ImageDimensions closestSize = ImageDimensions( mClosestSize );
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["size"] = Dali::Any(size);
+  namedParams["fittingMode"] = Dali::Any(int(fittingMode));
+  namedParams["samplingMode"] = Dali::Any(int(samplingMode));
+  namedParams["orientationCorrection"] = Dali::Any(orientationCorrection);
+  mTrace.PushCall("GetClosestImageSize", namedParams);
   return closestSize;
 }
 
 Integration::ResourcePointer TestPlatformAbstraction::LoadImageSynchronously( const Integration::BitmapResourceType& resourceType, const std::string& resourcePath )
 {
-  mTrace.PushCall("LoadResourceSynchronously", "");
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["resourcePath"] = Dali::Any(resourcePath);
+  mTrace.PushCall("LoadResourceSynchronously", namedParams);
   return mSynchronouslyLoadedResource;
 }
 
 Integration::BitmapPtr TestPlatformAbstraction::DecodeBuffer( const Integration::BitmapResourceType& resourceType, uint8_t * buffer, size_t size )
 {
-  mTrace.PushCall("DecodeBuffer", "");
+  mTrace.PushCall("DecodeBuffer");
   return mDecodedBitmap;
 }
 
 bool TestPlatformAbstraction::LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const
 {
-  mTrace.PushCall("LoadShaderBinaryFile", "");
+  Test::TraceCallStack::NamedParams namedParams;
+  namedParams["filename"]=Dali::Any(filename);
+  mTrace.PushCall("LoadShaderBinaryFile", namedParams);
   if( mLoadFileResult.loadResult )
   {
     buffer = mLoadFileResult.buffer;
@@ -115,9 +131,9 @@ void TestPlatformAbstraction::ClearReadyResources()
   mDecodedBitmap.Reset();
 }
 
-void TestPlatformAbstraction::SetClosestImageSize(const Vector2& size)
+void TestPlatformAbstraction::SetClosestImageSize( const Vector2& size )
 {
-  mClosestSize = size;
+  mClosestSize = ImageDimensions( static_cast<uint32_t>( size.x ), static_cast<uint32_t>( size.y ) );
 }
 
 void TestPlatformAbstraction::SetLoadFileResult( bool result, Dali::Vector< unsigned char >& buffer )
index f31561e..cf2df0f 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TEST_PLATFORM_ABSTRACTION_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -105,7 +105,7 @@ public: // TEST FUNCTIONS
 
   inline void EnableTrace(bool enable) { mTrace.Enable(enable); }
   inline void ResetTrace() { mTrace.Reset(); }
-  inline TraceCallStack& GetTrace() { return mTrace; }
+  inline Test::TraceCallStack& GetTrace() { return mTrace; }
 
   /**
    * @brief Checks if a platform function was called
@@ -129,7 +129,7 @@ public: // TEST FUNCTIONS
    * @brief Sets the value returned by GetClosestImageSize.
    * @param[in] size The size that should be returned.
    */
-  void SetClosestImageSize(const Vector2& size);
+  void SetClosestImageSize( const Vector2& size );
 
   /**
    * @brief Sets the result return by LoadFile.
@@ -175,9 +175,9 @@ private:
     Dali::Vector< unsigned char> buffer;
   };
 
-  mutable TraceCallStack        mTrace;
+  mutable Test::TraceCallStack  mTrace;
   bool                          mIsLoadingResult;
-  Vector2                       mClosestSize;
+  ImageDimensions               mClosestSize;
 
   LoadFileResult                mLoadFileResult;
   bool                          mSaveFileResult;
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-render-surface.cpp b/automated-tests/src/dali/dali-test-suite-utils/test-render-surface.cpp
new file mode 100644 (file)
index 0000000..e205152
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test-render-surface.h"
+
+namespace Dali
+{
+
+TestRenderSurface::TestRenderSurface( Dali::PositionSize positionSize )
+: mPositionSize( positionSize ),
+  mBackgroundColor()
+{
+}
+
+TestRenderSurface::~TestRenderSurface()
+{
+}
+
+Dali::PositionSize TestRenderSurface::GetPositionSize() const
+{
+  return mPositionSize;
+};
+
+void TestRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
+{
+  dpiHorizontal = dpiVertical = 96;
+};
+
+void TestRenderSurface::InitializeGraphics( Dali::Graphics::GraphicsInterface& graphics )
+{
+}
+
+void TestRenderSurface::CreateSurface()
+{
+}
+
+void TestRenderSurface::DestroySurface()
+{
+}
+
+bool TestRenderSurface::ReplaceGraphicsSurface()
+{
+  return false;
+}
+
+void TestRenderSurface::MoveResize( Dali::PositionSize positionSize )
+{
+  mPositionSize = positionSize;
+}
+
+void TestRenderSurface::StartRender()
+{
+}
+
+bool TestRenderSurface::PreRender( bool resizingSurface )
+{
+  return true;
+}
+
+void TestRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
+{
+}
+
+void TestRenderSurface::StopRender()
+{
+}
+
+void TestRenderSurface::ReleaseLock()
+{
+}
+
+Dali::Integration::RenderSurface::Type TestRenderSurface::GetSurfaceType()
+{
+  return WINDOW_RENDER_SURFACE;
+}
+
+void TestRenderSurface::MakeContextCurrent()
+{
+}
+
+Integration::DepthBufferAvailable TestRenderSurface::GetDepthBufferRequired()
+{
+  return Integration::DepthBufferAvailable::TRUE;
+}
+
+Integration::StencilBufferAvailable TestRenderSurface::GetStencilBufferRequired()
+{
+  return Integration::StencilBufferAvailable::TRUE;
+}
+
+void TestRenderSurface::SetBackgroundColor( Vector4 color )
+{
+  mBackgroundColor = color;
+}
+
+Vector4 TestRenderSurface::GetBackgroundColor()
+{
+  return mBackgroundColor;
+}
+
+} // Namespace dali
diff --git a/automated-tests/src/dali/dali-test-suite-utils/test-render-surface.h b/automated-tests/src/dali/dali-test-suite-utils/test-render-surface.h
new file mode 100644 (file)
index 0000000..8faecb6
--- /dev/null
@@ -0,0 +1,155 @@
+#ifndef TEST_REENDER_SURFACE_H
+#define TEST_REENDER_SURFACE_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+#include <dali/integration-api/render-surface.h>
+
+namespace Dali
+{
+
+/**
+ * Concrete implementation of the RenderSurface class.
+ */
+class DALI_CORE_API TestRenderSurface : public Dali::Integration::RenderSurface
+{
+public:
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::RenderSurface
+   */
+  TestRenderSurface( Dali::PositionSize positionSize );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::~RenderSurface
+   */
+  virtual ~TestRenderSurface();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetPositionSize
+   */
+  virtual Dali::PositionSize GetPositionSize() const;
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetDpi
+   */
+  virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::InitializeGraphics
+   */
+  virtual void InitializeGraphics( Dali::Graphics::GraphicsInterface& graphics );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::CreateSurface
+   */
+  virtual void CreateSurface();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::DestroySurface
+   */
+  virtual void DestroySurface();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface
+   */
+  virtual bool ReplaceGraphicsSurface();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::MoveResize
+   */
+  virtual void MoveResize( Dali::PositionSize positionSize );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::StartRender
+   */
+  virtual void StartRender();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::PreRender
+   */
+  virtual bool PreRender( bool resizingSurface );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::PostRender
+   */
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::StopRender
+   */
+  virtual void StopRender();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::ReleaseLock
+   */
+  virtual void ReleaseLock();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetSurfaceType
+   */
+  virtual Dali::Integration::RenderSurface::Type GetSurfaceType();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent
+   */
+  virtual void MakeContextCurrent();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired
+   */
+  virtual Integration::DepthBufferAvailable GetDepthBufferRequired();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired
+   */
+  virtual Integration::StencilBufferAvailable GetStencilBufferRequired();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::SetBackgroundColor
+   */
+  virtual void SetBackgroundColor( Vector4 color );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetBackgroundColor
+   */
+  virtual Vector4 GetBackgroundColor();
+
+private:
+
+  /**
+   * @brief Undefined copy constructor. RenderSurface cannot be copied
+   */
+  TestRenderSurface( const TestRenderSurface& rhs );
+
+  /**
+   * @brief Undefined assignment operator. RenderSurface cannot be copied
+   */
+  TestRenderSurface& operator=( const TestRenderSurface& rhs );
+
+private:
+
+  Dali::PositionSize mPositionSize;
+  Vector4 mBackgroundColor;                                     ///< The background color of the surface
+};
+
+} // Dali
+
+#endif
index f57dc50..2e33223 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+#include "dali-test-suite-utils.h"
 #include "test-trace-call-stack.h"
 #include <sstream>
+#include <cstring>
+#include <unistd.h>
 
-namespace Dali
+namespace Test
 {
-
-std::string ToString(int x)
-{
-  std::stringstream out;
-  out << x;
-  return out.str();
-}
-
-std::string ToString(unsigned int x)
-{
-  std::stringstream out;
-  out << x;
-  return out.str();
-}
-
-std::string ToString(float x)
-{
-  std::stringstream out;
-  out << x;
-  return out.str();
-}
-
 /**
  * Constructor
  */
@@ -59,25 +40,20 @@ void TraceCallStack::Enable(bool enable) { mTraceActive = enable; }
 
 bool TraceCallStack::IsEnabled() { return mTraceActive; }
 
-/**
- * Push a call onto the stack if the trace is active
- * @param[in] method The name of the method
- * @param[in] params A comma separated list of parameter values
- */
-void TraceCallStack::PushCall(std::string method, std::string params)
+void TraceCallStack::PushCall(std::string method)
 {
   if(mTraceActive)
   {
-    FunctionCall stackFrame(method, params);
+    FunctionCall stackFrame(method);
     mCallStack.push_back( stackFrame );
   }
 }
 
-void TraceCallStack::PushCall(std::string method, std::string params, const TraceCallStack::NamedParams& altParams)
+void TraceCallStack::PushCall(std::string method, const TraceCallStack::NamedParams& params)
 {
   if(mTraceActive)
   {
-    FunctionCall stackFrame(method, params, altParams);
+    FunctionCall stackFrame(method, params);
     mCallStack.push_back( stackFrame );
   }
 }
@@ -101,7 +77,7 @@ bool TraceCallStack::FindMethod(std::string method) const
   return found;
 }
 
-bool TraceCallStack::FindMethodAndGetParameters(std::string method, std::string& params ) const
+bool TraceCallStack::FindMethodAndGetParameters(std::string method, NamedParams& params ) const
 {
   bool found = false;
   for( size_t i=0; i < mCallStack.size(); i++ )
@@ -109,7 +85,7 @@ bool TraceCallStack::FindMethodAndGetParameters(std::string method, std::string&
     if( 0 == mCallStack[i].method.compare(method) )
     {
       found = true;
-      params = mCallStack[i].paramList;
+      params = mCallStack[i].namedParams;
       break;
     }
   }
@@ -129,83 +105,101 @@ int TraceCallStack::CountMethod(std::string method) const
   return numCalls;
 }
 
-/**
- * Search for a method in the stack with the given parameter list
- * @param[in] method The name of the method
- * @param[in] params A comma separated list of parameter values
- * @return true if the method was in the stack
- */
-bool TraceCallStack::FindMethodAndParams(std::string method, std::string params) const
-{
-  return FindIndexFromMethodAndParams( method, params ) > -1;
-}
-
-bool TraceCallStack::FindMethodAndParams(std::string method, const NamedParams& params) const
+bool TraceCallStack::FindMethodAndParams(std::string method, const TraceCallStack::NamedParams& params) const
 {
   return FindIndexFromMethodAndParams( method, params ) > -1;
 }
 
-bool TraceCallStack::FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const
+bool AnyEquals( Dali::Any test, Dali::Any match )
 {
-  for( size_t i = startIndex; i < mCallStack.size(); ++i )
+  if( test.GetType() == match.GetType() )
   {
-    if( ( mCallStack[i].method.compare( method ) == 0 ) && ( mCallStack[i].paramList.compare( params ) == 0 ) )
+    if( test.GetType() == typeid(bool) )
     {
-      startIndex = i;
-      return true;
+      return test.Get<bool>() == match.Get<bool>();
     }
-  }
-  return false;
-}
-
-/**
- * Search for a method in the stack with the given parameter list
- * @param[in] method The name of the method
- * @param[in] params A comma separated list of parameter values
- * @return index in the stack where the method was found or -1 otherwise
- */
-int TraceCallStack::FindIndexFromMethodAndParams(std::string method, std::string params) const
-{
-  int index = -1;
-  for( size_t i=0; i < mCallStack.size(); i++ )
-  {
-    if( 0 == mCallStack[i].method.compare(method) && 0 == mCallStack[i].paramList.compare(params) )
+    if( test.GetType() == typeid(size_t) )
     {
-      index = i;
-      break;
+      return test.Get<size_t>() == match.Get<size_t>();
+    }
+    if( test.GetType() == typeid(uint32_t) )
+    {
+      return test.Get<uint32_t>() == match.Get<uint32_t>();
+    }
+    if( test.GetType() == typeid(int32_t) )
+    {
+      return test.Get<int32_t>() == match.Get<int32_t>();
+    }
+    if( test.GetType() == typeid(int) )
+    {
+      return test.Get<int>() == match.Get<int>();
+    }
+    else if( test.GetType() == typeid(float) )
+    {
+      return Equals(test.Get<float>(), match.Get<float>());
+    }
+    else if( test.GetType() == typeid(std::string) )
+    {
+      return test.Get<std::string>() == match.Get<std::string>();
+    }
+    else
+    {
+      //DALI_TEST_CHECK(false); // Fail the test case if it's constructed with an unknown type.
     }
   }
-  return index;
+  return false;
 }
 
-int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const TraceCallStack::NamedParams& params) const
+bool TraceCallStack::FindMethodAndParamsFromStartIndex(
+  std::string method,
+  const TraceCallStack::NamedParams& params,
+  uint32_t& startIndex ) const
 {
-  int index = -1;
-  for( size_t i=0; i < mCallStack.size(); i++ )
+  for( uint32_t i = startIndex; i < uint32_t(mCallStack.size()); ++i )
   {
-    if( 0 == mCallStack[i].method.compare(method) )
+    if( mCallStack[i].method.compare( method ) == 0 )
     {
-      // Test each of the passed in parameters:
-      bool match = true;
-      for( NamedParams::const_iterator iter = params.begin() ; iter != params.end() ; ++iter )
+      bool found = true;
+      auto& namedParams = mCallStack[i].namedParams;
+      for( auto param : params )
       {
-        NamedParams::const_iterator paramIter = mCallStack[i].namedParams.find(iter->first);
-        if( paramIter == params.end() || paramIter->second.compare(iter->second) != 0 )
+        const std::string& paramName = param.first;
+        auto iter = namedParams.find(paramName);
+        if( iter == mCallStack[i].namedParams.end() )
         {
-          match = false;
+          found = false;
           break;
         }
+        else
+        {
+          Any test = iter->second;
+          Any match = param.second;
+          if( !AnyEquals( test, match ) )
+          {
+            found = false;
+            break;
+          }
+        }
       }
-      if( match == true )
+      if(found)
       {
-        index = i;
-        break;
+        startIndex = i;
+        return true;
       }
     }
   }
-  return index;
+  return false;
 }
 
+int32_t TraceCallStack::FindIndexFromMethodAndParams(std::string method, const TraceCallStack::NamedParams& params) const
+{
+  uint32_t index = 0;
+  if( FindMethodAndParamsFromStartIndex( method, params, index ) )
+  {
+    return int32_t(index);
+  }
+  return -1;
+}
 
 /**
  * Test if the given method and parameters are at a given index in the stack
@@ -213,9 +207,10 @@ int TraceCallStack::FindIndexFromMethodAndParams(std::string method, const Trace
  * @param[in] method Name of method to test
  * @param[in] params A comma separated list of parameter values to test
  */
-bool TraceCallStack::TestMethodAndParams(int index, std::string method, std::string params) const
+bool TraceCallStack::TestMethodAndParams(uint32_t index, std::string method, const NamedParams& params) const
 {
-  return ( 0 == mCallStack[index].method.compare(method) && 0 == mCallStack[index].paramList.compare(params) );
+  uint32_t startIndex = index;
+  return( FindMethodAndParamsFromStartIndex( method, params, startIndex ) && startIndex == index );
 }
 
 /**
@@ -226,5 +221,63 @@ void TraceCallStack::Reset()
   mCallStack.clear();
 }
 
+std::ostream& operator<<( std::ostream& o, const Dali::Any& param)
+{
+  if(param.GetType() == typeid(bool))
+  {
+    o << param.Get<bool>();
+  }
+  else if( param.GetType() == typeid(uint32_t) )
+  {
+    o << param.Get<uint32_t>();
+  }
+  else if( param.GetType() == typeid(int32_t) )
+  {
+    o << param.Get<int32_t>();
+  }
+  else if(param.GetType() == typeid(int))
+  {
+    o << param.Get<int>();
+  }
+  else if(param.GetType() == typeid(size_t))
+  {
+    o << param.Get<size_t>();
+  }
+  else if(param.GetType() == typeid(float))
+  {
+    o << param.Get<float>();
+  }
+  else if(param.GetType() == typeid(std::string))
+  {
+    o << param.Get<std::string>();
+  }
+  return o;
+}
+
+std::ostream& operator<<( std::ostream& o, const TraceCallStack::NamedParams& params)
+{
+  bool first = true;
+  for( auto& param : params )
+  {
+    if(!first) o << ", ";
+    first = false;
+    o << param.first << ":" << param.second;
+  }
+  return o;
+}
+
+std::string TraceCallStack::GetTraceString()
+{
+  std::stringstream traceStream;
+  std::size_t functionCount = mCallStack.size();
+  for( std::size_t i = 0; i < functionCount; ++i )
+  {
+    Test::TraceCallStack::FunctionCall functionCall = mCallStack[ i ];
+    traceStream << "StackTrace: Index:" << i << ", " << functionCall.method << "(" << functionCall.namedParams << ")"<<std::endl;
+  }
+
+  return traceStream.str();
+}
+
 
-} // namespace Dali
+} // namespace Test
index d32f619..45acf8c 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_TRACE_CALL_STACK_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <string>
 #include <vector>
 #include <map>
+#include <ostream>
 #include <sstream>
+#include <dali/public-api/object/any.h>
 
-namespace Dali
+namespace Test
 {
 
-template<typename T>
-std::string ToString(const T& x)
-{
-  return "undefined";
-}
-
-std::string ToString(int x);
-std::string ToString(unsigned int x);
-std::string ToString(float x);
-
 /**
  * Helper class to track method calls in the abstraction and search for them in test cases
  */
@@ -43,8 +35,8 @@ class TraceCallStack
 {
 public:
 
-  /// Typedef for passing and storing named parameters
-  typedef std::map< std::string, std::string > NamedParams;
+  typedef std::map< std::string, Dali::Any > NamedParams;
+  friend std::ostream& operator<<( std::ostream& o, const TraceCallStack::NamedParams& params);
 
   /**
    * Constructor
@@ -66,17 +58,15 @@ public:
   /**
    * Push a call onto the stack if the trace is active
    * @param[in] method The name of the method
-   * @param[in] params A comma separated list of parameter values
+   * @param[in] params A map of named parameter values
    */
-  void PushCall(std::string method, std::string params);
+  void PushCall(std::string method, const NamedParams& params);
 
   /**
    * Push a call onto the stack if the trace is active
    * @param[in] method The name of the method
-   * @param[in] params A comma separated list of parameter values
-   * @param[in] altParams A map of named parameter values
    */
-  void PushCall(std::string method, std::string params, const NamedParams& altParams);
+  void PushCall(std::string method);
 
   /**
    * Search for a method in the stack
@@ -91,7 +81,7 @@ public:
    * @param[out] params of the method
    * @return true if the method was in the stack
    */
-  bool FindMethodAndGetParameters(std::string method, std::string& params ) const;
+  bool FindMethodAndGetParameters(std::string method, NamedParams& params ) const;
 
   /**
    * Count how many times a method was called
@@ -103,18 +93,18 @@ public:
   /**
    * Search for a method in the stack with the given parameter list
    * @param[in] method The name of the method
-   * @param[in] params A comma separated list of parameter values
+   * @param[in] params A map of named parameters to match
    * @return true if the method was in the stack
    */
-  bool FindMethodAndParams(std::string method, std::string params) const;
+  bool FindMethodAndParams(std::string method, const NamedParams& params) const;
 
   /**
    * Search for a method in the stack with the given parameter list
    * @param[in] method The name of the method
-   * @param[in] params A map of named parameters to test for
-   * @return true if the method was in the stack
+   * @param[in] params A map of named parameters to match
+   * @return index in the stack where the method was found or -1 otherwise
    */
-  bool FindMethodAndParams(std::string method, const NamedParams& params) const;
+  int32_t FindIndexFromMethodAndParams(std::string method, const NamedParams& params) const;
 
   /**
    * Search for a method in the stack with the given parameter list.
@@ -127,31 +117,15 @@ public:
    *                calls can search for methods occuring after this one.
    * @return True if the method was in the stack
    */
-  bool FindMethodAndParamsFromStartIndex( std::string method, std::string params, size_t& startIndex ) const;
-
-  /**
-   * Search for a method in the stack with the given parameter list
-   * @param[in] method The name of the method
-   * @param[in] params A comma separated list of parameter values
-   * @return index in the stack where the method was found or -1 otherwise
-   */
-  int FindIndexFromMethodAndParams(std::string method, std::string params) const;
-
-  /**
-   * Search for a method in the stack with the given parameter list
-   * @param[in] method The name of the method
-   * @param[in] params A map of named parameter values to match
-   * @return index in the stack where the method was found or -1 otherwise
-   */
-  int FindIndexFromMethodAndParams(std::string method, const NamedParams& params) const;
+  bool FindMethodAndParamsFromStartIndex( std::string method, const NamedParams& params, uint32_t& startIndex ) const;
 
   /**
    * Test if the given method and parameters are at a given index in the stack
    * @param[in] index Index in the call stack
    * @param[in] method Name of method to test
-   * @param[in] params A comma separated list of parameter values to test
+   * @param[in] params A map of named parameter values to match
    */
-  bool TestMethodAndParams(int index, std::string method, std::string params) const;
+  bool TestMethodAndParams(uint32_t index, std::string method, const NamedParams& params) const;
 
   /**
    * Reset the call stack
@@ -162,18 +136,7 @@ public:
    * Method to display contents of the TraceCallStack.
    * @return A string containing a list of function calls and parameters (may contain newline characters)
    */
-  std::string GetTraceString()
-  {
-    std::stringstream traceStream;
-    int functionCount = mCallStack.size();
-    for( int i = 0; i < functionCount; ++i )
-    {
-      Dali::TraceCallStack::FunctionCall functionCall = mCallStack[ i ];
-      traceStream << "StackTrace: Index:" << i << ",  Function:" << functionCall.method << ",  ParamList:" << functionCall.paramList << std::endl;
-    }
-
-    return traceStream.str();
-  }
+  std::string GetTraceString();
 
 private:
   bool mTraceActive; ///< True if the trace is active
@@ -181,14 +144,13 @@ private:
   struct FunctionCall
   {
     std::string method;
-    std::string paramList;
     NamedParams namedParams;
-    FunctionCall( const std::string& aMethod, const std::string& aParamList )
-    : method( aMethod ), paramList( aParamList )
+    FunctionCall( const std::string& aMethod, const NamedParams& params )
+    : method( aMethod ), namedParams( params )
     {
     }
-    FunctionCall( const std::string& aMethod, const std::string& aParamList, const NamedParams& altParams )
-    : method( aMethod ), paramList( aParamList ), namedParams( altParams )
+    FunctionCall( const std::string& aMethod )
+    : method( aMethod )
     {
     }
   };
@@ -196,6 +158,8 @@ private:
   std::vector< FunctionCall > mCallStack; ///< The call stack
 };
 
-} // namespace dali
+std::ostream& operator<<( std::ostream& o, const TraceCallStack::NamedParams& params);
+
+} // namespace Test
 
 #endif // TEST_TRACE_CALL_STACK_H
index 04b74f1..ff6b14d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -246,6 +246,40 @@ struct VisibilityChangedVoidFunctor
   bool& mSignalCalled;
 };
 
+struct ChildOrderChangedFunctor
+{
+  ChildOrderChangedFunctor(bool& signalCalled, Actor& actor)
+  : mSignalCalled( signalCalled ),
+    mActor( actor )
+  { }
+
+  void operator()( Actor actor )
+  {
+    mSignalCalled  = true;
+    mActor = actor;
+  }
+
+  bool& mSignalCalled;
+  Actor& mActor;
+};
+
+struct CulledPropertyNotificationFunctor
+{
+  CulledPropertyNotificationFunctor( bool& signalCalled, PropertyNotification& propertyNotification )
+  : mSignalCalled( signalCalled ),
+    mPropertyNotification( propertyNotification )
+  { }
+
+  void operator()( PropertyNotification& source )
+  {
+    mSignalCalled  = true;
+    mPropertyNotification = source;
+  }
+
+  bool& mSignalCalled;
+  PropertyNotification& mPropertyNotification;
+};
+
 } // anonymous namespace
 
 
@@ -1519,55 +1553,6 @@ int UtcDaliActorGetCurrentWorldPosition(void)
   END_TEST;
 }
 
-int UtcDaliActorInheritPosition(void)
-{
-  tet_infoline("Testing Actor::SetPositionInheritanceMode");
-  TestApplication application;
-
-  Actor parent = Actor::New();
-  Vector3 parentPosition( 1.0f, 2.0f, 3.0f );
-  parent.SetPosition( parentPosition );
-  parent.SetParentOrigin( ParentOrigin::CENTER );
-  parent.SetAnchorPoint( AnchorPoint::CENTER );
-  Stage::GetCurrent().Add( parent );
-
-  Actor child = Actor::New();
-  child.SetParentOrigin( ParentOrigin::CENTER );
-  child.SetAnchorPoint( AnchorPoint::CENTER );
-  Vector3 childPosition( 10.0f, 11.0f, 12.0f );
-  child.SetPosition( childPosition );
-  parent.Add( child );
-
-  // The actors should not have a world position yet
-  DALI_TEST_EQUALS( parent.GetCurrentWorldPosition(), Vector3::ZERO, TEST_LOCATION );
-  DALI_TEST_EQUALS( child.GetCurrentWorldPosition(), Vector3::ZERO, TEST_LOCATION );
-
-  // first test default, which is to inherit position
-  DALI_TEST_EQUALS( child.GetPositionInheritanceMode(), Dali::INHERIT_PARENT_POSITION, TEST_LOCATION );
-  application.SendNotification();
-  application.Render(0); // should only really call Update as Render is not required to update scene
-  DALI_TEST_EQUALS( parent.GetCurrentPosition(), parentPosition, TEST_LOCATION );
-  DALI_TEST_EQUALS( child.GetCurrentPosition(), childPosition, TEST_LOCATION );
-  DALI_TEST_EQUALS( parent.GetCurrentWorldPosition(), parentPosition, TEST_LOCATION );
-  DALI_TEST_EQUALS( child.GetCurrentWorldPosition(), parentPosition + childPosition, TEST_LOCATION );
-
-
-  //Change child position
-  Vector3 childOffset( -1.0f, 1.0f, 0.0f );
-  child.SetPosition( childOffset );
-
-  // Change inheritance mode to not inherit
-  child.SetPositionInheritanceMode( Dali::DONT_INHERIT_POSITION );
-  DALI_TEST_EQUALS( child.GetPositionInheritanceMode(), Dali::DONT_INHERIT_POSITION, TEST_LOCATION );
-  application.SendNotification();
-  application.Render(0); // should only really call Update as Render is not required to update scene
-  DALI_TEST_EQUALS( parent.GetCurrentPosition(), parentPosition, TEST_LOCATION );
-  DALI_TEST_EQUALS( child.GetCurrentPosition(), childOffset, TEST_LOCATION );
-  DALI_TEST_EQUALS( parent.GetCurrentWorldPosition(), parentPosition, TEST_LOCATION );
-  DALI_TEST_EQUALS( child.GetCurrentWorldPosition(), childOffset, TEST_LOCATION );
-  END_TEST;
-}
-
 int UtcDaliActorSetInheritPosition(void)
 {
   tet_infoline("Testing Actor::SetInheritPosition");
@@ -1626,6 +1611,41 @@ int UtcDaliActorSetInheritPosition(void)
   END_TEST;
 }
 
+int UtcDaliActorInheritOpacity(void)
+{
+  tet_infoline("Testing Actor::Inherit Opacity");
+  TestApplication application;
+
+  Actor parent = Actor::New();
+  Actor child = Actor::New();
+  parent.Add( child );
+  Stage::GetCurrent().Add( parent );
+
+  DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
+
+  // flush the queue and render once
+  application.SendNotification();
+  application.Render();
+
+  parent.SetOpacity( 0.1f );
+
+  DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 0.1f, 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( parent.GetCurrentProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 0.1f, 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( parent.GetCurrentProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetCurrentProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( child.GetCurrentProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.f, 0.0001f, TEST_LOCATION );
+
+  END_TEST;
+}
+
 // SetOrientation(float angleRadians, Vector3 axis)
 int UtcDaliActorSetOrientation01(void)
 {
@@ -2857,37 +2877,37 @@ int UtcDaliActorSetDrawMode(void)
   END_TEST;
 }
 
+TextureSet CreateTexture(uint32_t width, uint32_t height)
+{
+  uint32_t size = 4*width*height;
+  uint8_t *b = new uint8_t[size];
+  PixelData p = PixelData::New(b, size, width, height, Pixel::RGBA8888, PixelData::DELETE_ARRAY);
+  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height);
+  texture.Upload(p);
+  TextureSet textureSet = TextureSet::New();
+  textureSet.SetTexture(0, texture);
+  return textureSet;
+}
+
 int UtcDaliActorSetDrawModeOverlayRender(void)
 {
   TestApplication app;
   tet_infoline(" UtcDaliActorSetDrawModeOverlayRender");
 
-  app.SendNotification();
-  app.Render(1);
-
-  std::vector<GLuint> ids;
-  ids.push_back( 8 );   // first rendered actor
-  ids.push_back( 9 );   // second rendered actor
-  ids.push_back( 10 );  // third rendered actor
-  app.GetGlAbstraction().SetNextTextureIds( ids );
+  Test::GraphicsController& controller = app.GetGraphicsController();
+  controller.mControllerTrace.Enable(true);
 
-  BufferImage imageA = BufferImage::New(16, 16);
-  BufferImage imageB = BufferImage::New(16, 16);
-  BufferImage imageC = BufferImage::New(16, 16);
-  Actor a = CreateRenderableActor( imageA );
-  Actor b = CreateRenderableActor( imageB );
-  Actor c = CreateRenderableActor( imageC );
-
-  app.SendNotification();
-  app.Render(1);
-
-  //Textures are bound when first created. Clear bound textures vector
-  app.GetGlAbstraction().ClearBoundTextures();
+  auto textureSetA = CreateTexture(16, 16); // Texture must be created and uploaded
+  auto textureSetB = CreateTexture(16, 16);
+  auto textureSetC = CreateTexture(16, 16);
+  Actor a = CreateRenderableActor( textureSetA );
+  Actor b = CreateRenderableActor( textureSetB );
+  Actor c = CreateRenderableActor( textureSetC );
 
   // Render a,b,c as regular non-overlays. so order will be:
-  // a (8)
-  // b (9)
-  // c (10)
+  // a
+  // b
+  // c
   Stage::GetCurrent().Add(a);
   Stage::GetCurrent().Add(b);
   Stage::GetCurrent().Add(c);
@@ -2895,36 +2915,54 @@ int UtcDaliActorSetDrawModeOverlayRender(void)
   app.SendNotification();
   app.Render(1);
 
+  tet_infoline(controller.mControllerTrace.GetTraceString().c_str());
+  controller.mControllerTrace.Reset();
+
   // Should be 3 textures changes.
-  const std::vector<GLuint>& boundTextures = app.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 );
-  typedef std::vector<GLuint>::size_type TextureSize;
-  DALI_TEST_EQUALS( boundTextures.size(), static_cast<TextureSize>( 3 ), TEST_LOCATION );
-  if( boundTextures.size() == 3 )
   {
-    DALI_TEST_CHECK( boundTextures[0] == 8u );
-    DALI_TEST_CHECK( boundTextures[1] == 9u );
-    DALI_TEST_CHECK( boundTextures[2] == 10u );
+    auto& renderCmds = controller.GetRenderCommands();
+    auto& createdTextures = controller.GetTextures();
+    int textureIndex=0;
+    for( auto& renderCmd : renderCmds )
+    {
+      const auto& textures = *renderCmd.GetTextureBindings();
+      if( textures.size() > 0 )
+      {
+        DALI_TEST_CHECK(textures[0].texture == createdTextures[textureIndex] );
+        ++textureIndex;
+      }
+    }
   }
 
   // Now texture ids have been set, we can monitor their render order.
   // render a as an overlay (last), so order will be:
-  // b (9)
-  // c (10)
-  // a (8)
+  // b
+  // c
+  // a
   a.SetDrawMode( DrawMode::OVERLAY_2D );
-  app.GetGlAbstraction().ClearBoundTextures();
 
   app.SendNotification();
   app.Render(1);
+  tet_infoline(controller.mControllerTrace.GetTraceString().c_str());
 
   // Should be 3 texture changes.
-  DALI_TEST_EQUALS( boundTextures.size(), static_cast<TextureSize>(3), TEST_LOCATION );
-  if( boundTextures.size() == 3 )
   {
-    DALI_TEST_CHECK( boundTextures[0] == 9u );
-    DALI_TEST_CHECK( boundTextures[1] == 10u );
-    DALI_TEST_CHECK( boundTextures[2] == 8u );
+    auto& renderCmds = app.GetGraphicsController().GetRenderCommands();
+    auto& createdTextures = app.GetGraphicsController().GetTextures();
+    std::vector<int> expectedTextures = {1, 2, 0};
+    int textureIndex = 0;
+
+    for( auto& renderCmd : renderCmds )
+    {
+      const auto& textures = *renderCmd.GetTextureBindings();
+      if( textures.size() > 0 )
+      {
+        DALI_TEST_CHECK(textures[0].texture == createdTextures[expectedTextures[textureIndex]] );
+        ++textureIndex;
+      }
+    }
   }
+
   END_TEST;
 }
 
@@ -3228,7 +3266,6 @@ const PropertyStringIndex PROPERTY_TABLE[] =
   { "inheritOrientation",       Actor::Property::INHERIT_ORIENTATION,      Property::BOOLEAN     },
   { "inheritScale",             Actor::Property::INHERIT_SCALE,            Property::BOOLEAN     },
   { "colorMode",                Actor::Property::COLOR_MODE,               Property::STRING      },
-  { "positionInheritance",      Actor::Property::POSITION_INHERITANCE,     Property::STRING      },
   { "drawMode",                 Actor::Property::DRAW_MODE,                Property::STRING      },
   { "sizeModeFactor",           Actor::Property::SIZE_MODE_FACTOR,         Property::VECTOR3     },
   { "widthResizePolicy",        Actor::Property::WIDTH_RESIZE_POLICY,      Property::STRING      },
@@ -3747,31 +3784,6 @@ int UtcDaliActorColorModePropertyAsString(void)
   END_TEST;
 }
 
-int UtcDaliActorPositionInheritancePropertyAsString(void)
-{
-  TestApplication application;
-
-  Actor actor = Actor::New();
-
-  actor.SetProperty( Actor::Property::POSITION_INHERITANCE, "INHERIT_PARENT_POSITION" );
-  DALI_TEST_EQUALS( actor.GetPositionInheritanceMode(), INHERIT_PARENT_POSITION, TEST_LOCATION );
-
-  actor.SetProperty( Actor::Property::POSITION_INHERITANCE, "USE_PARENT_POSITION" );
-  DALI_TEST_EQUALS( actor.GetPositionInheritanceMode(), USE_PARENT_POSITION, TEST_LOCATION );
-
-  actor.SetProperty( Actor::Property::POSITION_INHERITANCE, "USE_PARENT_POSITION_PLUS_LOCAL_POSITION" );
-  DALI_TEST_EQUALS( actor.GetPositionInheritanceMode(), USE_PARENT_POSITION_PLUS_LOCAL_POSITION, TEST_LOCATION );
-
-  actor.SetProperty( Actor::Property::POSITION_INHERITANCE, "DONT_INHERIT_POSITION" );
-  DALI_TEST_EQUALS( actor.GetPositionInheritanceMode(), DONT_INHERIT_POSITION, TEST_LOCATION );
-
-  // Invalid should not change anything
-  actor.SetProperty( Actor::Property::POSITION_INHERITANCE, "INVALID_ARG" );
-  DALI_TEST_EQUALS( actor.GetPositionInheritanceMode(), DONT_INHERIT_POSITION, TEST_LOCATION );
-
-  END_TEST;
-}
-
 int UtcDaliActorDrawModePropertyAsString(void)
 {
   TestApplication application;
@@ -3784,12 +3796,9 @@ int UtcDaliActorDrawModePropertyAsString(void)
   actor.SetProperty( Actor::Property::DRAW_MODE, "OVERLAY_2D" );
   DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION );
 
-  actor.SetProperty( Actor::Property::DRAW_MODE, "STENCIL" );
-  DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::STENCIL, TEST_LOCATION );
-
   // Invalid should not change anything
   actor.SetProperty( Actor::Property::DRAW_MODE, "INVALID_ARG" );
-  DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::STENCIL, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION );
 
   END_TEST;
 }
@@ -3815,27 +3824,6 @@ int UtcDaliActorColorModePropertyAsEnum(void)
   END_TEST;
 }
 
-int UtcDaliActorPositionInheritancePropertyAsEnum(void)
-{
-  TestApplication application;
-
-  Actor actor = Actor::New();
-
-  actor.SetProperty( Actor::Property::POSITION_INHERITANCE, INHERIT_PARENT_POSITION );
-  DALI_TEST_EQUALS( actor.GetPositionInheritanceMode(), INHERIT_PARENT_POSITION, TEST_LOCATION );
-
-  actor.SetProperty( Actor::Property::POSITION_INHERITANCE, USE_PARENT_POSITION );
-  DALI_TEST_EQUALS( actor.GetPositionInheritanceMode(), USE_PARENT_POSITION, TEST_LOCATION );
-
-  actor.SetProperty( Actor::Property::POSITION_INHERITANCE, USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
-  DALI_TEST_EQUALS( actor.GetPositionInheritanceMode(), USE_PARENT_POSITION_PLUS_LOCAL_POSITION, TEST_LOCATION );
-
-  actor.SetProperty( Actor::Property::POSITION_INHERITANCE, DONT_INHERIT_POSITION );
-  DALI_TEST_EQUALS( actor.GetPositionInheritanceMode(), DONT_INHERIT_POSITION, TEST_LOCATION );
-
-  END_TEST;
-}
-
 int UtcDaliActorDrawModePropertyAsEnum(void)
 {
   TestApplication application;
@@ -3848,9 +3836,6 @@ int UtcDaliActorDrawModePropertyAsEnum(void)
   actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
   DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION );
 
-  actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::STENCIL );
-  DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::STENCIL, TEST_LOCATION );
-
   END_TEST;
 }
 
@@ -4050,7 +4035,7 @@ Actor CreateActorWithContent16x16()
   return CreateActorWithContent( 16, 16 );
 }
 
-void GenerateTrace( TestApplication& application, TraceCallStack& enabledDisableTrace, TraceCallStack& stencilTrace )
+void GenerateTrace( TestApplication& application, Test::TraceCallStack& enabledDisableTrace, Test::TraceCallStack& stencilTrace )
 {
   enabledDisableTrace.Reset();
   stencilTrace.Reset();
@@ -4064,6 +4049,7 @@ void GenerateTrace( TestApplication& application, TraceCallStack& enabledDisable
   stencilTrace.Enable( false );
 }
 
+#if 0
 void CheckColorMask( TestGlAbstraction& glAbstraction, bool maskValue )
 {
   const TestGlAbstraction::ColorMaskParams& colorMaskParams = glAbstraction.GetColorMaskParams();
@@ -4073,6 +4059,7 @@ void CheckColorMask( TestGlAbstraction& glAbstraction, bool maskValue )
   DALI_TEST_EQUALS<bool>( colorMaskParams.blue,  maskValue, TEST_LOCATION );
   DALI_TEST_EQUALS<bool>( colorMaskParams.alpha, maskValue, TEST_LOCATION );
 }
+#endif
 
 int UtcDaliActorPropertyClippingP(void)
 {
@@ -4161,6 +4148,8 @@ int UtcDaliActorPropertyClippingActor(void)
 {
   // This test checks that an actor is correctly setup for clipping.
   tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_CHILDREN actor" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -4190,6 +4179,7 @@ int UtcDaliActorPropertyClippingActor(void)
   DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilMask", "1", startIndex ) );
   DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilOp", "7680, 7681, 7681", startIndex ) ); // GL_KEEP, GL_REPLACE, GL_REPLACE
 
+#endif
   END_TEST;
 }
 
@@ -4197,6 +4187,8 @@ int UtcDaliActorPropertyClippingActorEnableThenDisable(void)
 {
   // This test checks that an actor is correctly setup for clipping and then correctly setup when clipping is disabled
   tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_CHILDREN actor enable and then disable" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -4238,7 +4230,7 @@ int UtcDaliActorPropertyClippingActorEnableThenDisable(void)
   // Ensure all values in stencil-mask are set to 1.
   startIndex = 0u;
   DALI_TEST_CHECK( stencilTrace.FindMethodAndParamsFromStartIndex( "StencilMask", "255", startIndex ) );
-
+#endif
   END_TEST;
 }
 
@@ -4247,6 +4239,8 @@ int UtcDaliActorPropertyClippingNestedChildren(void)
   // This test checks that a hierarchy of actors are clipped correctly by
   // writing to and reading from the correct bit-planes of the stencil buffer.
   tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_CHILDREN nested children" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& stencilTrace = glAbstraction.GetStencilFunctionTrace();
@@ -4316,7 +4310,7 @@ int UtcDaliActorPropertyClippingNestedChildren(void)
       GenerateTrace( application, enabledDisableTrace, stencilTrace );
     }
   }
-
+#endif
   END_TEST;
 }
 
@@ -4324,6 +4318,8 @@ int UtcDaliActorPropertyClippingActorDrawOrder(void)
 {
   // This test checks that a hierarchy of actors are drawn in the correct order when clipping is enabled.
   tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_CHILDREN draw order" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace();
@@ -4408,7 +4404,7 @@ int UtcDaliActorPropertyClippingActorDrawOrder(void)
   startIndex = 0u;
   DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParamsFromStartIndex(  "Enable",  "2960", startIndex ) );
   DALI_TEST_CHECK( !enabledDisableTrace.FindMethodAndParamsFromStartIndex( "Disable", "2960", startIndex ) );
-
+#endif
   END_TEST;
 }
 
@@ -4416,6 +4412,8 @@ int UtcDaliActorPropertyScissorClippingActor(void)
 {
   // This test checks that an actor is correctly setup for clipping.
   tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -4459,7 +4457,7 @@ int UtcDaliActorPropertyScissorClippingActor(void)
   compareParametersString.clear();
   compareParametersString << ( stageSize.x - imageSize.x ) << ", " << ( stageSize.y - imageSize.y ) << ", " << imageSize.x << ", " << imageSize.y;
   DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", compareParametersString.str() ) );                  // Compare with 464, 784, 16, 16
-
+#endif
   END_TEST;
 }
 
@@ -4467,6 +4465,8 @@ int UtcDaliActorPropertyScissorClippingActorSiblings(void)
 {
   // This test checks that an actor is correctly setup for clipping.
   tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actors which are siblings" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
 
 
@@ -4513,7 +4513,7 @@ int UtcDaliActorPropertyScissorClippingActorSiblings(void)
 
   DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipA ) );
   DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipB ) );
-
+#endif
   END_TEST;
 }
 
@@ -4521,6 +4521,8 @@ int UtcDaliActorPropertyScissorClippingActorNested01(void)
 {
   // This test checks that an actor is correctly setup for clipping.
   tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor nested" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -4590,7 +4592,7 @@ int UtcDaliActorPropertyScissorClippingActorNested01(void)
     compareParametersString << expectResults.x << ", " << expectResults.y << ", " << expectResults.z << ", " << expectResults.w;
     DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", compareParametersString.str() ) );                  // Compare with the expected result
   }
-
+#endif
   END_TEST;
 }
 
@@ -4598,6 +4600,8 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void)
 {
   // This test checks that an actor is correctly setup for clipping.
   tet_infoline( "Testing Actor::Property::ClippingMode: CLIP_TO_BOUNDING_BOX actor nested" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -4680,6 +4684,7 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void)
   DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", clipD ) );
   DALI_TEST_CHECK( scissorTrace.CountMethod( "Scissor" ) == 4 );    // Scissor rect should not be changed in clippingActorE case. So count should be 4.
 
+#endif
   END_TEST;
 }
 
@@ -4687,6 +4692,8 @@ int UtcDaliActorPropertyClippingActorWithRendererOverride(void)
 {
   // This test checks that an actor with clipping will be ignored if overridden by the Renderer properties.
   tet_infoline( "Testing Actor::Property::CLIPPING_MODE actor with renderer override" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -4727,7 +4734,7 @@ int UtcDaliActorPropertyClippingActorWithRendererOverride(void)
   DALI_TEST_CHECK( !enabledDisableTrace.FindMethodAndParams( "Enable", "3089" ) );    // 3089 = 0xC11 (GL_SCISSOR_TEST)
 
   DALI_TEST_CHECK( !scissorTrace.FindMethod( "StencilFunc" ) );
-
+#endif
   END_TEST;
 }
 
@@ -4792,6 +4799,12 @@ int UtcDaliActorRaiseLower(void)
   actorB.TouchSignal().Connect( TestTouchCallback2 );
   actorC.TouchSignal().Connect( TestTouchCallback3 );
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   Dali::Integration::Point point;
   point.SetDeviceId( 1 );
   point.SetState( PointState::DOWN );
@@ -4815,7 +4828,11 @@ int UtcDaliActorRaiseLower(void)
   Property::Value value  = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER );
   value.Get( preActorOrder );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.Raise();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   // Ensure sort order is calculated before next touch event
   application.SendNotification();
 
@@ -4837,7 +4854,13 @@ int UtcDaliActorRaiseLower(void)
   value  = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER );
   value.Get( preActorOrder );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.Lower();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   application.SendNotification(); // ensure sort order calculated before next touch event
 
   value  = actorB.GetProperty(Dali::DevelActor::Property::SIBLING_ORDER );
@@ -4859,7 +4882,8 @@ int UtcDaliActorRaiseLower(void)
 int UtcDaliActorRaiseToTopLowerToBottom(void)
 {
   tet_infoline( "UtcDaliActorRaiseToTop and LowerToBottom test \n" );
-
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
 
   Stage stage( Stage::GetCurrent() );
@@ -4915,6 +4939,12 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   // Set up gl abstraction trace so can query the set uniform order
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   glAbstraction.EnableSetUniformCallTrace(true);
@@ -4964,7 +4994,11 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
 
   tet_printf( "RaiseToTop ActorA\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseToTop();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   application.SendNotification(); // ensure sorting order is calculated before next touch event
 
   application.ProcessEvent( touchEvent );
@@ -4995,7 +5029,13 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
 
   tet_printf( "RaiseToTop ActorB\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.RaiseToTop();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   application.SendNotification(); // Ensure sort order is calculated before next touch event
 
   application.ProcessEvent( touchEvent );
@@ -5026,11 +5066,23 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
 
   tet_printf( "LowerToBottom ActorA then ActorB leaving Actor C at Top\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.LowerToBottom();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.LowerToBottom();
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
@@ -5059,13 +5111,15 @@ int UtcDaliActorRaiseToTopLowerToBottom(void)
   DALI_TEST_EQUALS( gTouchCallBackCalled3,  true , TEST_LOCATION );
 
   ResetTouchCallbacks();
-
+#endif
   END_TEST;
 }
 
 int UtcDaliActorRaiseAbove(void)
 {
-  tet_infoline( "UtcDaliActor RaiseToAbove test \n" );
+  tet_infoline( "UtcDaliActorRaiseToAbove test \n" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   TestApplication application;
 
@@ -5112,6 +5166,11 @@ int UtcDaliActorRaiseAbove(void)
   actorB.TouchSignal().Connect( TestTouchCallback2 );
   actorC.TouchSignal().Connect( TestTouchCallback3 );
 
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   Dali::Integration::Point point;
   point.SetDeviceId( 1 );
   point.SetState( PointState::DOWN );
@@ -5129,10 +5188,13 @@ int UtcDaliActorRaiseAbove(void)
 
   tet_printf( "Raise actor B Above Actor C\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
-
   application.ProcessEvent( touchEvent );
 
   DALI_TEST_EQUALS( gTouchCallBackCalled,  false, TEST_LOCATION );
@@ -5143,7 +5205,12 @@ int UtcDaliActorRaiseAbove(void)
 
   tet_printf( "Raise actor A Above Actor B\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorB );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
 
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
@@ -5155,13 +5222,15 @@ int UtcDaliActorRaiseAbove(void)
   DALI_TEST_EQUALS( gTouchCallBackCalled3,  false , TEST_LOCATION );
 
   ResetTouchCallbacks();
-
+#endif
   END_TEST;
 }
 
 int UtcDaliActorLowerBelow(void)
 {
   tet_infoline( "UtcDaliActor LowerBelow test \n" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   TestApplication application;
 
@@ -5223,6 +5292,12 @@ int UtcDaliActorLowerBelow(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( container ).Connect( &application, f ) ;
+
   // Set up gl abstraction trace so can query the set uniform order
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   glAbstraction.EnableSetUniformCallTrace(true);
@@ -5277,7 +5352,11 @@ int UtcDaliActorLowerBelow(void)
 
   tet_printf( "Lower actor C below Actor B ( actor B and A on same level due to insertion order) so C is below both \n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorC.LowerBelow( actorB );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorC, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
   application.Render();
@@ -5309,7 +5388,13 @@ int UtcDaliActorLowerBelow(void)
 
   tet_printf( "Lower actor C below Actor A leaving B on top\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorC.LowerBelow( actorA );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorC, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
   application.Render();
@@ -5338,7 +5423,13 @@ int UtcDaliActorLowerBelow(void)
 
   tet_printf( "Lower actor B below Actor C leaving A on top\n" );
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.LowerBelow( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorB, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
   application.Render();
@@ -5358,7 +5449,7 @@ int UtcDaliActorLowerBelow(void)
 
   DALI_TEST_EQUALS( indexC > indexB, true, TEST_LOCATION );
   DALI_TEST_EQUALS( indexA > indexC, true, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -5417,6 +5508,12 @@ int UtcDaliActorRaiseAboveDifferentParentsN(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   application.SendNotification();
   application.Render();
 
@@ -5447,7 +5544,10 @@ int UtcDaliActorRaiseAboveDifferentParentsN(void)
 
   tet_printf( "Raise actor A Above Actor C which have different parents\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
 
@@ -5494,6 +5594,12 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   application.SendNotification();
   application.Render();
 
@@ -5516,7 +5622,10 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   tet_printf( "Raise actor A Above Actor C which have no parents\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
 
@@ -5530,9 +5639,14 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   stage.Add ( actorB );
   tet_printf( "Lower actor A below Actor C when only A is not on stage \n" );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.LowerBelow( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
 
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
@@ -5547,6 +5661,8 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Adding Actor A to stage, will be on top\n" );
 
   stage.Add ( actorA );
@@ -5554,7 +5670,11 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
   application.Render();
 
   tet_printf( "Raise actor B Above Actor C when only B has a parent\n" );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
 
@@ -5567,8 +5687,14 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Lower actor A below Actor C when only A has a parent\n" );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.LowerBelow( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
 
@@ -5581,8 +5707,15 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   stage.Add ( actorC );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   // Ensure sorting happens at end of Core::ProcessEvents() before next touch
   application.SendNotification();
   application.Render();
@@ -5629,6 +5762,12 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   // connect to actor touch signals, will use touch callbacks to determine which actor is on top.
   // Only top actor will get touched.
   actorA.TouchSignal().Connect( TestTouchCallback );
@@ -5644,7 +5783,10 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
 
   stage.Add ( actorA );
   tet_printf( "Raise actor B Above Actor C but B not parented\n" );
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.Raise();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
 
   application.SendNotification();
   application.Render();
@@ -5660,7 +5802,12 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
   tet_printf( "Raise actor B Above Actor C but B not parented\n" );
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorC.Lower();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Sort actor tree before next touch event
   application.SendNotification();
   application.Render();
@@ -5674,9 +5821,14 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
   DALI_TEST_EQUALS( gTouchCallBackCalled3,  false , TEST_LOCATION );
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Lower actor C below B but C not parented\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.Lower();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Sort actor tree before next touch event
   application.SendNotification();
   application.Render();
@@ -5690,9 +5842,14 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
   DALI_TEST_EQUALS( gTouchCallBackCalled3,  false , TEST_LOCATION );
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Raise actor B to top\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorB.RaiseToTop();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   // Sort actor tree before next touch event
   application.SendNotification();
   application.Render();
@@ -5706,13 +5863,18 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void)
   DALI_TEST_EQUALS( gTouchCallBackCalled3,  false , TEST_LOCATION );
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
   tet_printf( "Add ActorB to stage so only Actor C not parented\n" );
 
   stage.Add ( actorB );
 
   tet_printf( "Lower actor C to Bottom, B stays at top\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorC.LowerToBottom();
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
@@ -5771,6 +5933,12 @@ int UtcDaliActorRaiseAboveActorAndTargetTheSameN(void)
 
   ResetTouchCallbacks();
 
+  // Connect ChildOrderChangedSignal
+  bool orderChangedSignal( false );
+  Actor orderChangedActor;
+  ChildOrderChangedFunctor f( orderChangedSignal, orderChangedActor );
+  DevelActor::ChildOrderChangedSignal( stage.GetRootLayer() ).Connect( &application, f ) ;
+
   application.SendNotification();
   application.Render();
 
@@ -5791,7 +5959,11 @@ int UtcDaliActorRaiseAboveActorAndTargetTheSameN(void)
 
   tet_infoline( "Raise actor A Above Actor A which is the same actor!!\n" );
 
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorA );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
@@ -5805,7 +5977,13 @@ int UtcDaliActorRaiseAboveActorAndTargetTheSameN(void)
 
   ResetTouchCallbacks();
 
+  orderChangedSignal = false;
+
+  DALI_TEST_EQUALS( orderChangedSignal, false, TEST_LOCATION );
   actorA.RaiseAbove( actorC );
+  DALI_TEST_EQUALS( orderChangedSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( orderChangedActor, actorA, TEST_LOCATION );
+
   application.SendNotification();
   application.Render();
 
@@ -6992,3 +7170,50 @@ int UtcDaliChildMovedSignalP(void)
 
   END_TEST;
 }
+
+int utcDaliActorCulled(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  tet_infoline( "Check that the actor is culled if the actor is out of the screen" );
+
+  Actor actor = Actor::New();
+  actor.SetSize( 10.0f, 10.0f );
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader shader = CreateShader();
+  Renderer renderer = Renderer::New(geometry, shader);
+  actor.AddRenderer( renderer );
+
+  stage.Add( actor );
+
+  application.SendNotification();
+  application.Render( 0 );
+
+  DALI_TEST_EQUALS( actor.GetProperty< bool >( DevelActor::Property::CULLED ), false, TEST_LOCATION );
+
+  PropertyNotification notification = actor.AddPropertyNotification( DevelActor::Property::CULLED, LessThanCondition( 0.5f ) );
+  notification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+
+  // Connect NotifySignal
+  bool propertyNotificationSignal( false );
+  PropertyNotification source;
+  CulledPropertyNotificationFunctor f( propertyNotificationSignal, source );
+  notification.NotifySignal().Connect( &application, f ) ;
+
+  actor.SetPosition( 1000.0f, 1000.0f );
+
+  application.SendNotification();
+  application.Render();
+
+  application.SendNotification();
+
+  DALI_TEST_EQUALS( actor.GetProperty< bool >( DevelActor::Property::CULLED ), true, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( propertyNotificationSignal, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( source.GetTargetProperty(), static_cast< int >( DevelActor::Property::CULLED ), TEST_LOCATION );
+  DALI_TEST_EQUALS( source.GetTarget().GetProperty< bool >( source.GetTargetProperty() ), true, TEST_LOCATION );
+
+  END_TEST;
+}
index 8595756..615d2f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -2073,7 +2073,7 @@ int UtcDaliAnimationPlayP(void)
   END_TEST;
 }
 
-int UtcDaliAnimationPlayOffStageP(void)
+int UtcDaliAnimationPlayOffStageDiscardP(void)
 {
   // Test that an animation can be played, when the actor is off-stage.
   // When the actor is added to the stage, it should appear at the current position
@@ -2084,7 +2084,7 @@ int UtcDaliAnimationPlayOffStageP(void)
   Actor actor = Actor::New();
   Vector3 basePosition(Vector3::ZERO);
   DALI_TEST_EQUALS( actor.GetCurrentPosition(), basePosition, TEST_LOCATION );
-  // Not added to the stage!
+  // Not added to the stage yet!
 
   // Build the animation
   float durationSeconds(1.0f);
@@ -2106,7 +2106,7 @@ int UtcDaliAnimationPlayOffStageP(void)
   // We didn't expect the animation to finish yet
   application.SendNotification();
   finishCheck.CheckSignalNotReceived();
-  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO/*off-stage*/, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(20,20,20), TEST_LOCATION );
 
   // Add to the stage
   Stage::GetCurrent().Add(actor);
@@ -2117,8 +2117,7 @@ int UtcDaliAnimationPlayOffStageP(void)
   // We didn't expect the animation to finish yet
   application.SendNotification();
   finishCheck.CheckSignalNotReceived();
-  Vector3 expectedPosition(basePosition + (targetPosition - basePosition)*0.4f);
-  DALI_TEST_EQUALS( actor.GetCurrentPosition(), expectedPosition/*on-stage*/, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(40,40,40)/*on-stage*/, TEST_LOCATION );
 
   // Remove from the stage
   Stage::GetCurrent().Remove(actor);
@@ -2129,7 +2128,14 @@ int UtcDaliAnimationPlayOffStageP(void)
   // We didn't expect the animation to finish yet
   application.SendNotification();
   finishCheck.CheckSignalNotReceived();
-  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO/*back to start position*/, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO/*back to start position as disconnect behaviour is discard*/, TEST_LOCATION );
+  // Check that nothing has changed after a couple of buffer swaps
+  application.Render(0);
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
+  application.Render(0);
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
+  application.Render(0);
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
 
   // Add to the stage
   Stage::GetCurrent().Add(actor);
@@ -2140,8 +2146,197 @@ int UtcDaliAnimationPlayOffStageP(void)
   // We didn't expect the animation to finish yet
   application.SendNotification();
   finishCheck.CheckSignalNotReceived();
-  expectedPosition = Vector3(basePosition + (targetPosition - basePosition)*0.8f);
-  DALI_TEST_EQUALS( actor.GetCurrentPosition(), expectedPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(80,80,80), TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/);
+
+  // We did expect the animation to finish
+  application.SendNotification();
+  finishCheck.CheckSignalReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
+
+  // Check that nothing has changed after a couple of buffer swaps
+  application.Render(0);
+  DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION );
+
+
+  application.Render(0);
+  DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliAnimationPlayOffStageBakeFinalP(void)
+{
+  // Test that an animation can be played, when the actor is off-stage.
+  // When the actor is added to the stage, it should appear at the current position
+  // i.e. where it would have been anyway, if on-stage from the beginning.
+
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Vector3 basePosition(Vector3::ZERO);
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), basePosition, TEST_LOCATION );
+  // Not added to the stage!
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+  Vector3 targetPosition(100.0f, 100.0f, 100.0f);
+  animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+
+  // Start the animation
+  animation.Play();
+
+  bool signalReceived(false);
+  AnimationFinishCheck finishCheck(signalReceived);
+  animation.FinishedSignal().Connect(&application, finishCheck);
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 20% progress */);
+
+  // We didn't expect the animation to finish yet
+  application.SendNotification();
+  finishCheck.CheckSignalNotReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(20,20,20), TEST_LOCATION );
+
+  // Add to the stage
+  Stage::GetCurrent().Add(actor);
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 40% progress */);
+
+  // We didn't expect the animation to finish yet
+  application.SendNotification();
+  finishCheck.CheckSignalNotReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(40,40,40)/*on-stage*/, TEST_LOCATION );
+
+  // Remove from the stage
+  Stage::GetCurrent().Remove(actor);
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 60% progress */);
+
+  // We didn't expect the animation to finish yet
+  application.SendNotification();
+  finishCheck.CheckSignalNotReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition /*bake final*/, TEST_LOCATION );
+
+  // Add to the stage
+  Stage::GetCurrent().Add(actor);
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 80% progress */);
+
+  // We didn't expect the animation to finish yet
+  application.SendNotification();
+  finishCheck.CheckSignalNotReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition /*bake final removed the */, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/);
+
+  // We did expect the animation to finish
+  application.SendNotification();
+  finishCheck.CheckSignalReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
+
+  // Check that nothing has changed after a couple of buffer swaps
+  application.Render(0);
+  DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION );
+
+  application.Render(0);
+  DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliAnimationPlayOffStageBakeP(void)
+{
+  // Test that an animation can be played, when the actor is off-stage.
+  // When the actor is added to the stage, it should appear at the current position
+  // i.e. where it would have been anyway, if on-stage from the beginning.
+
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Vector3 basePosition(Vector3::ZERO);
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), basePosition, TEST_LOCATION );
+  // Not added to the stage!
+
+  // Build the animation
+  float durationSeconds(1.0f);
+  Animation animation = Animation::New(durationSeconds);
+  animation.SetDisconnectAction( Animation::Bake );
+  Vector3 targetPosition(100.0f, 100.0f, 100.0f);
+  animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+
+  // Start the animation
+  animation.Play();
+
+  bool signalReceived(false);
+  AnimationFinishCheck finishCheck(signalReceived);
+  animation.FinishedSignal().Connect(&application, finishCheck);
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 20% progress */);
+
+  // We didn't expect the animation to finish yet
+  application.SendNotification();
+  finishCheck.CheckSignalNotReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(20,20,20), TEST_LOCATION );
+
+  // Add to the stage
+  Stage::GetCurrent().Add(actor);
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 40% progress */);
+
+  // We didn't expect the animation to finish yet
+  application.SendNotification();
+  finishCheck.CheckSignalNotReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(40,40,40)/*on-stage*/, TEST_LOCATION );
+
+  // Remove from the stage
+  Stage::GetCurrent().Remove(actor); // baked here
+
+  application.SendNotification();
+  // this render is a no-op in this case as animator is disabled while off stage
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 60% progress */);
+  // We didn't expect the animation to finish yet
+  application.SendNotification();
+  finishCheck.CheckSignalNotReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(40,40,40) /*baked value*/, TEST_LOCATION );
+
+  // Add back to the stage
+  Stage::GetCurrent().Add(actor);
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 80% progress */);
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(88,88,88) /* animation restarted at 40,40,40 + 80%*60 */, TEST_LOCATION );
+  application.Render(static_cast<unsigned int>(0.0f) );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(88,88,88) /*baked value*/, TEST_LOCATION );
+  application.Render(static_cast<unsigned int>(0.0f) );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(88,88,88) /*baked value*/, TEST_LOCATION );
+
+  // Remove from the stage
+  Stage::GetCurrent().Remove(actor); // baked here
+
+  application.SendNotification();
+  // this render is a no-op in this case as animator is disabled while off stage
+  application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 100% progress */);
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(88,88,88) /*baked value*/, TEST_LOCATION );
+  application.Render(static_cast<unsigned int>(0.0f) );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(88,88,88) /*baked value*/, TEST_LOCATION );
+  application.Render(static_cast<unsigned int>(0.0f) );
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(88,88,88) /*baked value*/, TEST_LOCATION );
+
+  // Add back to the stage
+  Stage::GetCurrent().Add(actor);
+
+  // We didn't expect the animation to finish yet
+  application.SendNotification();
+  finishCheck.CheckSignalNotReceived();
+  DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3(88,88,88) , TEST_LOCATION );
 
   application.SendNotification();
   application.Render(static_cast<unsigned int>(durationSeconds*200.0f) + 1u/*just beyond the animation duration*/);
@@ -2154,6 +2349,7 @@ int UtcDaliAnimationPlayOffStageP(void)
   // Check that nothing has changed after a couple of buffer swaps
   application.Render(0);
   DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION );
+
   application.Render(0);
   DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION );
   END_TEST;
@@ -6696,19 +6892,15 @@ int UtcDaliAnimationAnimateToActorParentOriginP(void)
   Animation animation = Animation::New(durationSeconds);
   Vector3 targetParentOrigin(ParentOrigin::BOTTOM_RIGHT);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN), targetParentOrigin );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "Property is not animatable" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorParentOriginXP(void)
+int UtcDaliAnimationAnimateToActorParentOriginXN(void)
 {
   TestApplication application;
 
@@ -6723,19 +6915,15 @@ int UtcDaliAnimationAnimateToActorParentOriginXP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetX(1.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN_X), targetX );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "Property is not animatable" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorParentOriginYP(void)
+int UtcDaliAnimationAnimateToActorParentOriginYN(void)
 {
   TestApplication application;
 
@@ -6750,19 +6938,15 @@ int UtcDaliAnimationAnimateToActorParentOriginYP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetY(1.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN_Y), targetY );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "Property is not animatable" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorParentOriginZP(void)
+int UtcDaliAnimationAnimateToActorParentOriginZN(void)
 {
   TestApplication application;
 
@@ -6777,19 +6961,15 @@ int UtcDaliAnimationAnimateToActorParentOriginZP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetZ(1.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::PARENT_ORIGIN_Z), targetZ );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "Property is not animatable" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorAnchorPointP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointN(void)
 {
   TestApplication application;
 
@@ -6802,19 +6982,15 @@ int UtcDaliAnimationAnimateToActorAnchorPointP(void)
   Animation animation = Animation::New(durationSeconds);
   Vector3 targetAnchorPoint(AnchorPoint::TOP_LEFT);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT), targetAnchorPoint);
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "Property is not animatable" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorAnchorPointXP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointXN(void)
 {
   TestApplication application;
 
@@ -6829,19 +7005,15 @@ int UtcDaliAnimationAnimateToActorAnchorPointXP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetX(1.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT_X), targetX );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "Property is not animatable" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorAnchorPointYP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointYN(void)
 {
   TestApplication application;
 
@@ -6856,19 +7028,15 @@ int UtcDaliAnimationAnimateToActorAnchorPointYP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetY(0.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT_Y), targetY );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "Property is not animatable" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationAnimateToActorAnchorPointZP(void)
+int UtcDaliAnimationAnimateToActorAnchorPointZN(void)
 {
   TestApplication application;
 
@@ -6883,15 +7051,11 @@ int UtcDaliAnimationAnimateToActorAnchorPointZP(void)
   Animation animation = Animation::New(durationSeconds);
   float targetZ(100.0f);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     animation.AnimateTo( Property(actor, Actor::Property::ANCHOR_POINT_Z), targetZ );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "IsPropertyAnimatable( index )", TEST_LOCATION);
-  }
+  }, "Property is not animatable" );
+
   END_TEST;
 }
 
@@ -8642,7 +8806,7 @@ int UtcDaliAnimationKeyFrames01P(void)
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames02P(void)
+int UtcDaliAnimationKeyFrames02N(void)
 {
   TestApplication application;
 
@@ -8658,19 +8822,15 @@ int UtcDaliAnimationKeyFrames02P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::FLOAT, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(1.9f, false);
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames03P(void)
+int UtcDaliAnimationKeyFrames03N(void)
 {
   TestApplication application;
 
@@ -8686,19 +8846,15 @@ int UtcDaliAnimationKeyFrames03P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::BOOLEAN, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, Vector3(1.0f, 1.0f, 1.0f));
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames04P(void)
+int UtcDaliAnimationKeyFrames04N(void)
 {
   TestApplication application;
 
@@ -8714,19 +8870,15 @@ int UtcDaliAnimationKeyFrames04P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::VECTOR2, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, Vector3(1.0f, 1.0f, 1.0f));
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames05P(void)
+int UtcDaliAnimationKeyFrames05N(void)
 {
   TestApplication application;
 
@@ -8742,19 +8894,15 @@ int UtcDaliAnimationKeyFrames05P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::VECTOR3, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, 1.0f);
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames06P(void)
+int UtcDaliAnimationKeyFrames06N(void)
 {
   TestApplication application;
 
@@ -8770,19 +8918,15 @@ int UtcDaliAnimationKeyFrames06P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::VECTOR4, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, Quaternion(Radian(1.717f), Vector3::XAXIS));
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
-int UtcDaliAnimationKeyFrames07P(void)
+int UtcDaliAnimationKeyFrames07N(void)
 {
   TestApplication application;
 
@@ -8798,15 +8942,11 @@ int UtcDaliAnimationKeyFrames07P(void)
 
   DALI_TEST_EQUALS(keyFrames.GetType(), Property::ROTATION, TEST_LOCATION);
 
-  try
+  DALI_TEST_ASSERTION(
   {
     keyFrames.Add(0.7f, 1.1f);
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT(e, "mType == value.GetType()", TEST_LOCATION);
-  }
+  }, "mType == value.GetType()" );
+
   END_TEST;
 }
 
@@ -10709,19 +10849,14 @@ int UtcDaliAnimationAnimateByNonAnimateableTypeN(void)
   Stage::GetCurrent().Add(actor);
   DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
 
-  try
+  DALI_TEST_ASSERTION(
   {
     // Build the animation
     Animation animation = Animation::New( 2.0f );
     std::string relativeValue = "relative string";
     animation.AnimateBy( Property(actor, index), relativeValue );
     tet_result(TET_FAIL);
-  }
-  catch ( Dali::DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
-  }
-
+  }, "Target value is not animatable" );
 
   END_TEST;
 }
@@ -10739,19 +10874,13 @@ int UtcDaliAnimationAnimateToNonAnimateableTypeN(void)
   Stage::GetCurrent().Add(actor);
   DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
 
-  try
+  DALI_TEST_ASSERTION(
   {
     // Build the animation
     Animation animation = Animation::New( 2.0f );
     std::string relativeValue = "relative string";
     animation.AnimateTo( Property(actor, index), relativeValue );
-
-    tet_result(TET_FAIL);
-  }
-  catch ( Dali::DaliException& e )
-  {
-   DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
-  }
+  }, "Target value is not animatable" );
 
   END_TEST;
 }
@@ -10768,20 +10897,14 @@ int UtcDaliAnimationAnimateBetweenNonAnimateableTypeN(void)
   Stage::GetCurrent().Add(actor);
   DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
 
-  try
+  DALI_TEST_ASSERTION(
   {
     // Build the animation
     KeyFrames keyFrames = KeyFrames::New();
     keyFrames.Add( 0.0f, std::string("relative string1") );
     keyFrames.Add( 1.0f, std::string("relative string2") );
     // no need to really create the animation as keyframes do the check
-
-    tet_result(TET_FAIL);
-  }
-  catch ( Dali::DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "Type not animateable", TEST_LOCATION );
-  }
+  }, "Property type is not animatable" );
 
   END_TEST;
 }
@@ -13011,3 +13134,180 @@ int UtcDaliAnimationProgressCallbackLongDurationP(void)
 
   END_TEST;
 }
+
+int UtcDaliAnimationAnimateByInvalidParameters(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+
+  // Create the animation
+  Animation animation = Animation::New(1.0f);
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable property (STRING)
+    animation.AnimateBy( Property( actor, Actor::Property::LAYOUT_DIRECTION ), Property::Value( "new direction" ) );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable property (MATRIX)
+    Property::Index index = actor.RegisterProperty( "Foobar", Property::Value( Dali::Matrix() ), Property::ANIMATABLE );
+    animation.AnimateBy( Property( actor, index ), Property::Value( Property::MATRIX ) );
+  }, "Property type is not animatable" );
+
+  // AnimateBy
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (NONE)
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value() );
+  }, "Target value is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (STRING)
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value("foo") );
+  }, "Target value is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (VECTOR3, FLOAT)
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value( 10.f ) );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (VECTOR3.A, VECTOR2)
+    animation.AnimateBy( Property( actor, Actor::Property::COLOR_ALPHA ), Property::Value( Property::VECTOR2 ) );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // negative duration
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value( Vector3(1,2,3) ), TimePeriod(-1) );
+  }, "Duration must be >=0" );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateToInvalidParameters(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+
+  // Create the animation
+  Animation animation = Animation::New(1.0f);
+
+  // AnimateTo
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable property (MAP)
+    Property::Index index = actor.RegisterProperty( "Foobar", Property::Value( Property::MAP ), Property::ANIMATABLE );
+    animation.AnimateTo( Property( actor, index ), Property::Value( Property::MAP ) );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (NONE)
+    animation.AnimateTo( Property( actor, Actor::Property::CLIPPING_MODE ), Property::Value() );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (ARRAY)
+    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Property::Value( Property::ARRAY ) );
+  }, "Target value is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (RECTANGLE)
+    animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Property::Value( Rect<int32_t>() ) );
+  }, "Target value is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (FLOAT, INT)
+    animation.AnimateTo( Property( actor, Actor::Property::SCALE_Y ), Property::Value(10) );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (VECTOR3, VECTOR2)
+    animation.AnimateTo( Property( actor, Actor::Property::COLOR ), Property::Value( Property::VECTOR2 ) );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // negative duration
+    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Property::Value( Vector3(1,2,3) ), TimePeriod(-1) );
+  }, "Duration must be >=0" );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationAnimateBetweenInvalidParameters(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+
+  // Create the animation
+  Animation animation = Animation::New(1.0f);
+
+  // AnimateBetween
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable property (ARRAY)
+    Property::Index index = actor.RegisterProperty( "Foobar", Property::Value( Property::ARRAY ), Property::ANIMATABLE );
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value( Property::ARRAY ) );
+    animation.AnimateBetween( Property( actor, index ), keyframes );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (NONE)
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value() );
+    animation.AnimateBetween( Property( actor, Actor::Property::CLIPPING_MODE ), keyframes );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (EXTENTS)
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value( Property::EXTENTS ) ); // throws
+    animation.AnimateBetween( Property( actor, Actor::Property::POSITION ), keyframes );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // non animateable target (RECTANGLE)
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value( Property::MAP ) ); // throws
+    animation.AnimateBetween( Property( actor, Actor::Property::POSITION ), keyframes );
+  }, "Property type is not animatable" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // not mathing properties (VECTOR2, VECTOR4)
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value( Vector4( 1, 2, 3, 4 ) ) );
+    animation.AnimateBetween( Property( actor, Actor::Property::MAXIMUM_SIZE ), keyframes );
+  }, "Property and target types don't match" );
+
+  DALI_TEST_ASSERTION(
+  {
+    // negative duration
+    KeyFrames keyframes = KeyFrames::New();
+    keyframes.Add( 0.5f, Property::Value(Vector3( 1, 2, 3 ) ) );
+    animation.AnimateBetween( Property( actor, Actor::Property::POSITION ), keyframes, TimePeriod(-1) );
+  }, "Duration must be >=0" );
+
+  END_TEST;
+}
index 865fa5b..e25be23 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ struct AnimationFinishCheck
   {
   }
 
-  void operator()(Animation& animation)
+  void operator()()
   {
     mSignalReceived = true;
   }
@@ -366,16 +366,43 @@ int UtcDaliBaseHandleDoAction(void)
 
   bool signalReceived(false);
   AnimationFinishCheck finishCheck(signalReceived);
-  animation.FinishedSignal().Connect(&application, finishCheck);
+  // use the handle API to connect the signal
+  animation.ConnectSignal( &application, "finished", finishCheck );
+  // just for coverage connect to non-existant signal as well
+  animation.ConnectSignal( &application, "foo", finishCheck );
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render(static_cast<uint32_t>(newDurationSeconds * 500.0f) /* half of time */);
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
+  // pause
+  animationObject.DoAction("pause", attributes);
+  application.SendNotification();
+  application.Render(static_cast<uint32_t>(newDurationSeconds * 500.0f) + 1u/*just beyond the animation duration*/);
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
 
+  // continue
+  animationObject.DoAction("play", attributes);
   application.SendNotification();
-  application.Render(static_cast<unsigned int>(newDurationSeconds * 1000.0f) + 1u/*just beyond the animation duration*/);
+  application.Render(static_cast<uint32_t>(newDurationSeconds * 500.0f) + 1u/*just beyond the animation duration*/);
 
   // We expect the animation to finish
   application.SendNotification();
   finishCheck.CheckSignalReceived();
   DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
 
+  // play again
+  signalReceived = false;
+  animationObject.DoAction("play", attributes);
+  DALI_TEST_EQUALS(animation.GetCurrentProgress(), 0.f, TEST_LOCATION);
+  application.SendNotification();
+  application.Render(static_cast<uint32_t>(newDurationSeconds * 500.0f) /* half of time */);
+  animationObject.DoAction("stop", attributes);
+  application.SendNotification();
+  application.Render(static_cast<uint32_t>(newDurationSeconds * 1000.0f) /* full time */);
+  DALI_TEST_EQUALS( signalReceived, false, TEST_LOCATION );
+
   // Check the new animation duration is 2 seconds
   DALI_TEST_EQUALS(animation.GetDuration(), newDurationSeconds, TEST_LOCATION);
   END_TEST;
index 28c2168..22f43a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -242,6 +242,8 @@ int UtcDaliBufferImageUpdate01(void)
   TestApplication application;
 
   tet_infoline("UtcDaliBufferImageUpdate01 - single empty rect");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   PixelBuffer* buffer = new PixelBuffer[16 * 16];
 
@@ -280,6 +282,8 @@ int UtcDaliBufferImageUpdate01(void)
   std::stringstream out;
   out << GL_TEXTURE_2D <<", "<< 0u << ", " << 16u <<", "<< 16u;
   DALI_TEST_EQUALS( callStack.TestMethodAndParams(0, "TexImage2D", out.str().c_str() ), true, TEST_LOCATION);
+
+#endif
   END_TEST;
 }
 
@@ -288,6 +292,8 @@ int UtcDaliBufferImageUpdate02(void)
   TestApplication application;
 
   tet_infoline("UtcDaliBufferImageUpdate02 - Multiple rects");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   PixelBuffer* buffer = new PixelBuffer[16 * 16];
   BufferImage image = BufferImage::New(buffer, 16, 16, Pixel::A8);
@@ -337,6 +343,6 @@ int UtcDaliBufferImageUpdate02(void)
     DALI_TEST_EQUALS( callStack.TestMethodAndParams(2, "TexSubImage2D", out.str().c_str()), true, TEST_LOCATION);
   }
 
+#endif
   END_TEST;
 }
-
index 46eb92f..b9ee2d2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
 #include <stdlib.h>
 #include <cmath>
 #include <dali/public-api/dali-core.h>
+#include <dali/devel-api/actors/actor-devel.h>
+
 
 #include "dali-test-suite-utils/dali-test-suite-utils.h"
 
@@ -66,6 +68,16 @@ const char* const RENDER_SHADOW_FRAGMENT_SOURCE =
   "  gl_FragColor = vec4(uShadowColor.rgb, uShadowColor.a * alpha);\n"
   "}\n";
 
+struct PropertyDetails
+{
+  std::string name;           ///< The name of the property.
+  Property::Type type;        ///< The property type.
+  bool writable;              ///< Whether the property is writable
+  bool animatable;            ///< Whether the property is animatable.
+  bool constraintInput;       ///< Whether the property can be used as an input to a constraint.
+  Property::Index enumIndex;  ///< Used to check the index is correct within a debug build.
+};
+
 } // Anonymous namespace
 
 
@@ -270,7 +282,7 @@ int UtcDaliCameraActorSetFieldOfViewP(void)
   CameraActor defaultCamera = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   const float defaultFieldOfView = defaultCamera.GetFieldOfView();
 
-  CameraActor actor = CameraActor::New();
+  CameraActor actor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   DALI_TEST_EQUALS( actor.GetFieldOfView(), defaultFieldOfView, TEST_LOCATION );
 
   float fieldOfView = Math::PI / 3.0f;
@@ -291,7 +303,7 @@ int UtcDaliCameraActorSetFieldOfViewN(void)
   CameraActor defaultCamera = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   const float defaultFieldOfView = defaultCamera.GetFieldOfView();
 
-  CameraActor actor = CameraActor::New();
+  CameraActor actor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   DALI_TEST_EQUALS( actor.GetFieldOfView(), defaultFieldOfView, TEST_LOCATION );
 
   float fieldOfView = Math::PI / 3.0f;
@@ -315,7 +327,7 @@ int UtcDaliCameraActorGetFieldOfViewP(void)
   const float cameraZ = 2.0f * std::max( size.width, size.height );
   const float expectedFieldOfView = 2.0f * std::atan( size.height * 0.5f / cameraZ );
 
-  CameraActor actor = CameraActor::New();
+  CameraActor actor = CameraActor::New( size );
   DALI_TEST_EQUALS( actor.GetFieldOfView(), expectedFieldOfView, TEST_LOCATION );
 
   float value;
@@ -352,7 +364,7 @@ int UtcDaliCameraActorSetAspectRatioP(void)
   TestApplication application;
   tet_infoline( "Testing Dali::CameraActor Set Aspect Ratio (P)" );
 
-  CameraActor actor = CameraActor::New();
+  CameraActor actor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   DALI_TEST_EQUALS( actor.GetAspectRatio(), static_cast<float>( TestApplication::DEFAULT_SURFACE_WIDTH ) / static_cast<float>( TestApplication::DEFAULT_SURFACE_HEIGHT ), TEST_LOCATION );
 
   // Set an initial value to confirm a further set changes it.
@@ -395,7 +407,7 @@ int UtcDaliCameraActorGetAspectRatioP(void)
   TestApplication application;
   tet_infoline("Testing Dali::CameraActor Get Aspect Ratio");
 
-  CameraActor actor = CameraActor::New();
+  CameraActor actor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   float defaultAspect = static_cast<float>( TestApplication::DEFAULT_SURFACE_WIDTH ) / static_cast<float>( TestApplication::DEFAULT_SURFACE_HEIGHT );
 
   DALI_TEST_EQUALS( actor.GetAspectRatio(), defaultAspect, TEST_LOCATION );
@@ -564,7 +576,7 @@ int UtcDaliCameraActorGetFarClippingPlaneP(void)
   TestApplication application;
   tet_infoline( "Testing Dali::CameraActor Get Far clipping plane (P)" );
 
-  CameraActor actor = CameraActor::New();
+  CameraActor actor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   float defaultValue = 800.0f + ( 0xFFFF >> 4 );
   DALI_TEST_EQUALS( actor.GetFarClippingPlane(), defaultValue, TEST_LOCATION );
 
@@ -793,16 +805,14 @@ int UtcDaliCameraActorSetPerspectiveProjectionN(void)
   TestApplication application;
   tet_infoline( "Testing Dali::CameraActor::SetPerspectiveProjection (N)" );
 
-  Stage stage = Stage::GetCurrent();
-  Vector2 stageSize = stage.GetSize();
-
   CameraActor actor = CameraActor::New();
 
-  // Check that setting perspective projection without a size (using zero size) uses the stages size.
+  // Check that setting perspective projection without a size does not do anything.
   actor.SetPerspectiveProjection( Size::ZERO );
 
-  float nearClippingPlane = std::max( stageSize.width, stageSize.height );
-  float farClippingPlane = nearClippingPlane + static_cast<float>( 0xFFFF >> 4 );
+  // So the default values should be the same as defined in CameraActor
+  float nearClippingPlane = 800.0f;
+  float farClippingPlane = nearClippingPlane + 2.0f * nearClippingPlane;
 
   DALI_TEST_EQUALS( nearClippingPlane, actor.GetNearClippingPlane(), FLOAT_EPSILON, TEST_LOCATION );
   DALI_TEST_EQUALS( farClippingPlane, actor.GetFarClippingPlane(), FLOAT_EPSILON, TEST_LOCATION );
@@ -1265,10 +1275,129 @@ int UtcDaliCameraActorDefaultProperties(void)
   END_TEST;
 }
 
+template< typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
+void TEST_CAMERA_PROPERTY( P1 camera, P2 stringName, P3 type, P4 isWriteable, P5 isAnimateable, P6 isConstraintInput, P7 enumName, P8 LOCATION )
+{
+  DALI_TEST_EQUALS( camera.GetPropertyName( enumName ), stringName, LOCATION );
+  DALI_TEST_EQUALS( camera.GetPropertyIndex( stringName ), static_cast<Property::Index>(enumName), LOCATION );
+  DALI_TEST_EQUALS( camera.GetPropertyType( enumName ), type, LOCATION );
+  DALI_TEST_EQUALS( camera.IsPropertyWritable( enumName ), isWriteable, LOCATION );
+  DALI_TEST_EQUALS( camera.IsPropertyAnimatable( enumName ), isAnimateable, LOCATION );
+  DALI_TEST_EQUALS( camera.IsPropertyAConstraintInput( enumName ), isConstraintInput, LOCATION );
+}
+int UtcDaliCameraActorDefaultPropertiesInherited(void)
+{
+  TestApplication application;
+
+  CameraActor actor = CameraActor::New();
+  Stage stage = Stage::GetCurrent();
+  stage.Add(actor);
+  stage.GetRenderTaskList().GetTask(0).SetCameraActor( actor );
+
+  Stage::GetCurrent().Add( actor );
+  application.Render( 0 );
+  application.SendNotification();
+
+  const PropertyDetails CAMERA_DEFAULT_PROPERTY[] =
+  {
+// actor
+    { "parentOrigin",           Property::VECTOR3,  true,  false, true,  Dali::Actor::Property::PARENT_ORIGIN },
+    { "parentOriginX",          Property::FLOAT,    true,  false, true,  Dali::Actor::Property::PARENT_ORIGIN_X },
+    { "parentOriginY",          Property::FLOAT,    true,  false, true,  Dali::Actor::Property::PARENT_ORIGIN_Y },
+    { "parentOriginZ",          Property::FLOAT,    true,  false, true,  Dali::Actor::Property::PARENT_ORIGIN_Z },
+    { "anchorPoint",            Property::VECTOR3,  true,  false, true,  Dali::Actor::Property::ANCHOR_POINT },
+    { "anchorPointX",           Property::FLOAT,    true,  false, true,  Dali::Actor::Property::ANCHOR_POINT_X },
+    { "anchorPointY",           Property::FLOAT,    true,  false, true,  Dali::Actor::Property::ANCHOR_POINT_Y },
+    { "anchorPointZ",           Property::FLOAT,    true,  false, true,  Dali::Actor::Property::ANCHOR_POINT_Z },
+    { "size",                   Property::VECTOR3,  true,  true,  true,  Dali::Actor::Property::SIZE },
+    { "sizeWidth",              Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::SIZE_WIDTH },
+    { "sizeHeight",             Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::SIZE_HEIGHT },
+    { "sizeDepth",              Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::SIZE_DEPTH },
+    { "position",               Property::VECTOR3,  true,  true,  true,  Dali::Actor::Property::POSITION },
+    { "positionX",              Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::POSITION_X },
+    { "positionY",              Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::POSITION_Y },
+    { "positionZ",              Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::POSITION_Z },
+    { "worldPosition",          Property::VECTOR3,  false, false, true,  Dali::Actor::Property::WORLD_POSITION },
+    { "worldPositionX",         Property::FLOAT,    false, false, true,  Dali::Actor::Property::WORLD_POSITION_X },
+    { "worldPositionY",         Property::FLOAT,    false, false, true,  Dali::Actor::Property::WORLD_POSITION_Y },
+    { "worldPositionZ",         Property::FLOAT,    false, false, true,  Dali::Actor::Property::WORLD_POSITION_Z },
+    { "orientation",            Property::ROTATION, true,  true,  true,  Dali::Actor::Property::ORIENTATION },
+    { "worldOrientation",       Property::ROTATION, false, false, true,  Dali::Actor::Property::WORLD_ORIENTATION },
+    { "scale",                  Property::VECTOR3,  true,  true,  true,  Dali::Actor::Property::SCALE },
+    { "scaleX",                 Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::SCALE_X },
+    { "scaleY",                 Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::SCALE_Y },
+    { "scaleZ",                 Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::SCALE_Z },
+    { "worldScale",             Property::VECTOR3,  false, false, true,  Dali::Actor::Property::WORLD_SCALE },
+    { "visible",                Property::BOOLEAN,  true,  true,  true,  Dali::Actor::Property::VISIBLE },
+    { "color",                  Property::VECTOR4,  true,  true,  true,  Dali::Actor::Property::COLOR },
+    { "colorRed",               Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::COLOR_RED },
+    { "colorGreen",             Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::COLOR_GREEN },
+    { "colorBlue",              Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::COLOR_BLUE },
+    { "colorAlpha",             Property::FLOAT,    true,  true,  true,  Dali::Actor::Property::COLOR_ALPHA },
+    { "worldColor",             Property::VECTOR4,  false, false, true,  Dali::Actor::Property::WORLD_COLOR },
+    { "worldMatrix",            Property::MATRIX,   false, false, true,  Dali::Actor::Property::WORLD_MATRIX },
+    { "name",                   Property::STRING,   true,  false, false, Dali::Actor::Property::NAME },
+    { "sensitive",              Property::BOOLEAN,  true,  false, false, Dali::Actor::Property::SENSITIVE },
+    { "leaveRequired",          Property::BOOLEAN,  true,  false, false, Dali::Actor::Property::LEAVE_REQUIRED },
+    { "inheritOrientation",     Property::BOOLEAN,  true,  false, false, Dali::Actor::Property::INHERIT_ORIENTATION },
+    { "inheritScale",           Property::BOOLEAN,  true,  false, false, Dali::Actor::Property::INHERIT_SCALE },
+    { "colorMode",              Property::STRING,   true,  false, false, Dali::Actor::Property::COLOR_MODE },
+    { "drawMode",               Property::STRING,   true,  false, false, Dali::Actor::Property::DRAW_MODE },
+    { "sizeModeFactor",         Property::VECTOR3,  true,  false, false, Dali::Actor::Property::SIZE_MODE_FACTOR },
+    { "widthResizePolicy",      Property::STRING,   true,  false, false, Dali::Actor::Property::WIDTH_RESIZE_POLICY },
+    { "heightResizePolicy",     Property::STRING,   true,  false, false, Dali::Actor::Property::HEIGHT_RESIZE_POLICY },
+    { "sizeScalePolicy",        Property::STRING,   true,  false, false, Dali::Actor::Property::SIZE_SCALE_POLICY },
+    { "widthForHeight",         Property::BOOLEAN,  true,  false, false, Dali::Actor::Property::WIDTH_FOR_HEIGHT },
+    { "heightForWidth",         Property::BOOLEAN,  true,  false, false, Dali::Actor::Property::HEIGHT_FOR_WIDTH },
+    { "padding",                Property::VECTOR4,  true,  false, false, Dali::Actor::Property::PADDING },
+    { "minimumSize",            Property::VECTOR2,  true,  false, false, Dali::Actor::Property::MINIMUM_SIZE },
+    { "maximumSize",            Property::VECTOR2,  true,  false, false, Dali::Actor::Property::MAXIMUM_SIZE },
+    { "inheritPosition",        Property::BOOLEAN,  true,  false, false, Dali::Actor::Property::INHERIT_POSITION },
+    { "clippingMode",           Property::STRING,   true,  false, false, Dali::Actor::Property::CLIPPING_MODE },
+    { "layoutDirection",        Property::STRING,   true,  false, false, Dali::Actor::Property::LAYOUT_DIRECTION },
+    { "inheritLayoutDirection", Property::BOOLEAN,  true,  false, false, Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION },
+    { "siblingOrder",           Property::INTEGER,  true,  false, false, Dali::DevelActor::Property::SIBLING_ORDER },
+    { "opacity",                Property::FLOAT,    true,  true,  true,  Dali::DevelActor::Property::OPACITY },
+    { "screenPosition",         Property::VECTOR2,  false, false, false, Dali::DevelActor::Property::SCREEN_POSITION },
+    { "positionUsesAnchorPoint",Property::BOOLEAN,  true,  false, false, Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT },
+    { "culled",                 Property::BOOLEAN,  false, false, true,  Dali::DevelActor::Property::CULLED },
+// camera own
+    { "type",                   Property::STRING,   true,    false,   true,   Dali::CameraActor::Property::TYPE                  },
+    { "projectionMode",         Property::STRING,   true,    false,   true,   Dali::CameraActor::Property::PROJECTION_MODE       },
+    { "fieldOfView",            Property::FLOAT,    true,    false,   true,   Dali::CameraActor::Property::FIELD_OF_VIEW         },
+    { "aspectRatio",            Property::FLOAT,    true,    false,   true,   Dali::CameraActor::Property::ASPECT_RATIO          },
+    { "nearPlaneDistance",      Property::FLOAT,    true,    false,   true,   Dali::CameraActor::Property::NEAR_PLANE_DISTANCE   },
+    { "farPlaneDistance",       Property::FLOAT,    true,    false,   true,   Dali::CameraActor::Property::FAR_PLANE_DISTANCE    },
+    { "leftPlaneDistance",      Property::FLOAT,    true,    false,   true,   Dali::CameraActor::Property::LEFT_PLANE_DISTANCE   },
+    { "rightPlaneDistance",     Property::FLOAT,    true,    false,   true,   Dali::CameraActor::Property::RIGHT_PLANE_DISTANCE  },
+    { "topPlaneDistance",       Property::FLOAT,    true,    false,   true,   Dali::CameraActor::Property::TOP_PLANE_DISTANCE    },
+    { "bottomPlaneDistance",    Property::FLOAT,    true,    false,   true,   Dali::CameraActor::Property::BOTTOM_PLANE_DISTANCE },
+    { "targetPosition",         Property::VECTOR3,  true,    false,   true,   Dali::CameraActor::Property::TARGET_POSITION       },
+    { "projectionMatrix",       Property::MATRIX,   false,   false,   true,   Dali::CameraActor::Property::PROJECTION_MATRIX     },
+    { "viewMatrix",             Property::MATRIX,   false,   false,   true,   Dali::CameraActor::Property::VIEW_MATRIX           },
+    { "invertYAxis",            Property::BOOLEAN,  true,    false,   true,   Dali::CameraActor::Property::INVERT_Y_AXIS         }
+  };
+
+  for( uint32_t index = 0; index < (sizeof(CAMERA_DEFAULT_PROPERTY)/sizeof(PropertyDetails)); ++index )
+  {
+    TEST_CAMERA_PROPERTY( actor,
+                          CAMERA_DEFAULT_PROPERTY[ index ].name,
+                          CAMERA_DEFAULT_PROPERTY[ index ].type,
+                          CAMERA_DEFAULT_PROPERTY[ index ].writable,
+                          CAMERA_DEFAULT_PROPERTY[ index ].animatable,
+                          CAMERA_DEFAULT_PROPERTY[ index ].constraintInput,
+                          CAMERA_DEFAULT_PROPERTY[ index ].enumIndex,
+                          TEST_LOCATION );
+  }
+  END_TEST;
+}
+
 int UtcDaliCameraActorModelView(void)
 {
   TestApplication application;
   tet_infoline( "Testing Dali::CameraActor Test view application" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   BufferImage image = CreateBufferImage();
 
@@ -1294,6 +1423,8 @@ int UtcDaliCameraActorModelView(void)
   Matrix::Multiply( resultMatrix, resultMatrix, viewMatrix );
 
   DALI_TEST_CHECK( application.GetGlAbstraction().CheckUniformValue( "uModelView", resultMatrix ) );
+
+#endif
   END_TEST;
 }
 
@@ -1301,6 +1432,8 @@ int UtcDaliCameraActorReadProjectionMatrix(void)
 {
   TestApplication application;
   tet_infoline( "Testing Dali::CameraActor::ReadProjectionMatrix()" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   CameraActor camera = Stage::GetCurrent().GetRenderTaskList().GetTask( 0u ).GetCameraActor();
   application.SendNotification();
@@ -1339,6 +1472,7 @@ int UtcDaliCameraActorReadProjectionMatrix(void)
   DALI_TEST_CHECK( application.GetGlAbstraction().CheckUniformValue( SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME.c_str(), projectionMatrix) );
 
   DALI_TEST_CHECK( application.GetGlAbstraction().CheckUniformValue( SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME.c_str(), viewMatrix ) );
+#endif
   END_TEST;
 }
 
index 9bea015..2024a82 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -693,3 +693,59 @@ int UtcLinearConstrainerProperties(void)
 
   END_TEST;
 }
+
+int UtcDaliLinearConstrainerDetectorRegisterProperty(void)
+{
+  TestApplication application;
+
+  Dali::LinearConstrainer constrainer = Dali::LinearConstrainer::New();
+
+  Property::Index index = constrainer.RegisterProperty( "sceneProperty", 0 );
+  DALI_TEST_EQUALS( index, (Property::Index)PROPERTY_CUSTOM_START_INDEX, TEST_LOCATION );
+  DALI_TEST_EQUALS( constrainer.GetProperty< int32_t >( index ), 0, TEST_LOCATION );
+
+  constrainer.SetProperty( index, -123 );
+  DALI_TEST_EQUALS( constrainer.GetProperty< int32_t >( index ), -123, TEST_LOCATION );
+
+  using Dali::Animation;
+  Animation animation = Animation::New( 1.0f );
+  animation.AnimateTo( Property( constrainer, index ), 99 );
+
+  DALI_TEST_EQUALS( constrainer.GetProperty< int32_t >( index ), -123, TEST_LOCATION );
+  // Start the animation
+  animation.Play();
+
+  application.SendNotification();
+  application.Render( 1000 /* 100% progress */);
+  DALI_TEST_EQUALS( constrainer.GetProperty< int32_t >( index ), 99, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliPathConstrainerDetectorRegisterProperty(void)
+{
+  TestApplication application;
+
+  Dali::PathConstrainer constrainer = Dali::PathConstrainer::New();
+
+  Property::Index index = constrainer.RegisterProperty( "pathProperty", Vector2() );
+  DALI_TEST_EQUALS( index, (Property::Index)PROPERTY_CUSTOM_START_INDEX, TEST_LOCATION );
+  DALI_TEST_EQUALS( constrainer.GetProperty< Vector2 >( index ), Vector2(), TEST_LOCATION );
+
+  constrainer.SetProperty( index, Vector2(1,2) );
+  DALI_TEST_EQUALS( constrainer.GetProperty< Vector2 >( index ), Vector2(1,2), TEST_LOCATION );
+
+  using Dali::Animation;
+  Animation animation = Animation::New( 1.0f );
+  animation.AnimateTo( Property( constrainer, index ), Vector2(3,4) );
+
+  DALI_TEST_EQUALS( constrainer.GetProperty< Vector2 >( index ), Vector2(1,2), TEST_LOCATION );
+  // Start the animation
+  animation.Play();
+
+  application.SendNotification();
+  application.Render( 1000 /* 100% progress */);
+  DALI_TEST_EQUALS( constrainer.GetProperty< Vector2 >( index ), Vector2(3,4), TEST_LOCATION );
+
+  END_TEST;
+}
index 814c453..f8f8ac5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1237,3 +1237,124 @@ int UtcDaliConstraintTestPropertyTypesP(void)
 
 ///////////////////////////////////////////////////////////////////////////////
 
+///////////////////////////////////////////////////////////////////////////////
+namespace
+{
+void SetHalfOpacity( Vector4& current, const PropertyInputContainer& inputs )
+{
+  current.a = 0.5f;
+}
+} // unnamed namespace
+
+int UtcDaliConstraintEnsureResetterAppliedOnStageRemoval(void)
+{
+  // Ensure BOTH double-buffered values of our color property is reset when a constraint is applied to it.
+
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add( actor );
+
+  // Check initial value is fully opaque
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 1.0f, TEST_LOCATION );
+
+  // Create a constraint whose value is discarded when it is removed
+  Constraint constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, SetHalfOpacity );
+  constraint.SetRemoveAction( Constraint::RemoveAction::Discard );
+  constraint.Apply();
+
+  // Check value after one render, it should be constrained
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.5f, TEST_LOCATION );
+
+  // Render another frame, ensure the other value has also been updated
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.5f, TEST_LOCATION );
+
+  // Remove the actor from the stage and delete the constraint
+  actor.Unparent();
+  constraint.Remove();
+  constraint.Reset();
+
+  // Check value while off-stage, it should be fully opaque
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 1.0f, TEST_LOCATION );
+
+  // Add the actor back to the stage and check the value, it should be fully opaque again
+  Stage::GetCurrent().Add( actor );
+
+  // Check value when back on-stage, it should be fully opaque as the constraint is no longer applied to it.
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 1.0f, TEST_LOCATION );
+
+  // Render for another frame to ensure both buffers have the correct value
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 1.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliConstraintOnActorAddedAndRemoved(void)
+{
+  // Ensure adding and removing an actor from stage with a constraint still has it applied when it is re-added back to the stage
+
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add( actor );
+
+  // Check initial value is fully opaque
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 1.0f, TEST_LOCATION );
+
+  // Create a constraint whose value is discarded when it is removed
+  Constraint constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, SetHalfOpacity );
+  constraint.SetRemoveAction( Constraint::RemoveAction::Discard );
+  constraint.Apply();
+
+  // Check value after one render, it should be constrained
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.5f, TEST_LOCATION );
+
+  // Render another frame, ensure the other value has also been updated
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.5f, TEST_LOCATION );
+
+  // Remove the actor from the stage
+  actor.Unparent();
+
+  // Check value while off-stage, the constraint is no longer being applied as it's off-stage
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 1.0f, TEST_LOCATION );
+
+  // Check the other buffer, the constraint should not be applied to this either.
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 1.0f, TEST_LOCATION );
+
+  // Add the actor back to the stage and check the value, the constraint should have been re-applied
+  Stage::GetCurrent().Add( actor );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.5f, TEST_LOCATION );
+
+  // Render for another frame to ensure both buffers have the correct value
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS( actor.GetCurrentColor().a, 0.5f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+///////////////////////////////////////////////////////////////////////////////
index 0b8e151..38c2e88 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,6 +43,7 @@ enum TestAttribType
 };
 
 // Create bitmap actor
+#if 0
 static Actor CreateBitmapActor()
 {
   BufferImage image = BufferImage::New(4,4,Pixel::RGBA8888);
@@ -51,7 +52,7 @@ static Actor CreateBitmapActor()
   actor.SetName("Test Image Rendering Actor");
   return actor;
 }
-
+#endif
 } // anonymous namespace
 
 
@@ -59,6 +60,8 @@ static Actor CreateBitmapActor()
 int UtcDaliContextVertexAttribStartup(void)
 {
   tet_infoline("Testing vertex attrib initial state in context");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   TestApplication application;
 
@@ -74,6 +77,7 @@ int UtcDaliContextVertexAttribStartup(void)
   }
 
   tet_result(TET_PASS);
+#endif
   END_TEST;
 }
 
@@ -81,6 +85,8 @@ int UtcDaliContextVertexAttribStartup(void)
 int UtcDaliContextVertexAttribImageRendering(void)
 {
   tet_infoline("Testing vertex attrib rendering state in context with images");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   TestApplication application;
 
@@ -119,5 +125,6 @@ int UtcDaliContextVertexAttribImageRendering(void)
 
 
   tet_result(TET_PASS);
+#endif
   END_TEST;
 }
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+#include <iostream>
+#include <sstream>
+#include <cmath> // isfinite
+
+#include <stdlib.h>
+#include <dali/integration-api/core.h>
 #include <dali-test-suite-utils.h>
-#include <dali/graphics-api/graphics-api-texture.h>
 
-using Dali::Graphics::API::Texture;
+using namespace Dali;
 
-void utc_dali_graphics_api_textures_startup(void)
+void utc_dali_core_startup(void)
 {
   test_return_value = TET_UNDEF;
 }
 
-void utc_dali_graphics_api_textures_cleanup(void)
+void utc_dali_core_cleanup(void)
 {
   test_return_value = TET_PASS;
 }
 
-namespace
-{
-
-class TestTexture : public Texture
-{
-public:
-  virtual int GetNumber() const override
-  {
-    return 42;
-  }
-
-  virtual Texture
-};
-
-} // namespace
-
-int UtcDaliGraphicsAPITextures(void)
+int UtcDaliCoreGetMaximumUpdateCount(void)
 {
-  TestTexture testTexture;
+  TestApplication application;
+  tet_infoline("Testing Dali::GetMaximumUpdateCount");
 
+  DALI_TEST_EQUALS( 2, application.GetCore().GetMaximumUpdateCount(), TEST_LOCATION );
   END_TEST;
 }
+
index 34392ad..c3138e7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1331,7 +1331,6 @@ int UtcDaliCustomActorSetGetProperty(void)
   END_TEST;
 }
 
-
 int utcDaliActorGetTypeInfo(void)
 {
   TestApplication application;
@@ -1345,3 +1344,202 @@ int utcDaliActorGetTypeInfo(void)
 
   END_TEST;
 }
+
+namespace Impl
+{
+/**
+ * A custom actor that is not type registered on purpose
+ */
+struct UnregisteredCustomActor : public Dali::CustomActorImpl
+{
+  UnregisteredCustomActor() : CustomActorImpl( ACTOR_BEHAVIOUR_DEFAULT )
+  { }
+  virtual ~UnregisteredCustomActor()
+  { }
+  virtual void OnStageConnection( int32_t depth )
+  { }
+  virtual void OnStageDisconnection()
+  { }
+  virtual void OnChildAdd(Actor& child)
+  { }
+  virtual void OnChildRemove(Actor& child)
+  { }
+  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue )
+  { }
+  virtual void OnSizeSet(const Vector3& targetSize)
+  { }
+  virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize)
+  { }
+  virtual bool OnTouchEvent(const TouchEvent& event) DALI_DEPRECATED_API
+  { return false; }
+  virtual bool OnHoverEvent(const HoverEvent& event)
+  { return false; }
+  virtual bool OnKeyEvent(const KeyEvent& event)
+  { return false; }
+  virtual bool OnWheelEvent(const WheelEvent& event)
+  { return false; }
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container )
+  { }
+  virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
+  { }
+  virtual Vector3 GetNaturalSize()
+  { return Vector3(); }
+  virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension )
+  { return 0.f; }
+  virtual float GetHeightForWidth( float width )
+  { return 0.f; }
+  virtual float GetWidthForHeight( float height )
+  { return 0.f; }
+  virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS )
+  { return false; }
+  virtual void OnCalculateRelayoutSize( Dimension::Type dimension )
+  { }
+  virtual void OnLayoutNegotiated( float size, Dimension::Type dimension )
+  { }
+};
+}
+struct UnregisteredCustomActor : public Dali::CustomActor
+{
+  static UnregisteredCustomActor New()
+  {
+    Impl::UnregisteredCustomActor* impl = new Impl::UnregisteredCustomActor;
+    UnregisteredCustomActor custom( *impl ); // takes ownership
+    return custom;
+  }
+  UnregisteredCustomActor()
+  { }
+  ~UnregisteredCustomActor()
+  { }
+  UnregisteredCustomActor( Internal::CustomActor* impl )
+  : CustomActor( impl )
+  { }
+  UnregisteredCustomActor( Impl::UnregisteredCustomActor& impl )
+  : CustomActor( impl )
+  { }
+  static UnregisteredCustomActor DownCast( BaseHandle handle )
+  {
+    UnregisteredCustomActor hndl;
+    CustomActor custom = Dali::CustomActor::DownCast( handle );
+    if( custom )
+    {
+      CustomActorImpl& customImpl = custom.GetImplementation();
+
+      Impl::UnregisteredCustomActor* impl = dynamic_cast<Impl::UnregisteredCustomActor*>( &customImpl );
+
+      if( impl )
+      {
+        hndl = UnregisteredCustomActor( customImpl.GetOwner() );
+      }
+    }
+    return hndl;
+  }
+};
+
+int UtcDaliCustomActorSetGetActorPropertyActionSignal(void)
+{
+  TestApplication application; // Need the type registry
+
+  auto custom = UnregisteredCustomActor::New();
+  Stage::GetCurrent().Add( custom );
+
+  // should have all actor properties
+  DALI_TEST_EQUALS( custom.GetPropertyType( Actor::Property::COLOR ), Property::VECTOR4, TEST_LOCATION );
+  auto actorHandle = Actor::New();
+  DALI_TEST_EQUALS( custom.GetPropertyCount(), actorHandle.GetPropertyCount(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( custom.IsVisible(), true, TEST_LOCATION );
+  custom.SetProperty( Actor::Property::VISIBLE, false );
+  application.SendNotification();
+  application.Render(); // IsVisible returns scene value
+  DALI_TEST_EQUALS( custom.IsVisible(), false, TEST_LOCATION );
+
+  // should have custom actor typename (as it has not registered itself)
+  DALI_TEST_EQUALS( "CustomActor", custom.GetTypeName(), TEST_LOCATION );
+
+  // should have actor actions
+  custom.DoAction( "show",  Property::Map() );
+  DALI_TEST_EQUALS( custom.GetProperty( Actor::Property::VISIBLE ).Get<bool>(), true, TEST_LOCATION );
+
+  Animation animation = Animation::New(0.01f); // very short animation
+  // should be able to animate actor property
+  animation.AnimateTo( Property( custom, Actor::Property::POSITION ), Vector3( 100.0f, 150.0f, 200.0f ) );
+  animation.Play();
+
+  application.SendNotification();
+  application.Render(1000.f);
+
+  DALI_TEST_EQUALS( Vector3( 100.0f, 150.0f, 200.0f ), custom.GetProperty( Actor::Property::POSITION ).Get<Vector3>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( Vector3( 100.0f, 150.0f, 200.0f ), custom.GetCurrentPosition(), TEST_LOCATION );
+
+  Dali::WeakHandle<UnregisteredCustomActor> weakRef( custom );
+  // should have actor signals
+  custom.ConnectSignal( &application, "offStage",
+    [weakRef]()
+      {
+        DALI_TEST_EQUALS( weakRef.GetHandle().OnStage(), false, TEST_LOCATION );
+      } );
+
+  Stage::GetCurrent().Remove( custom );
+  Stage::GetCurrent().Add( custom );
+
+  END_TEST;
+}
+
+namespace Impl
+{
+struct DerivedCustomActor : public UnregisteredCustomActor
+{ };
+}
+
+struct DerivedCustomActor : public UnregisteredCustomActor
+{
+  static DerivedCustomActor New()
+  {
+    Impl::DerivedCustomActor* impl = new Impl::DerivedCustomActor;
+    DerivedCustomActor custom( *impl ); // takes ownership
+    return custom;
+  }
+  DerivedCustomActor()
+  { }
+  ~DerivedCustomActor()
+  { }
+  DerivedCustomActor( Internal::CustomActor* impl )
+  : UnregisteredCustomActor( impl )
+  { }
+  DerivedCustomActor( Impl::UnregisteredCustomActor& impl )
+  : UnregisteredCustomActor( impl )
+  { }
+};
+
+// register custom
+DALI_TYPE_REGISTRATION_BEGIN( DerivedCustomActor, UnregisteredCustomActor, nullptr );
+DALI_TYPE_REGISTRATION_END()
+
+int UtcDaliCustomActorPropertyRegistrationDefaultValue(void)
+{
+  TestApplication application; // Need the type registry
+
+  // register our base and add a property with default value for it
+  Dali::TypeRegistration typeRegistration( typeid( UnregisteredCustomActor ), typeid( Dali::CustomActor ), nullptr );
+
+  auto derived = DerivedCustomActor::New();
+  Stage::GetCurrent().Add( derived );
+
+  // should have all actor properties
+  DALI_TEST_EQUALS( derived.GetPropertyType( Actor::Property::WORLD_MATRIX ), Property::MATRIX, TEST_LOCATION );
+  auto actorHandle = Actor::New();
+  DALI_TEST_EQUALS( derived.GetPropertyCount(), actorHandle.GetPropertyCount(), TEST_LOCATION );
+
+  // add a property in base class
+  AnimatablePropertyRegistration( typeRegistration, "Foobar", ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX, 10.f );
+
+  // should be one more property now
+  DALI_TEST_EQUALS( derived.GetPropertyCount(), actorHandle.GetPropertyCount() + 1, TEST_LOCATION );
+  // check that the default value is set for base class
+  DALI_TEST_EQUALS( UnregisteredCustomActor::New().GetProperty(ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX).Get<float>(), 10.f, TEST_LOCATION );
+  // check that the default value is set for the derived instance as well
+  DALI_TEST_EQUALS( derived.GetProperty(ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX).Get<float>(), 10.f, TEST_LOCATION );
+
+  END_TEST;
+}
+
index b96b82f..04a0535 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,6 +35,9 @@ void framebuffer_set_cleanup(void)
 int UtcDaliFrameBufferNew01(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliFramebufferNew01");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int width(64);
   unsigned int height(64);
@@ -48,13 +51,16 @@ int UtcDaliFrameBufferNew01(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
 int UtcDaliFrameBufferNew02(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliFramebufferNew02");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int width(64);
   unsigned int height(64);
@@ -68,7 +74,7 @@ int UtcDaliFrameBufferNew02(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
@@ -76,6 +82,9 @@ int UtcDaliFrameBufferNew03(void)
 {
   TestApplication application;
 
+  tet_infoline("UtcDaliFramebufferNew03");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   unsigned int width(64);
   unsigned int height(64);
   FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::STENCIL );
@@ -88,13 +97,16 @@ int UtcDaliFrameBufferNew03(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
 int UtcDaliFrameBufferNew04(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliFramebufferNew04");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int width(64);
   unsigned int height(64);
@@ -108,13 +120,15 @@ int UtcDaliFrameBufferNew04(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
 int UtcDaliFrameBufferNew05(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliFrameBufferNew05");
+
   FrameBuffer frameBuffer;
   DALI_TEST_CHECK( !frameBuffer );
   END_TEST;
@@ -123,6 +137,9 @@ int UtcDaliFrameBufferNew05(void)
 int UtcDaliFrameBufferNew06(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliFrameBufferNew06");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int width(64);
   unsigned int height(64);
@@ -136,7 +153,113 @@ int UtcDaliFrameBufferNew06(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+#endif
+  END_TEST;
+}
 
+int UtcDaliFrameBufferNewWithColor01(void)
+{
+  TestApplication application;
+  tet_infoline("UtcDaliFrameBufferNewWithColor01");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+  uint32_t width = 64;
+  uint32_t height = 64;
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  // check that texture is not empty handle
+  DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+
+#endif
+  END_TEST;
+}
+
+int UtcDaliFrameBufferNewWithColor02(void)
+{
+  TestApplication application;
+  tet_infoline("UtcDaliFrameBufferNewWithColor02");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+  uint32_t width = 64;
+  uint32_t height = 64;
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  // check that texture is not empty handle
+  DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+
+#endif
+  END_TEST;
+}
+
+int UtcDaliFrameBufferNewWithColor03(void)
+{
+  TestApplication application;
+  tet_infoline("UtcDaliFrameBufferNewWithColor03");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+  uint32_t width = 64;
+  uint32_t height = 64;
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR_DEPTH );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  // check that texture is not empty handle
+  DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+
+#endif
+  END_TEST;
+}
+
+int UtcDaliFrameBufferNewWithColor04(void)
+{
+  TestApplication application;
+  tet_infoline("UtcDaliFrameBufferNewWithColor04");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
+  uint32_t width = 64;
+  uint32_t height = 64;
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR_STENCIL );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  // check that texture is not empty handle
+  DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+
+#endif
+  END_TEST;
+}
+
+int UtcDaliFrameBufferNewWithColor05(void)
+{
+  TestApplication application;
+  tet_infoline("UtcDaliFrameBufferNewWithColor05");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+  uint32_t width = 64;
+  uint32_t height = 64;
+  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::COLOR_DEPTH_STENCIL );
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
+  // check that texture is not empty handle
+  DALI_TEST_CHECK( frameBuffer.GetColorTexture() );
+
+#endif
   END_TEST;
 }
 
@@ -199,6 +322,9 @@ int UtcDaliFrameBufferDownCast02(void)
 int UtcDaliFrameBufferAttachColorTexture01(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliFrameBufferAttachColorTexture01");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int width(64);
   unsigned int height(64);
@@ -212,13 +338,16 @@ int UtcDaliFrameBufferAttachColorTexture01(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
 int UtcDaliFrameBufferAttachColorTexture02(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliFrameBufferAttachColorTexture02");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int width(64);
   unsigned int height(64);
@@ -235,13 +364,16 @@ int UtcDaliFrameBufferAttachColorTexture02(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
 int UtcDaliFrameBufferAttachColorTexture03(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliFrameBufferAttachColorTexture03");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int width(64);
   unsigned int height(64);
@@ -258,13 +390,16 @@ int UtcDaliFrameBufferAttachColorTexture03(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
 int UtcDaliFrameBufferAttachColorTexture04(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliFrameBufferAttachColorTexture04");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int width(64);
   unsigned int height(64);
@@ -278,7 +413,7 @@ int UtcDaliFrameBufferAttachColorTexture04(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
@@ -311,31 +446,3 @@ int UtcDaliFrameBufferGetColorTexture02(void)
 
   END_TEST;
 }
-
-int UtcDaliFramebufferContextLoss(void)
-{
-  tet_infoline("UtcDaliFramebufferContextLoss\n");
-  TestApplication application; // Default config: DALI_DISCARDS_ALL_DATA
-
-  //Create the texture
-  unsigned int width(64);
-  unsigned int height(64);
-  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
-  DALI_TEST_CHECK( texture );
-  FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::NONE );
-  DALI_TEST_CHECK( frameBuffer );
-  frameBuffer.AttachColorTexture( texture, 0u, 1u );
-
-  Geometry geometry = CreateQuadGeometry();
-  Shader shader = CreateShader();
-  Renderer renderer = Renderer::New(geometry, shader);
-
-  application.SendNotification();
-  application.Render(16);
-
-  // Lose & regain context (in render 'thread')
-  application.ResetContext();
-  DALI_TEST_CHECK( frameBuffer );
-
-  END_TEST;
-}
index af150dc..6a98af1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali-test-suite-utils.h>
 #include <test-native-image.h>
-#include <dali/integration-api/gl-abstraction.h>
+
 
 using std::max;
 using namespace Dali;
@@ -113,6 +113,8 @@ int UtcDaliFrameBufferImageAttachments01(void)
   TestApplication application;
 
   tet_infoline("UtcDaliFrameBufferImageAttachments01 - FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // invoke default handle constructor
   FrameBufferImage image;
@@ -130,7 +132,7 @@ int UtcDaliFrameBufferImageAttachments01(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
@@ -139,6 +141,8 @@ int UtcDaliFrameBufferImageAttachments02(void)
   TestApplication application;
 
   tet_infoline("UtcDaliFrameBufferImageAttachments02 - FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // invoke default handle constructor
   FrameBufferImage image;
@@ -156,7 +160,7 @@ int UtcDaliFrameBufferImageAttachments02(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
@@ -165,6 +169,8 @@ int UtcDaliFrameBufferImageAttachments03(void)
   TestApplication application;
 
   tet_infoline("UtcDaliFrameBufferImageAttachments03 - FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // invoke default handle constructor
   FrameBufferImage image;
@@ -182,7 +188,7 @@ int UtcDaliFrameBufferImageAttachments03(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_FALSE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
@@ -191,6 +197,8 @@ int UtcDaliFrameBufferImageAttachments04(void)
   TestApplication application;
 
   tet_infoline("UtcDaliFrameBufferImageAttachments04 - FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format, RenderBuffer::Format)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // invoke default handle constructor
   FrameBufferImage image;
@@ -208,7 +216,7 @@ int UtcDaliFrameBufferImageAttachments04(void)
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferColorAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferDepthAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckFramebufferStencilAttachment(), (GLenum)GL_TRUE, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
diff --git a/automated-tests/src/dali/utc-Dali-FrameCallbackInterface.cpp b/automated-tests/src/dali/utc-Dali-FrameCallbackInterface.cpp
new file mode 100644 (file)
index 0000000..d854148
--- /dev/null
@@ -0,0 +1,922 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+
+#include <stdlib.h>
+#include <dali/public-api/dali-core.h>
+#include <dali/devel-api/common/map-wrapper.h>
+#include <dali/devel-api/common/stage-devel.h>
+#include <dali/devel-api/update/frame-callback-interface.h>
+#include <dali/devel-api/update/update-proxy.h>
+#include <dali-test-suite-utils.h>
+
+using namespace Dali;
+
+void utc_dali_frame_callback_interface_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_frame_callback_interface_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+namespace
+{
+
+class FrameCallbackBasic : public FrameCallbackInterface
+{
+public:
+
+  FrameCallbackBasic() = default;
+
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds )
+  {
+    mCalled = true;
+  }
+
+  virtual void Reset()
+  {
+    mCalled = false;
+  }
+
+  bool mCalled{ false };
+};
+
+class FrameCallbackOneActor : public FrameCallbackBasic
+{
+public:
+
+  FrameCallbackOneActor( unsigned int actorId )
+  : mActorId( actorId )
+  {
+  }
+
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
+  {
+    FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
+    updateProxy.GetSize( mActorId, mSizeGetSizeCall );
+    updateProxy.GetPosition( mActorId, mPositionGetPositionCall );
+    updateProxy.GetPositionAndSize( mActorId, mPositionGetPositionAndSizeCall, mSizeGetPositionAndSizeCall );
+    updateProxy.GetColor( mActorId, mColor );
+    updateProxy.GetScale( mActorId, mScale );
+  }
+
+  const unsigned int mActorId;
+
+  Vector3 mSizeGetSizeCall;
+  Vector3 mPositionGetPositionCall;
+  Vector3 mPositionGetPositionAndSizeCall;
+  Vector3 mSizeGetPositionAndSizeCall;
+  Vector4 mColor;
+  Vector3 mScale;
+};
+
+class FrameCallbackSetter : public FrameCallbackBasic
+{
+public:
+
+  FrameCallbackSetter(
+      unsigned int actorId,
+      const Vector3& sizeToSet,
+      const Vector3& positionToSet,
+      const Vector4& colorToSet,
+      const Vector3& scaleToSet )
+  : mActorId( actorId ),
+    mSizeToSet( sizeToSet ),
+    mPositionToSet( positionToSet ),
+    mColorToSet( colorToSet ),
+    mScaleToSet( scaleToSet )
+  {
+  }
+
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
+  {
+    FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
+    updateProxy.SetSize( mActorId, mSizeToSet );
+    updateProxy.SetPosition( mActorId, mPositionToSet );
+    updateProxy.SetColor( mActorId, mColorToSet );
+    updateProxy.SetScale( mActorId, mScaleToSet );
+    updateProxy.GetSize( mActorId, mSizeAfterSetting );
+    updateProxy.GetPosition( mActorId, mPositionAfterSetting );
+    updateProxy.GetColor( mActorId, mColorAfterSetting );
+    updateProxy.GetScale( mActorId, mScaleAfterSetting );
+  }
+
+  const unsigned int mActorId;
+  const Vector3& mSizeToSet;
+  const Vector3& mPositionToSet;
+  const Vector4& mColorToSet;
+  const Vector3& mScaleToSet;
+
+  Vector3 mSizeAfterSetting;
+  Vector3 mPositionAfterSetting;
+  Vector4 mColorAfterSetting;
+  Vector3 mScaleAfterSetting;
+};
+
+class FrameCallbackBaker : public FrameCallbackBasic
+{
+public:
+
+  FrameCallbackBaker(
+      unsigned int actorId,
+      const Vector3& sizeToSet,
+      const Vector3& positionToSet,
+      const Vector4& colorToSet,
+      const Vector3& scaleToSet )
+  : mActorId( actorId ),
+    mSizeToSet( sizeToSet ),
+    mPositionToSet( positionToSet ),
+    mColorToSet( colorToSet ),
+    mScaleToSet( scaleToSet )
+  {
+  }
+
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
+  {
+    FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
+    updateProxy.BakeSize( mActorId, mSizeToSet );
+    updateProxy.BakePosition( mActorId, mPositionToSet );
+    updateProxy.BakeColor( mActorId, mColorToSet );
+    updateProxy.BakeScale( mActorId, mScaleToSet );
+    updateProxy.GetSize( mActorId, mSizeAfterSetting );
+    updateProxy.GetPosition( mActorId, mPositionAfterSetting );
+    updateProxy.GetColor( mActorId, mColorAfterSetting );
+    updateProxy.GetScale( mActorId, mScaleAfterSetting );
+  }
+
+  const unsigned int mActorId;
+  const Vector3& mSizeToSet;
+  const Vector3& mPositionToSet;
+  const Vector4& mColorToSet;
+  const Vector3& mScaleToSet;
+
+  Vector3 mSizeAfterSetting;
+  Vector3 mPositionAfterSetting;
+  Vector4 mColorAfterSetting;
+  Vector3 mScaleAfterSetting;
+};
+
+class FrameCallbackMultipleActors : public FrameCallbackBasic
+{
+public:
+
+  FrameCallbackMultipleActors()
+  {
+  }
+
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
+  {
+    FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
+    for( auto&& i : mActorIds )
+    {
+      Vector3 position;
+      Vector3 size;
+      updateProxy.GetPositionAndSize( i, position, size );
+      mPositions[ i ] = position;
+      mSizes[ i ] = size;
+    }
+  }
+
+  Vector< unsigned int > mActorIds;
+
+  std::map< unsigned int, Vector3 > mPositions;
+  std::map< unsigned int, Vector3 > mSizes;
+};
+
+class FrameCallbackActorIdCheck : public FrameCallbackBasic
+{
+public:
+
+  FrameCallbackActorIdCheck( unsigned int actorId )
+  : mActorId( actorId )
+  {
+  }
+
+  virtual void Update( Dali::UpdateProxy& updateProxy, float elapsedSeconds ) override
+  {
+    FrameCallbackBasic::Update( updateProxy, elapsedSeconds );
+    Vector3 vec3;
+    Vector4 vec4;
+
+    mGetSizeCallSuccess            = updateProxy.GetSize( mActorId, vec3 );
+    mGetPositionCallSuccess        = updateProxy.GetPosition( mActorId, vec3 );
+    mGetColorCallSuccess           = updateProxy.GetColor( mActorId, vec4 );
+    mGetScaleCallSuccess           = updateProxy.GetScale( mActorId, vec3 );
+    mGetPositionAndSizeCallSuccess = updateProxy.GetPositionAndSize( mActorId, vec3, vec3 );
+    mSetSizeCallSuccess            = updateProxy.SetSize( mActorId, vec3 );
+    mSetPositionCallSuccess        = updateProxy.SetPosition( mActorId, vec3 );
+    mSetColorCallSuccess           = updateProxy.SetColor( mActorId, vec4 );
+    mSetScaleCallSuccess           = updateProxy.SetScale( mActorId, vec3 );
+    mBakeSizeCallSuccess           = updateProxy.BakeSize( mActorId, vec3 );
+    mBakePositionCallSuccess       = updateProxy.BakePosition( mActorId, vec3 );
+    mBakeColorCallSuccess          = updateProxy.BakeColor( mActorId, vec4 );
+    mBakeScaleCallSuccess          = updateProxy.BakeScale( mActorId, vec3 );
+  }
+
+  virtual void Reset() override
+  {
+    // Up-call
+    FrameCallbackBasic::Reset();
+
+    mGetSizeCallSuccess = false;
+    mGetPositionCallSuccess = false;
+    mGetColorCallSuccess = false;
+    mGetScaleCallSuccess = false;
+    mGetPositionAndSizeCallSuccess = false;
+    mSetSizeCallSuccess = false;
+    mSetPositionCallSuccess = false;
+    mSetColorCallSuccess = false;
+    mSetScaleCallSuccess = false;
+    mBakeSizeCallSuccess = false;
+    mBakePositionCallSuccess = false;
+    mBakeColorCallSuccess = false;
+    mBakeScaleCallSuccess = false;
+  }
+
+  const uint32_t mActorId;
+  bool mGetSizeCallSuccess{ false };
+  bool mGetPositionCallSuccess{ false };
+  bool mGetColorCallSuccess{ false };
+  bool mGetScaleCallSuccess{ false };
+  bool mGetPositionAndSizeCallSuccess{ false };
+  bool mSetSizeCallSuccess{ false };
+  bool mSetPositionCallSuccess{ false };
+  bool mSetColorCallSuccess{ false };
+  bool mSetScaleCallSuccess{ false };
+  bool mBakeSizeCallSuccess{ false };
+  bool mBakePositionCallSuccess{ false };
+  bool mBakeColorCallSuccess{ false };
+  bool mBakeScaleCallSuccess{ false };
+};
+
+} // anon namespace
+
+///////////////////////////////////////////////////////////////////////////////
+
+int UtcDaliFrameCallbackCheckInstallationAndRemoval(void)
+{
+  // Basic test to check that the frame-callback can be installed and removed correctly
+
+  TestApplication application;
+
+  FrameCallbackBasic frameCallback;
+
+  Stage stage = Stage::GetCurrent();
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
+
+  frameCallback.mCalled = false;
+
+  DevelStage::RemoveFrameCallback( stage, frameCallback );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackGetters(void)
+{
+  // Test to see that the Getters all return the expected values
+
+  TestApplication application;
+  Vector2 actorSize( 200, 300 );
+  Vector4 color( 0.5f, 0.6f, 0.7f, 0.8f );
+  Vector3 position( 10.0f, 20.0f, 30.0f );
+  Vector3 scale( 2.0f, 4.0f, 6.0f );
+
+  Actor actor = Actor::New();
+  actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actor.SetSize( actorSize );
+  actor.SetColor( color );
+  actor.SetPosition( position );
+  actor.SetScale( scale );
+
+  Stage stage = Stage::GetCurrent();
+  stage.Add( actor );
+
+  FrameCallbackOneActor frameCallback( actor.GetId() );
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSizeGetSizeCall, Vector3( actorSize.width, actorSize.height, 0.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mPositionGetPositionCall, position, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mPositionGetPositionAndSizeCall, position, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSizeGetPositionAndSizeCall, Vector3( actorSize.width, actorSize.height, 0.0f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mColor, color, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mScale, scale, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackSetters(void)
+{
+  // Test to see that the setters set the values appropriately
+
+  TestApplication application;
+  Vector2 actorSize( 200, 300 );
+
+  Actor actor = Actor::New();
+  actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actor.SetSize( actorSize );
+
+  Stage stage = Stage::GetCurrent();
+  stage.Add( actor );
+
+  Vector3 sizeToSet( 1.0f, 2.0f, 3.0f );
+  Vector3 positionToSet( 10.0f, 20.0f, 30.0f );
+  Vector4 colorToSet( Color::MAGENTA );
+  Vector3 scaleToSet( 1.0f, 3.0f, 5.0f );
+
+  FrameCallbackSetter frameCallback( actor.GetId(), sizeToSet, positionToSet, colorToSet, scaleToSet );
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSizeAfterSetting, sizeToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mPositionAfterSetting, positionToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mColorAfterSetting, colorToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mScaleAfterSetting, scaleToSet, TEST_LOCATION );
+
+  // Ensure the actual actor values haven't changed as we didn't bake the values after removing the callback
+  DevelStage::RemoveFrameCallback( stage, frameCallback );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(), Vector3( actorSize ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::COLOR ).Get< Vector4 >(), Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SCALE ).Get< Vector3 >(), Vector3::ONE, TEST_LOCATION );
+
+  // Render for a couple more frames to ensure the values are reset properly (some values are double-buffered)
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(), Vector3( actorSize ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::COLOR ).Get< Vector4 >(), Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SCALE ).Get< Vector3 >(), Vector3::ONE, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(), Vector3( actorSize ), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::COLOR ).Get< Vector4 >(), Color::WHITE, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SCALE ).Get< Vector3 >(), Vector3::ONE, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackBake(void)
+{
+  // Test to see that the bake methods bake the values
+
+  TestApplication application;
+  Vector2 actorSize( 200, 300 );
+
+  Actor actor = Actor::New();
+  actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actor.SetSize( actorSize );
+
+  Stage stage = Stage::GetCurrent();
+  stage.Add( actor );
+
+  Vector3 sizeToSet( 1.0f, 2.0f, 3.0f );
+  Vector3 positionToSet( 10.0f, 20.0f, 30.0f );
+  Vector4 colorToSet( Color::MAGENTA );
+  Vector3 scaleToSet( 1.0f, 3.0f, 5.0f );
+
+  FrameCallbackBaker frameCallback( actor.GetId(), sizeToSet, positionToSet, colorToSet, scaleToSet );
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSizeAfterSetting, sizeToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mPositionAfterSetting, positionToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mColorAfterSetting, colorToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mScaleAfterSetting, scaleToSet, TEST_LOCATION );
+
+  // Ensure the new values are saved after removing the callback
+  DevelStage::RemoveFrameCallback( stage, frameCallback );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::POSITION ).Get< Vector3 >(), positionToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(), sizeToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::COLOR ).Get< Vector4 >(), colorToSet, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetCurrentProperty( Actor::Property::SCALE ).Get< Vector3 >(), scaleToSet, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliFrameCallbackMultipleActors(void)
+{
+  /**
+   * Test to check that the frame callback behaves appropriately with multiple actors
+   *
+   * Tree:
+   *              root-layer
+   *              /        \
+   *             /          \
+   *            /            \
+   *           /              \
+   *        actorA           actorE
+   *         / \              / \
+   *        /   \            /   \
+   *    actorB  actorD   actorF actorG
+   *      /                        \
+   *   actorC                     actorH
+   *
+   *  Screen positions (with minor alterations due to local position):
+   *  -----------------------
+   *  |actorA|actorD        |
+   *  |      actorB         |
+   *  |      actorC         |
+   *  |                     |
+   *  |                     |
+   *  |                     |
+   *  |                     |
+   *  |                     |
+   *  |actorF       actorH  |
+   *  |actorE|actorG        |
+   *  -----------------------
+   */
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  std::map< char, Vector3 > sizes;
+  sizes['A'] = Vector3(  50.0f,  50.0f, 0.0f );
+  sizes['B'] = Vector3( 100.0f, 100.0f, 0.0f );
+  sizes['C'] = Vector3( 150.0f, 150.0f, 0.0f );
+  sizes['D'] = Vector3( 200.0f, 200.0f, 0.0f );
+  sizes['E'] = Vector3( 250.0f, 250.0f, 0.0f );
+  sizes['F'] = Vector3( 300.0f, 300.0f, 0.0f );
+  sizes['G'] = Vector3( 350.0f, 350.0f, 0.0f );
+  sizes['H'] = Vector3( 400.0f, 350.0f, 0.0f );
+
+  std::map< char, Vector3 > positions;
+  positions['A'] = Vector3(  0.0f,  1.0f,  2.0f );
+  positions['B'] = Vector3(  2.0f,  3.0f,  4.0f );
+  positions['C'] = Vector3(  5.0f,  6.0f,  7.0f );
+  positions['D'] = Vector3(  8.0f,  9.0f, 10.0f );
+  positions['E'] = Vector3( 11.0f, 12.0f, 13.0f );
+  positions['F'] = Vector3( 14.0f, 15.0f, 16.0f );
+  positions['G'] = Vector3( 17.0f, 18.0f, 19.0f );
+  positions['H'] = Vector3( 20.0f, 21.0f, 22.0f );
+
+  Actor actorA = Actor::New();
+  actorA.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  actorA.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actorA.SetSize( sizes['A'] );
+  actorA.SetPosition( positions['A'] );
+  stage.Add( actorA );
+
+  Actor actorB = Actor::New();
+  actorB.SetParentOrigin( ParentOrigin::BOTTOM_RIGHT );
+  actorB.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actorB.SetSize( sizes['B'] );
+  actorB.SetPosition( positions['B'] );
+  actorA.Add( actorB );
+
+  Actor actorC = Actor::New();
+  actorC.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+  actorC.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+  actorC.SetSize( sizes['C'] );
+  actorC.SetPosition( positions['C'] );
+  actorB.Add( actorC );
+
+  Actor actorD = Actor::New();
+  actorD.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
+  actorD.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
+  actorD.SetSize( sizes['D'] );
+  actorD.SetPosition( positions['D'] );
+  actorA.Add( actorD );
+
+  Actor actorE = Actor::New();
+  actorE.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
+  actorE.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
+  actorE.SetSize( sizes['E'] );
+  actorE.SetPosition( positions['E'] );
+  stage.Add( actorE );
+
+  Actor actorF = Actor::New();
+  actorF.SetParentOrigin( ParentOrigin::TOP_CENTER );
+  actorF.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+  actorF.SetSize( sizes['F'] );
+  actorF.SetPosition( positions['F'] );
+  actorE.Add( actorF );
+
+  Actor actorG = Actor::New();
+  actorG.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
+  actorG.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
+  actorG.SetSize( sizes['G'] );
+  actorG.SetPosition( positions['G'] );
+  actorE.Add( actorG );
+
+  Actor actorH = Actor::New();
+  actorH.SetParentOrigin( ParentOrigin::TOP_RIGHT );
+  actorH.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT );
+  actorH.SetSize( sizes['H'] );
+  actorH.SetPosition( positions['H'] );
+  actorG.Add( actorH );
+
+  std::map< char, unsigned int > actorIds;
+  actorIds['A'] = actorA.GetId();
+  actorIds['B'] = actorB.GetId();
+  actorIds['C'] = actorC.GetId();
+  actorIds['D'] = actorD.GetId();
+  actorIds['E'] = actorE.GetId();
+  actorIds['F'] = actorF.GetId();
+  actorIds['G'] = actorG.GetId();
+  actorIds['H'] = actorH.GetId();
+
+  FrameCallbackMultipleActors frameCallback;
+  for( auto&& i : actorIds )
+  {
+    frameCallback.mActorIds.PushBack( i.second );
+  }
+
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
+
+  for( char i = 'A'; i <= 'H'; ++i )
+  {
+    DALI_TEST_EQUALS( frameCallback.mPositions[ actorIds[ i ] ], positions[ i ], TEST_LOCATION );
+    DALI_TEST_EQUALS( frameCallback.mSizes[ actorIds[ i ] ], sizes[ i ], TEST_LOCATION );
+  }
+
+  // Render again to make sure it still gets called and gives the correct values (in case any optimisations break this)
+  frameCallback.mCalled = false;
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
+
+  for( char i = 'A'; i <= 'H'; ++i )
+  {
+    DALI_TEST_EQUALS( frameCallback.mPositions[ actorIds[ i ] ], positions[ i ], TEST_LOCATION );
+    DALI_TEST_EQUALS( frameCallback.mSizes[ actorIds[ i ] ], sizes[ i ], TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackCheckActorNotAdded(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actor.SetSize( 200, 300 );
+
+  Stage stage = Stage::GetCurrent();
+  FrameCallbackOneActor frameCallback( actor.GetId() );
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  // All should be default constructed objects
+  DALI_TEST_EQUALS( frameCallback.mCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mPositionGetPositionCall, Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSizeGetSizeCall, Vector3::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mColor, Vector4::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mScale, Vector3::ZERO, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackInvalidActorId(void)
+{
+  // Test to ensure that there are no issues when trying to use the update-proxy methods with an invalid actor ID.
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  FrameCallbackActorIdCheck frameCallback( 10000 );
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  // Invalid Actor ID so all the methods should not return successfully.
+
+  DALI_TEST_EQUALS( frameCallback.mCalled,                        true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetSizeCallSuccess,            false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionCallSuccess,        false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetColorCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetScaleCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionAndSizeCallSuccess, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetSizeCallSuccess,            false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetPositionCallSuccess,        false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetColorCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetScaleCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeSizeCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakePositionCallSuccess,       false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeColorCallSuccess,          false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeScaleCallSuccess,          false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackActorRemovedAndAdded(void)
+{
+  // Test to ensure that we do not call methods on actors that have been removed on the stage
+  // and then re-start calling the required methods if that actor is re-added back to the stage
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  Actor actor = Actor::New();
+  stage.Add( actor );
+
+  FrameCallbackActorIdCheck frameCallback( actor.GetId() );
+  DevelStage::AddFrameCallback( stage, frameCallback, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  // All methods should return successfully.
+
+  DALI_TEST_EQUALS( frameCallback.mCalled,                        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetSizeCallSuccess,            true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionCallSuccess,        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetColorCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetScaleCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionAndSizeCallSuccess, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetSizeCallSuccess,            true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetPositionCallSuccess,        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetColorCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetScaleCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeSizeCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakePositionCallSuccess,       true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeColorCallSuccess,          true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeScaleCallSuccess,          true, TEST_LOCATION );
+  frameCallback.Reset();
+
+  // Remove the actor from stage, the methods should not return successfully.
+
+  stage.Remove( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled,                        true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetSizeCallSuccess,            false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionCallSuccess,        false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetColorCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetScaleCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionAndSizeCallSuccess, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetSizeCallSuccess,            false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetPositionCallSuccess,        false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetColorCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetScaleCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeSizeCallSuccess,           false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakePositionCallSuccess,       false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeColorCallSuccess,          false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeScaleCallSuccess,          false, TEST_LOCATION );
+  frameCallback.Reset();
+
+  // Re-add the actor back to the stage, all the methods should once again, return successfully.
+
+  stage.Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback.mCalled,                        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetSizeCallSuccess,            true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionCallSuccess,        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetColorCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetScaleCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mGetPositionAndSizeCallSuccess, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetSizeCallSuccess,            true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetPositionCallSuccess,        true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetColorCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mSetScaleCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeSizeCallSuccess,           true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakePositionCallSuccess,       true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeColorCallSuccess,          true, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback.mBakeScaleCallSuccess,          true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackMultipleCallbacks(void)
+{
+  // Test to ensure multiple frame-callbacks work as expected
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  Actor actor = Actor::New();
+  stage.Add( actor );
+
+  FrameCallbackBasic frameCallback1;
+  FrameCallbackBasic frameCallback2;
+  DevelStage::AddFrameCallback( stage, frameCallback1, stage.GetRootLayer() );
+  DevelStage::AddFrameCallback( stage, frameCallback2, stage.GetRootLayer() );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, true,  TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Remove the second frame-callback, only the first should be called
+
+  DevelStage::RemoveFrameCallback( stage, frameCallback2 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, false, TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Re-add the second frame-callback and remove the first, only the second should be called
+
+  DevelStage::AddFrameCallback( stage, frameCallback2, stage.GetRootLayer() );
+  DevelStage::RemoveFrameCallback( stage, frameCallback1 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, true,  TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Attempt removal of the first frame-callback again, should be a no-op and yield the exact same results as the last run
+  DevelStage::RemoveFrameCallback( stage, frameCallback1 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, true,  TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Remove the second frame-callback as well, neither should be called
+  DevelStage::RemoveFrameCallback( stage, frameCallback2 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, false, TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackActorDestroyed(void)
+{
+  // Test to ensure that the frame-callback behaves gracefully if the connected root-actor is destroyed
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  Actor actor = Actor::New();
+  stage.Add( actor );
+
+  FrameCallbackBasic frameCallback1;
+  FrameCallbackBasic frameCallback2;
+  DevelStage::AddFrameCallback( stage, frameCallback1, actor );
+  DevelStage::AddFrameCallback( stage, frameCallback2, actor );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, true,  TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Remove the second frame-callback, only the first should be called
+
+  DevelStage::RemoveFrameCallback( stage, frameCallback2 );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, true,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, false, TEST_LOCATION );
+  frameCallback1.Reset();
+  frameCallback2.Reset();
+
+  // Remove and destroy the actor, the first one should not be called either
+  stage.Remove( actor );
+  actor.Reset();
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( frameCallback1.mCalled, false,  TEST_LOCATION );
+  DALI_TEST_EQUALS( frameCallback2.mCalled, false, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackDestroyedBeforeRemoving(void)
+{
+  // Ensure there's no segmentation fault if the callback is deleted without being removed
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  Actor actor = Actor::New();
+  stage.Add( actor );
+
+  {
+    FrameCallbackBasic frameCallback;
+    DevelStage::AddFrameCallback( stage, frameCallback, actor );
+
+    application.SendNotification();
+    application.Render();
+
+    DALI_TEST_EQUALS( frameCallback.mCalled, true,  TEST_LOCATION );
+    frameCallback.Reset();
+  }
+
+  // frameCallback has now been destroyed but not removed
+
+  application.SendNotification();
+  application.Render();
+  DALI_TEST_CHECK( true ); // If it runs to here then there's no segmentation fault
+
+  END_TEST;
+}
+
+int UtcDaliFrameCallbackDoubleAddition(void)
+{
+  // Ensure we don't connect the same frame-callback twice
+
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+  Actor rootActor = stage.GetRootLayer();
+
+  FrameCallbackBasic frameCallback;
+  DevelStage::AddFrameCallback( stage, frameCallback, rootActor );
+
+  try
+  {
+    DevelStage::AddFrameCallback( stage, frameCallback, rootActor );
+  }
+  catch( ... )
+  {
+    DALI_TEST_CHECK( true );
+  }
+
+  END_TEST;
+}
index 6fb9b80..8dc5c18 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -132,6 +132,8 @@ int UtcDaliGeometryAddVertexBuffer(void)
   TestApplication application;
 
   tet_infoline("Test AddVertexBuffer");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   PropertyBuffer vertexBuffer1 = CreateVertexBuffer("aPosition1", "aTexCoord1" );
   Geometry geometry = Geometry::New();
@@ -176,7 +178,7 @@ int UtcDaliGeometryAddVertexBuffer(void)
     DALI_TEST_EQUALS( bufferDataCalls.size(), 1u, TEST_LOCATION );
     DALI_TEST_EQUALS( bufferDataCalls[0], 4*sizeof( TexturedQuadVertex ), TEST_LOCATION );
   }
-
+#endif
   END_TEST;
 }
 
@@ -242,6 +244,8 @@ int UtcDaliGeometrySetIndexBuffer(void)
   TestApplication application;
 
   tet_infoline("Test SetIndexBuffer");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
 
@@ -290,7 +294,7 @@ int UtcDaliGeometrySetIndexBuffer(void)
     DALI_TEST_EQUALS( bufferDataCalls[0], 6*sizeof( unsigned short ), TEST_LOCATION );
   }
 
-
+#endif
   END_TEST;
 }
 
@@ -299,6 +303,8 @@ int UtcDaliGeometrySetGetGeometryType01(void)
   TestApplication application;
 
   tet_infoline("Test SetType and GetType: without index buffer");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int numVertex = 4u;
   PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
@@ -418,7 +424,7 @@ int UtcDaliGeometrySetGetGeometryType01(void)
   DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawArrays", out.str()), true, TEST_LOCATION);
 
   DALI_TEST_EQUALS( geometry.GetType(), Geometry::TRIANGLE_FAN, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
@@ -427,6 +433,8 @@ int UtcDaliGeometrySetGetGeometryType02(void)
   TestApplication application;
 
   tet_infoline("Test SetType and GetType: with index buffer");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   unsigned int numVertex = 4u;
   unsigned int numIndex = 6u; // 6 unsigned short
@@ -546,6 +554,6 @@ int UtcDaliGeometrySetGetGeometryType02(void)
   DALI_TEST_EQUALS( drawTrace.TestMethodAndParams(1, "DrawElements", out.str()), true, TEST_LOCATION);
 
   DALI_TEST_EQUALS( geometry.GetType(), Geometry::TRIANGLE_FAN, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
index 2cbbcf1..316e776 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -467,3 +467,31 @@ int UtcDaliGestureDetectorProperties(void)
 
   END_TEST;
 }
+
+int UtcDaliGestureDetectorRegisterProperty(void)
+{
+  TestApplication application;
+
+  GestureDetector detector = PinchGestureDetector::New();
+
+  Property::Index index = detector.RegisterProperty( "sceneProperty", 0 );
+  DALI_TEST_EQUALS( index, (Property::Index)PROPERTY_CUSTOM_START_INDEX, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetProperty< int32_t >( index ), 0, TEST_LOCATION );
+
+  detector.SetProperty( index, -123 );
+  DALI_TEST_EQUALS( detector.GetProperty< int32_t >( index ), -123, TEST_LOCATION );
+
+  using Dali::Animation;
+  Animation animation = Animation::New( 1.0f );
+  animation.AnimateTo( Property( detector, index ), 99 );
+
+  DALI_TEST_EQUALS( detector.GetProperty< int32_t >( index ), -123, TEST_LOCATION );
+  // Start the animation
+  animation.Play();
+
+  application.SendNotification();
+  application.Render( 1000 /* 100% progress */);
+  DALI_TEST_EQUALS( detector.GetProperty< int32_t >( index ), 99, TEST_LOCATION );
+
+  END_TEST;
+}
index e34cc24..c413f05 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -413,7 +413,6 @@ int UtcDaliHandleIsPropertyAConstraintInput(void)
   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::INHERIT_ORIENTATION ) );
   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::INHERIT_SCALE ) );
   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_MODE ) );
-  DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::POSITION_INHERITANCE ) );
   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::DRAW_MODE ) );
   DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::SIZE_MODE_FACTOR ) );
 
@@ -540,7 +539,7 @@ int UtcDaliHandleNonAnimatableProperties(void)
   }
   catch ( Dali::DaliException& e )
   {
-    DALI_TEST_ASSERT( e, "Animated value and Property type don't match", TEST_LOCATION );
+    DALI_TEST_ASSERT( e, "Property type is not animatable", TEST_LOCATION );
   }
 
   DALI_TEST_EQUALS( "yes", actor.GetProperty( nonAnimStringIndex ).Get<std::string>(), TEST_LOCATION );
index 4c3b5b8..bae3164 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -145,96 +145,6 @@ int UtcDaliHitTestAlgorithmWithFunctor(void)
   END_TEST;
 }
 
-int UtcDaliHitTestAlgorithmWithFunctorOnRenderTask(void)
-{
-  TestApplication application;
-  tet_infoline("Testing Dali::HitTestAlgorithm functor, specific to a given render task");
-
-  Stage stage = Stage::GetCurrent();
-  Size stageSize = stage.GetSize();
-  RenderTaskList taskList = stage.GetRenderTaskList();
-
-  Actor actor[2];
-
-  for( int i=0; i<2; i++ )
-  {
-    actor[i] = Actor::New();
-    actor[i].SetSize(100.f, 100.f);
-    actor[i].SetParentOrigin(ParentOrigin::TOP_LEFT);
-    actor[i].SetAnchorPoint(AnchorPoint::TOP_LEFT);
-    actor[i].SetName("HittableActor");
-    stage.Add(actor[i]);
-  }
-  Vector2 position( 50.f, 40.f );
-  actor[1].SetPosition( position.x, position.y );
-
-  RenderTask renderTask[2];
-  renderTask[0] = taskList.GetTask( 0u );
-
-  FrameBufferImage frameBufferImage =  FrameBufferImage::New(stageSize.width, stageSize.height, Pixel::A8);
-  renderTask[1] = taskList.CreateTask();
-  renderTask[1].SetSourceActor( actor[1] );
-  renderTask[1].SetExclusive( true );
-  renderTask[1].SetInputEnabled( true );
-  renderTask[1].SetTargetFrameBuffer( frameBufferImage );
-  renderTask[1].SetRefreshRate( RenderTask::REFRESH_ONCE );
-  renderTask[1].SetScreenToFrameBufferFunction( RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION );
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  // Perform a hit-test at the given screen coordinates with different render tasks
-
-  Dali::HitTestAlgorithm::Results results;
-  Vector2 screenCoordinates( 25.f, 25.f );
-
-  Dali::HitTestAlgorithm::HitTest( renderTask[0], screenCoordinates, results, IsActorHittableFunction );
-  DALI_TEST_CHECK( results.actor == actor[0] );
-  DALI_TEST_EQUALS( screenCoordinates, results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  results.actor = Actor();
-  results.actorCoordinates = Vector2::ZERO;
-  Dali::HitTestAlgorithm::HitTest( renderTask[1], screenCoordinates, results, IsActorHittableFunction );
-  DALI_TEST_CHECK( !results.actor );
-  DALI_TEST_EQUALS( Vector2::ZERO, results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  screenCoordinates.x = 80.f;
-  screenCoordinates.y = 70.f;
-
-  results.actor = Actor();
-  results.actorCoordinates = Vector2::ZERO;
-  Dali::HitTestAlgorithm::HitTest( renderTask[0], screenCoordinates, results, IsActorHittableFunction );
-  DALI_TEST_CHECK( results.actor == actor[0] );
-  DALI_TEST_EQUALS( screenCoordinates, results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  results.actor = Actor();
-  results.actorCoordinates = Vector2::ZERO;
-  Dali::HitTestAlgorithm::HitTest( renderTask[1], screenCoordinates, results, IsActorHittableFunction );
-  DALI_TEST_CHECK( results.actor == actor[1]);
-  DALI_TEST_EQUALS( screenCoordinates - position, results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  screenCoordinates.x = 120.f;
-  screenCoordinates.y = 130.f;
-
-  results.actor = Actor();
-  results.actorCoordinates = Vector2::ZERO;
-  Dali::HitTestAlgorithm::HitTest( renderTask[0], screenCoordinates, results, IsActorHittableFunction );
-  DALI_TEST_CHECK( !results.actor );
-  DALI_TEST_EQUALS( Vector2::ZERO, results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  results.actor = Actor();
-  results.actorCoordinates = Vector2::ZERO;
-  Dali::HitTestAlgorithm::HitTest( renderTask[1], screenCoordinates, results, IsActorHittableFunction );
-  DALI_TEST_CHECK( results.actor == actor[1]);
-  DALI_TEST_EQUALS( screenCoordinates - position, results.actorCoordinates, 0.1f, TEST_LOCATION );
-  END_TEST;
-}
-
-
 int UtcDaliHitTestAlgorithmOrtho01(void)
 {
   TestApplication application;
index 93630ed..e195146 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/hover-event-integ.h>
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
@@ -956,6 +956,10 @@ int UtcDaliHoverMultipleRenderTasksWithChildLayer(void)
 int UtcDaliHoverOffscreenRenderTasks(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliHoverOffscreenRenderTasks");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
   Stage stage ( Stage::GetCurrent() );
   Vector2 stageSize ( stage.GetSize() );
 
@@ -1000,6 +1004,8 @@ int UtcDaliHoverOffscreenRenderTasks(void)
   application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   data.Reset();
+
+#endif
   END_TEST;
 }
 
@@ -1166,42 +1172,6 @@ int UtcDaliHoverActorUnStaged(void)
   END_TEST;
 }
 
-int UtcDaliHoverSystemOverlayActor(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core( application.GetCore() );
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // Create an actor and add it to the system overlay.
-  Actor systemActor = Actor::New();
-  systemActor.SetSize(100.0f, 100.0f);
-  systemActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add( systemActor );
-
-  // Create an actor and add it to the stage as per normal, same position and size as systemActor
-  Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(actor);
-
-  // Connect to the hover signals.
-  SignalData data;
-  HoverEventFunctor functor( data );
-  systemActor.HoveredSignal().Connect( &application, functor );
-  actor.HoveredSignal().Connect( &application, functor );
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Emit a started signal, the system overlay is drawn last so is at the top, should hit the systemActor.
-  application.ProcessEvent( GenerateSingleHover( TouchPoint::Started, Vector2( 10.0f, 10.0f ) ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_CHECK( systemActor == data.hoveredActor );
-  END_TEST;
-}
-
 int UtcDaliHoverLeaveActorReadded(void)
 {
   TestApplication application;
index 8caa2be..ad81071 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -104,6 +104,8 @@ int UtcDaliImageDiscard01(void)
 {
   TestApplication application;
   tet_infoline("UtcDaliImageDiscard01 - no actors");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   {
     Image image = ResourceImage::New(gTestImageFilename);
@@ -127,5 +129,7 @@ int UtcDaliImageDiscard01(void)
   const std::vector<GLuint>& texIds = application.GetGlAbstraction().GetNextTextureIds();
   DALI_TEST_CHECK( texIds.size() == 1 );
   DALI_TEST_CHECK( texIds[0] == 23 );
+
+#endif
   END_TEST;
 }
index 96e74ff..e34e752 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -295,6 +295,7 @@ int UtcDaliIntegrationKeyEvent(void)
     Integration::KeyEvent keyEvent;
     DALI_TEST_EQUALS( keyEvent.type, Integration::Event::Key, TEST_LOCATION );
     DALI_TEST_CHECK( keyEvent.keyName == std::string() );
+    DALI_TEST_CHECK( keyEvent.logicalKey == std::string() );
     DALI_TEST_CHECK( keyEvent.keyString == std::string() );
     DALI_TEST_EQUALS( keyEvent.keyCode, -1, TEST_LOCATION );
     DALI_TEST_EQUALS( keyEvent.keyModifier, 0, TEST_LOCATION );
@@ -304,6 +305,7 @@ int UtcDaliIntegrationKeyEvent(void)
 
   {
     const std::string keyName("keyName");
+    const std::string logicalKey("logicalKey");
     const std::string keyString("keyString");
     const int keyCode(333);
     const int keyModifier(312);
@@ -314,9 +316,10 @@ int UtcDaliIntegrationKeyEvent(void)
     const Device::Class::Type deviceClass = Device::Class::KEYBOARD;
     const Device::Subclass::Type deviceSubclass = Device::Subclass::NONE;
 
-    Integration::KeyEvent keyEvent(keyName, keyString, keyCode, keyModifier, timeStamp, keyState, compose, deviceName, deviceClass, deviceSubclass );
+    Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, keyModifier, timeStamp, keyState, compose, deviceName, deviceClass, deviceSubclass );
     DALI_TEST_EQUALS( keyEvent.type, Integration::Event::Key, TEST_LOCATION );
     DALI_TEST_CHECK( keyEvent.keyName == keyName );
+    DALI_TEST_CHECK( keyEvent.logicalKey == logicalKey );
     DALI_TEST_CHECK( keyEvent.keyString == keyString );
     DALI_TEST_EQUALS( keyEvent.keyCode, keyCode, TEST_LOCATION );
     DALI_TEST_EQUALS( keyEvent.keyModifier, keyModifier, TEST_LOCATION );
@@ -340,6 +343,7 @@ int UtcDaliIntegrationKeyEventConvertor(void)
 
   DALI_TEST_EQUALS( keyEvent.type, Integration::Event::Key, TEST_LOCATION );
   DALI_TEST_CHECK( keyEvent.keyName == TEST_STRING_1 );
+  DALI_TEST_CHECK( keyEvent.logicalKey == "" );
   DALI_TEST_CHECK( keyEvent.keyString == "i" );
   DALI_TEST_EQUALS( keyEvent.keyCode, 99, TEST_LOCATION );
   DALI_TEST_EQUALS( keyEvent.keyModifier, SHIFT_MODIFIER, TEST_LOCATION );
index b61dd46..e395bbc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -474,14 +474,16 @@ int UtcDaliLayerDefaultProperties(void)
 
   // set the same boundaries, but through a clipping box object
   actor.SetClippingBox( testBox );
-
   DALI_TEST_CHECK( actor.GetClippingBox() == testBox );
 
+  actor.SetProperty(Layer::Property::BEHAVIOR, Property::Value(Layer::LAYER_UI));
+  DALI_TEST_CHECK(Property::STRING == actor.GetPropertyType(Layer::Property::BEHAVIOR));
+
   Property::Value behavior = actor.GetProperty(Layer::Property::BEHAVIOR);
-  DALI_TEST_EQUALS(behavior.Get<std::string>().c_str(), "LAYER_2D", TEST_LOCATION );
+  DALI_TEST_EQUALS(behavior.Get<std::string>().c_str(), "LAYER_UI", TEST_LOCATION );
 
   behavior = actor.GetCurrentProperty( Layer::Property::BEHAVIOR );
-  DALI_TEST_EQUALS(behavior.Get<std::string>().c_str(), "LAYER_2D", TEST_LOCATION );
+  DALI_TEST_EQUALS(behavior.Get<std::string>().c_str(), "LAYER_UI", TEST_LOCATION );
 
   END_TEST;
 }
@@ -553,6 +555,10 @@ int UtcDaliLayerHoverConsumed(void)
 int UtcDaliLayerClippingGLCalls(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliLayerClippingGLCalls");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
   const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() );
   Stage stage( Stage::GetCurrent() );
 
@@ -574,6 +580,8 @@ int UtcDaliLayerClippingGLCalls(void)
   DALI_TEST_EQUALS( testBox.y, (int)(stage.GetSize().height - glScissorParams.y - testBox.height), TEST_LOCATION ); // GL Coordinates are from bottom left
   DALI_TEST_EQUALS( testBox.width, glScissorParams.width, TEST_LOCATION );
   DALI_TEST_EQUALS( testBox.height, glScissorParams.height, TEST_LOCATION );
+
+#endif
   END_TEST;
 }
 
@@ -582,7 +590,7 @@ int UtcDaliLayerBehaviour(void)
   TestApplication application;
   Layer layer = Layer::New();
 
-  DALI_TEST_EQUALS( layer.GetBehavior(), Dali::Layer::LAYER_2D, TEST_LOCATION );
+  DALI_TEST_EQUALS( layer.GetBehavior(), Dali::Layer::LAYER_UI, TEST_LOCATION );
   layer.SetBehavior( Dali::Layer::LAYER_3D );
   DALI_TEST_EQUALS( layer.GetBehavior(), Dali::Layer::LAYER_3D, TEST_LOCATION );
   END_TEST;
@@ -616,6 +624,8 @@ Actor CreateActor( bool withAlpha )
 int UtcDaliLayer3DSort(void)
 {
   tet_infoline( "Testing LAYER_3D sort coverage test" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   TestApplication application;
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace();
@@ -640,5 +650,7 @@ int UtcDaliLayer3DSort(void)
 
   DALI_TEST_CHECK( enabledDisableTrace.FindMethodAndParams( "Enable", "2929" ) );  // 2929 is GL_DEPTH_TEST
 
+  // Check pipelines to see if depth test was enabled (There will be one per actor...)
+#endif
   END_TEST;
 }
index 2f2761f..040f942 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/long-press-gesture-event.h>
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
 #include <test-touch-utils.h>
 
@@ -1264,145 +1264,6 @@ int UtcDaliLongPressGestureActorStagedAndDestroyed(void)
   END_TEST;
 }
 
-int UtcDaliLongPressGestureSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(actor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  LongPressGestureDetector detector = LongPressGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  // Do a long press inside actor's area
-  Vector2 screenCoords( 50.0f, 50.0f );
-  application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, screenCoords ) );
-  application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, screenCoords ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliLongPressGestureBehindTouchableSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set system-overlay actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  systemOverlayActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set stage actor to receive the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  LongPressGestureDetector detector = LongPressGestureDetector::New();
-  detector.Attach(stageActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  // Start long press within the two actors' area
-  Vector2 screenCoords( 50.0f, 50.0f );
-  application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, screenCoords ) );
-  application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, screenCoords ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliLongPressGestureTouchBehindGesturedSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set stage actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  stageActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set system-overlay actor to have the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  LongPressGestureDetector detector = LongPressGestureDetector::New();
-  detector.Attach(systemOverlayActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  // Start long press within the two actors' area
-  Vector2 screenCoords( 50.0f, 50.0f );
-  application.ProcessEvent( GenerateLongPress( Gesture::Possible, 1u, screenCoords ) );
-  application.ProcessEvent( GenerateLongPress( Gesture::Started, 1u, screenCoords ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
 int UtcDaliLongPressGestureLayerConsumesTouch(void)
 {
   TestApplication application;
index 089ab4e..4f296bd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -159,6 +159,10 @@ int UtcDaliNativeImageGetCustomSamplerTypenameP(void)
 int UtcDaliNativeImageTestCreationFailure(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliNativeImageTestCreationFailure");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
   TestNativeImagePointer nativeImageInterface = TestNativeImage::New( 16, 16 );
   NativeImage nativeImage = NativeImage::New( *(nativeImageInterface.Get()) );
 
@@ -203,5 +207,6 @@ int UtcDaliNativeImageTestCreationFailure(void)
   DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
   DALI_TEST_EQUALS( drawTrace.FindMethod("DrawElements") || drawTrace.FindMethod("DrawArrays"), true, TEST_LOCATION );
 
+#endif
   END_TEST;
 }
index b830f9d..745d3ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -145,3 +145,55 @@ int UtcDaliPanGestureDynamicAllocation(void)
 
   END_TEST;
 }
+
+int UtcDaliPanGestureDetectorRegisterProperty(void)
+{
+  TestApplication application;
+
+  GestureDetector detector = PanGestureDetector::New();
+
+  Property::Index index = detector.RegisterProperty( "sceneProperty", 0 );
+  DALI_TEST_EQUALS( index, (Property::Index)PROPERTY_CUSTOM_START_INDEX, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetProperty< int32_t >( index ), 0, TEST_LOCATION );
+  detector.SetProperty( index, -99 );
+
+  using Dali::Animation;
+  Animation animation = Animation::New( 1.0f );
+  animation.AnimateTo( Property( detector, index ), 99 );
+  DALI_TEST_EQUALS( detector.GetProperty< int32_t >( index ), -99, TEST_LOCATION );
+
+  // create another pan gesture
+  GestureDetector detector2 = PanGestureDetector::New();
+  DALI_TEST_EQUALS( detector2.GetProperty< int32_t >( index ), 0, TEST_LOCATION );
+
+  // Start the animation
+  animation.Play();
+  application.SendNotification();
+  application.Render( 500 /* 50% progress */);
+  DALI_TEST_EQUALS( detector.GetCurrentProperty< int32_t >( index ), 0 /*half way*/, TEST_LOCATION );
+
+  // register another pan gesture value
+  Property::Index index2 = detector2.RegisterProperty( "sceneProperty2", 12 );
+  DALI_TEST_EQUALS( index2, (Property::Index)PROPERTY_CUSTOM_START_INDEX, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector2.GetProperty< int32_t >( index2 ), 12, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector2.GetCurrentProperty< int32_t >( index2 ), 12, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( detector.GetProperty< int32_t >( index ), 99 /*target*/, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetCurrentProperty< int32_t >( index ), 0, TEST_LOCATION );
+
+  Animation animation2 = Animation::New( 1.0f );
+  animation2.AnimateTo( Property( detector2, index2 ), -99 );
+  // Start the animation
+  animation2.Play();
+  application.SendNotification();
+  application.Render( 1000 /* 100% more progress */);
+
+  DALI_TEST_EQUALS( detector2.GetProperty< int32_t >( index2 ), -99, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector2.GetCurrentProperty< int32_t >( index2 ), -99, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( detector.GetProperty< int32_t >( index ), 99, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetCurrentProperty< int32_t >( index ), 99, TEST_LOCATION );
+
+  END_TEST;
+}
+
index cd5cc59..2a79efe 100644 (file)
@@ -22,7 +22,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/pan-gesture-event.h>
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <dali/integration-api/profiling.h>
 #include <dali/integration-api/input-options.h>
 #include <dali-test-suite-utils.h>
@@ -1603,153 +1603,6 @@ int UtcDaliPanGestureActorStagedAndDestroyed(void)
   END_TEST;
 }
 
-int UtcDaliPanGestureSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(actor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  PanGestureDetector detector = PanGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoordsStart( 10.0f, 20.0f );
-  Vector2 screenCoordsEnd( 20.0f, 20.0f );
-
-  // Start pan within the actor's area
-  application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliPanGestureBehindTouchableSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set system-overlay actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  systemOverlayActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set stage actor to receive the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  PanGestureDetector detector = PanGestureDetector::New();
-  detector.Attach(stageActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoordsStart( 10.0f, 20.0f );
-  Vector2 screenCoordsEnd( 20.0f, 20.0f );
-
-  // Start pan within the two actors' area
-  application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Finished, screenCoordsStart, screenCoordsEnd, 10 ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoordsStart ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliPanGestureTouchBehindGesturedSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set stage actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  stageActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set system-overlay actor to have the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  PanGestureDetector detector = PanGestureDetector::New();
-  detector.Attach(systemOverlayActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoordsStart( 10.0f, 20.0f );
-  Vector2 screenCoordsEnd( 20.0f, 20.0f );
-
-  // Start pan within the two actors' area
-  application.ProcessEvent( GeneratePan( Gesture::Possible, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Started, screenCoordsStart, screenCoordsEnd, 10 ) );
-  application.ProcessEvent( GeneratePan( Gesture::Finished, screenCoordsStart, screenCoordsEnd, 10 ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoordsStart ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
 int UtcDaliPanGestureAngleHandling(void)
 {
   TestApplication application;
index c3be5fb..d9c56cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -472,3 +472,32 @@ int UtcDaliPathPropertyControlPoints(void)
 
   END_TEST;
 }
+
+int UtcDaliPathRegisterProperty(void)
+{
+  TestApplication application;
+
+  Dali::Path path = Dali::Path::New();
+
+  Property::Index index = path.RegisterProperty( "sceneProperty", 0.f );
+  DALI_TEST_EQUALS( index, (Property::Index)PROPERTY_CUSTOM_START_INDEX, TEST_LOCATION );
+  DALI_TEST_EQUALS( path.GetProperty< float >( index ), 0.f, TEST_LOCATION );
+
+  path.SetProperty( index, -1 );
+  DALI_TEST_EQUALS( path.GetProperty< float >( index ), -1.f, TEST_LOCATION );
+
+  using Dali::Animation;
+  Animation animation = Animation::New( 1.0f );
+  animation.AnimateTo( Property( path, index ), 100.f );
+
+  DALI_TEST_EQUALS( path.GetProperty< float >( index ), -1.f, TEST_LOCATION );
+  // Start the animation
+  animation.Play();
+
+  application.SendNotification();
+  application.Render( 1000 /* 100% progress */);
+  DALI_TEST_EQUALS( path.GetProperty< float >( index ), 100.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
index 7d9358d..40193e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/pinch-gesture-event.h>
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
 #include <test-touch-utils.h>
 
@@ -1184,153 +1184,6 @@ int UtcDaliPinchGestureActorStagedAndDestroyed(void)
   END_TEST;
 }
 
-int UtcDaliPinchGestureSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(actor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  PinchGestureDetector detector = PinchGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoords( 50.0f, 50.0f );
-  float scale ( 10.0f );
-  float speed ( 50.0f );
-
-  // Start pan within the actor's area
-  application.ProcessEvent( GeneratePinch( Gesture::Started, scale, speed, screenCoords ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliPinchGestureBehindTouchableSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set system-overlay actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  systemOverlayActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set stage actor to receive the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  PinchGestureDetector detector = PinchGestureDetector::New();
-  detector.Attach(stageActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoords( 50.0f, 50.0f );
-  float scale ( 10.0f );
-  float speed ( 50.0f );
-
-  // Start pinch within the two actors' area
-  application.ProcessEvent( GeneratePinch( Gesture::Started, scale, speed, screenCoords ) );
-  application.ProcessEvent( GeneratePinch( Gesture::Finished, scale, speed, screenCoords ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliPinchGestureTouchBehindGesturedSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set stage actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  stageActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set system-overlay actor to have the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  PinchGestureDetector detector = PinchGestureDetector::New();
-  detector.Attach(systemOverlayActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoords( 50.0f, 50.0f );
-  float scale ( 10.0f );
-  float speed ( 50.0f );
-
-  // Start pinch within the two actors' area
-  application.ProcessEvent( GeneratePinch( Gesture::Started, scale, speed, screenCoords ) );
-  application.ProcessEvent( GeneratePinch( Gesture::Finished, scale, speed, screenCoords ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
 int UtcDaliPinchGestureLayerConsumesTouch(void)
 {
   TestApplication application;
index 0d45357..fb1d139 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/core.h>
 #include <dali-test-suite-utils.h>
+#include <dali/integration-api/processor-interface.h>
 
 using namespace Dali;
 
@@ -26,6 +27,7 @@ using namespace Dali;
 class TestProcessor : public Integration::Processor
 {
 public:
+
   TestProcessor()
   : processRun(false)
   {
@@ -66,3 +68,53 @@ int UtcDaliCoreProcessorP(void)
 
   END_TEST;
 }
+
+int UtcDaliCoreProcessorMultipleP(void)
+{
+  TestApplication application;
+
+  TestProcessor testProcessor1;
+  TestProcessor testProcessor2;
+  TestProcessor testProcessor3;
+
+  Integration::Core& core = application.GetCore();
+  core.RegisterProcessor( testProcessor1 );
+
+  tet_infoline("Test that the processor has not been executed yet:");
+  DALI_TEST_CHECK( testProcessor1.processRun == false );
+
+  application.SendNotification();
+
+  tet_infoline("Test that the processor has been executed:");
+  DALI_TEST_CHECK( testProcessor1.processRun );
+
+  // Clear down for next part of test
+  testProcessor1.processRun = false;
+
+  core.RegisterProcessor( testProcessor2 );
+  core.RegisterProcessor( testProcessor3 );
+
+  tet_infoline("Test that the processors have not been executed yet:");
+  DALI_TEST_CHECK( testProcessor1.processRun == false );
+  DALI_TEST_CHECK( testProcessor2.processRun == false );
+  DALI_TEST_CHECK( testProcessor3.processRun == false );
+
+  application.SendNotification();
+
+  tet_infoline("Test that the processors have been executed:");
+  DALI_TEST_CHECK( testProcessor1.processRun );
+  DALI_TEST_CHECK( testProcessor2.processRun );
+  DALI_TEST_CHECK( testProcessor3.processRun );
+
+  // Clear down for next part of test
+  testProcessor2.processRun = false;
+
+  core.UnregisterProcessor( testProcessor2 );
+  application.SendNotification();
+  tet_infoline("Test that the unregistered processor has not been executed again but others have");
+  DALI_TEST_CHECK( testProcessor1.processRun );
+  DALI_TEST_CHECK( testProcessor2.processRun == false );
+  DALI_TEST_CHECK( testProcessor3.processRun );
+
+  END_TEST;
+}
\ No newline at end of file
index 20c468f..68bd2fd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -113,7 +113,9 @@ int UtcDaliPropertyBufferAssignmentOperator(void)
 int UtcDaliPropertyBufferSetData01(void)
 {
   TestApplication application;
-
+  tet_infoline("UtcDaliPropertyBufferSetData01");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   Property::Map texturedQuadVertexFormat;
   texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
   texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
@@ -159,12 +161,16 @@ int UtcDaliPropertyBufferSetData01(void)
   application.SendNotification();
   application.Render(0);
 
+#endif
   END_TEST;
 }
 
 int UtcDaliPropertyBufferSetData02(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliPropertyBufferSetData02");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Property::Map texturedQuadVertexFormat;
   texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
@@ -231,6 +237,7 @@ int UtcDaliPropertyBufferSetData02(void)
     }
   }
 
+#endif
   END_TEST;
 }
 
@@ -253,4 +260,3 @@ int UtcDaliPropertyBufferInvalidTypeN(void)
   }
   END_TEST;
 }
-
index b747b8c..f7c4211 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -79,6 +79,8 @@ void utc_dali_render_task_cleanup(void)
 
 namespace // unnamed namespace
 {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
 
 const int RENDER_FRAME_INTERVAL = 16;                           ///< Duration of each frame in ms. (at approx 60FPS)
 
@@ -232,7 +234,7 @@ RenderTask CreateRenderTask(TestApplication& application,
   return newTask;
 }
 
-bool UpdateRender(TestApplication& application, TraceCallStack& callStack, bool testDrawn, bool& finishedSig, bool testFinished, bool testKeepUpdating, int lineNumber )
+bool UpdateRender(TestApplication& application, Test::TraceCallStack& callStack, bool testDrawn, bool& finishedSig, bool testFinished, bool testKeepUpdating, int lineNumber )
 {
   finishedSig = false;
   callStack.Reset();
@@ -286,41 +288,7 @@ bool UpdateRender(TestApplication& application, TraceCallStack& callStack, bool
   return result;
 }
 
-// The functor to be used in the hit-test algorithm to check whether the actor is hittable.
-bool IsActorHittableFunction(Actor actor, Dali::HitTestAlgorithm::TraverseType type)
-{
-  bool hittable = false;
-
-  switch (type)
-  {
-    case Dali::HitTestAlgorithm::CHECK_ACTOR:
-    {
-      // Check whether the actor is visible and not fully transparent.
-      if( actor.IsVisible()
-          && actor.GetCurrentWorldColor().a > 0.01f) // not FULLY_TRANSPARENT
-      {
-
-        hittable = true;
-      }
-      break;
-    }
-    case Dali::HitTestAlgorithm::DESCEND_ACTOR_TREE:
-    {
-      if( actor.IsVisible() ) // Actor is visible, if not visible then none of its children are visible.
-      {
-        hittable = true;
-      }
-      break;
-    }
-    default:
-    {
-      break;
-    }
-  }
-
-  return hittable;
-}
-
+#pragma GCC diagnostic pop
 } // unnamed namespace
 
 
@@ -388,6 +356,8 @@ int UtcDaliRenderTaskSetSourceActorP01(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask::SetSourceActor() Positive - check that setting a non-renderable actor stops existing source actor being rendered ");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Stage stage = Stage::GetCurrent();
   RenderTaskList taskList = stage.GetRenderTaskList();
@@ -422,6 +392,7 @@ int UtcDaliRenderTaskSetSourceActorP01(void)
   // Check that nothing was rendered
   DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION );
 
+#endif
   END_TEST;
 }
 
@@ -431,6 +402,8 @@ int UtcDaliRenderTaskSetSourceActorP02(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask::SetSourceActor() Positive - check that switching source from a non-renderable to a renderable actor causes the texture to be drawn");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Stage stage = Stage::GetCurrent();
 
@@ -481,6 +454,7 @@ int UtcDaliRenderTaskSetSourceActorP02(void)
 
   // Check that the newActor was rendered
   DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION );
+#endif
   END_TEST;
 }
 
@@ -489,6 +463,8 @@ int UtcDaliRenderTaskSetSourceActorOffStage(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask::SetSourceActor (on/off stage testing)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Stage stage = Stage::GetCurrent();
   RenderTaskList taskList = stage.GetRenderTaskList();
@@ -533,7 +509,7 @@ int UtcDaliRenderTaskSetSourceActorOffStage(void)
   application.SendNotification();
   application.Render();
   DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -542,6 +518,8 @@ int UtcDaliRenderTaskSetSourceActorEmpty(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask::SetSourceActor (empty handle case)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Stage stage = Stage::GetCurrent();
   RenderTaskList taskList = stage.GetRenderTaskList();
@@ -584,6 +562,7 @@ int UtcDaliRenderTaskSetSourceActorEmpty(void)
 
   // Check that the newActor was rendered
   DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION );
+#endif
   END_TEST;
 }
 
@@ -648,6 +627,8 @@ int UtcDaliRenderTaskSetExclusive(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask::SetExclusive() Check that exclusion works");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
 
@@ -670,11 +651,16 @@ int UtcDaliRenderTaskSetExclusive(void)
 
   // Check that the actor1 was rendered
   const std::vector<GLuint>& boundTextures = application.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 );
-  DALI_TEST_EQUALS( boundTextures.size(), 1u, TEST_LOCATION );
+  DALI_TEST_GREATER( boundTextures.size(), static_cast<std::vector<GLuint>::size_type>( 0 ), TEST_LOCATION );
 
   if ( boundTextures.size() )
   {
-    DALI_TEST_EQUALS( boundTextures[0], 8u/*unique to actor1*/, TEST_LOCATION );
+    int c = 0;
+    DALI_TEST_EQUALS( boundTextures[c++], 8u/*unique to actor1*/, TEST_LOCATION );
+    if( boundTextures.size() > 1 )
+    {
+      DALI_TEST_EQUALS( boundTextures[c++], 8u/*unique to actor1*/, TEST_LOCATION );
+    }
   }
 
   BufferImage img2 = BufferImage::New( 1,1 );
@@ -693,12 +679,17 @@ int UtcDaliRenderTaskSetExclusive(void)
   application.Render();
 
   // Check that the actors were rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 2u, TEST_LOCATION );
+  DALI_TEST_GREATER( boundTextures.size(), static_cast<std::vector<GLuint>::size_type>( 1 ), TEST_LOCATION );
 
   if ( boundTextures.size() )
   {
-    DALI_TEST_EQUALS( boundTextures[0], 9u/*unique to actor2*/, TEST_LOCATION );
-    DALI_TEST_EQUALS( boundTextures[1], 8u/*unique to actor1*/, TEST_LOCATION );
+    int c = 0;
+    DALI_TEST_EQUALS( boundTextures[c++], 9u/*unique to actor2*/, TEST_LOCATION );
+    if( boundTextures.size() > 2 )
+    {
+      DALI_TEST_EQUALS( boundTextures[c++], 9u/*unique to actor1*/, TEST_LOCATION );
+    }
+    DALI_TEST_EQUALS( boundTextures[c++], 8u/*unique to actor1*/, TEST_LOCATION );
   }
 
   BufferImage img3 = BufferImage::New( 1,1 );
@@ -717,13 +708,18 @@ int UtcDaliRenderTaskSetExclusive(void)
   application.Render();
 
   // Check that the actors were rendered
-  DALI_TEST_EQUALS( boundTextures.size(), 3u, TEST_LOCATION );
+  DALI_TEST_GREATER( boundTextures.size(), static_cast<std::vector<GLuint>::size_type>( 2 ), TEST_LOCATION );
 
   if ( boundTextures.size() )
   {
-    DALI_TEST_EQUALS( boundTextures[0], 10u/*unique to actor3*/, TEST_LOCATION );
-    DALI_TEST_EQUALS( boundTextures[1], 9u/*unique to actor2*/, TEST_LOCATION );
-    DALI_TEST_EQUALS( boundTextures[2], 8u/*unique to actor1*/, TEST_LOCATION );
+    int c = 0;
+    DALI_TEST_EQUALS( boundTextures[c++], 10u/*unique to actor3*/, TEST_LOCATION );
+    if( boundTextures.size() > 3 )
+    {
+      DALI_TEST_EQUALS( boundTextures[c++], 10u/*unique to actor2*/, TEST_LOCATION );
+    }
+    DALI_TEST_EQUALS( boundTextures[c++], 9u/*unique to actor2*/, TEST_LOCATION );
+    DALI_TEST_EQUALS( boundTextures[c++], 8u/*unique to actor1*/, TEST_LOCATION );
   }
 
   // Both actors are now connected to the root node
@@ -777,6 +773,7 @@ int UtcDaliRenderTaskSetExclusive(void)
     // Test that task 2 renders actor2
     DALI_TEST_CHECK( boundTextures[2] == 9u );
   }
+#endif
   END_TEST;
 }
 
@@ -785,6 +782,8 @@ int UtcDaliRenderTaskSetExclusive02(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask::SetExclusive() Check that changing from exclusive to not-exclusive works");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   std::vector<GLuint> ids;
   ids.push_back( 8 ); // 8 = actor1
@@ -819,6 +818,7 @@ int UtcDaliRenderTaskSetExclusive02(void)
 
   DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 2, TEST_LOCATION );
 
+#endif
   END_TEST;
 }
 
@@ -1139,9 +1139,9 @@ int UtcDaliRenderTaskGetFrameBufferN(void)
 
   RenderTask task = taskList.GetTask( 0u );
 
-  // By default render-tasks do not render off-screen
+  // A scene creates frame buffer by default
   FrameBuffer frameBuffer = task.GetFrameBuffer();
-  DALI_TEST_CHECK( !frameBuffer );
+  DALI_TEST_CHECK( frameBuffer );
 
   END_TEST;
 }
@@ -1829,6 +1829,8 @@ int UtcDaliRenderTaskSignalFinished(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask::SignalFinished()");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
   TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
@@ -1896,6 +1898,8 @@ int UtcDaliRenderTaskSignalFinished(void)
   DALI_TEST_CHECK( finished );
 
   DALI_TEST_EQUALS( application.GetUpdateStatus(), 0, TEST_LOCATION );
+
+#endif
   END_TEST;
 }
 
@@ -1905,6 +1909,8 @@ int UtcDaliRenderTaskContinuous01(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask Render Continuous using loading image\nPRE: render task not ready (source actor not staged)\nPOST:continuous renders, no Finished signal");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP AN OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1914,7 +1920,7 @@ int UtcDaliRenderTaskContinuous01(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
@@ -1934,6 +1940,7 @@ int UtcDaliRenderTaskContinuous01(void)
 
   // CONTINUE PROCESS/RENDER                  Input,    Expected  Input,    Expected
   DALI_TEST_CHECK( UpdateRender(application,  drawTrace, true,    finished, false, false, __LINE__ ) );
+#endif
   END_TEST;
 }
 
@@ -1943,6 +1950,8 @@ int UtcDaliRenderTaskContinuous02(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask Render Continuous using loading image\nPRE: render task not ready (source actor not visible)\nPOST:continuous renders, no Finished signal");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP AN OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1952,7 +1961,7 @@ int UtcDaliRenderTaskContinuous02(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
@@ -1975,6 +1984,8 @@ int UtcDaliRenderTaskContinuous02(void)
 
   // CONTINUE PROCESS/RENDER                 Input,    Expected  Input,    Expected
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, false, __LINE__ ) );
+
+#endif
   END_TEST;
 }
 
@@ -1983,6 +1994,8 @@ int UtcDaliRenderTaskContinuous03(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask Render Continuous using loading image\nPRE: render task not ready (camera actor not staged)\nPOST:continuous renders, no Finished signal");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP AN OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -1992,7 +2005,7 @@ int UtcDaliRenderTaskContinuous03(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
 
@@ -2012,6 +2025,8 @@ int UtcDaliRenderTaskContinuous03(void)
 
   // CONTINUE PROCESS/RENDER                 Input,    Expected  Input,    Expected
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, false, __LINE__ ) );
+
+#endif
   END_TEST;
 }
 
@@ -2021,6 +2036,8 @@ int UtcDaliRenderTaskContinuous04(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask Render Continuous using loaded image");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP AN OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2030,7 +2047,7 @@ int UtcDaliRenderTaskContinuous04(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorFailed(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2043,6 +2060,7 @@ int UtcDaliRenderTaskContinuous04(void)
 
   // START PROCESS/RENDER                    Input,    Expected  Input,    Expected
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,   finished, false, false, __LINE__ ) );
+#endif
   END_TEST;
 }
 
@@ -2051,6 +2069,8 @@ int UtcDaliRenderTaskOnce01(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask Render Once GlSync, using loaded image");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP AN OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2061,7 +2081,7 @@ int UtcDaliRenderTaskOnce01(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
 
@@ -2081,6 +2101,8 @@ int UtcDaliRenderTaskOnce01(void)
 
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__  ) );
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, true, false, __LINE__  ) );
+
+#endif
   END_TEST;
 }
 
@@ -2089,6 +2111,8 @@ int UtcDaliRenderTaskOnce02(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask Render Once GlSync, using Mesh which accesses texture through sampler with loaded image.\n");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP AN OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2099,7 +2123,7 @@ int UtcDaliRenderTaskOnce02(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Shader shader = CreateShader();
@@ -2129,7 +2153,8 @@ int UtcDaliRenderTaskOnce02(void)
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__  ) );
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, true, false, __LINE__  ) );
 
-   END_TEST;
+#endif
+  END_TEST;
 }
 
 int UtcDaliRenderTaskOnce03(void)
@@ -2137,6 +2162,8 @@ int UtcDaliRenderTaskOnce03(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask Render Once GlSync, using loaded image. Switch from render always after ready to render once\n");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP A CONTINUOUS OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2147,7 +2174,7 @@ int UtcDaliRenderTaskOnce03(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2172,6 +2199,7 @@ int UtcDaliRenderTaskOnce03(void)
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__  ) );
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, true, false, __LINE__  ) );
 
+#endif
   END_TEST;
 }
 
@@ -2182,6 +2210,8 @@ int UtcDaliRenderTaskOnce04(void)
   tet_infoline("Testing RenderTask Render Once GlSync, using Mesh which accesses texture through sampler with loaded image.\n"
                "Switch from render always after ready to render once\n"
               );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP AN OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2192,7 +2222,7 @@ int UtcDaliRenderTaskOnce04(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Shader shader = CreateShader();
@@ -2227,6 +2257,7 @@ int UtcDaliRenderTaskOnce04(void)
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, false, true, __LINE__  ) );
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, true, false, __LINE__  ) );
 
+#endif
   END_TEST;
 }
 
@@ -2235,6 +2266,8 @@ int UtcDaliRenderTaskOnceNoSync01(void)
   TestApplication application;
 
   tet_infoline("Testing RenderTask Render Once, \nPRE: Resources ready\nPOST: Finished signal sent once only");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP AN OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2244,7 +2277,7 @@ int UtcDaliRenderTaskOnceNoSync01(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2257,6 +2290,8 @@ int UtcDaliRenderTaskOnceNoSync01(void)
 
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, true, __LINE__ ) );
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, true, false, __LINE__ ) );
+
+#endif
   END_TEST;
 }
 
@@ -2266,6 +2301,9 @@ int UtcDaliRenderTaskOnceNoSync02(void)
 
   tet_infoline("Testing RenderTask Render Once, using Mesh which accesses texture through sampler with loaded image.\n"
                "PRE: Resources ready\nPOST: Finished signal sent once only");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
   // SETUP AN OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
   TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
@@ -2274,7 +2312,7 @@ int UtcDaliRenderTaskOnceNoSync02(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Shader shader = CreateShader();
@@ -2299,6 +2337,7 @@ int UtcDaliRenderTaskOnceNoSync02(void)
   application.GetPlatform().ClearReadyResources();
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, true, false, __LINE__ ) );
 
+#endif
   END_TEST;
 }
 
@@ -2309,6 +2348,8 @@ int UtcDaliRenderTaskOnceNoSync03(void)
   tet_infoline("Testing RenderTask Render Once, using loaded image. Switch from render always after ready to render once\n"
                "PRE: Render task ready, Image loaded\n"
                "POST: Finished signal sent only once");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP A CONTINUOUS OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2318,7 +2359,7 @@ int UtcDaliRenderTaskOnceNoSync03(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2335,6 +2376,8 @@ int UtcDaliRenderTaskOnceNoSync03(void)
   application.SendNotification(); //         Input,    Expected  Input,    Expected
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, true, __LINE__ ) );
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,   finished, true, false, __LINE__ ) );
+
+#endif
   END_TEST;
 }
 
@@ -2346,6 +2389,8 @@ int UtcDaliRenderTaskOnceNoSync04(void)
                "Switch from render always after ready to render once\n"
                "PRE: Render task ready, Image not loaded\n"
                "POST: Finished signal sent only once");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP A CONTINUOUS OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2355,7 +2400,7 @@ int UtcDaliRenderTaskOnceNoSync04(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
 
   Shader shader = CreateShader();
@@ -2389,7 +2434,7 @@ int UtcDaliRenderTaskOnceNoSync04(void)
 
   lastSyncObj = sync.GetLastSyncObject();
   DALI_TEST_CHECK( lastSyncObj == NULL );
-
+#endif
   END_TEST;
 }
 
@@ -2401,6 +2446,8 @@ int UtcDaliRenderTaskOnceNoSync05(void)
                "SetRefreshRate(ONCE), resource load failed, completes render task.\n"
                "PRE: resources failed to load\n"
                "POST: No finished signal sent.");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP A CONTINUOUS OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2410,7 +2457,7 @@ int UtcDaliRenderTaskOnceNoSync05(void)
   Actor rootActor = Actor::New();
   Stage::GetCurrent().Add( rootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor secondRootActor = CreateRenderableActorFailed(application, "aFile.jpg");
   Stage::GetCurrent().Add(secondRootActor);
@@ -2427,7 +2474,7 @@ int UtcDaliRenderTaskOnceNoSync05(void)
   // CHANGE TO RENDER ONCE,
   newTask.SetRefreshRate(RenderTask::REFRESH_ONCE);
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, true,    finished, false, false, __LINE__ ) );
-
+#endif
   END_TEST;
 }
 
@@ -2441,6 +2488,8 @@ int UtcDaliRenderTaskOnceChain01(void)
                "SetRefreshRate(ONCE), resource load completes, both render tasks render.\n"
                "PRE: resources ready\n"
                "POST: 2 finished signals sent.");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // SETUP A CONTINUOUS OFFSCREEN RENDER TASK
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
@@ -2450,7 +2499,7 @@ int UtcDaliRenderTaskOnceChain01(void)
   Actor defaultRootActor = Actor::New(); // Root for default RT
   Stage::GetCurrent().Add( defaultRootActor );
 
-  CameraActor offscreenCameraActor = CameraActor::New();
+  CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
   Stage::GetCurrent().Add( offscreenCameraActor );
   Actor firstRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
   Stage::GetCurrent().Add(firstRootActor);
@@ -2481,7 +2530,7 @@ int UtcDaliRenderTaskOnceChain01(void)
   DALI_TEST_CHECK( UpdateRender(application, drawTrace, false,  firstFinished, true, false, __LINE__ ) );
   DALI_TEST_CHECK( firstFinished == true );
   DALI_TEST_CHECK( secondFinished == true );
-
+#endif
   END_TEST;
 }
 
@@ -2498,83 +2547,13 @@ int UtcDaliRenderTaskProperties(void)
   END_TEST;
 }
 
-int UtcDaliRenderTaskSetScreenToFrameBufferMappingActor(void)
-{
-  TestApplication application;
-  tet_infoline("Testing RenderTask::SetScreenToFrameBufferMappingActor ");
-
-  Stage stage = Stage::GetCurrent();
-  Size stageSize = stage.GetSize();
-  Actor mappingActor = Actor::New();
-  Vector2 scale( 0.6f, 0.75f);
-  Vector2 offset( stageSize.x*0.1f, stageSize.y*0.15f);
-  mappingActor.SetSize( stageSize * scale );
-  mappingActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  mappingActor.SetPosition( offset.x, offset.y );
-  stage.Add( mappingActor );
-
-  Actor offscreenActor = Actor::New();
-  offscreenActor.SetSize( stageSize );
-  offscreenActor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  stage.Add( offscreenActor );
-
-  RenderTaskList taskList = stage.GetRenderTaskList();
-  RenderTask renderTask = taskList.CreateTask();
-  FrameBufferImage frameBufferImage =  FrameBufferImage::New(stageSize.width*scale.x, stageSize.height*scale.y, Pixel::A8);
-  renderTask.SetSourceActor( offscreenActor );
-  renderTask.SetExclusive( true );
-  renderTask.SetInputEnabled( true );
-  renderTask.SetTargetFrameBuffer( frameBufferImage );
-  renderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
-  renderTask.SetScreenToFrameBufferMappingActor( mappingActor );
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-  application.Render();
-  application.SendNotification();
-
-  Vector2 screenCoordinates( stageSize.x * 0.05f, stageSize.y * 0.05f );
-  Dali::HitTestAlgorithm::Results results;
-  DALI_TEST_CHECK( !results.actor );
-  DALI_TEST_EQUALS( Vector2::ZERO, results.actorCoordinates, 0.1f, TEST_LOCATION );
-  // miss expected, results not changed
-  DALI_TEST_CHECK( false == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
-  DALI_TEST_CHECK( !results.actor );
-  DALI_TEST_EQUALS( Vector2::ZERO, results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  screenCoordinates.x = stageSize.x * 0.265f;
-  screenCoordinates.y = stageSize.y * 0.33f;
-  results.actor = Actor();
-  results.actorCoordinates = Vector2::ZERO;
-  // hit expected, results changed
-  DALI_TEST_CHECK( true == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
-  DALI_TEST_CHECK( results.actor  == offscreenActor );
-  DALI_TEST_EQUALS( (screenCoordinates-offset)/scale , results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  screenCoordinates.x = stageSize.x * 0.435f;
-  screenCoordinates.y = stageSize.y * 0.52f;
-  // hit expected, results changed
-  DALI_TEST_CHECK( true == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
-  DALI_TEST_CHECK( results.actor  == offscreenActor );
-  const Vector2 expectedCoordinates = (screenCoordinates-offset)/scale;
-  DALI_TEST_EQUALS( expectedCoordinates , results.actorCoordinates, 0.1f, TEST_LOCATION );
-
-  screenCoordinates.x = stageSize.x * 0.65f;
-  screenCoordinates.y = stageSize.y * 0.95f;
-  // miss expected, results not changed
-  DALI_TEST_CHECK( false == Dali::HitTestAlgorithm::HitTest( renderTask, screenCoordinates, results, IsActorHittableFunction ) );
-  DALI_TEST_CHECK( results.actor  == offscreenActor );
-  DALI_TEST_EQUALS( expectedCoordinates , results.actorCoordinates, 0.1f, TEST_LOCATION );
-  END_TEST;
-}
-
 int UtcDaliRenderTaskFinishInvisibleSourceActor(void)
 {
   TestApplication application;
 
   tet_infoline("Testing RenderTask::FinishInvisibleSourceActor()");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
   TestGlSyncAbstraction& sync = application.GetGlSyncAbstraction();
@@ -2652,6 +2631,7 @@ int UtcDaliRenderTaskFinishInvisibleSourceActor(void)
   application.SendNotification();
   DALI_TEST_CHECK( ! finished );
 
+#endif
   END_TEST;
 }
 
@@ -2698,7 +2678,7 @@ int UtcDaliRenderTaskFinishMissingImage(void)
 
 int UtcDaliRenderTaskWorldToViewport(void)
 {
-  TestApplication application( static_cast<size_t>(400), static_cast<size_t>(400) ); // square surface
+  TestApplication application( 400u, 400u ); // square surface
 
   RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
 
index b5c1add..3199632 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 
 #include <dali/public-api/dali-core.h>
 #include <dali/devel-api/images/texture-set-image.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <cstdio>
 #include <string>
 
@@ -42,6 +43,7 @@ const BlendFactor::Type   DEFAULT_BLEND_FACTOR_DEST_ALPHA( BlendFactor::ONE_MINU
 const BlendEquation::Type DEFAULT_BLEND_EQUATION_RGB(      BlendEquation::ADD );
 const BlendEquation::Type DEFAULT_BLEND_EQUATION_ALPHA(    BlendEquation::ADD );
 
+#if 0
 /**
  * @brief Get GL stencil test enumeration value as a string.
  * @return The string representation of the value of GL_STENCIL_TEST
@@ -71,6 +73,7 @@ void ResetDebugAndFlush( TestApplication& application, TraceCallStack& glEnableD
   application.SendNotification();
   application.Render();
 }
+#endif
 
 void TestConstraintNoBlue( Vector4& current, const PropertyInputContainer& inputs )
 {
@@ -89,7 +92,6 @@ void renderer_test_cleanup(void)
   test_return_value = TET_PASS;
 }
 
-
 int UtcDaliRendererNew01(void)
 {
   TestApplication application;
@@ -164,6 +166,85 @@ int UtcDaliRendererDownCast02(void)
   END_TEST;
 }
 
+// using a template to auto deduce the parameter types
+template< typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8>
+void TEST_RENDERER_PROPERTY( P1 renderer, P2 stringName, P3 type, P4 isWriteable, P5 isAnimateable, P6 isConstraintInput, P7 enumName, P8 LOCATION )
+{
+  DALI_TEST_EQUALS( renderer.GetPropertyName( enumName ), stringName, LOCATION );
+  DALI_TEST_EQUALS( renderer.GetPropertyIndex( stringName ), static_cast<Property::Index>(enumName), LOCATION );
+  DALI_TEST_EQUALS( renderer.GetPropertyType( enumName ), type, LOCATION );
+  DALI_TEST_EQUALS( renderer.IsPropertyWritable( enumName ), isWriteable, LOCATION );
+  DALI_TEST_EQUALS( renderer.IsPropertyAnimatable( enumName ), isAnimateable, LOCATION );
+  DALI_TEST_EQUALS( renderer.IsPropertyAConstraintInput( enumName ), isConstraintInput, LOCATION );
+}
+
+int UtcDaliRendererDefaultProperties(void)
+{
+  TestApplication application;
+/* from renderer-impl.cpp
+  DALI_PROPERTY( "depthIndex",                      INTEGER,   true, false,  false, Dali::Renderer::Property::DEPTH_INDEX )
+  DALI_PROPERTY( "faceCullingMode",                 INTEGER,   true, false,  false, Dali::Renderer::Property::FACE_CULLING_MODE )
+  DALI_PROPERTY( "blendMode",                       INTEGER,   true, false,  false, Dali::Renderer::Property::BLEND_MODE )
+  DALI_PROPERTY( "blendEquationRgb",                INTEGER,   true, false,  false, Dali::Renderer::Property::BLEND_EQUATION_RGB )
+  DALI_PROPERTY( "blendEquationAlpha",              INTEGER,   true, false,  false, Dali::Renderer::Property::BLEND_EQUATION_ALPHA )
+  DALI_PROPERTY( "blendFactorSrcRgb",               INTEGER,   true, false,  false, Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB )
+  DALI_PROPERTY( "blendFactorDestRgb",              INTEGER,   true, false,  false, Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB )
+  DALI_PROPERTY( "blendFactorSrcAlpha",             INTEGER,   true, false,  false, Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA )
+  DALI_PROPERTY( "blendFactorDestAlpha",            INTEGER,   true, false,  false, Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA )
+  DALI_PROPERTY( "blendColor",                      VECTOR4,   true, false,  false, Dali::Renderer::Property::BLEND_COLOR )
+  DALI_PROPERTY( "blendPreMultipliedAlpha",         BOOLEAN,   true, false,  false, Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA )
+  DALI_PROPERTY( "indexRangeFirst",                 INTEGER,   true, false,  false, Dali::Renderer::Property::INDEX_RANGE_FIRST )
+  DALI_PROPERTY( "indexRangeCount",                 INTEGER,   true, false,  false, Dali::Renderer::Property::INDEX_RANGE_COUNT )
+  DALI_PROPERTY( "depthWriteMode",                  INTEGER,   true, false,  false, Dali::Renderer::Property::DEPTH_WRITE_MODE )
+  DALI_PROPERTY( "depthFunction",                   INTEGER,   true, false,  false, Dali::Renderer::Property::DEPTH_FUNCTION )
+  DALI_PROPERTY( "depthTestMode",                   INTEGER,   true, false,  false, Dali::Renderer::Property::DEPTH_TEST_MODE )
+  DALI_PROPERTY( "renderMode",                      INTEGER,   true, false,  false, Dali::Renderer::Property::RENDER_MODE )
+  DALI_PROPERTY( "stencilFunction",                 INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_FUNCTION )
+  DALI_PROPERTY( "stencilFunctionMask",             INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_FUNCTION_MASK )
+  DALI_PROPERTY( "stencilFunctionReference",        INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE )
+  DALI_PROPERTY( "stencilMask",                     INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_MASK )
+  DALI_PROPERTY( "stencilOperationOnFail",          INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL )
+  DALI_PROPERTY( "stencilOperationOnZFail",         INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL )
+  DALI_PROPERTY( "stencilOperationOnZPass",         INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS )
+  DALI_PROPERTY( "opacity",                         FLOAT,     true, true,   true,  Dali::DevelRenderer::Property::OPACITY )
+  DALI_PROPERTY( "renderingBehavior",               INTEGER,   true, false,  false, Dali::DevelRenderer::Property::RENDERING_BEHAVIOR )
+*/
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader shader = CreateShader();
+  Renderer renderer = Renderer::New(geometry, shader);
+  DALI_TEST_EQUALS( renderer.GetPropertyCount(), 26, TEST_LOCATION );
+
+  TEST_RENDERER_PROPERTY( renderer, "depthIndex",              Property::INTEGER, true, false, false, Renderer::Property::DEPTH_INDEX, TEST_LOCATION );
+  TEST_RENDERER_PROPERTY( renderer, "faceCullingMode",         Property::INTEGER, true, false, false, Renderer::Property::FACE_CULLING_MODE, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "blendMode",               Property::INTEGER, true, false, false, Renderer::Property::BLEND_MODE, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "blendEquationRgb",        Property::INTEGER, true, false, false, Renderer::Property::BLEND_EQUATION_RGB, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "blendEquationAlpha",      Property::INTEGER, true, false, false, Renderer::Property::BLEND_EQUATION_ALPHA, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "blendFactorSrcRgb",       Property::INTEGER, true, false, false, Renderer::Property::BLEND_FACTOR_SRC_RGB, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "blendFactorDestRgb",      Property::INTEGER, true, false, false, Renderer::Property::BLEND_FACTOR_DEST_RGB, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "blendFactorSrcAlpha",     Property::INTEGER, true, false, false, Renderer::Property::BLEND_FACTOR_SRC_ALPHA, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "blendFactorDestAlpha",    Property::INTEGER, true, false, false, Renderer::Property::BLEND_FACTOR_DEST_ALPHA, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "blendColor",              Property::VECTOR4, true, false, false, Renderer::Property::BLEND_COLOR, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "blendPreMultipliedAlpha", Property::BOOLEAN, true, false, false, Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "indexRangeFirst",         Property::INTEGER, true, false, false, Renderer::Property::INDEX_RANGE_FIRST, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "indexRangeCount",         Property::INTEGER, true, false, false, Renderer::Property::INDEX_RANGE_COUNT, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "depthWriteMode",          Property::INTEGER, true, false, false, Renderer::Property::DEPTH_WRITE_MODE, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "depthFunction",           Property::INTEGER, true, false, false, Renderer::Property::DEPTH_FUNCTION, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "depthTestMode",           Property::INTEGER, true, false, false, Renderer::Property::DEPTH_TEST_MODE, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "renderMode",              Property::INTEGER, true, false, false, Renderer::Property::RENDER_MODE, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "stencilFunction",         Property::INTEGER, true, false, false, Renderer::Property::STENCIL_FUNCTION, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "stencilFunctionMask",     Property::INTEGER, true, false, false, Renderer::Property::STENCIL_FUNCTION_MASK, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "stencilFunctionReference",Property::INTEGER, true, false, false, Renderer::Property::STENCIL_FUNCTION_REFERENCE, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "stencilMask",             Property::INTEGER, true, false, false, Renderer::Property::STENCIL_MASK, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "stencilOperationOnFail",  Property::INTEGER, true, false, false, Renderer::Property::STENCIL_OPERATION_ON_FAIL, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "stencilOperationOnZFail", Property::INTEGER, true, false, false, Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "stencilOperationOnZPass", Property::INTEGER, true, false, false, Renderer::Property::STENCIL_OPERATION_ON_Z_PASS, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "opacity",                 Property::FLOAT,   true, true,  true,  DevelRenderer::Property::OPACITY, TEST_LOCATION  );
+  TEST_RENDERER_PROPERTY( renderer, "renderingBehavior",       Property::INTEGER, true, false, false, DevelRenderer::Property::RENDERING_BEHAVIOR, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliRendererSetGetGeometry(void)
 {
   TestApplication application;
@@ -197,6 +278,8 @@ int UtcDaliRendererSetGetShader(void)
 {
   TestApplication application;
   tet_infoline( "Test SetShader, GetShader" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   glAbstraction.EnableCullFaceCallTrace(true);
@@ -236,7 +319,7 @@ int UtcDaliRendererSetGetShader(void)
   DALI_TEST_EQUALS( actualValue, Color::GREEN, TEST_LOCATION );
 
   DALI_TEST_EQUALS( renderer.GetShader(), shader2, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -284,6 +367,8 @@ int UtcDaliRendererSetGetFaceCullingMode(void)
   TestApplication application;
 
   tet_infoline("Test SetFaceCullingMode(cullingMode)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
   Renderer renderer = Renderer::New( geometry, shader );
@@ -359,7 +444,7 @@ int UtcDaliRendererSetGetFaceCullingMode(void)
     cullFace = renderer.GetProperty<int>( Renderer::Property::FACE_CULLING_MODE );
     DALI_TEST_CHECK( static_cast< FaceCullingMode::Type >( cullFace ) == FaceCullingMode::NONE );
   }
-
+#endif
   END_TEST;
 }
 
@@ -368,6 +453,8 @@ int UtcDaliRendererBlendOptions01(void)
   TestApplication application;
 
   tet_infoline("Test BLEND_FACTOR properties ");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -405,7 +492,7 @@ int UtcDaliRendererBlendOptions01(void)
   DALI_TEST_EQUALS( (GLenum)GL_SRC_ALPHA_SATURATE,  glAbstraction.GetLastBlendFuncDstRgb(),   TEST_LOCATION );
   DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_SRC_COLOR, glAbstraction.GetLastBlendFuncSrcAlpha(), TEST_LOCATION );
   DALI_TEST_EQUALS( (GLenum)GL_SRC_ALPHA_SATURATE,  glAbstraction.GetLastBlendFuncDstAlpha(), TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -414,6 +501,8 @@ int UtcDaliRendererBlendOptions02(void)
   TestApplication application;
 
   tet_infoline("Test BLEND_FACTOR properties ");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -451,7 +540,7 @@ int UtcDaliRendererBlendOptions02(void)
   DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_CONSTANT_COLOR, glAbstraction.GetLastBlendFuncDstRgb(),   TEST_LOCATION );
   DALI_TEST_EQUALS( (GLenum)GL_CONSTANT_ALPHA,           glAbstraction.GetLastBlendFuncSrcAlpha(), TEST_LOCATION );
   DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_CONSTANT_ALPHA, glAbstraction.GetLastBlendFuncDstAlpha(), TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -485,6 +574,8 @@ int UtcDaliRendererBlendOptions04(void)
   TestApplication application;
 
   tet_infoline("Test SetBlendEquation() ");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -521,7 +612,7 @@ int UtcDaliRendererBlendOptions04(void)
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   DALI_TEST_EQUALS( (GLenum)GL_FUNC_REVERSE_SUBTRACT, glAbstraction.GetLastBlendEquationRgb(),   TEST_LOCATION );
   DALI_TEST_EQUALS( (GLenum)GL_FUNC_REVERSE_SUBTRACT, glAbstraction.GetLastBlendEquationAlpha(), TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -530,6 +621,8 @@ int UtcDaliRendererSetBlendMode01(void)
   TestApplication application;
 
   tet_infoline("Test setting the blend mode to on with an opaque color renders with blending enabled");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -553,7 +646,7 @@ int UtcDaliRendererSetBlendMode01(void)
   std::ostringstream blendStr;
   blendStr << GL_BLEND;
   DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) );
-
+#endif
   END_TEST;
 }
 
@@ -562,6 +655,8 @@ int UtcDaliRendererSetBlendMode01b(void)
   TestApplication application;
 
   tet_infoline("Test setting the blend mode to on with an transparent color renders with blending enabled");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -588,7 +683,7 @@ int UtcDaliRendererSetBlendMode01b(void)
   DALI_TEST_CHECK( !glEnableStack.FindMethod( "Enable" ) );
 
   DALI_TEST_CHECK( !glAbstraction.GetDrawTrace().FindMethod( "DrawElements" ) );
-
+#endif
   END_TEST;
 }
 
@@ -597,6 +692,8 @@ int UtcDaliRendererSetBlendMode02(void)
   TestApplication application;
 
   tet_infoline("Test setting the blend mode to off with a transparent color renders with blending disabled (and not enabled)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -620,7 +717,7 @@ int UtcDaliRendererSetBlendMode02(void)
   std::ostringstream blendStr;
   blendStr << GL_BLEND;
   DALI_TEST_CHECK( ! glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) );
-
+#endif
   END_TEST;
 }
 
@@ -629,6 +726,8 @@ int UtcDaliRendererSetBlendMode03(void)
   TestApplication application;
 
   tet_infoline("Test setting the blend mode to auto with a transparent color renders with blending enabled");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -652,7 +751,7 @@ int UtcDaliRendererSetBlendMode03(void)
   std::ostringstream blendStr;
   blendStr << GL_BLEND;
   DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) );
-
+#endif
   END_TEST;
 }
 
@@ -661,6 +760,8 @@ int UtcDaliRendererSetBlendMode04(void)
   TestApplication application;
 
   tet_infoline("Test setting the blend mode to auto with an opaque color renders with blending disabled");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -683,7 +784,7 @@ int UtcDaliRendererSetBlendMode04(void)
   std::ostringstream blendStr;
   blendStr << GL_BLEND;
   DALI_TEST_CHECK( ! glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) );
-
+#endif
   END_TEST;
 }
 
@@ -692,6 +793,8 @@ int UtcDaliRendererSetBlendMode04b(void)
   TestApplication application;
 
   tet_infoline("Test setting the blend mode to auto with a transparent actor color renders with blending enabled");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -715,7 +818,7 @@ int UtcDaliRendererSetBlendMode04b(void)
   std::ostringstream blendStr;
   blendStr << GL_BLEND;
   DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) );
-
+#endif
   END_TEST;
 }
 
@@ -724,6 +827,8 @@ int UtcDaliRendererSetBlendMode04c(void)
   TestApplication application;
 
   tet_infoline("Test setting the blend mode to auto with an opaque opaque actor color renders with blending disabled");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -747,7 +852,7 @@ int UtcDaliRendererSetBlendMode04c(void)
   std::ostringstream blendStr;
   blendStr << GL_BLEND;
   DALI_TEST_CHECK( ! glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) );
-
+#endif
   END_TEST;
 }
 
@@ -756,6 +861,8 @@ int UtcDaliRendererSetBlendMode05(void)
   TestApplication application;
 
   tet_infoline("Test setting the blend mode to auto with an opaque color and an image with an alpha channel renders with blending enabled");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   BufferImage image = BufferImage::New( 40, 40, Pixel::RGBA8888 );
@@ -782,7 +889,7 @@ int UtcDaliRendererSetBlendMode05(void)
   std::ostringstream blendStr;
   blendStr << GL_BLEND;
   DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) );
-
+#endif
   END_TEST;
 }
 
@@ -790,6 +897,8 @@ int UtcDaliRendererSetBlendMode06(void)
 {
   TestApplication application;
   tet_infoline("Test setting the blend mode to auto with an opaque color and an image without an alpha channel and a shader with the hint OUTPUT_IS_TRANSPARENT renders with blending enabled");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = Shader::New( "vertexSrc", "fragmentSrc", Shader::Hint::OUTPUT_IS_TRANSPARENT );
@@ -813,7 +922,7 @@ int UtcDaliRendererSetBlendMode06(void)
   std::ostringstream blendStr;
   blendStr << GL_BLEND;
   DALI_TEST_CHECK( glEnableStack.FindMethodAndParams( "Enable", blendStr.str().c_str() ) );
-
+#endif
   END_TEST;
 }
 
@@ -821,6 +930,8 @@ int UtcDaliRendererSetBlendMode07(void)
 {
   TestApplication application;
   tet_infoline("Test setting the blend mode to auto with an opaque color and an image without an alpha channel and a shader with the hint OUTPUT_IS_OPAQUE renders with blending disabled");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
@@ -845,7 +956,7 @@ int UtcDaliRendererSetBlendMode07(void)
 
   TraceCallStack& glEnableStack = glAbstraction.GetEnableDisableTrace();
   DALI_TEST_CHECK( ! glEnableStack.FindMethodAndParams( "Enable", "GL_BLEND" ) );
-
+#endif
   END_TEST;
 }
 
@@ -881,6 +992,8 @@ int UtcDaliRendererSetBlendColor(void)
   TestApplication application;
 
   tet_infoline("Test SetBlendColor(color)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
@@ -922,7 +1035,7 @@ int UtcDaliRendererSetBlendColor(void)
   application.SendNotification();
   application.Render();
   DALI_TEST_EQUALS( glAbstraction.GetLastBlendColor(), color, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -957,6 +1070,8 @@ int UtcDaliRendererPreMultipledAlpha(void)
   TestApplication application;
 
   tet_infoline("Test BLEND_PRE_MULTIPLIED_ALPHA property");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
@@ -991,7 +1106,8 @@ int UtcDaliRendererPreMultipledAlpha(void)
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Vector4(1.0f, 0.0f, 1.0f, 0.5f), TEST_LOCATION );
 
-  renderer.SetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, true);
+  // Enable pre-multiplied alpha
+  renderer.SetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, true );
 
   application.SendNotification();
   application.Render();
@@ -1017,6 +1133,33 @@ int UtcDaliRendererPreMultipledAlpha(void)
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Vector4(0.5f, 0.0f, 0.5f, 0.5f), TEST_LOCATION );
 
+  // Disable pre-multiplied alpha again
+  renderer.SetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, false );
+
+  application.SendNotification();
+  application.Render();
+
+  value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
+  DALI_TEST_CHECK( value.Get( preMultipliedAlpha ) );
+  DALI_TEST_CHECK( !preMultipliedAlpha );
+
+  value = renderer.GetCurrentProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
+  DALI_TEST_CHECK( value.Get( preMultipliedAlpha ) );
+  DALI_TEST_CHECK( !preMultipliedAlpha );
+
+  srcFactorRgb    = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_RGB );
+  destFactorRgb   = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_RGB );
+  srcFactorAlpha  = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_ALPHA );
+  destFactorAlpha = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_ALPHA );
+
+  DALI_TEST_EQUALS( (int)BlendFactor::SRC_ALPHA,           srcFactorRgb,    TEST_LOCATION );
+  DALI_TEST_EQUALS( (int)BlendFactor::ONE_MINUS_SRC_ALPHA, destFactorRgb,   TEST_LOCATION );
+  DALI_TEST_EQUALS( (int)BlendFactor::ONE,                 srcFactorAlpha,  TEST_LOCATION );
+  DALI_TEST_EQUALS( (int)BlendFactor::ONE_MINUS_SRC_ALPHA, destFactorAlpha, TEST_LOCATION );
+
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uColor", actualValue ) );
+  DALI_TEST_EQUALS( actualValue, Vector4( 1.0f, 0.0f, 1.0f, 0.5f ), TEST_LOCATION );
+#endif
   END_TEST;
 }
 
@@ -1067,6 +1210,8 @@ int UtcDaliRendererConstraint02(void)
   TestApplication application;
 
   tet_infoline("Test that a uniform map renderer property can be constrained");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Shader shader = Shader::New("VertexSource", "FragmentSource");
   Geometry geometry = CreateQuadGeometry();
@@ -1112,7 +1257,7 @@ int UtcDaliRendererConstraint02(void)
 
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::WHITE, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1162,6 +1307,8 @@ int UtcDaliRendererAnimatedProperty02(void)
   TestApplication application;
 
   tet_infoline("Test that a uniform map renderer property can be animated");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Shader shader = Shader::New("VertexSource", "FragmentSource");
   Geometry geometry = CreateQuadGeometry();
@@ -1202,7 +1349,7 @@ int UtcDaliRendererAnimatedProperty02(void)
   application.Render(500);
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::TRANSPARENT, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1211,6 +1358,8 @@ int UtcDaliRendererUniformMapPrecendence01(void)
   TestApplication application;
 
   tet_infoline("Test the uniform map precedence is applied properly");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
 
@@ -1259,7 +1408,7 @@ int UtcDaliRendererUniformMapPrecendence01(void)
   application.Render(500);
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::GREEN, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1268,6 +1417,8 @@ int UtcDaliRendererUniformMapPrecendence02(void)
   TestApplication application;
 
   tet_infoline("Test the uniform map precedence is applied properly");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
 
@@ -1316,7 +1467,7 @@ int UtcDaliRendererUniformMapPrecendence02(void)
   application.Render(500);
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::GREEN, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1326,6 +1477,8 @@ int UtcDaliRendererUniformMapPrecendence03(void)
   TestApplication application;
 
   tet_infoline("Test the uniform map precedence is applied properly");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
 
@@ -1355,7 +1508,7 @@ int UtcDaliRendererUniformMapPrecendence03(void)
   Vector4 actualValue(Vector4::ZERO);
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::BLACK, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1364,6 +1517,8 @@ int UtcDaliRendererUniformMapMultipleUniforms01(void)
   TestApplication application;
 
   tet_infoline("Test the uniform maps are collected from all objects (same type)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
 
@@ -1402,7 +1557,7 @@ int UtcDaliRendererUniformMapMultipleUniforms01(void)
   Vector4 uniform3Value(Vector4::ZERO);
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uUniform3", uniform3Value ) );
   DALI_TEST_EQUALS( uniform3Value, Color::MAGENTA, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1411,6 +1566,8 @@ int UtcDaliRendererUniformMapMultipleUniforms02(void)
   TestApplication application;
 
   tet_infoline("Test the uniform maps are collected from all objects (different types)");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
 
@@ -1454,7 +1611,7 @@ int UtcDaliRendererUniformMapMultipleUniforms02(void)
   Matrix3 uniform3Value;
   DALI_TEST_CHECK( gl.GetUniformValue<Matrix3>( "uANormalMatrix", uniform3Value ) );
   DALI_TEST_EQUALS( uniform3Value, value3.Get<Matrix3>(), TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1489,6 +1646,8 @@ int UtcDaliRendererRenderOrder2DLayer(void)
 {
   TestApplication application;
   tet_infoline("Test the rendering order in a 2D layer is correct");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Shader shader = Shader::New("VertexSource", "FragmentSource");
   Geometry geometry = CreateQuadGeometry();
@@ -1553,7 +1712,7 @@ int UtcDaliRendererRenderOrder2DLayer(void)
 
   //Check that actor3 has been rendered after actor0
   DALI_TEST_GREATER( textureBindIndex[3], textureBindIndex[0], TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1561,6 +1720,8 @@ int UtcDaliRendererRenderOrder2DLayerMultipleRenderers(void)
 {
   TestApplication application;
   tet_infoline("Test the rendering order in a 2D layer is correct using multiple renderers per actor");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   /*
    * Creates the following hierarchy:
@@ -1626,7 +1787,7 @@ int UtcDaliRendererRenderOrder2DLayerMultipleRenderers(void)
 
   //Check that renderer2 has been rendered after renderer1
   DALI_TEST_GREATER( textureBindIndex[2], textureBindIndex[1], TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1635,6 +1796,8 @@ int UtcDaliRendererRenderOrder2DLayerSiblingOrder(void)
 {
   TestApplication application;
   tet_infoline("Test the rendering order in a 2D layer is correct using sibling order");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   /*
    * Creates the following hierarchy:
@@ -1729,7 +1892,7 @@ int UtcDaliRendererRenderOrder2DLayerSiblingOrder(void)
   DALI_TEST_EQUALS( textureBindIndex[2], 3, TEST_LOCATION );
   DALI_TEST_EQUALS( textureBindIndex[3], 4, TEST_LOCATION );
   DALI_TEST_EQUALS( textureBindIndex[4], 5, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1737,6 +1900,8 @@ int UtcDaliRendererRenderOrder2DLayerOverlay(void)
 {
   TestApplication application;
   tet_infoline("Test the rendering order in a 2D layer is correct for overlays");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Shader shader = Shader::New("VertexSource", "FragmentSource");
   Geometry geometry = CreateQuadGeometry();
@@ -1813,7 +1978,7 @@ int UtcDaliRendererRenderOrder2DLayerOverlay(void)
 
   //Check that actor3 has been rendered after actor0
   DALI_TEST_GREATER( textureBindIndex[3], textureBindIndex[0], TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -1836,6 +2001,8 @@ int UtcDaliRendererSetIndexRange(void)
 
   TestApplication application;
   tet_infoline("Test setting the range of indices to draw");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
   gl.EnableDrawCallTrace( true );
@@ -1957,7 +2124,7 @@ int UtcDaliRendererSetIndexRange(void)
     bool result = gl.GetDrawTrace().FindMethodAndParams( "DrawElements" , buffer );
     DALI_TEST_CHECK( result );
   }
-
+#endif
   END_TEST;
 }
 
@@ -1967,6 +2134,8 @@ int UtcDaliRendererSetDepthFunction(void)
   TestApplication application;
 
   tet_infoline("Test setting the depth function");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = CreateShader();
@@ -2094,7 +2263,7 @@ int UtcDaliRendererSetDepthFunction(void)
     depthFunctionStr << GL_GEQUAL;
     DALI_TEST_CHECK( glDepthFunctionStack.FindMethodAndParams( "DepthFunc", depthFunctionStr.str().c_str() ) );
   }
-
+#endif
   END_TEST;
 }
 
@@ -2195,6 +2364,8 @@ int UtcDaliRendererSetDepthTestMode(void)
 {
   TestApplication application;
   tet_infoline("Test setting the DepthTestMode");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Renderer renderer = RendererTestFixture( application );
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -2232,9 +2403,9 @@ int UtcDaliRendererSetDepthTestMode(void)
   DALI_TEST_CHECK( glEnableDisableStack.FindMethodAndParams( "Enable", GetDepthTestString() ) );
   DALI_TEST_CHECK( !glEnableDisableStack.FindMethodAndParams( "Disable", GetDepthTestString() ) );
 
-  // Change the layer behavior to LAYER_2D.
+  // Change the layer behavior to LAYER_UI.
   // Note this will also disable depth testing for the layer by default, we test this first.
-  Stage::GetCurrent().GetRootLayer().SetBehavior( Layer::LAYER_2D );
+  Stage::GetCurrent().GetRootLayer().SetBehavior( Layer::LAYER_UI );
 
   glEnableDisableStack.Reset();
   application.SendNotification();
@@ -2252,7 +2423,7 @@ int UtcDaliRendererSetDepthTestMode(void)
 
   // Check depth-test is *still* disabled.
   DALI_TEST_CHECK( glEnableDisableStack.FindMethodAndParams( "Enable", GetDepthTestString() ) );
-
+#endif
   END_TEST;
 }
 
@@ -2260,6 +2431,8 @@ int UtcDaliRendererSetDepthWriteMode(void)
 {
   TestApplication application;
   tet_infoline("Test setting the DepthWriteMode");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Renderer renderer = RendererTestFixture( application );
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -2298,7 +2471,7 @@ int UtcDaliRendererSetDepthWriteMode(void)
 
   // Check depth-write is now disabled.
   DALI_TEST_CHECK( !glAbstraction.GetLastDepthMask() );
-
+#endif
   END_TEST;
 }
 
@@ -2306,6 +2479,8 @@ int UtcDaliRendererCheckStencilDefaults(void)
 {
   TestApplication application;
   tet_infoline("Test the stencil defaults");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Renderer renderer = RendererTestFixture( application );
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -2325,6 +2500,7 @@ int UtcDaliRendererCheckStencilDefaults(void)
   DALI_TEST_EQUALS<int>( static_cast<int>( renderer.GetProperty( Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL ).Get<int>() ), static_cast<int>( StencilOperation::KEEP ), TEST_LOCATION );
   DALI_TEST_EQUALS<int>( static_cast<int>( renderer.GetProperty( Renderer::Property::STENCIL_OPERATION_ON_Z_PASS ).Get<int>() ), static_cast<int>( StencilOperation::KEEP ), TEST_LOCATION );
 
+#endif
   END_TEST;
 }
 
@@ -2332,6 +2508,8 @@ int UtcDaliRendererSetRenderModeToUseStencilBuffer(void)
 {
   TestApplication application;
   tet_infoline("Test setting the RenderMode to use the stencil buffer");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Renderer renderer = RendererTestFixture( application );
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -2380,6 +2558,7 @@ int UtcDaliRendererSetRenderModeToUseStencilBuffer(void)
   DALI_TEST_CHECK( glEnableDisableStack.FindMethodAndParams( "Enable", GetStencilTestString() ) );
   DALI_TEST_CHECK( glStencilFunctionStack.FindMethod( methodString ) );
 
+#endif
   END_TEST;
 }
 
@@ -2390,7 +2569,7 @@ void CheckRenderModeColorMask( TestApplication& application, Renderer& renderer,
   renderer.SetProperty( Renderer::Property::RENDER_MODE, renderMode );
   application.SendNotification();
   application.Render();
-
+#if 0
   // Check if ColorMask has been called, and that the values are correct.
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   const TestGlAbstraction::ColorMaskParams& colorMaskParams( glAbstraction.GetColorMaskParams() );
@@ -2399,12 +2578,15 @@ void CheckRenderModeColorMask( TestApplication& application, Renderer& renderer,
   DALI_TEST_EQUALS<bool>( colorMaskParams.green, expectedValue, TEST_LOCATION );
   DALI_TEST_EQUALS<bool>( colorMaskParams.blue,  expectedValue, TEST_LOCATION );
   DALI_TEST_EQUALS<bool>( colorMaskParams.alpha, expectedValue, TEST_LOCATION );
+#endif
 }
 
 int UtcDaliRendererSetRenderModeToUseColorBuffer(void)
 {
   TestApplication application;
   tet_infoline("Test setting the RenderMode to use the color buffer");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Renderer renderer = RendererTestFixture( application );
 
@@ -2415,7 +2597,7 @@ int UtcDaliRendererSetRenderModeToUseColorBuffer(void)
   CheckRenderModeColorMask( application, renderer, RenderMode::COLOR, true );
   CheckRenderModeColorMask( application, renderer, RenderMode::STENCIL, false );
   CheckRenderModeColorMask( application, renderer, RenderMode::COLOR_STENCIL, true );
-
+#endif
   END_TEST;
 }
 
@@ -2423,6 +2605,8 @@ int UtcDaliRendererSetStencilFunction(void)
 {
   TestApplication application;
   tet_infoline("Test setting the StencilFunction");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Renderer renderer = RendererTestFixture( application );
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -2510,6 +2694,7 @@ int UtcDaliRendererSetStencilFunction(void)
 
   DALI_TEST_CHECK( glStencilFunctionStack.FindMethodAndParams( methodString, parameterStream.str() ) );
 
+#endif
   END_TEST;
 }
 
@@ -2517,6 +2702,8 @@ int UtcDaliRendererSetStencilOperation(void)
 {
   TestApplication application;
   tet_infoline("Test setting the StencilOperation");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Renderer renderer = RendererTestFixture( application );
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -2604,7 +2791,7 @@ int UtcDaliRendererSetStencilOperation(void)
       }
     }
   }
-
+#endif
   END_TEST;
 }
 
@@ -2612,6 +2799,8 @@ int UtcDaliRendererSetStencilMask(void)
 {
   TestApplication application;
   tet_infoline("Test setting the StencilMask");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Renderer renderer = RendererTestFixture( application );
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
@@ -2653,7 +2842,7 @@ int UtcDaliRendererSetStencilMask(void)
 
   // Check the function was called and the parameters were correct.
   DALI_TEST_CHECK( glStencilFunctionStack.FindMethodAndParams( methodString, parameterString ) );
-
+#endif
   END_TEST;
 }
 
@@ -2661,6 +2850,8 @@ int UtcDaliRendererWrongNumberOfTextures(void)
 {
   TestApplication application;
   tet_infoline("Test renderer does render even if number of textures is different than active samplers in the shader");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   //Create a TextureSet with 4 textures (One more texture in the texture set than active samplers)
   //@note Shaders in the test suit have 3 active samplers. See TestGlAbstraction::GetActiveUniform()
@@ -2703,7 +2894,7 @@ int UtcDaliRendererWrongNumberOfTextures(void)
 
   //Test we do the drawcall when TextureSet has less textures than there are active samplers in the shader.
   DALI_TEST_EQUALS( drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -2712,6 +2903,8 @@ int UtcDaliRendererOpacity(void)
   TestApplication application;
 
   tet_infoline( "Test OPACITY property" );
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Geometry geometry = CreateQuadGeometry();
   Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
@@ -2751,7 +2944,7 @@ int UtcDaliRendererOpacity(void)
 
   DALI_TEST_CHECK( gl.GetUniformValue< Vector4 >( "uColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue.a, 0.5f, Dali::Math::MACHINE_EPSILON_1, TEST_LOCATION );
-
+#endif
   END_TEST;
 }
 
@@ -2832,3 +3025,71 @@ int UtcDaliRendererInvalidProperty(void)
 
   END_TEST;
 }
+
+int UtcDaliRendererRenderingBehavior(void)
+{
+  TestApplication application;
+
+  tet_infoline( "Test RENDERING_BEHAVIOR property" );
+
+  Geometry geometry = CreateQuadGeometry();
+  Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
+  Renderer renderer = Renderer::New( geometry, shader );
+
+  Actor actor = Actor::New();
+  actor.AddRenderer( renderer );
+  actor.SetSize( 400, 400 );
+  actor.SetColor( Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
+  Stage::GetCurrent().Add( actor );
+
+  Property::Value value = renderer.GetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR );
+  int renderingBehavior;
+  DALI_TEST_CHECK( value.Get( renderingBehavior ) );
+  DALI_TEST_EQUALS( static_cast< DevelRenderer::Rendering::Type >( renderingBehavior ), DevelRenderer::Rendering::IF_REQUIRED, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  uint32_t updateStatus = application.GetUpdateStatus();
+
+  DALI_TEST_CHECK( !( updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING ) );
+
+  renderer.SetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::CONTINUOUSLY );
+
+  value = renderer.GetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR );
+  DALI_TEST_CHECK( value.Get( renderingBehavior ) );
+  DALI_TEST_EQUALS( static_cast< DevelRenderer::Rendering::Type >( renderingBehavior ), DevelRenderer::Rendering::CONTINUOUSLY, TEST_LOCATION );
+
+  // Render and check the update status
+  application.SendNotification();
+  application.Render();
+
+  updateStatus = application.GetUpdateStatus();
+
+  DALI_TEST_CHECK( updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING );
+
+  value = renderer.GetCurrentProperty( DevelRenderer::Property::RENDERING_BEHAVIOR );
+  DALI_TEST_CHECK( value.Get( renderingBehavior ) );
+  DALI_TEST_EQUALS( static_cast< DevelRenderer::Rendering::Type >( renderingBehavior ), DevelRenderer::Rendering::CONTINUOUSLY, TEST_LOCATION );
+
+  // Render again and check the update status
+  application.SendNotification();
+  application.Render();
+
+  updateStatus = application.GetUpdateStatus();
+
+  DALI_TEST_CHECK( updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING );
+
+  // Change rendering behavior
+  renderer.SetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::IF_REQUIRED );
+
+  // Render and check the update status
+  application.SendNotification();
+  application.Render();
+
+  updateStatus = application.GetUpdateStatus();
+
+  DALI_TEST_CHECK( !( updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING ) );
+
+  END_TEST;
+}
index fb895a1..e5ba62d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -119,6 +119,9 @@ int UtcDaliSamplerAssignmentOperator(void)
 int UtcSamplerSetFilterMode(void)
 {
   TestApplication application;
+  tet_infoline("UtcSamplerSetFilterMode");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
   Sampler sampler = Sampler::New();
@@ -244,12 +247,16 @@ int UtcSamplerSetFilterMode(void)
   out << GL_TEXTURE_2D << ", " << GL_TEXTURE_MIN_FILTER << ", " << GL_NEAREST_MIPMAP_LINEAR;
   DALI_TEST_EQUALS( texParameterTrace.TestMethodAndParams(0, "TexParameteri", out.str()), true, TEST_LOCATION);
 
+#endif
   END_TEST;
 }
 
 int UtcSamplerSetWrapMode1(void)
 {
   TestApplication application;
+  tet_infoline("UtcSamplerSetWrapMode1");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
   TextureSet textureSet = CreateTextureSet();
@@ -311,13 +318,16 @@ int UtcSamplerSetWrapMode1(void)
   DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 0, TEST_LOCATION);
 
   //Todo: Test the other wrap mode ( REPEAT, MIRRORED_REPEAT )  , currently not support!!
-
+#endif
   END_TEST;
 }
 
 int UtcSamplerSetWrapMode2(void)
 {
   TestApplication application;
+  tet_infoline("UtcSamplerSetWrapMode2");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   // Create a cube-map texture.
   unsigned int width = 8u;
@@ -385,5 +395,6 @@ int UtcSamplerSetWrapMode2(void)
 
   // Verify that 3 TexParameteri calls occurred.
   DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 3u, TEST_LOCATION );
+#endif
   END_TEST;
 }
diff --git a/automated-tests/src/dali/utc-Dali-Scene.cpp b/automated-tests/src/dali/utc-Dali-Scene.cpp
new file mode 100644 (file)
index 0000000..062679c
--- /dev/null
@@ -0,0 +1,669 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <iostream>
+
+#include <stdlib.h>
+#include <dali/integration-api/scene.h>
+#include <dali/integration-api/events/key-event-integ.h>
+#include <dali/public-api/events/key-event.h>
+#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/events/wheel-event-integ.h>
+
+#include <dali-test-suite-utils.h>
+
+// Internal headers are allowed here
+
+namespace
+{
+
+const std::string DEFAULT_DEVICE_NAME("hwKeyboard");
+
+// Functor for EventProcessingFinished signal
+struct EventProcessingFinishedFunctor
+{
+  /**
+   * @param[in] eventProcessingFinished reference to a boolean variable used to check if signal has been called.
+   */
+  EventProcessingFinishedFunctor( bool& eventProcessingFinished )
+  : mEventProcessingFinished( eventProcessingFinished )
+  {}
+
+  void operator()()
+  {
+    mEventProcessingFinished = true;
+  }
+
+  bool& mEventProcessingFinished;
+};
+
+// Stores data that is populated in the key-event callback and will be read by the TET cases
+struct KeyEventSignalData
+{
+  KeyEventSignalData()
+  : functorCalled(false)
+  {}
+
+  void Reset()
+  {
+    functorCalled = false;
+
+    receivedKeyEvent.keyModifier = 0;
+    receivedKeyEvent.keyPressedName.clear();
+    receivedKeyEvent.keyPressed.clear();
+  }
+
+  bool functorCalled;
+  KeyEvent receivedKeyEvent;
+};
+
+// Functor that sets the data when called
+struct KeyEventReceivedFunctor
+{
+  KeyEventReceivedFunctor( KeyEventSignalData& data ) : signalData( data ) { }
+
+  bool operator()( const KeyEvent& keyEvent )
+  {
+    signalData.functorCalled = true;
+    signalData.receivedKeyEvent = keyEvent;
+
+    return true;
+  }
+
+  KeyEventSignalData& signalData;
+};
+
+// Stores data that is populated in the touched signal callback and will be read by the TET cases
+struct TouchedSignalData
+{
+  TouchedSignalData()
+  : functorCalled(false)
+  {}
+
+  void Reset()
+  {
+    functorCalled = false;
+
+    receivedTouchEvent.points.clear();
+    receivedTouchEvent.time = 0;
+
+    receivedTouchData.Reset();
+  }
+
+  bool functorCalled;
+  TouchEvent receivedTouchEvent;
+  TouchData receivedTouchData;
+};
+
+// Functor that sets the data when touched signal is received
+struct TouchedFunctor
+{
+  TouchedFunctor( TouchedSignalData& data ) : signalData( data ) { }
+
+  void operator()( const TouchEvent& touch )
+  {
+    signalData.functorCalled = true;
+    signalData.receivedTouchEvent = touch;
+  }
+
+  TouchedSignalData& signalData;
+};
+
+// Functor that sets the data when touched signal is received
+struct TouchFunctor
+{
+  TouchFunctor( TouchedSignalData& data ) : signalData( data ) { }
+
+  void operator()( const TouchData& touch )
+  {
+    signalData.functorCalled = true;
+    signalData.receivedTouchData = touch;
+  }
+
+  void operator()()
+  {
+    signalData.functorCalled = true;
+  }
+
+  TouchedSignalData& signalData;
+};
+
+// Stores data that is populated in the wheel-event callback and will be read by the TET cases
+struct WheelEventSignalData
+{
+  WheelEventSignalData()
+  : functorCalled(false)
+  {}
+
+  void Reset()
+  {
+    functorCalled = false;
+  }
+
+  bool functorCalled;
+  WheelEvent receivedWheelEvent;
+};
+
+// Functor that sets the data when wheel-event signal is received
+struct WheelEventReceivedFunctor
+{
+  WheelEventReceivedFunctor( WheelEventSignalData& data ) : signalData( data ) { }
+
+  bool operator()( const WheelEvent& wheelEvent )
+  {
+    signalData.functorCalled = true;
+    signalData.receivedWheelEvent = wheelEvent;
+
+    return true;
+  }
+
+  WheelEventSignalData& signalData;
+};
+
+void GenerateTouch( TestApplication& application, PointState::Type state, const Vector2& screenPosition )
+{
+  Integration::TouchEvent touchEvent;
+  Integration::Point point;
+  point.SetState( state );
+  point.SetScreenPosition( screenPosition );
+  touchEvent.points.push_back( point );
+  application.ProcessEvent( touchEvent );
+}
+
+bool DummyTouchCallback( Actor actor, const TouchEvent& touch )
+{
+  return true;
+}
+
+} // unnamed namespace
+
+int UtcDaliSceneAdd(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::Integration::Scene::Add");
+
+  Dali::Integration::Scene scene = application.GetScene();
+
+  Actor actor = Actor::New();
+  DALI_TEST_CHECK( !actor.OnStage() );
+
+  scene.Add( actor );
+  DALI_TEST_CHECK( actor.OnStage() );
+
+  END_TEST;
+}
+
+int UtcDaliSceneRemove(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::Integration::Scene::Remove");
+
+  Dali::Integration::Scene scene = application.GetScene();
+
+  Actor actor = Actor::New();
+  DALI_TEST_CHECK( !actor.OnStage() );
+
+  scene.Add( actor );
+  DALI_TEST_CHECK( actor.OnStage() );
+
+  scene.Remove(actor);
+  DALI_TEST_CHECK( !actor.OnStage() );
+
+  END_TEST;
+}
+
+int UtcDaliSceneGetSize(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::Integration::Scene::GetSize");
+
+  Dali::Integration::Scene scene = application.GetScene();
+  Size size = scene.GetSize();
+  DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_WIDTH, size.width, TEST_LOCATION );
+  DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_HEIGHT, size.height, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliSceneGetDpi(void)
+{
+  TestApplication application; // Initializes core DPI to default values
+
+  // Test that setting core DPI explicitly also sets up the scene's DPI.
+  Dali::Integration::Scene scene = application.GetScene();
+  scene.SetDpi( Vector2(200.0f, 180.0f) );
+  Vector2 dpi = scene.GetDpi();
+  DALI_TEST_EQUALS( dpi.x, 200.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( dpi.y, 180.0f, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliSceneGetRenderTaskList(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::Integration::Scene::GetRenderTaskList");
+
+  Dali::Integration::Scene scene = application.GetScene();
+
+  // Check we get a valid instance.
+  const RenderTaskList& tasks = scene.GetRenderTaskList();
+
+  // There should be 1 task by default.
+  DALI_TEST_EQUALS( tasks.GetTaskCount(), 1u, TEST_LOCATION );
+
+  // RenderTaskList has it's own UTC tests.
+  // But we can confirm that GetRenderTaskList in Stage retrieves the same RenderTaskList each time.
+  RenderTask newTask = scene.GetRenderTaskList().CreateTask();
+
+  DALI_TEST_EQUALS( scene.GetRenderTaskList().GetTask( 1 ), newTask, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliSceneGetRootLayer(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::Integration::Scene::GetRootLayer");
+
+  Dali::Integration::Scene scene = application.GetScene();
+  Layer layer = scene.GetLayer( 0 );
+  DALI_TEST_CHECK( layer );
+
+  // Check that GetRootLayer() correctly retreived layer 0.
+  DALI_TEST_CHECK( scene.GetRootLayer() == layer );
+
+  END_TEST;
+}
+
+int UtcDaliSceneGetLayerCount(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::Integration::Scene::GetLayerCount");
+
+  Dali::Integration::Scene scene = application.GetScene();
+  // Initially we have a default layer
+  DALI_TEST_EQUALS( scene.GetLayerCount(), 1u, TEST_LOCATION );
+
+  Layer layer = Layer::New();
+  scene.Add( layer );
+
+  DALI_TEST_EQUALS( scene.GetLayerCount(), 2u, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliSceneGetLayer(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Dali::Integration::Scene::GetLayer");
+
+  Dali::Integration::Scene scene = application.GetScene();
+
+  Layer rootLayer = scene.GetLayer( 0 );
+  DALI_TEST_CHECK( rootLayer );
+
+  Layer layer = Layer::New();
+  scene.Add( layer );
+
+  Layer sameLayer = scene.GetLayer( 1 );
+  DALI_TEST_CHECK( layer == sameLayer );
+
+  END_TEST;
+}
+
+int UtcDaliSceneEventProcessingFinishedP(void)
+{
+  TestApplication application;
+  Dali::Integration::Scene scene = application.GetScene();
+
+  bool eventProcessingFinished = false;
+  EventProcessingFinishedFunctor functor( eventProcessingFinished );
+  scene.EventProcessingFinishedSignal().Connect( &application, functor );
+
+  Actor actor( Actor::New() );
+  scene.Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK( eventProcessingFinished );
+
+  END_TEST;
+}
+
+int UtcDaliSceneEventProcessingFinishedN(void)
+{
+  TestApplication application;
+  Dali::Integration::Scene scene = application.GetScene();
+
+  bool eventProcessingFinished = false;
+  EventProcessingFinishedFunctor functor( eventProcessingFinished );
+  scene.EventProcessingFinishedSignal().Connect( &application, functor );
+
+  Actor actor( Actor::New() );
+  scene.Add( actor );
+
+  // Do not complete event processing and confirm the signal has not been emitted.
+  DALI_TEST_CHECK( !eventProcessingFinished );
+
+  END_TEST;
+}
+
+int UtcDaliSceneSignalKeyEventP(void)
+{
+  TestApplication application;
+  Dali::Integration::Scene scene = application.GetScene();
+
+  KeyEventSignalData data;
+  KeyEventReceivedFunctor functor( data );
+  scene.KeyEventSignal().Connect( &application, functor );
+
+  Integration::KeyEvent event( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Down, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  application.ProcessEvent( event );
+
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.keyModifier );
+  DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.keyPressedName );
+  DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.keyPressed );
+  DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+
+  data.Reset();
+
+  Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  application.ProcessEvent( event2 );
+
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.keyModifier );
+  DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.keyPressedName );
+  DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.keyPressed );
+  DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+
+  data.Reset();
+
+  Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  application.ProcessEvent( event3 );
+
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.keyModifier );
+  DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.keyPressedName );
+  DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.keyPressed );
+  DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+
+  data.Reset();
+
+  Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  application.ProcessEvent( event4 );
+
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.keyModifier );
+  DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.keyPressedName );
+  DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.keyPressed );
+  DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+  END_TEST;
+}
+
+int UtcDaliSceneSignalKeyEventN(void)
+{
+  TestApplication application;
+  Dali::Integration::Scene scene = application.GetScene();
+
+  KeyEventSignalData data;
+  KeyEventReceivedFunctor functor( data );
+  scene.KeyEventSignal().Connect( &application, functor );
+
+  // Check that a non-pressed key events data is not modified.
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliSceneTouchSignalP(void)
+{
+  TestApplication application;
+  Dali::Integration::Scene scene = application.GetScene();
+
+  TouchedSignalData data;
+  TouchFunctor functor( data );
+  scene.TouchSignal().Connect( &application, functor );
+
+  // Render and notify.
+  application.SendNotification();
+  application.Render();
+
+  // Basic test: No actors, single touch (down then up).
+  {
+    GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
+
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
+    data.Reset();
+
+    GenerateTouch( application, PointState::UP, Vector2( 10.0f, 10.0f ) );
+
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
+    data.Reset();
+  }
+
+  // Add an actor to the scene.
+  Actor actor = Actor::New();
+  actor.SetSize( 100.0f, 100.0f );
+  actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  actor.TouchedSignal().Connect( &DummyTouchCallback );
+  scene.Add( actor );
+
+  // Render and notify.
+  application.SendNotification();
+  application.Render();
+
+  // Actor on scene, single touch, down in actor, motion, then up outside actor.
+  {
+    GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
+
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
+    DALI_TEST_CHECK( data.receivedTouchData.GetHitActor(0) == actor );
+    data.Reset();
+
+    GenerateTouch( application, PointState::MOTION, Vector2( 150.0f, 10.0f ) ); // Some motion
+
+    DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+    data.Reset();
+
+    GenerateTouch( application, PointState::UP, Vector2( 150.0f, 10.0f ) ); // Some motion
+
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
+    data.Reset();
+  }
+
+  // Multiple touch. Should only receive a touch on first down and last up.
+  {
+    Integration::TouchEvent touchEvent;
+    Integration::Point point;
+
+    // 1st point
+    point.SetState( PointState::DOWN );
+    point.SetScreenPosition( Vector2( 10.0f, 10.0f ) );
+    touchEvent.points.push_back( point );
+    application.ProcessEvent( touchEvent );
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION );
+    data.Reset();
+
+    // 2nd point
+    touchEvent.points[0].SetState( PointState::STATIONARY );
+    point.SetDeviceId( 1 );
+    point.SetScreenPosition( Vector2( 50.0f, 50.0f ) );
+    touchEvent.points.push_back( point );
+    application.ProcessEvent( touchEvent );
+    DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+    data.Reset();
+
+    // Primary point is up
+    touchEvent.points[0].SetState( PointState::UP );
+    touchEvent.points[1].SetState( PointState::STATIONARY );
+    application.ProcessEvent( touchEvent );
+    DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+    data.Reset();
+
+    // Remove 1st point now, 2nd point is now in motion
+    touchEvent.points.erase( touchEvent.points.begin() );
+    touchEvent.points[0].SetState( PointState::MOTION );
+    touchEvent.points[0].SetScreenPosition( Vector2( 150.0f, 50.0f ) );
+    application.ProcessEvent( touchEvent );
+    DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+    data.Reset();
+
+    // Final point Up
+    touchEvent.points[0].SetState( PointState::UP );
+    application.ProcessEvent( touchEvent );
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION );
+    data.Reset();
+  }
+  END_TEST;
+}
+
+int UtcDaliSceneTouchSignalN(void)
+{
+  TestApplication application;
+  Dali::Integration::Scene scene = application.GetScene();
+
+  TouchedSignalData data;
+  TouchFunctor functor( data );
+  scene.TouchSignal().Connect( &application, functor );
+
+  // Render and notify.
+  application.SendNotification();
+  application.Render();
+
+  // Confirm functor not called before there has been any touch event.
+  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+
+  // No actors, single touch, down, motion then up.
+  {
+    GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
+
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0));
+
+    data.Reset();
+
+    // Confirm there is no signal when the touchpoint is only moved.
+    GenerateTouch( application, PointState::MOTION, Vector2( 1200.0f, 10.0f ) ); // Some motion
+
+    DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
+    data.Reset();
+
+    // Confirm a following up event generates a signal.
+    GenerateTouch( application, PointState::UP, Vector2( 1200.0f, 10.0f ) );
+
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0));
+    data.Reset();
+  }
+
+  // Add an actor to the scene.
+  Actor actor = Actor::New();
+  actor.SetSize( 100.0f, 100.0f );
+  actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  actor.TouchedSignal().Connect( &DummyTouchCallback );
+  scene.Add( actor );
+
+  // Render and notify.
+  application.SendNotification();
+  application.Render();
+
+  // Actor on scene. Interrupted before down and interrupted after down.
+  {
+    GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) );
+
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
+    DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::INTERRUPTED );
+    data.Reset();
+
+    GenerateTouch( application, PointState::DOWN, Vector2( 10.0f, 10.0f ) );
+
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
+    DALI_TEST_CHECK( data.receivedTouchData.GetHitActor(0) == actor );
+    DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::DOWN );
+    data.Reset();
+
+    GenerateTouch( application, PointState::INTERRUPTED, Vector2( 10.0f, 10.0f ) );
+
+    DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+    DALI_TEST_CHECK( data.receivedTouchData.GetPointCount() != 0u );
+    DALI_TEST_CHECK( !data.receivedTouchData.GetHitActor(0) );
+    DALI_TEST_CHECK( data.receivedTouchData.GetState(0) == PointState::INTERRUPTED );
+
+    DALI_TEST_EQUALS( data.receivedTouchData.GetPointCount(), 1u, TEST_LOCATION );
+
+    // Check that getting info about a non-existent point returns an empty handle
+    Actor actor = data.receivedTouchData.GetHitActor( 1 );
+    DALI_TEST_CHECK( !actor );
+
+    data.Reset();
+  }
+
+  END_TEST;
+}
+
+int UtcDaliSceneSignalWheelEventP(void)
+{
+  TestApplication application;
+  Dali::Integration::Scene scene = application.GetScene();
+
+  WheelEventSignalData data;
+  WheelEventReceivedFunctor functor( data );
+  scene.WheelEventSignal().Connect( &application, functor );
+
+  Integration::WheelEvent event( Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2( 0.0f, 0.0f ), 1, 1000u );
+  application.ProcessEvent( event );
+
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event.type) == data.receivedWheelEvent.type );
+  DALI_TEST_CHECK( event.direction == data.receivedWheelEvent.direction );
+  DALI_TEST_CHECK( event.modifiers == data.receivedWheelEvent.modifiers );
+  DALI_TEST_CHECK( event.point == data.receivedWheelEvent.point );
+  DALI_TEST_CHECK( event.z == data.receivedWheelEvent.z );
+  DALI_TEST_CHECK( event.timeStamp == data.receivedWheelEvent.timeStamp );
+
+  data.Reset();
+
+  Integration::WheelEvent event2( Integration::WheelEvent::CUSTOM_WHEEL, 0, 0u, Vector2( 0.0f, 0.0f ), -1, 1000u );
+  application.ProcessEvent( event2 );
+
+  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
+  DALI_TEST_CHECK( static_cast< WheelEvent::Type >(event2.type) == data.receivedWheelEvent.type );
+  DALI_TEST_CHECK( event2.direction == data.receivedWheelEvent.direction );
+  DALI_TEST_CHECK( event2.modifiers == data.receivedWheelEvent.modifiers );
+  DALI_TEST_CHECK( event2.point == data.receivedWheelEvent.point );
+  DALI_TEST_CHECK( event2.z == data.receivedWheelEvent.z );
+  DALI_TEST_CHECK( event2.timeStamp == data.receivedWheelEvent.timeStamp );
+  END_TEST;
+}
+
index 336de3d..0a73ca8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -37,15 +37,6 @@ const StringEnum COLOR_MODE_VALUES[] =
 };
 const unsigned int COLOR_MODE_VALUES_COUNT = sizeof( COLOR_MODE_VALUES ) / sizeof( COLOR_MODE_VALUES[0] );
 
-const StringEnum POSITION_INHERITANCE_MODE_VALUES[] =
-{
-    { "INHERIT_PARENT_POSITION", INHERIT_PARENT_POSITION },
-    { "USE_PARENT_POSITION", USE_PARENT_POSITION },
-    { "USE_PARENT_POSITION_PLUS_LOCAL_POSITION", USE_PARENT_POSITION_PLUS_LOCAL_POSITION },
-    { "DONT_INHERIT_POSITION", DONT_INHERIT_POSITION },
-};
-const unsigned int POSITION_INHERITANCE_MODE_VALUES_COUNT = sizeof( POSITION_INHERITANCE_MODE_VALUES ) / sizeof( POSITION_INHERITANCE_MODE_VALUES[0] );
-
 const StringEnum DRAW_MODE_VALUES[] =
 {
     { "NORMAL", DrawMode::NORMAL },
@@ -479,7 +470,6 @@ int UtcDaliScriptingNewActorProperties(void)
   map[ "colorMode" ] = "USE_PARENT_COLOR";
   map[ "sensitive" ] = false;
   map[ "leaveRequired" ] = true;
-  map[ "positionInheritance" ] = "DONT_INHERIT_POSITION";
   map[ "drawMode" ] = "OVERLAY_2D";
   map[ "inheritOrientation" ] = false;
   map[ "inheritScale" ] = false;
@@ -502,7 +492,6 @@ int UtcDaliScriptingNewActorProperties(void)
     DALI_TEST_EQUALS( handle.GetColorMode(), USE_PARENT_COLOR, TEST_LOCATION );
     DALI_TEST_EQUALS( handle.IsSensitive(), false, TEST_LOCATION );
     DALI_TEST_EQUALS( handle.GetLeaveRequired(), true, TEST_LOCATION );
-    DALI_TEST_EQUALS( handle.GetPositionInheritanceMode(), DONT_INHERIT_POSITION, TEST_LOCATION );
     DALI_TEST_EQUALS( handle.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION );
     DALI_TEST_EQUALS( handle.IsOrientationInherited(), false, TEST_LOCATION );
     DALI_TEST_EQUALS( handle.IsScaleInherited(), false, TEST_LOCATION );
@@ -712,9 +701,6 @@ int UtcDaliScriptingCreatePropertyMapActor(void)
   // ColorMode
   TestEnumStrings< ColorMode >( "colorMode",  application, COLOR_MODE_VALUES, COLOR_MODE_VALUES_COUNT, &Actor::SetColorMode );
 
-  // PositionInheritanceMode
-  TestEnumStrings< PositionInheritanceMode >( "positionInheritance",  application, POSITION_INHERITANCE_MODE_VALUES, POSITION_INHERITANCE_MODE_VALUES_COUNT, &Actor::SetPositionInheritanceMode );
-
   // DrawMode
   TestEnumStrings< DrawMode::Type >( "drawMode",  application, DRAW_MODE_VALUES, DRAW_MODE_VALUES_COUNT, &Actor::SetDrawMode );
 
index cf419be..6a0160e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -116,6 +116,25 @@ int UtcDaliShaderDownCast02(void)
   END_TEST;
 }
 
+int UtcDaliShaderDefaultProperties(void)
+{
+  TestApplication application;
+// from shader-impl.cpp
+// DALI_PROPERTY( "program",       MAP,     true,     false,     false,  Dali::Shader::Property::PROGRAM )
+
+  Shader shader = Shader::New(VertexSource, FragmentSource);
+  DALI_TEST_EQUALS( shader.GetPropertyCount(), 1, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( shader.GetPropertyName( Shader::Property::PROGRAM ), "program", TEST_LOCATION );
+  DALI_TEST_EQUALS( shader.GetPropertyIndex( "program" ), (Property::Index)Shader::Property::PROGRAM, TEST_LOCATION );
+  DALI_TEST_EQUALS( shader.GetPropertyType( Shader::Property::PROGRAM ), Property::MAP, TEST_LOCATION );
+  DALI_TEST_EQUALS( shader.IsPropertyWritable( Shader::Property::PROGRAM ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( shader.IsPropertyAnimatable( Shader::Property::PROGRAM ), false, TEST_LOCATION );
+  DALI_TEST_EQUALS( shader.IsPropertyAConstraintInput( Shader::Property::PROGRAM ), false, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliShaderConstraint01(void)
 {
   TestApplication application;
@@ -163,6 +182,8 @@ int UtcDaliShaderConstraint02(void)
   TestApplication application;
 
   tet_infoline("Test that a uniform map shader property can be constrained");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Shader shader = Shader::New(VertexSource, FragmentSource);
   Geometry geometry = CreateQuadGeometry();
@@ -209,6 +230,7 @@ int UtcDaliShaderConstraint02(void)
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::WHITE, TEST_LOCATION );
 
+#endif
   END_TEST;
 }
 
@@ -258,6 +280,8 @@ int UtcDaliShaderAnimatedProperty02(void)
   TestApplication application;
 
   tet_infoline("Test that a uniform map shader property can be animated");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Shader shader = Shader::New(VertexSource, FragmentSource);
   Geometry geometry = CreateQuadGeometry();
@@ -299,6 +323,30 @@ int UtcDaliShaderAnimatedProperty02(void)
   DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::TRANSPARENT, TEST_LOCATION );
 
+  // change shader program
+  Property::Map map;
+  map["vertex"] = VertexSource;
+  map["fragment"] = FragmentSource;
+  map["hints"] = "MODIFIES_GEOMETRY";
+  shader.SetProperty( Shader::Property::PROGRAM, Property::Value(map) );
+  application.SendNotification();
+  application.Render(100);
+
+  // register another custom property as well
+  Property::Index customIndex = shader.RegisterProperty( "uCustom", Vector3(1,2,3) );
+  DALI_TEST_EQUALS( shader.GetProperty<Vector3>( customIndex ), Vector3(1,2,3), TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render(100);
+
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uFadeColor", actualValue ) );
+  DALI_TEST_EQUALS( actualValue, Color::TRANSPARENT, TEST_LOCATION );
+
+  Vector3 customValue;
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector3>( "uCustom", customValue ) );
+  DALI_TEST_EQUALS( customValue, Vector3(1,2,3), TEST_LOCATION );
+
+#endif
   END_TEST;
 }
 
@@ -306,7 +354,7 @@ int UtcDaliShaderProgramProperty(void)
 {
   TestApplication application;
 
-  tet_infoline("Test get/set progam property");
+  tet_infoline("Test get/set program property");
 
   Shader shader = Shader::New("", "");
   std::string hintSet = "MODIFIES_GEOMETRY";
@@ -317,6 +365,9 @@ int UtcDaliShaderProgramProperty(void)
   map["hints"] = hintSet;
 
   shader.SetProperty( Shader::Property::PROGRAM, Property::Value(map) );
+  // register a custom property as well
+  Property::Index customIndex = shader.RegisterProperty( "custom", Vector3(1,2,3) );
+  DALI_TEST_EQUALS( shader.GetProperty<Vector3>( customIndex ), Vector3(1,2,3), TEST_LOCATION );
 
   Property::Value value = shader.GetProperty(Shader::Property::PROGRAM);
   DALI_TEST_CHECK( value.GetType() == Property::MAP);
@@ -333,6 +384,15 @@ int UtcDaliShaderProgramProperty(void)
   value = shader.GetCurrentProperty( Shader::Property::PROGRAM );
   DALI_TEST_CHECK( value.GetType() == Property::MAP);
   outMap = value.GetMap();
+  // check that changing the shader did not cause us to loose custom property
+  DALI_TEST_EQUALS( shader.GetProperty<Vector3>( customIndex ), Vector3(1,2,3), TEST_LOCATION );
+  using Dali::Animation;
+  Animation animation = Animation::New( 0.1f );
+  animation.AnimateTo( Property( shader, customIndex ), Vector3(4,5,6) );
+  animation.Play();
+  application.SendNotification();
+  application.Render(100);
+  DALI_TEST_EQUALS( shader.GetProperty<Vector3>( customIndex ), Vector3(4,5,6), TEST_LOCATION );
 
   v = (*outMap)["vertex"].Get<std::string>();
   f = (*outMap)["fragment"].Get<std::string>();
index 7ed9f20..6278822 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
 
 #include <dali/public-api/dali-core.h>
 #include <dali/devel-api/common/stage-devel.h>
-#include <dali/integration-api/context-notifier.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/public-api/events/key-event.h>
 #include <dali/integration-api/events/touch-event-integ.h>
@@ -591,7 +590,8 @@ int UtcDaliStageGetDpiP2(void)
   TestApplication application; // Initializes core DPI to default values
 
   // Test that setting core DPI explicitly also sets up the Stage's DPI.
-  application.GetCore().SetDpi( 200, 180 );
+  Dali::Integration::Scene scene = application.GetScene();
+  scene.SetDpi( Vector2(200.0f, 180.0f) );
 
   Stage stage = Stage::GetCurrent();
   Vector2 dpi = stage.GetDpi();
@@ -602,7 +602,7 @@ int UtcDaliStageGetDpiP2(void)
 
 int UtcDaliStageGetDpiP3(void)
 {
-  TestApplication application( 480, 800, 72.0f, 120.0f ); // Initializes core DPI with specific values
+  TestApplication application( 480, 800, 72, 120 ); // Initializes core DPI with specific values
 
   Stage stage = Stage::GetCurrent();
 
@@ -883,7 +883,7 @@ int UtcDaliStageKeyEventGeneratedSignalP(void)
   KeyEventGeneratedReceivedFunctor functor2( data2 );
   GetImplementation( stage ).ConnectSignal( &application, "keyEventGenerated", functor2 );
 
-  Integration::KeyEvent event( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
   application.ProcessEvent( event );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
@@ -894,7 +894,7 @@ int UtcDaliStageKeyEventGeneratedSignalP(void)
 
   data.Reset();
 
-  Integration::KeyEvent event2( "i", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
   application.ProcessEvent( event2 );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
@@ -905,7 +905,7 @@ int UtcDaliStageKeyEventGeneratedSignalP(void)
 
   data.Reset();
 
-  Integration::KeyEvent event3( "a", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
   application.ProcessEvent( event3 );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
@@ -916,7 +916,7 @@ int UtcDaliStageKeyEventGeneratedSignalP(void)
 
   data.Reset();
 
-  Integration::KeyEvent event4( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
   application.ProcessEvent( event4 );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
@@ -936,7 +936,7 @@ int UtcDaliStageSignalKeyEventP(void)
   KeyEventReceivedFunctor functor( data );
   stage.KeyEventSignal().Connect( &application, functor );
 
-  Integration::KeyEvent event( "i", "i", 0, 0, 0, Integration::KeyEvent::Down, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  Integration::KeyEvent event( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Down, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
   application.ProcessEvent( event );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
@@ -947,7 +947,7 @@ int UtcDaliStageSignalKeyEventP(void)
 
   data.Reset();
 
-  Integration::KeyEvent event2( "i", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
   application.ProcessEvent( event2 );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
@@ -958,7 +958,7 @@ int UtcDaliStageSignalKeyEventP(void)
 
   data.Reset();
 
-  Integration::KeyEvent event3( "a", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
   application.ProcessEvent( event3 );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
@@ -969,7 +969,7 @@ int UtcDaliStageSignalKeyEventP(void)
 
   data.Reset();
 
-  Integration::KeyEvent event4( "a", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+  Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
   application.ProcessEvent( event4 );
 
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
@@ -1455,86 +1455,6 @@ int UtcDaliStageSignalWheelEventP(void)
   END_TEST;
 }
 
-int UtcDaliStageContextLostSignalP(void)
-{
-  TestApplication app;
-  Stage stage = Stage::GetCurrent();
-
-  bool contextLost = false;
-  ContextStatusFunctor contextLostFunctor( contextLost );
-  stage.ContextLostSignal().Connect( &app, contextLostFunctor );
-
-  Integration::ContextNotifierInterface* notifier = app.GetCore().GetContextNotifier();
-  notifier->NotifyContextLost();
-  DALI_TEST_EQUALS( contextLost, true, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliStageContextLostSignalN(void)
-{
-  TestApplication app;
-  Stage stage;
-
-  // Check that connecting to the signal with a bad stage instance causes an assert.
-  bool asserted = false;
-  bool contextLost = false;
-  ContextStatusFunctor contextLostFunctor( contextLost );
-  try
-  {
-    stage.ContextLostSignal().Connect( &app, contextLostFunctor );
-  }
-  catch( Dali::DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT( e, "stage && \"Stage handle is empty\"", TEST_LOCATION );
-    asserted = true;
-  }
-  DALI_TEST_CHECK( asserted );
-
-  END_TEST;
-}
-
-int UtcDaliStageContextRegainedSignalP(void)
-{
-  TestApplication app;
-  Stage stage = Stage::GetCurrent();
-
-  bool contextRegained = false;
-  ContextStatusFunctor contextRegainedFunctor( contextRegained );
-  stage.ContextRegainedSignal().Connect( &app, contextRegainedFunctor );
-
-  Integration::ContextNotifierInterface* notifier = app.GetCore().GetContextNotifier();
-  notifier->NotifyContextLost();
-  notifier->NotifyContextRegained();
-  DALI_TEST_EQUALS( contextRegained, true, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliStageContextRegainedSignalN(void)
-{
-  TestApplication app;
-  Stage stage;
-
-  // Check that connecting to the signal with a bad stage instance causes an assert.
-  bool asserted = false;
-  bool contextRegained = false;
-  ContextStatusFunctor contextRegainedFunctor( contextRegained );
-  try
-  {
-    stage.ContextRegainedSignal().Connect( &app, contextRegainedFunctor );
-  }
-  catch( Dali::DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_ASSERT( e, "stage && \"Stage handle is empty\"", TEST_LOCATION );
-    asserted = true;
-  }
-  DALI_TEST_CHECK( asserted );
-
-  END_TEST;
-}
 
 int UtcDaliStageSceneCreatedSignalP(void)
 {
@@ -1670,3 +1590,46 @@ int UtcDaliStageOperatorAssign(void)
 
   END_TEST;
 }
+
+int UtcDaliStageRenderingBehavior(void)
+{
+  TestApplication application;
+  Stage stage = Stage::GetCurrent();
+
+  tet_infoline( "Check default rendering behavior is only if required" );
+  DALI_TEST_CHECK( DevelStage::GetRenderingBehavior( stage ) == DevelStage::Rendering::IF_REQUIRED );
+
+  tet_infoline( "No update required with an empty application" );
+  application.SendNotification();
+  DALI_TEST_CHECK( application.UpdateOnly() == false );
+  application.RenderOnly();
+
+  tet_infoline( "Change to continuous rendering, further updates should be required" );
+  DevelStage::SetRenderingBehavior( stage, DevelStage::Rendering::CONTINUOUSLY );
+
+  DALI_TEST_CHECK( DevelStage::GetRenderingBehavior( stage ) == DevelStage::Rendering::CONTINUOUSLY );
+
+  application.SendNotification();
+  DALI_TEST_CHECK( application.UpdateOnly() == true );
+  application.RenderOnly();
+
+  application.SendNotification();
+  DALI_TEST_CHECK( application.UpdateOnly() == true );
+  application.RenderOnly();
+
+  tet_infoline( "Change to rendering only if required, further updates should NOT be required" );
+  DevelStage::SetRenderingBehavior( stage, DevelStage::Rendering::IF_REQUIRED );
+
+  DALI_TEST_CHECK( DevelStage::GetRenderingBehavior( stage ) == DevelStage::Rendering::IF_REQUIRED );
+
+  application.SendNotification();
+  DALI_TEST_CHECK( application.UpdateOnly() == false );
+  application.RenderOnly();
+
+  tet_infoline( "The next update is not required so TestApplication should print a warning" );
+  application.SendNotification();
+  DALI_TEST_CHECK( application.UpdateOnly() == false );
+  application.RenderOnly();
+
+  END_TEST;
+}
index 05681a9..9d394f0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/integration-api/events/tap-gesture-event.h>
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
 #include <test-touch-utils.h>
 
@@ -1196,148 +1196,6 @@ int UtcDaliTapGestureActorRemovedWhilePossible(void)
   END_TEST;
 }
 
-int UtcDaliTapGestureSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(actor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  TapGestureDetector detector = TapGestureDetector::New();
-  detector.Attach(actor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoords( 50.0f, 50.0f );
-
-  // Do a tap inside actor's area
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliTapGestureBehindTouchableSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set system-overlay actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  systemOverlayActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set stage actor to receive the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  TapGestureDetector detector = TapGestureDetector::New();
-  detector.Attach(stageActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoords( 50.0f, 50.0f );
-
-  // Do a tap inside both actors' area
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliTapGestureTouchBehindGesturedSystemOverlay(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core = application.GetCore();
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // SystemOverlay actor
-  Actor systemOverlayActor = Actor::New();
-  systemOverlayActor.SetSize(100.0f, 100.0f);
-  systemOverlayActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add(systemOverlayActor);
-
-  // Stage actor
-  Actor stageActor = Actor::New();
-  stageActor.SetSize(100.0f, 100.0f);
-  stageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(stageActor);
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Set stage actor to touchable
-  TouchEventData touchData;
-  TouchEventDataFunctor touchFunctor( touchData );
-  stageActor.TouchedSignal().Connect(&application, touchFunctor);
-
-  // Set system-overlay actor to have the gesture
-  SignalData data;
-  GestureReceivedFunctor functor(data);
-
-  TapGestureDetector detector = TapGestureDetector::New();
-  detector.Attach(systemOverlayActor);
-  detector.DetectedSignal().Connect(&application, functor);
-
-  Vector2 screenCoords( 50.0f, 50.0f );
-
-  // Do a tap inside both actors' area
-  application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, screenCoords ) );
-  application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, screenCoords ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( false, touchData.functorCalled, TEST_LOCATION );
-
-  data.Reset();
-  touchData.Reset();
-
-  // Do touch in the same area
-  application.ProcessEvent( touchFunctor.GenerateSingleTouch( PointState::DOWN, screenCoords ) );
-  DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_EQUALS( true, touchData.functorCalled, TEST_LOCATION );
-
-  END_TEST;
-}
-
 int UtcDaliTapGestureLayerConsumesTouch(void)
 {
   TestApplication application;
index 30d0a7f..3663a50 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -128,6 +128,9 @@ int UtcDaliTextureDownCast02(void)
 int UtcDaliTextureUpload01(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTextureUpload01");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   //Create the texture
   unsigned int width(64);
@@ -181,13 +184,16 @@ int UtcDaliTextureUpload01(void)
     DALI_TEST_CHECK( callStack.FindMethodAndParams("TexSubImage2D", out.str().c_str() ) );
   }
 
-
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureUpload02(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTextureUpload02");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   //Create the texture
   unsigned int width(64);
@@ -304,7 +310,7 @@ int UtcDaliTextureUpload02(void)
       DALI_TEST_CHECK( callStack.FindMethodAndParams("TexImage2D", out.str().c_str() ) );
     }
   }
-
+#endif
   END_TEST;
 }
 
@@ -312,6 +318,9 @@ int UtcDaliTextureUpload03(void)
 {
   TestApplication application;
 
+  tet_infoline("UtcDaliTextureUpload03");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
   //Create the texture
   unsigned int width(64);
   unsigned int height(64);
@@ -360,13 +369,16 @@ int UtcDaliTextureUpload03(void)
     out << GL_TEXTURE_2D <<", "<< 1u << ", " << widthMipmap1 <<", "<< heightMipmap1;
     DALI_TEST_CHECK( callStack.FindMethodAndParams("TexImage2D", out.str().c_str() ) );
   }
-
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureUpload04(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTextureUpload04");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   //Create the texture
   unsigned int width(64);
@@ -403,12 +415,16 @@ int UtcDaliTextureUpload04(void)
     out << GL_TEXTURE_CUBE_MAP_NEGATIVE_X <<", "<< 1u << ", " << widthMipmap1 <<", "<< heightMipmap1;
     DALI_TEST_CHECK( callStack.FindMethodAndParams("TexImage2D", out.str().c_str() ) );
   }
-
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureUpload05(void)
 {
+  tet_infoline("UtcDaliTextureUpload05");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
   Pixel::Format COMPRESSED_PIXEL_FORMATS[] =
   {
     Pixel::COMPRESSED_R11_EAC,
@@ -511,12 +527,16 @@ int UtcDaliTextureUpload05(void)
     }
   }
 
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureUpload06(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTextureUpload06");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   //Create the texture
   unsigned int width(64);
@@ -555,12 +575,16 @@ int UtcDaliTextureUpload06(void)
     out << GL_TEXTURE_2D <<", "<< 0u << ", " << width <<", "<< height;
     DALI_TEST_CHECK( callStack.FindMethodAndParams("TexImage2D", out.str().c_str() ) );
   }
-
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureUpload07(void)
 {
+  tet_infoline("UtcDaliTextureUpload07");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
   Pixel::Format FLOATING_POINT_PIXEL_FORMATS[] =
   {
     Pixel::RGB16F,
@@ -610,13 +634,16 @@ int UtcDaliTextureUpload07(void)
       DALI_TEST_CHECK( callStack.FindMethodAndParams("TexImage2D", out.str().c_str() ) );
     }
   }
-
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureUploadSmallerThanSize(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTextureUploadSmallerThanSize");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   //Create the texture
   unsigned int width(64);
@@ -657,13 +684,18 @@ int UtcDaliTextureUploadSmallerThanSize(void)
     DALI_TEST_CHECK( callStack.FindMethodAndGetParameters("TexSubImage2D", params ) );
     DALI_TEST_EQUALS( out.str(), params, TEST_LOCATION );
   }
-
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureGenerateMipmaps(void)
 {
   TestApplication application;
+
+  tet_infoline("UtcDaliTextureGenerateMipmaps");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
   unsigned int width(64);
   unsigned int height(64);
 
@@ -688,7 +720,7 @@ int UtcDaliTextureGenerateMipmaps(void)
     out << GL_TEXTURE_CUBE_MAP;
     DALI_TEST_CHECK( callStack.FindMethodAndParams("GenerateMipmap", out.str().c_str() ) );
   }
-
+#endif
   END_TEST;
 }
 
@@ -715,27 +747,6 @@ int UtcDaliTextureGetHeight(void)
   END_TEST;
 }
 
-int UtcDaliTextureContextLoss(void)
-{
-  tet_infoline("UtcDaliTextureContextLoss\n");
-  TestApplication application; // Default config: DALI_DISCARDS_ALL_DATA
-
-  //Create the texture
-  unsigned int width(64);
-  unsigned int height(64);
-  Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
-  DALI_TEST_CHECK( texture );
-
-  application.SendNotification();
-  application.Render(16);
-
-  // Lose & regain context (in render 'thread')
-  application.ResetContext();
-  DALI_TEST_CHECK( texture );
-
-  END_TEST;
-}
-
 int UtcDaliNativeImageTexture(void)
 {
   TestApplication application;
@@ -752,4 +763,3 @@ int UtcDaliNativeImageTexture(void)
 
   END_TEST;
 }
-
index c8d91b9..82ea913 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,6 +34,8 @@ enum SetSampler
   DONT_SET_SAMPLER
 };
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-function"
 Actor CreateActor( SetSampler setSamplerOption )
 {
   Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 64, 64 );
@@ -60,7 +62,7 @@ Actor CreateActor( SetSampler setSamplerOption )
 
   return actor;
 }
-
+#pragma GCC diagnostic pop
 } // namespace
 
 
@@ -147,6 +149,9 @@ int UtcDaliTextureSetDownCast02(void)
 int UtcDaliTextureSetTexture01(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTextureSetTexture01");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Actor actor = CreateActor( DONT_SET_SAMPLER );
 
@@ -170,13 +175,16 @@ int UtcDaliTextureSetTexture01(void)
   // There are four calls to TexParameteri when the texture is first created
   // as the texture is using default sampling parametrers there shouldn't be any more calls to TexParameteri
   DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 4, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureSetTexture02(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTextureSetTexture02");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Actor actor = CreateActor(SET_SAMPLER);
 
@@ -201,13 +209,16 @@ int UtcDaliTextureSetTexture02(void)
   // Texture minification and magnification filters are now different than default so
   //there should have been two extra TexParameteri calls to set the new filter mode
   DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 6, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureSetMultiple(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTextureSetMultiple");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Actor actor1 = CreateActor(SET_SAMPLER);
   Actor actor2 = CreateActor(SET_SAMPLER);
@@ -234,13 +245,16 @@ int UtcDaliTextureSetMultiple(void)
   // Texture minification and magnification filters are now different than default so
   //there should have been two extra TexParameteri calls to set the new filter mode
   DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 2 * 6, TEST_LOCATION);
-
+#endif
   END_TEST;
 }
 
 int UtcDaliTextureSetSetSampler(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTextureSetSetSampler");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
 
   Image image = BufferImage::New( 64, 64, Pixel::RGBA8888 );
 
@@ -294,7 +308,7 @@ int UtcDaliTextureSetSetSampler(void)
   //There should have been two calls to TexParameteri to set the new filtering mode
   DALI_TEST_EQUALS( texParameterTrace.CountMethod( "TexParameteri" ), 2, TEST_LOCATION);
 
-
+#endif
   END_TEST;
 }
 
old mode 100644 (file)
new mode 100755 (executable)
index 6250198..c8f5cde
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
 
 using namespace Dali;
@@ -1188,6 +1188,11 @@ int UtcDaliTouchDataMultipleRenderTasksWithChildLayer(void)
 int UtcDaliTouchDataOffscreenRenderTasks(void)
 {
   TestApplication application;
+
+  tet_infoline("UtcDaliTouchDataOffscreenRenderTasks");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
   Stage stage ( Stage::GetCurrent() );
   Vector2 stageSize ( stage.GetSize() );
 
@@ -1232,6 +1237,7 @@ int UtcDaliTouchDataOffscreenRenderTasks(void)
   application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   data.Reset();
+#endif
   END_TEST;
 }
 
@@ -1399,42 +1405,6 @@ int UtcDaliTouchDataActorUnStaged(void)
   END_TEST;
 }
 
-int UtcDaliTouchDataSystemOverlayActor(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core( application.GetCore() );
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // Create an actor and add it to the system overlay.
-  Actor systemActor = Actor::New();
-  systemActor.SetSize(100.0f, 100.0f);
-  systemActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add( systemActor );
-
-  // Create an actor and add it to the stage as per normal, same position and size as systemActor
-  Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(actor);
-
-  // Connect to the touch signals.
-  SignalData data;
-  TouchDataFunctor functor( data );
-  systemActor.TouchSignal().Connect( &application, functor );
-  actor.TouchSignal().Connect( &application, functor );
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Emit a down signal, the system overlay is drawn last so is at the top, should hit the systemActor.
-  application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_CHECK( systemActor == data.touchedActor );
-  END_TEST;
-}
-
 int UtcDaliTouchDataLayerConsumesTouch(void)
 {
   TestApplication application;
@@ -2010,3 +1980,62 @@ int UtcDaliTouchDataGetDeviceAPINegative(void)
   DALI_TEST_EQUALS( data.GetDeviceSubclass( -1 ), Device::Subclass::NONE, TEST_LOCATION );
   END_TEST;
 }
+
+int UtcDaliTouchDataGetMouseButtonPositive(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetSize(100.0f, 100.0f);
+  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  Stage::GetCurrent().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  HandleData handleData;
+  TouchDataHandleFunctor functor( handleData );
+  actor.TouchSignal().Connect( &application, functor );
+
+  // Emit a down signal with MouseButton
+  Integration::TouchEvent touchEvent = GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) );
+  touchEvent.points[ 0 ].SetMouseButton( static_cast< MouseButton::Type >( 3 ) );
+  application.ProcessEvent( touchEvent );
+
+  TouchData data = handleData.touchData;
+  DALI_TEST_EQUALS( data.GetMouseButton( 0 ), MouseButton::SECONDARY, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliTouchDataGetMouseButtonNagative(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetSize(100.0f, 100.0f);
+  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  Stage::GetCurrent().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touched signal
+  HandleData handleData;
+  TouchDataHandleFunctor functor( handleData );
+  actor.TouchSignal().Connect( &application, functor );
+
+  // Emit a down signal with MouseButton
+  Integration::TouchEvent touchEvent = GenerateSingleTouch( PointState::DOWN, Vector2( 10.0f, 10.0f ) );
+  touchEvent.points[ 0 ].SetMouseButton( static_cast< MouseButton::Type >( 2 ) );
+  application.ProcessEvent( touchEvent );
+
+  TouchData data = handleData.touchData;
+  DALI_TEST_EQUALS( data.GetMouseButton( 0 ), MouseButton::TERTIARY, TEST_LOCATION );
+  DALI_TEST_EQUALS( data.GetMouseButton( 3 ), MouseButton::INVALID, TEST_LOCATION );
+
+  END_TEST;
+}
old mode 100644 (file)
new mode 100755 (executable)
index 6e48db1..20e9e65
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,8 +20,9 @@
 #include <stdlib.h>
 #include <dali/public-api/dali-core.h>
 #include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 #include <dali-test-suite-utils.h>
+#include <dali/devel-api/events/touch-data-devel.h>
 
 using namespace Dali;
 
@@ -956,6 +957,11 @@ int UtcDaliTouchMultipleRenderTasksWithChildLayer(void)
 int UtcDaliTouchOffscreenRenderTasks(void)
 {
   TestApplication application;
+  tet_infoline("UtcDaliTouchOffscreenRenderTasks");
+  tet_infoline("   Test requires GraphicsController");
+#if 0
+
+
   Stage stage ( Stage::GetCurrent() );
   Vector2 stageSize ( stage.GetSize() );
 
@@ -1000,6 +1006,8 @@ int UtcDaliTouchOffscreenRenderTasks(void)
   application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
   DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
   data.Reset();
+
+#endif
   END_TEST;
 }
 
@@ -1167,42 +1175,6 @@ int UtcDaliTouchActorUnStaged(void)
   END_TEST;
 }
 
-int UtcDaliTouchSystemOverlayActor(void)
-{
-  TestApplication application;
-  Dali::Integration::Core& core( application.GetCore() );
-  Dali::Integration::SystemOverlay& systemOverlay( core.GetSystemOverlay() );
-  systemOverlay.GetOverlayRenderTasks().CreateTask();
-
-  // Create an actor and add it to the system overlay.
-  Actor systemActor = Actor::New();
-  systemActor.SetSize(100.0f, 100.0f);
-  systemActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  systemOverlay.Add( systemActor );
-
-  // Create an actor and add it to the stage as per normal, same position and size as systemActor
-  Actor actor = Actor::New();
-  actor.SetSize(100.0f, 100.0f);
-  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-  Stage::GetCurrent().Add(actor);
-
-  // Connect to the touch signals.
-  SignalData data;
-  TouchEventFunctor functor( data );
-  systemActor.TouchedSignal().Connect( &application, functor );
-  actor.TouchedSignal().Connect( &application, functor );
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  // Emit a down signal, the system overlay is drawn last so is at the top, should hit the systemActor.
-  application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, Vector2( 10.0f, 10.0f ) ) );
-  DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
-  DALI_TEST_CHECK( systemActor == data.touchedActor );
-  END_TEST;
-}
-
 int UtcDaliTouchLayerConsumesTouch(void)
 {
   TestApplication application;
@@ -1596,3 +1568,41 @@ int UtcDaliTouchInterruptedDifferentConsumer(void)
 
   END_TEST;
 }
+
+int UtcDaliTouchDataConvert(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+  actor.SetSize(100.0f, 100.0f);
+  actor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  Stage::GetCurrent().Add(actor);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Connect to actor's touch signal
+  SignalData data;
+  TouchEventFunctor functor(data);
+  actor.TouchedSignal().Connect(&application, functor);
+
+  Vector2 screenCoordiantes(10.0f, 10.0f);
+  Vector2 localCoordinates;
+  actor.ScreenToLocal(localCoordinates.x, localCoordinates.y, screenCoordiantes.x, screenCoordiantes.y);
+
+  // Emit a down signal
+  application.ProcessEvent(GenerateSingleTouch(TouchPoint::Down, screenCoordiantes));
+  Dali::TouchData touchData = Dali::DevelTouchData::Convert(data.touchEvent);
+
+  DALI_TEST_EQUALS( 1u, touchData.GetPointCount(), TEST_LOCATION );
+  DALI_TEST_EQUALS( screenCoordiantes, touchData.GetScreenPosition(0), TEST_LOCATION );
+  DALI_TEST_EQUALS( localCoordinates, touchData.GetLocalPosition(0), 0.1f, TEST_LOCATION );
+  DALI_TEST_EQUALS( PointState::DOWN, touchData.GetState(0), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor, touchData.GetHitActor(0), TEST_LOCATION );
+
+  data.Reset();
+
+  END_TEST;
+
+}
\ No newline at end of file
index fb2bb5b..e9178c9 100644 (file)
@@ -1074,7 +1074,7 @@ int UtcDaliTypeRegistryPropertyRegistrationP(void)
   typeInfo.GetPropertyIndices( indices );
 
   size_t typePropertyCount = typeInfo.GetPropertyCount();
-  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), Actor::New().GetPropertyCount() + 1u, TEST_LOCATION );
   DALI_TEST_EQUALS( indices.Size(), typePropertyCount, TEST_LOCATION );
 
   // Ensure indices returned from actor and customActor differ by two
@@ -1164,7 +1164,7 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationP(void)
   // Check property count of type-info is 1
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION );
 
   // Ensure indices returned from actor and customActor differ by one
   Actor actor = Actor::New();
@@ -1267,10 +1267,10 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationWithDefaultP(void)
   // Check the animatable property type
   DALI_TEST_EQUALS( customActor.GetPropertyType( animatablePropertyIndex ), Property::FLOAT, TEST_LOCATION );
 
-  // Check property count of type-info is 1
+  // Check property count of type-info
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION );
 
   // Ensure indices returned from actor and customActor differ by one
   Actor actor = Actor::New();
@@ -1376,10 +1376,10 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   // Check the animatable property type
   DALI_TEST_EQUALS( customActor.GetPropertyType( animatablePropertyIndex ), animatablePropertyType, TEST_LOCATION );
 
-  // Check property count of type-info is 1
+  // Check property count of type-info
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), customActor.GetPropertyCount(), TEST_LOCATION );
 
   // Register animatable property components
   std::string animatablePropertyComponentName1( "animatableProp1X" );
@@ -2057,24 +2057,14 @@ int UtcDaliPropertyRegistrationPropertyWritableP(void)
 
 int UtcDaliPropertyRegistrationPropertyWritableN(void)
 {
-  // Currently Actors don't register properties with the type registry
-
   TypeInfo typeInfo = TypeRegistry::Get().GetTypeInfo( typeid(MyTestCustomActor) );
   Internal::TypeInfo& typeInfoImpl = GetImplementation( typeInfo );
 
-  try
-  {
-    typeInfoImpl.IsPropertyWritable( Actor::Property::COLOR);
-    tet_result( TET_FAIL );
+  DALI_TEST_EQUALS( typeInfoImpl.IsPropertyWritable( Actor::Property::COLOR), true, TEST_LOCATION );
 
-  }
-  catch ( DaliException& e )
-  {
-     DALI_TEST_ASSERT( e, "Cannot find property index", TEST_LOCATION );
-  }
   END_TEST;
-
 }
+
 int UtcDaliPropertyRegistrationPropertyAnimatable(void)
 {
   TestApplication application;
@@ -2111,7 +2101,7 @@ int UtcDaliPropertyRegistrationPropertyAnimatable(void)
   END_TEST;
 }
 
-int UtcDaliPropertyRegistrationInvalidGetAndSet(void)
+int UtcDaliPropertyRegistrationUnregisteredGetAndSet(void)
 {
   TestApplication application;
   int propertyIndex = PROPERTY_REGISTRATION_START_INDEX + 2000;
@@ -2125,47 +2115,14 @@ int UtcDaliPropertyRegistrationInvalidGetAndSet(void)
   Actor customActor = Actor::DownCast( handle );
   DALI_TEST_CHECK( customActor );
 
-  // Try to set an index that hasn't been added
-  try
-  {
-    customActor.SetProperty( propertyIndex, true );
-    tet_result( TET_FAIL );
-  }
-  catch ( DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "! \"Cannot find property index", TEST_LOCATION );
-  }
+  // Try to set an index that hasn't been registered, this is a no-op for now, to be fixed in future
+  customActor.SetProperty( propertyIndex, true );
+//  DALI_TEST_EQUALS( true, customActor.GetProperty( propertyIndex ).Get<bool>(), TEST_LOCATION);
 
-  try
-  {
-    customActor.SetProperty( animatablePropertyIndex, true );
-    tet_result( TET_FAIL );
-  }
-  catch ( DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "! \"Cannot find property index", TEST_LOCATION );
-  }
-
-  // Try to get an index that hasn't been added
-  try
-  {
-    (void) customActor.GetProperty< bool >( propertyIndex );
-    tet_result( TET_FAIL );
-  }
-  catch ( DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "! \"Cannot find property index", TEST_LOCATION );
-  }
+  // Try to set an index that hasn't been registered
+  customActor.SetProperty( animatablePropertyIndex, true );
+  DALI_TEST_EQUALS( true, customActor.GetProperty( animatablePropertyIndex ).Get<bool>(), TEST_LOCATION);
 
-  try
-  {
-    (void) customActor.GetProperty< bool >( animatablePropertyIndex );
-    tet_result( TET_FAIL );
-  }
-  catch ( DaliException& e )
-  {
-    DALI_TEST_ASSERT( e, "! \"Cannot find property index", TEST_LOCATION );
-  }
   END_TEST;
 }
 
@@ -2490,7 +2447,7 @@ int UtcDaliTypeInfoGetPropertyCountP1(void)
   DALI_TEST_CHECK( typeInfo );
   size_t actorPropertyCount = typeInfo.GetPropertyCount();
 
-  DALI_TEST_EQUALS( actorPropertyCount == 0 , true, TEST_LOCATION ); // No event only props
+  DALI_TEST_EQUALS( actorPropertyCount, Actor::New().GetPropertyCount(), TEST_LOCATION ); // No event only props
   END_TEST;
 }
 
@@ -2506,7 +2463,7 @@ int UtcDaliTypeInfoGetPropertyCountP2(void)
   typeInfo.GetPropertyIndices( indices );
 
   DALI_TEST_EQUALS( propertyCount > 0 && propertyCount <= indices.Size(), true, TEST_LOCATION );
-  DALI_TEST_EQUALS( propertyCount == 2, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( propertyCount, Actor::New().GetPropertyCount() + 2, TEST_LOCATION );
 
   END_TEST;
 }
index 2123cfa..0e1cbcb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# Copyright (c) 2018 Samsung Electronics Co., Ltd.
+# Copyright (c) 2019 Samsung Electronics Co., Ltd.
 
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -39,12 +39,12 @@ my @system_packages = (
     "pkg-config",
     "libtool",
     "ccache",
-    "libelementary-dev",
     "libexif-dev",
     "libgles2-mesa-dev",
     "libdrm-dev",
     "libgif-dev",
     "libturbojpeg",
+    "libturbojpeg0-dev",
     "libfribidi-dev",
     "libharfbuzz-dev",
     "doxygen",
@@ -54,8 +54,22 @@ my @system_packages = (
     "libssl-dev",
     "cifs-utils",
     "libgtest-dev",
+    "libcairo2-dev",
 );
 
+my $ubuntu_version = (split(/\s+/, `lsb_release -d`))[2];
+if (${ubuntu_version} > 20)
+{
+    # Add unique packages for 20.04 and above
+    push @system_packages, "libefl-all-dev";
+}
+else
+{
+    # Add unique packages for Ubuntu releases before 20.04
+    push @system_packages, "libelementary-dev";
+}
+
+
 # Some packages like require building from source
 # v8 is currently disabled until we can get it working without a http proxy being setup
 my @source_pkgs = (
@@ -169,7 +183,7 @@ if( $opt_vulkanVersion ne "" )
 else
 {
   # Default Vulkan Version if version not specified, will only be installed if --vulkan is specified
-  $opt_vulkanVersion="1.0.54.0"
+  $opt_vulkanVersion="1.1.108.0"
 }
 
 if( $opt_vulkanInstaller ne "" )
@@ -255,11 +269,15 @@ sub check_system_package
     my $package;
     foreach $package (@_)
     {
-        my @x=split(/\s+/, `dpkg -l $package|grep $package`);
+        my @x=split(/\s+/, `dpkg -l $package 2> /dev/null|grep $package`);
         if($x[0] ne "ii")
         {
-            print "Attempting to install $package\n";
-            system("sudo apt-get -y --force-yes install $package");
+            # Check if the package is available to install, exit-code is 0 if the package is found.
+            if(system("apt-cache show $package > /dev/null 2>&1") == 0)
+            {
+                print "Attempting to install $package\n";
+                system("sudo apt-get -y --force-yes install $package");
+            }
         }
     }
 }
@@ -295,9 +313,12 @@ sub check_source_packages
         }
         elsif ($pkg eq "gtest")
         {
-            print "Attempting to build $pkg\n";
-            # from https://www.eriksmistad.no/getting-started-with-google-test-on-ubuntu/
-            run_command("cd /usr/src/gtest; sudo cmake CMakeLists.txt; sudo make; sudo cp *.a /usr/lib; cd -;");
+            if(! -e "/usr/lib/libgtest.a")
+            {
+                print "Attempting to build $pkg\n";
+                # from https://www.eriksmistad.no/getting-started-with-google-test-on-ubuntu/
+                run_command("cd /usr/src/gtest; sudo cmake CMakeLists.txt; sudo make; sudo cp *.a /usr/lib; cd -;");
+            }
         }
     }
 }
@@ -724,7 +745,7 @@ EOF
         ;
 
         # write additional pkg-config file for local Vulkan
-        open(my $file2, '>', "$dev_env_root/opt/lib/pkgconfig/vulkan-1.0.pc") or die;
+        open(my $file2, '>', "$dev_env_root/opt/lib/pkgconfig/vulkan.pc") or die;
         print $file2 $pkg_config_body;
         close( $file2 );
     }
index 8b1e987..f31a0c9 100755 (executable)
@@ -42,7 +42,7 @@ os.environ['CXXFLAGS']='-O' + str(options.optimization) + ' -Wall -Wno-unused-pa
 if options.cmake:
     configure_command="cmake -DCMAKE_INSTALL_PREFIX=$DESKTOP_PREFIX . -DCMAKE_BUILD_TYPE=Debug"
 else:
-    configure_command="autoreconf --install && ./configure --prefix=$DESKTOP_PREFIX --enable-debug=yes --enable-profile=UBUNTU --enable-vulkan=1.0"
+    configure_command="autoreconf --install && ./configure --prefix=$DESKTOP_PREFIX --enable-debug=yes --enable-profile=UBUNTU --enable-vulkan=yes"
 
 if options.logging:
     configure_command += " --enable-networklogging"
diff --git a/build/tizen-cmake/CMakeLists.txt b/build/tizen-cmake/CMakeLists.txt
deleted file mode 100644 (file)
index ee54822..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-CMAKE_POLICY(SET CMP0012 NEW) # Prevent dereferencing of OFF/ON as variables
-
-SET(name "dali-core")
-
-PROJECT(${name})
-SET(PKG_NAME ${name})
-
-# API VERSION (Not DALi release version)
-SET(${name}_VERSION_MAJOR 0)
-SET(${name}_VERSION_MINOR 1)
-SET(${name}_VERSION_PATCH 1)
-SET(${name}_VERSION ${${name}_VERSION_MAJOR}.${${name}_VERSION_MINOR}.${${name}_VERSION_PATCH})
-
-SET(DALI_VERSION ${${name}_VERSION} )
-
-# Define options to CMake
-
-OPTION(ENABLE_EXPORTALL      "Enable Export all symbols" OFF)
-OPTION(ENABLE_DEBUG          "Enable Debug" OFF)
-OPTION(ENABLE_BACKTRACE      "Enable Backtrace" OFF)
-OPTION(ENABLE_LOCK_BACKTRACE "Enable" OFF)
-OPTION(ENABLE_COVERAGE       "Coverage" OFF)
-SET(GLES_VERSION 20 CACHE INTEGER "Gles Version")
-
-# Set up compiler definitions
-
-ADD_DEFINITIONS(-DPLATFORM_TIZEN -DDALI_COMPILATION)
-ADD_DEFINITIONS(-DDALI_GLES_VERSION=${GLES_VERSION})
-ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS)
-
-IF("${ARCH}" STREQUAL "arm")
-    ADD_DEFINITIONS("-DTARGET")
-ENDIF("${ARCH}" STREQUAL "arm")
-
-IF( NOT ${ENABLE_EXPORTALL} AND NOT ${ENABLE_DEBUG} )
-  ADD_DEFINITIONS( "-fvisibility=hidden -DHIDE_DALI_INTERNALS" )
-ENDIF( NOT ${ENABLE_EXPORTALL} AND NOT ${ENABLE_DEBUG} )
-
-IF( ENABLE_DEBUG )
-  ADD_DEFINITIONS( "-DDEBUG_ENABLED" )
-ENDIF( ENABLE_DEBUG )
-
-IF( ENABLE_BACKTRACE OR ENABLE_LOCK_BACKTRACE )
-  ADD_DEFINITIONS( "-DBACKTRACE_ENABLED" )
-ENDIF( ENABLE_BACKTRACE OR ENABLE_LOCK_BACKTRACE )
-
-IF( ENABLE_LOCK_BACKTRACE )
-  ADD_DEFINITIONS( "-DLOCK_BACKTRACE_ENABLED" )
-ENDIF( ENABLE_LOCK_BACKTRACE )
-
-# Deployment folder should come from spec file or command line:
-SET( PREFIX ${CMAKE_INSTALL_PREFIX})
-SET( EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
-
-# from root/build/tizen, get back to root
-SET(ROOT_SRC_DIR ${CMAKE_SOURCE_DIR}/../..)
-
-# Requires the following variables to be setup
-# @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIBDIR@ @DEV_INCLUDE_PATH@
-SET(INCLUDE_DIR $ENV{includedir})
-SET(DEV_INCLUDE_PATH ${INCLUDE_DIR})
-SET(LIB_DIR $ENV{libdir})
-CONFIGURE_FILE( dali-core.pc.in dali-core.pc )
-
-MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
-if(CMAKE_BUILD_TYPE MATCHES Debug)
-    MESSAGE("Setting variable: DEBUG_ENABLED")
-    SET(DEBUG_ENABLED "1")
-ENDIF()
-
-# Set up compiler flags and warnings
-#ADD_COMPILE_OPTIONS( -std=c++14 -ggdb )
-ADD_COMPILE_OPTIONS( -std=c++14 -gdwarf-4 )
-ADD_COMPILE_OPTIONS( -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast )
-ADD_COMPILE_OPTIONS( -Werror -Wall -Wextra -Wno-unused-parameter -Wfloat-equal )
-
-IF( ENABLE_DEBUG )
-  ADD_COMPILE_OPTIONS( -O0 )
-ELSE( ENABLE_DEBUG )
-  ADD_COMPILE_OPTIONS( -Os )
-ENDIF( ENABLE_DEBUG )
-
-IF( ENABLE_COVERAGE OR CXXFLAGS MATCHES --coverage)
-  ADD_COMPILE_OPTIONS( --coverage )
-  SET(COVERAGE --coverage)
-ENDIF()
-
-INCLUDE_DIRECTORIES(
-  ${ROOT_SRC_DIR}
-)
-
-SET(SOURCE_DIR "${ROOT_SRC_DIR}/dali")
-
-SET(SOURCES "")
-
-# could use INCLUDE to get the source lists a different way;
-# would then need to specify a build folder somehow...
-ADD_SUBDIRECTORY( ${SOURCE_DIR}/internal dali/internal )
-ADD_SUBDIRECTORY( ${SOURCE_DIR}/integration-api dali/integration-api )
-ADD_SUBDIRECTORY( ${SOURCE_DIR}/public-api dali/public-api )
-ADD_SUBDIRECTORY( ${SOURCE_DIR}/devel-api dali/devel-api )
-
-ADD_LIBRARY( ${name} SHARED ${SOURCES} )
-
-TARGET_LINK_LIBRARIES( ${name}
-  -lpthread
-  ${COVERAGE}
-)
-
-SET_TARGET_PROPERTIES( ${name}
-  PROPERTIES
-  VERSION ${DALI_VERSION}
-  SOVERSION ${${name}_VERSION_MAJOR}
-  CLEAN_DIRECT_OUPUT 1
-)
-
-# Install the library so file and symlinks
-INSTALL( TARGETS ${name} DESTINATION ${PREFIX}/lib )
-
-# macro for installing headers by replacing prefix. (TODO, investigate
-# if there is a CMAKE way of doing this automatically)
-MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST STRIP_PREFIX REPLACE_PREFIX)
-  GET_FILENAME_COMPONENT( SPREFIX ${STRIP_PREFIX} ABSOLUTE )
-  FOREACH(HEADER ${${HEADER_LIST}})
-    STRING(REGEX MATCH "(.*)[/]" DIR ${HEADER})
-    STRING(REPLACE ${SPREFIX} ${REPLACE_PREFIX} NEWDIR ${DIR})
-    INSTALL(FILES ${HEADER} DESTINATION ${PREFIX}/include/${NEWDIR})
-  ENDFOREACH(HEADER)
-ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
-
-# Install headers using lists defined by ADD_SUBDIRECTORY
-INSTALL_HEADERS_WITH_DIRECTORY(PUBLIC_API_HEADERS ${SOURCE_DIR} "dali")
-INSTALL_HEADERS_WITH_DIRECTORY(DEVEL_API_HEADERS ${SOURCE_DIR} "dali")
-INSTALL_HEADERS_WITH_DIRECTORY(INTEGRATION_API_HEADERS ${SOURCE_DIR} "dali")
-
-IF(UNIX)
-  # Define custom rules for coverage
-  SET(COVERAGE_DIR .cov)
-  SET(COVERAGE_OUTPUT_DIR doc/coverage)
-
-  # lcov prior to 1.10 doesn't have -rc option; this and subsequent version don't output
-  # branch coverage. Determine the lcov version, and enable branch coverage accordingly.
-  EXECUTE_PROCESS( COMMAND bash -c "lcov --version | cut -d' ' -f4" OUTPUT_VARIABLE LCOV_VERSION )
-  STRING( REPLACE "." ";" LCOV_VLIST ${LCOV_VERSION})
-  IF( NOT $<VERSION_LESS:${LCOV_VERSION},"1.10"> )
-    SET(LCOV_OPTS --rc lcov_branch_coverage=1)
-  ENDIF()
-
-  ADD_CUSTOM_TARGET( cov_data lcov ${LCOV_OPTS} --base-directory dali --directory . -c -o dali.info
-          COMMAND lcov ${LCOV_OPTS} --remove dali.info \"*/dali-env/*\" \"/usr/include/*\" \"public-api/shader-effects/*\" \"*/image-actor*\" -o dali.info )
-
-  ADD_CUSTOM_TARGET( coverage genhtml ${LCOV_OPTS} -o ${COVERAGE_OUTPUT_DIR} dali.info
-    DEPENDS cov_data )
-
-  ADD_CUSTOM_TARGET( reset_coverage @lcov -z --directory `pwd` )
-
-  # Define custom rule for distclean
-  ADD_CUSTOM_TARGET( distclean @echo cleaning for source distribution )
-  ADD_CUSTOM_COMMAND(
-        DEPENDS clean
-        COMMENT "distribution clean"
-        COMMAND find
-        ARGS    .
-        -not -name config.cmake -and \(
-        -name tester.c -or
-        -name Testing -or
-        -name CMakeFiles -or
-        -name cmake.depends -or
-        -name cmake.check_depends -or
-        -name CMakeCache.txt -or
-        -name cmake.check_cache -or
-        -name *.cmake -or
-        -name Makefile -or
-        -name core -or
-        -name core.* -or
-        -name gmon.out -or
-        -name install_manifest.txt -or
-        -name *.pc -or
-        -name *.gcov -or
-        -name *.gcno -or
-        -name *.gcda -or
-        -name *~ \)
-        | grep -v TC | xargs rm -rf
-        TARGET  distclean
-        VERBATIM
-        )
-
-ENDIF(UNIX)
-
-
-MESSAGE( STATUS "Configuration:\n" )
-MESSAGE( STATUS "Prefix:                " ${PREFIX} )
-MESSAGE( STATUS "Debug build:           " ${ENABLE_DEBUG} )
-MESSAGE( STATUS "Backtrace:             " ${ENABLE_BACKTRACE} )
-MESSAGE( STATUS "Scoped Lock backtrace: " ${ENABLE_LOCK_BACKTRACE} )
-MESSAGE( STATUS "Coverage:              " ${ENABLE_COVERAGE} )
diff --git a/build/tizen-cmake/dali-core.pc.in b/build/tizen-cmake/dali-core.pc.in
deleted file mode 100644 (file)
index 7075465..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-apiversion=@DALI_VERSION@
-libdir=@LIBDIR@
-includedir=@DEV_INCLUDE_PATH@
-
-Name: DALi 3D Engine
-Description: Cross platform 3D Engine
-Version: ${apiversion}
-Requires:
-Libs: -L${libdir} -ldali-core
-Cflags: -I${includedir} -std=c++14
index 644f5f5..a955344 100644 (file)
@@ -1,21 +1,12 @@
-/gmon.out
-/aclocal.m4
-/autom4te.cache
-/ar-lib
-/compile
-/config.guess
-/config.log
-/config.status
-/config.sub
-/configure
-/depcomp
-/install-sh
-/libtool
-/ltmain.sh
-/missing
-/demo/dali-demo
-/dali-core.pc
-/dali.pc
-/dali-core/dali-shaders.cpp
-/dali-core/dali-shaders.h
-/documentation.list
+/doc
+/linker-test
+/dali2-core-config.make
+
+.ninja_deps
+.ninja_log
+build.ninja
+
+/*.dylib
+
+libdali-core.so.1
+libdali-core.so.1.0.0
diff --git a/build/tizen/CMakeLists.txt b/build/tizen/CMakeLists.txt
new file mode 100644 (file)
index 0000000..be988a8
--- /dev/null
@@ -0,0 +1,408 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 3.8.2)
+CMAKE_POLICY(SET CMP0012 NEW) # Prevent dereferencing of OFF/ON as variables
+
+SET(name "dali-core")
+
+SET(CMAKE_C_STANDARD 99)
+SET(CMAKE_CXX_STANDARD 17)
+PROJECT(${name})
+SET(PKG_NAME ${name})
+
+SET(GCC_COMPILER_VERSION_REQUIRED "6")
+IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+  IF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS GCC_COMPILER_VERSION_REQUIRED)
+    MESSAGE(FATAL_ERROR "The GCC required compiler version is " ${GCC_COMPILER_VERSION_REQUIRED})
+  ENDIF()
+ENDIF()
+
+# API VERSION (Not DALi release version)
+SET(${name}_VERSION_MAJOR 1)
+SET(${name}_VERSION_MINOR 0)
+SET(${name}_VERSION_PATCH 0)
+SET(${name}_VERSION ${${name}_VERSION_MAJOR}.${${name}_VERSION_MINOR}.${${name}_VERSION_PATCH})
+
+SET(DALI_VERSION ${${name}_VERSION} )
+
+# Define options to CMake
+
+OPTION(ENABLE_EXPORTALL      "Enable Export all symbols" OFF)
+OPTION(ENABLE_DEBUG          "Enable Debug" OFF)
+OPTION(ENABLE_BACKTRACE      "Enable Backtrace" OFF)
+OPTION(ENABLE_LOCK_BACKTRACE "Enable" OFF)
+OPTION(ENABLE_COVERAGE       "Coverage" OFF)
+OPTION(ENABLE_TRACE          "Enable Trace" OFF)
+OPTION(ENABLE_PKG_CONFIGURE  "Use pkgconfig" ON)
+OPTION(ENABLE_LINK_TEST      "Enable the link test" ON)
+
+IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
+  FIND_PACKAGE( dali-windows-dependencies REQUIRED )
+ENDIF()
+
+SET( VCPKG_INCLUDE_DIR "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
+
+# Set up compiler definitions
+
+IF(CMAKE_BUILD_TYPE MATCHES Debug)
+  SET( ENABLE_DEBUG ON )
+ENDIF()
+
+IF( ENABLE_DEBUG )
+  MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Debug )
+  ADD_DEFINITIONS( "-DDEBUG_ENABLED" )
+  SET( ENABLE_EXPORTALL ON )
+ELSE()
+  MESSAGE( STATUS "CMAKE_BUILD_TYPE: " Release )
+ENDIF()
+
+IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
+
+  IF(NOT DEFINED STATIC)
+    ADD_DEFINITIONS( "-DBUILDING_DALI_CORE" )
+  ENDIF()
+
+ELSEIF( UNIX )
+
+  IF( NOT ${ENABLE_EXPORTALL} )
+    ADD_DEFINITIONS( "-DHIDE_DALI_INTERNALS" )
+  ENDIF()
+
+  ADD_DEFINITIONS(-DPIC -DSTDC_HEADERS)
+
+  IF("${ARCH}" STREQUAL "arm")
+    ADD_DEFINITIONS("-DTARGET")
+  ENDIF()
+
+ENDIF()
+
+IF( ENABLE_BACKTRACE OR ENABLE_LOCK_BACKTRACE )
+  ADD_DEFINITIONS( "-DBACKTRACE_ENABLED" )
+ENDIF()
+
+IF( ENABLE_LOCK_BACKTRACE )
+  ADD_DEFINITIONS( "-DLOCK_BACKTRACE_ENABLED" )
+ENDIF()
+
+IF( ENABLE_TRACE )
+  ADD_DEFINITIONS("-DTRACE_ENABLED")
+ENDIF()
+
+# Deployment folder should come from spec file or command line:
+SET( PREFIX ${CMAKE_INSTALL_PREFIX})
+SET( EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
+
+# from root/build/tizen, get back to root
+SET(ROOT_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../..)
+
+# Make sure the path is absolute
+GET_FILENAME_COMPONENT(ROOT_SRC_DIR ${ROOT_SRC_DIR} ABSOLUTE)
+
+# Set up the include dir
+SET( INCLUDE_DIR $ENV{includedir} )
+IF( NOT INCLUDE_DIR )
+  SET( INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR} )
+ENDIF()
+IF( NOT INCLUDE_DIR )
+  SET( INCLUDE_DIR ${PREFIX}/include )
+ENDIF()
+
+# Set up the lib dir
+SET( LIB_DIR $ENV{libdir} )
+IF( NOT LIB_DIR )
+  SET( LIB_DIR ${CMAKE_INSTALL_LIBDIR} )
+ENDIF()
+IF( NOT LIB_DIR )
+  SET( LIB_DIR ${PREFIX}/lib )
+ENDIF()
+
+# Set up the bin dir
+SET( BIN_DIR $ENV{bindir} )
+IF( NOT BIN_DIR )
+  SET( BIN_DIR ${CMAKE_INSTALL_BINDIR} )
+ENDIF()
+IF( NOT BIN_DIR )
+  SET( BIN_DIR ${PREFIX}/bin )
+ENDIF()
+
+IF( ENABLE_PKG_CONFIGURE )
+  # Configure the pkg-config file
+  # Requires the following variables to be setup:
+  # @PREFIX@ @EXEC_PREFIX@ @DALI_VERSION@ @LIB_DIR@ @DEV_INCLUDE_PATH@
+  SET( DEV_INCLUDE_PATH ${INCLUDE_DIR} )
+  SET( CORE_PKG_CFG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/dali-core.pc )
+  CONFIGURE_FILE( ${CORE_PKG_CFG_FILE}.in ${CORE_PKG_CFG_FILE} @ONLY )
+ENDIF()
+
+IF( WIN32 ) # WIN32 includes x64 as well according to the cmake doc.
+
+  ADD_COMPILE_OPTIONS( /FIdali-windows-dependencies.h ) # Adds missing definitions.
+  ADD_COMPILE_OPTIONS( /vmg )                           # Avoids a 'reinterpret_cast' compile error while compiling signals and callbacks.
+  ADD_COMPILE_OPTIONS( /wd4251 )                        # Ignores warning C4251: "'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'"
+
+ELSEIF( UNIX )
+
+  INCLUDE(CheckCXXCompilerFlag)
+
+  # Set up compiler flags and warnings
+  ADD_COMPILE_OPTIONS( -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast )
+
+  # TODO: Clang is a lot more strict with warnings, we should address
+  # those issues at some point.
+  IF( NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" )
+    ADD_COMPILE_OPTIONS( -Werror )
+  ENDIF()
+
+  ADD_COMPILE_OPTIONS( -Wall -Wextra -Wno-unused-parameter -Wfloat-equal )
+  CHECK_CXX_COMPILER_FLAG(-Wno-class-memaccess HAVE_NO_CLASS_MEMACCESS)
+  IF (HAVE_NO_CLASS_MEMACCESS)
+    ADD_COMPILE_OPTIONS( -Wno-class-memaccess )
+  ENDIF()
+
+  CHECK_CXX_COMPILER_FLAG(-Wno-cast-function-type HAVE_NO_CAST_FUNCTION_TYPE)
+  IF (HAVE_NO_CAST_FUNCTION_TYPE)
+    ADD_COMPILE_OPTIONS( -Wno-cast-function-type )
+  ENDIF()
+
+  CHECK_CXX_COMPILER_FLAG(-Wno-string-plus-int HAVE_NO_STRING_PLUS_INT)
+  IF (HAVE_NO_STRING_PLUS_INT)
+    ADD_COMPILE_OPTIONS( -Wno-string-plus-int )
+  ENDIF()
+  IF( ENABLE_COVERAGE OR "$ENV{CXXFLAGS}" MATCHES --coverage )
+    ADD_COMPILE_OPTIONS( --coverage )
+    SET(ENABLE_COVERAGE ON)
+    SET(COVERAGE --coverage)
+  ENDIF()
+
+  IF( NOT ${ENABLE_EXPORTALL} )
+    ADD_COMPILE_OPTIONS( "-fvisibility=hidden" )
+  ENDIF()
+
+ENDIF()
+
+INCLUDE_DIRECTORIES(
+  ${ROOT_SRC_DIR}
+  ${VCPKG_INCLUDE_DIR}
+  ${INCLUDE_DIR}
+)
+
+SET(SOURCE_DIR "${ROOT_SRC_DIR}/dali")
+SET(PACKAGE_DOXY_SRC_DIR "${ROOT_SRC_DIR}/doc")
+
+SET(SOURCES "")
+
+# could use INCLUDE to get the source lists a different way;
+# would then need to specify a build folder somehow...
+INCLUDE( ${ROOT_SRC_DIR}/dali/internal/file.list )
+INCLUDE( ${ROOT_SRC_DIR}/dali/integration-api/file.list )
+INCLUDE( ${ROOT_SRC_DIR}/dali/public-api/file.list )
+INCLUDE( ${ROOT_SRC_DIR}/dali/devel-api/file.list )
+INCLUDE( ${ROOT_SRC_DIR}/dali/graphics-api/file.list )
+IF( WIN32 )
+  INCLUDE( ${ROOT_SRC_DIR}/dali/internal/file-windows.list )
+ELSEIF( UNIX )
+  INCLUDE( ${ROOT_SRC_DIR}/dali/internal/file-unix.list )
+ENDIF()
+INCLUDE( ${ROOT_SRC_DIR}/doc/file.list )
+
+SET(LIBTYPE SHARED)
+IF(DEFINED STATIC)
+  SET(LIBTYPE STATIC)
+ENDIF()
+
+ADD_LIBRARY( ${name} ${LIBTYPE} ${SOURCES} )
+
+# pthread required due to gcc issue
+IF( WIN32 )
+    SET( OPTIONAL_LIBS ${OPTIONAL_LIBS} dali-windows-dependencies::dali-windows-dependencies )
+ELSEIF( UNIX )
+  FIND_LIBRARY(PTHREAD pthread)
+  IF(PTHREAD)
+    SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} -lpthread)
+  ENDIF()
+ENDIF()
+
+TARGET_LINK_LIBRARIES( ${name}
+  ${OPTIONAL_LIBS}
+  ${COVERAGE}
+)
+
+SET_TARGET_PROPERTIES( ${name}
+  PROPERTIES
+  VERSION ${DALI_VERSION}
+  SOVERSION ${${name}_VERSION_MAJOR}
+  CLEAN_DIRECT_OUPUT 1
+)
+
+IF( INSTALL_CMAKE_MODULES )
+  IF( ENABLE_DEBUG )
+    SET( BIN_DIR "${BIN_DIR}/debug" )
+    SET( LIB_DIR "${LIB_DIR}/debug" )
+  ENDIF()
+
+  # Install the library files.
+  INSTALL( TARGETS ${name}
+    EXPORT ${name}-targets
+    LIBRARY DESTINATION ${LIB_DIR}
+    ARCHIVE DESTINATION ${LIB_DIR}
+    RUNTIME DESTINATION ${BIN_DIR}
+  )
+
+  # Install the cmake modules.
+  INSTALL(
+    EXPORT ${name}-targets
+    NAMESPACE ${name}::
+    FILE ${name}-targets.cmake
+    DESTINATION share/${name}
+  )
+
+  FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/${name}-config.cmake "
+    include(CMakeFindDependencyMacro)
+    include(\${CMAKE_CURRENT_LIST_DIR}/${name}-targets.cmake)
+  ")
+  INSTALL( FILES ${CMAKE_CURRENT_BINARY_DIR}/${name}-config.cmake DESTINATION share/${name} )
+
+  # Install the pdb file.
+  IF( ENABLE_DEBUG AND WIN32 )
+    install( FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/${name}.pdb DESTINATION ${BIN_DIR} )
+  ENDIF()
+ELSE()
+  # Install the library so file and symlinks.
+  INSTALL( TARGETS ${name} DESTINATION ${LIB_DIR} )
+ENDIF()
+
+
+# Install the pkg-config file
+IF( ENABLE_PKG_CONFIGURE )
+  INSTALL( FILES ${CORE_PKG_CFG_FILE} DESTINATION ${LIB_DIR}/pkgconfig )
+ENDIF()
+
+# macro for installing headers by replacing prefix. (TODO, investigate
+# if there is a CMAKE way of doing this automatically)
+MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST STRIP_PREFIX REPLACE_PREFIX)
+  GET_FILENAME_COMPONENT( SPREFIX ${STRIP_PREFIX} ABSOLUTE )
+  FOREACH(HEADER ${${HEADER_LIST}})
+    STRING(REGEX MATCH "(.*)[/]" DIR ${HEADER})
+    STRING(REPLACE ${SPREFIX} ${REPLACE_PREFIX} NEWDIR ${DIR})
+    INSTALL(FILES ${HEADER} DESTINATION ${INCLUDE_DIR}/${NEWDIR})
+  ENDFOREACH(HEADER)
+ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
+
+# Install headers using lists defined by ADD_SUBDIRECTORY
+INSTALL_HEADERS_WITH_DIRECTORY(PUBLIC_API_HEADERS ${ROOT_SRC_DIR}/dali "dali")
+INSTALL_HEADERS_WITH_DIRECTORY(DEVEL_API_HEADERS ${ROOT_SRC_DIR}/dali "dali")
+INSTALL_HEADERS_WITH_DIRECTORY(GRAPHICS_API_HEADERS ${ROOT_SRC_DIR}/dali "dali")
+INSTALL_HEADERS_WITH_DIRECTORY(INTEGRATION_API_HEADERS ${ROOT_SRC_DIR}/dali "dali")
+INSTALL_HEADERS_WITH_DIRECTORY(PACKAGE_DOXY_HEADERS ${PACKAGE_DOXY_SRC_DIR} "dali/doc" )
+
+# The DALI_CORE_PREFIX must be set if this CMakeLists.txt is executed
+# from the top-level CMake script using ADD_SUBDIRECTORY() to avoid
+# target names duplication with other DALi modules.
+IF( ENABLE_COVERAGE )
+  FIND_PROGRAM( LCOV_BIN "lcov" )
+  IF( LCOV_BIN )
+
+    # Define custom rules for coverage
+    SET(COVERAGE_DIR .cov)
+    SET(COVERAGE_OUTPUT_DIR doc/coverage)
+
+    # lcov prior to 1.10 doesn't have -rc option; this and subsequent version don't output
+    # branch coverage. Determine the lcov version, and enable branch coverage accordingly.
+    EXECUTE_PROCESS( COMMAND bash -c "${LCOV_BIN} --version | cut -d' ' -f4" OUTPUT_VARIABLE LCOV_VERSION )
+    STRING( REPLACE "." ";" LCOV_VLIST ${LCOV_VERSION})
+    IF( NOT $<VERSION_LESS:${LCOV_VERSION},"1.10"> )
+      SET(LCOV_OPTS --rc lcov_branch_coverage=1)
+    ENDIF()
+
+    ADD_CUSTOM_TARGET( ${DALI_CORE_PREFIX}rename_cov_data ./rename-cov-data )
+
+    ADD_CUSTOM_TARGET( ${DALI_CORE_PREFIX}cov_data ${LCOV_BIN} ${LCOV_OPTS} --base-directory . --directory . -c -o dali.info
+      COMMAND ${LCOV_BIN} ${LCOV_OPTS} --remove dali.info \"*/dali-env/*\" \"/usr/include/*\" \"public-api/shader-effects/*\" \"*/image-actor*\" -o dali.info )
+
+    ADD_CUSTOM_TARGET( ${DALI_CORE_PREFIX}coverage genhtml ${LCOV_OPTS} -o ${COVERAGE_OUTPUT_DIR} dali.info
+      DEPENDS cov_data )
+
+    ADD_CUSTOM_TARGET( ${DALI_CORE_PREFIX}reset_coverage @${LCOV_BIN} -z --directory `pwd` )
+
+    # Define custom rule for distclean
+    ADD_CUSTOM_TARGET( ${DALI_CORE_PREFIX}distclean @echo cleaning for source distribution )
+    ADD_CUSTOM_COMMAND(
+          DEPENDS ${DALI_CORE_PREFIX}clean
+          COMMENT "distribution clean"
+          COMMAND find
+          ARGS    .
+          -not -name config.cmake -and \(
+          -name tester.c -or
+          -name Testing -or
+          -name CMakeFiles -or
+          -name doc -or
+          -name cmake.depends -or
+          -name cmake.check_depends -or
+          -name CMakeCache.txt -or
+          -name cmake.check_cache -or
+          -name *.cmake -or
+          -name Makefile -or
+          -name core -or
+          -name core.* -or
+          -name gmon.out -or
+          -name install_manifest.txt -or
+          -name *.pc -or
+          -name *.gcov -or
+          -name *.gcno -or
+          -name *.gcda -or
+          -name *~ -or
+          -name libdali*.so* \)
+          | grep -v TC | xargs rm -rf
+          TARGET  ${DALI_CORE_PREFIX}distclean
+VERBATIM
+          )
+
+  ENDIF( LCOV_BIN )
+ENDIF()
+
+IF( ENABLE_LINK_TEST )
+  # Linker Test
+  SET( DALI_TEST_SUITE_DIR ${ROOT_SRC_DIR}/automated-tests/src/dali/dali-test-suite-utils )
+  SET( LINKER_TEST_NAME ${DALI_CORE_PREFIX}linker-test )
+  SET( LINKER_TEST_SOURCES
+    linker-test.cpp
+    ${DALI_TEST_SUITE_DIR}/test-application.cpp
+    ${DALI_TEST_SUITE_DIR}/test-gesture-manager.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-buffer.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-buffer-factory.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-render-command.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-controller.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-framebuffer.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-framebuffer-factory.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-pipeline.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-pipeline-factory.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-sampler.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-sampler-factory.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-shader.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-shader-factory.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-texture.cpp
+    ${DALI_TEST_SUITE_DIR}/test-graphics-texture-factory.cpp
+    ${DALI_TEST_SUITE_DIR}/test-platform-abstraction.cpp
+    ${DALI_TEST_SUITE_DIR}/test-render-controller.cpp
+    ${DALI_TEST_SUITE_DIR}/test-render-surface.cpp
+    ${DALI_TEST_SUITE_DIR}/test-trace-call-stack.cpp
+  )
+  ADD_EXECUTABLE( ${LINKER_TEST_NAME} ${LINKER_TEST_SOURCES} )
+  TARGET_LINK_LIBRARIES(${LINKER_TEST_NAME} ${name} )
+  TARGET_INCLUDE_DIRECTORIES( ${LINKER_TEST_NAME} PRIVATE ${DALI_TEST_SUITE_DIR} )
+ENDIF()
+
+# Configuration Messages
+MESSAGE( STATUS "Configuration:\n" )
+MESSAGE( STATUS "Prefix:                " ${PREFIX} )
+MESSAGE( STATUS "Lib Dir:               " ${LIB_DIR} )
+MESSAGE( STATUS "Bin Dir:               " ${BIN_DIR} )
+MESSAGE( STATUS "Include Dir:           " ${INCLUDE_DIR} )
+MESSAGE( STATUS "Debug build:           " ${ENABLE_DEBUG} )
+MESSAGE( STATUS "Export all symbols:    " ${ENABLE_EXPORTALL} )
+MESSAGE( STATUS "Backtrace:             " ${ENABLE_BACKTRACE} )
+MESSAGE( STATUS "Scoped Lock backtrace: " ${ENABLE_LOCK_BACKTRACE} )
+MESSAGE( STATUS "Coverage:              " ${ENABLE_COVERAGE} )
+MESSAGE( STATUS "Trace:                 " ${ENABLE_TRACE} )
+MESSAGE( STATUS "Use pkg configure:     " ${ENABLE_PKG_CONFIGURE} )
+MESSAGE( STATUS "Enable link test:      " ${ENABLE_LINK_TEST} )
+MESSAGE( STATUS "CXXFLAGS:              " ${CMAKE_CXX_FLAGS} )
+MESSAGE( STATUS "LDFLAGS:               " ${CMAKE_SHARED_LINKER_FLAGS_INIT}${CMAKE_SHARED_LINKER_FLAGS} )
diff --git a/build/tizen/Makefile.am b/build/tizen/Makefile.am
deleted file mode 100644 (file)
index 2ab9efb..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# Copyright (c) 2018 Samsung Electronics Co., Ltd.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-SUBDIRS = dali-core/graphics dali-core
-
-pkgconfigdir = $(libdir)/pkgconfig
-
-if ENABLE_CXX03_ABI
-pkgconfig_DATA = dali-core-cxx03.pc
-else
-pkgconfig_DATA = dali-core.pc
-endif
-
-
-MAINTAINERCLEANFILES = \
-    aclocal.m4 \
-    autom4te.cache \
-    config.guess \
-    config.sub \
-    configure \
-    depcomp \
-    install-sh \
-    ltmain.sh \
-    missing \
-    `find "$(srcdir)" -type f -name Makefile.in -print` \
-    `find . \( -name "*.gcov" -o -name "*.gcno" -o -name "*.gcda" \) -print`
-
-CLEANFILES = \
-    `find . \( -name "*.gcov" -o -name "*.gcno" -o -name "*.gcda" \) -print`
-
-COVERAGE_DIR=.cov
-COVERAGE_OUTPUT_DIR=doc/coverage
-
-# From lcov version 1.10 onwards, branch coverage is off by default and earlier versions do not support the rc option
-LCOV_OPTS=`if [ \`printf "\\\`lcov --version | cut -d' ' -f4\\\`\n1.10\n" | sort -V | head -n 1\` = 1.10 ] ; then echo "--rc lcov_branch_coverage=1" ; fi`
-
-rename_cov_data:
-       @test -z $(COVERAGE_DIR) || mkdir -p $(COVERAGE_DIR)
-       @rm -f $(COVERAGE_DIR)/*
-       @cp dali-core/.libs/*.gcda dali-core/.libs/*.gcno $(COVERAGE_DIR)
-       @for i in `find $(COVERAGE_DIR) -name "libdali*_la-*.gcda" -o -name "libdali*_la-*.gcno"` ;\
-               do mv $$i `echo $$i | sed s/libdali_.*_la-//` ; echo $$i ; done
-
-cov_data: rename_cov_data
-       @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --base-directory . --directory . -c -o dali.info
-       @cd $(COVERAGE_DIR) ; lcov $(LCOV_OPTS) --remove dali.info "*/dali-env/*" "/usr/include/*" "public-api/shader-effects/*" "*/image-actor*" -o dali.info
-       @test -z $(COVERAGE_OUTPUT_DIR) || mkdir -p $(COVERAGE_OUTPUT_DIR)
-
-coverage: cov_data
-       @genhtml $(LCOV_OPTS) -o $(COVERAGE_OUTPUT_DIR) $(COVERAGE_DIR)/dali.info
-
-reset_coverage:
-       @lcov -z --directory `pwd`
diff --git a/build/tizen/configure.ac b/build/tizen/configure.ac
deleted file mode 100644 (file)
index a683716..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-# Copyright (c) 2018 Samsung Electronics Co., Ltd.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-m4_define([dali_version],[0.1.1])
-AC_INIT([dali], [dali_version])
-AM_INIT_AUTOMAKE([-Wall foreign])
-
-AM_PROG_AR([ar])
-
-AC_PROG_CXX
-AC_PROG_LIBTOOL
-AC_PROG_MKDIR_P
-
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-LT_INIT
-
-DALI_VERSION=dali_version
-AC_SUBST(DALI_VERSION)
-
-DALI_CFLAGS=-DPLATFORM_TIZEN
-
-# Use C++ 11
-DALI_CFLAGS="$DALI_CFLAGS -std=c++14 -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast -Werror -Wall -Wextra -Wno-unused-parameter -Wfloat-equal"
-
-AC_ARG_ENABLE(exportall,
-              [AC_HELP_STRING([--enable-exportall],
-                              [enables the exporting of all the symbols in the library])],
-              [enable_exportall=yes],
-              [enable_exportall=no])
-
-AC_ARG_ENABLE([debug],
-              [AC_HELP_STRING([--enable-debug],
-                              [Turns on debugging])],
-              [enable_debug=$enableval],
-              [enable_debug=no])
-
-AC_ARG_ENABLE([backtrace],
-              [AC_HELP_STRING([--enable-backtrace],
-                              [Backtrace for exceptions])],
-              [enable_backtrace=$enableval],
-              [enable_backtrace=yes])
-
-AC_ARG_ENABLE([lock_backtrace],
-              [AC_HELP_STRING([--enable-lock-backtrace],
-                              [Backtrace for when more than 1 lock is held on the same thread])],
-              [enable_lock_backtrace=$enableval],
-              [enable_lock_backtrace=no])
-
-AC_ARG_ENABLE([gles],
-              [AC_HELP_STRING([--enable-gles],
-                              [Specify the OpenGL ES version for backwards compatibility])],
-              [enable_gles=$enableval],
-              [enable_gles=20])
-
-AC_ARG_ENABLE([cxx03_abi],
-              [AC_HELP_STRING([--enable-cxx03-abi],
-                              [Specify abi for the build])],
-              [enable_cxx03_abi=$enableval],
-              [enable_cxx03_abi=no])
-
-AC_ARG_ENABLE([rename_so],
-              [AC_HELP_STRING([--enable-rename-so],
-                              [Specify whether so file is renamed or not])],
-              [enable_rename_so=$enableval],
-              [enable_rename_so=yes])
-
-AM_CONDITIONAL([ENABLE_CXX03_ABI], [test x$enable_cxx03_abi = xyes])
-AM_CONDITIONAL([ENABLE_RENAME_SO], [test x$enable_rename_so = xyes])
-
-if test "x$enable_cxx03_abi" = "xyes"; then
-  DALI_CFLAGS="$DALI_CFLAGS -D_GLIBCXX_USE_CXX11_ABI=0"
-fi
-
-AC_ARG_ENABLE([vulkan],
-              [AC_HELP_STRING([--enable-vulkan],
-                              [Enables Vulkan support])],
-              [enable_vulkan=$enableval],
-              [enable_vulkan=no])
-
-DALI_CFLAGS="$DALI_CFLAGS -DDALI_GLES_VERSION=${enable_gles}"
-
-if test "x$enable_debug" = "xyes"; then
-  DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED"
-fi
-
-if test "x$enable_trace" = "xyes"; then
-  DALI_CFLAGS="$DALI_CFLAGS -DTRACE_ENABLED"
-fi
-
-if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
-  DALI_CFLAGS="$DALI_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
-fi
-
-if test "x$enable_lock_backtrace" = "xyes"; then
-  DALI_CFLAGS="$DALI_CFLAGS -DLOCK_BACKTRACE_ENABLED"
-  enable_backtrace="yes"
-fi
-
-# Must come after locks backtrace feature test
-if test "x$enable_backtrace" = "xyes"; then
-  DALI_CFLAGS="$DALI_CFLAGS -DBACKTRACE_ENABLED"
-fi
-
-if test x$DALI_DATA_RW_DIR != x; then
-  dataReadWriteDir=$DALI_DATA_RW_DIR
-else
-  dataReadWriteDir=${prefix}/share/dali/
-fi
-
-if test x$DALI_DATA_RO_DIR != x; then
-  dataReadOnlyDir=$DALI_DATA_RO_DIR
-else
-  dataReadOnlyDir=${prefix}/share/dali/
-fi
-
-DALI_CFLAGS="$DALI_CFLAGS -I${includedir}"
-DALI_LDFLAGS="-L${libdir}"
-
-# forward VULKAN_SDK path to the graphics library if set correctly
-if test x"$enable_vulkan" != x"no"; then
-  PKG_CHECK_MODULES(VULKAN, vulkan-${enable_vulkan}, AC_DEFINE(ENABLE_VULKAN, 1, [Vulkan available as package]),
-                    [ AC_MSG_ERROR([Vulkan not available as a package!]) ]
-                    )
-  DALI_LDFLAGS+=" ${VULKAN_LIBS}"
-  DALI_CFLAGS+=" ${VULKAN_CFLAGS}"
-  AC_SUBST(VULKAN_SDK)
-  AC_SUBST(VULKAN_LIBS)
-  AC_SUBST(VULKAN_CFLAGS)
-fi
-AM_CONDITIONAL([VULKAN_SDK_SET], [test x"$enable_vulkan" != x"no"])
-
-AC_SUBST(dataReadWriteDir)
-AC_SUBST(dataReadOnlyDir)
-AC_SUBST(DALI_CFLAGS)
-AC_SUBST(DALI_LDFLAGS)
-
-
-# Specify the include directory for development headers
-devincludepath=${includedir}
-AC_SUBST(devincludepath)
-
-AC_CONFIG_FILES([Makefile dali-core/Makefile dali-core/graphics/Makefile])
-
-if test "x$enable_cxx03_abi" = "xyes"; then
-AC_CONFIG_FILES([dali-core-cxx03.pc])
-fi
-
-if test "x$enable_cxx03_abi" != "xyes"; then
-AC_CONFIG_FILES([dali-core.pc])
-fi
-
-AC_OUTPUT
-
-echo "
-Configuration
--------------
-  Prefix:                           $prefix
-  Debug Build:                      $enable_debug
-  Trace Build:                      $enable_trace
-  Data Dir (Read/Write):            $dataReadWriteDir
-  Data Dir (Read Only):             $dataReadOnlyDir
-  Backtrace:                        $enable_backtrace
-  ScopedLock Backtrace:             $enable_lock_backtrace
-  Vulkan Support:                   $enable_vulkan
-  OpenGL ES version:                $enable_gles
-  C++03 ABI:                        $enable_cxx03_abi
-  Rename so file:                   $enable_rename_so
-"
diff --git a/build/tizen/dali-core-cxx03.pc.in b/build/tizen/dali-core-cxx03.pc.in
deleted file mode 100644 (file)
index e4a43d5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-apiversion=@DALI_VERSION@
-libdir=@libdir@
-includedir=@devincludepath@
-
-Name: Dali 3D engine
-Description: Cross platform 3D Engine
-Version: ${apiversion}
-Requires:
-Libs: -L${libdir} -ldali-core-cxx03
-Cflags: -I${includedir} -std=c++14
index e974fdd..d1b8f7a 100644 (file)
@@ -1,12 +1,12 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
+prefix=@PREFIX@
+exec_prefix=@EXEC_PREFIX@
 apiversion=@DALI_VERSION@
-libdir=@libdir@
-includedir=@devincludepath@
+libdir=@LIB_DIR@
+includedir=@DEV_INCLUDE_PATH@
 
-Name: Dali 3D engine
+Name: DALi 3D Engine
 Description: Cross platform 3D Engine
 Version: ${apiversion}
 Requires:
 Libs: -L${libdir} -ldali-core
-Cflags: -I${includedir} -std=c++14
+Cflags: -I${includedir}
diff --git a/build/tizen/dali-core/Makefile.am b/build/tizen/dali-core/Makefile.am
deleted file mode 100644 (file)
index 5b4323b..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-# Copyright (c) 2018 Samsung Electronics Co., Ltd.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Parse each file.list
-# These files define <module>_src_files & <module>_header_files,
-# where <module> is the subdirectory from core_src_dir
-
-internal_src_dir = ../../../dali/internal
-include ../../../dali/internal/file.list
-
-public_api_src_dir = ../../../dali/public-api
-include ../../../dali/public-api/file.list
-
-devel_api_src_dir = ../../../dali/devel-api
-include ../../../dali/devel-api/file.list
-
-platform_abstraction_src_dir = ../../../dali/integration-api
-include ../../../dali/integration-api/file.list
-
-package_doxy_dir = ../../../doc
-include ../../../doc/file.list
-
-# Build the Dali libtool library
-
-DALI_CORE_LA_SOURCES = $(internal_src_files) \
-                       $(platform_abstraction_src_files) \
-                       $(public_api_src_files) \
-                       $(devel_api_src_files)
-
-DALI_CORE_LA_CXXFLAGS = -DDALI_COMPILATION \
-                        -DDALI_DATA_RW_DIR="\"${daliReadWriteDir}\"" \
-                        -DDALI_DATA_RO_DIR="\"${daliReadOnlyDir}\"" \
-                         $(cxx_flags) \
-                         $(dali_core_includes) \
-                         $(DALI_CFLAGS)
-
-
-DALI_CORE_LA_LDFLAGS = $(DALI_LDFLAGS) -Wl,--whole-archive,graphics/libdali-graphics.a,--no-whole-archive
-
-DALI_CORE_LA_LIBADD = $(DALI_LDFLAGS) \
-                      $(VULKAN_LIBS) \
-                      -lpthread
-
-dali_core_includes = \
-        -I../../..
-
-if ENABLE_CXX03_ABI
-
-lib_LTLIBRARIES = libdali-core.la
-
-libdali_core_la_SOURCES = $(DALI_CORE_LA_SOURCES)
-libdali_core_la_CXXFLAGS = $(DALI_CORE_LA_CXXFLAGS)
-libdali_core_la_LIBADD = $(DALI_CORE_LA_LIBADD) graphics/libdali-graphics.a
-
-else
-
-lib_LTLIBRARIES = libdali-core-cxx11.la
-
-libdali_core_cxx11_la_SOURCES = $(DALI_CORE_LA_SOURCES)
-libdali_core_cxx11_la_CXXFLAGS = $(DALI_CORE_LA_CXXFLAGS)
-libdali_core_cxx11_la_LIBADD = $(DALI_CORE_LA_LIBADD) graphics/libdali-graphics.a
-
-endif
-
-# Install headers under the correct subdirectories
-platformabstractiondir = $(includedir)/dali/integration-api
-platformabstractioneventsdir = $(includedir)/dali/integration-api/events
-platformabstractiongraphicsdir = $(includedir)/dali/integration-api/graphics
-platformabstractiongraphicsvulkandir = $(includedir)/dali/integration-api/graphics/vulkan
-
-platformabstraction_HEADERS = $(platform_abstraction_header_files)
-platformabstractionevents_HEADERS = $(platform_abstraction_events_header_files)
-platformabstractiongraphics_HEADERS = $(graphics_integration_header_files)
-platformabstractiongraphicsvulkan_HEADERS = $(graphics_vulkan_integration_header_files)
-
-#devel api (used by adaptor / toolkit
-develapidir = $(devincludepath)/dali/devel-api
-develapiactorsdir = $(develapidir)/actors
-develapianimationdir = $(develapidir)/animation
-develapicommondir = $(develapidir)/common
-develapieventsdir = $(develapidir)/events
-develapigeometrydir = $(develapidir)/geometry
-develapiimagesdir = $(develapidir)/images
-develapimodelingdir = $(develapidir)/modeling
-develapiobjectdir = $(develapidir)/object
-develapirenderingdir = $(develapidir)/rendering
-develapiscriptingdir = $(develapidir)/scripting
-develapisignalsdir = $(develapidir)/signals
-develapithreadingdir = $(develapidir)/threading
-
-develapi_HEADERS = $(devel_api_header_files)
-develapiactors_HEADERS = $(devel_api_core_actors_header_files)
-develapianimation_HEADERS = $(devel_api_core_animation_header_files)
-develapicommon_HEADERS = $(devel_api_core_common_header_files)
-develapievents_HEADERS = $(devel_api_core_events_header_files)
-develapiimages_HEADERS = $(devel_api_core_images_header_files)
-develapimodeling_HEADERS = $(devel_api_core_modeling_header_files)
-develapiobject_HEADERS = $(devel_api_core_object_header_files)
-develapirendering_HEADERS = $(devel_api_core_rendering_header_files)
-develapiscripting_HEADERS = $(devel_api_core_scripting_header_files)
-develapisignals_HEADERS = $(devel_api_core_signals_header_files)
-develapithreading_HEADERS = $(devel_api_core_threading_header_files)
-
-#public api
-publicapidir = $(devincludepath)/dali/public-api
-publicapiactorsdir = $(publicapidir)/actors
-publicapianimationdir = $(publicapidir)/animation
-publicapicommondir = $(publicapidir)/common
-publicapieventsdir = $(publicapidir)/events
-publicapiimagesdir = $(publicapidir)/images
-publicapimathdir = $(publicapidir)/math
-publicapiobjectdir = $(publicapidir)/object
-publicapirenderingdir = $(publicapidir)/rendering
-publicapirendertasksdir = $(publicapidir)/render-tasks
-publicapisignalsdir = $(publicapidir)/signals
-publicapisizenegotiationdir = $(publicapidir)/size-negotiation
-
-publicapi_HEADERS = $(public_api_header_files)
-publicapiactors_HEADERS = $(public_api_core_actors_header_files)
-publicapianimation_HEADERS = $(public_api_core_animation_header_files)
-publicapicommon_HEADERS = $(public_api_core_common_header_files)
-publicapievents_HEADERS = $(public_api_core_events_header_files)
-publicapiimages_HEADERS = $(public_api_core_images_header_files)
-publicapimath_HEADERS = $(public_api_core_math_header_files)
-publicapiobject_HEADERS = $(public_api_core_object_header_files)
-publicapirendering_HEADERS = $(public_api_core_rendering_header_files)
-publicapirendertasks_HEADERS = $(public_api_core_render_tasks_header_files)
-publicapisignals_HEADERS = $(public_api_core_signals_header_files)
-publicapisizenegotiation_HEADERS = $(public_api_core_size_negotiation_header_files)
-
-# package doxygen file (contains doxygen grouping information)
-packagedoxydir = $(devincludepath)/dali/doc
-packagedoxy_HEADERS = $(package_doxy_files)
-
-# linking test
-
-noinst_PROGRAMS = linker.test
-
-linker_test_SOURCES = linker-test.cpp  \
-    ../../../automated-tests/src/dali/dali-test-suite-utils/test-application.cpp \
-    ../../../automated-tests/src/dali/dali-test-suite-utils/test-platform-abstraction.cpp \
-    ../../../automated-tests/src/dali/dali-test-suite-utils/test-render-controller.cpp \
-    ../../../automated-tests/src/dali/dali-test-suite-utils/test-gesture-manager.cpp \
-    ../../../automated-tests/src/dali/dali-test-suite-utils/test-trace-call-stack.cpp
-
-linker_test_CXXFLAGS = \
-  $(cxx_flags) \
-  -I../../../automated-tests/src/dali/dali-test-suite-utils \
-  $(dali_core_includes) \
-  $(VULKAN_CFLAGS)
-
-if ENABLE_CXX03_ABI
-
-linker_test_DEPENDENCIES = libdali-core.la
-linker_test_LDADD = \
-  libdali-core.la \
-  $(VULKAN_LIBS)
-
-if ENABLE_RENAME_SO
-#rename
-install: install-am
-       rm -rf $(libdir)/libdali-core.so
-       rm -rf $(libdir)/libdali-core-cxx03.so
-       ln -s $(libdir)/libdali-core.so.0.0.* $(libdir)/libdali-core-cxx03.so
-endif
-
-else
-
-linker_test_DEPENDENCIES = libdali-core-cxx11.la
-linker_test_LDADD = \
-  libdali-core-cxx11.la \
-  $(VULKAN_LIBS)
-
-if ENABLE_RENAME_SO
-#rename
-install: install-am
-       rm -rf $(libdir)/libdali-core-cxx11.so
-       rm -rf $(libdir)/libdali-core.so
-       ln -s $(libdir)/libdali-core-cxx11.so.0.0.* $(libdir)/libdali-core.so
-endif
-
-endif
diff --git a/build/tizen/dali-core/graphics/Makefile.am b/build/tizen/dali-core/graphics/Makefile.am
deleted file mode 100644 (file)
index 11dd6de..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright (c) 2018 Samsung Electronics Co., Ltd.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Parse each file.list
-# These files define <module>_src_files & <module>_header_files,
-# where <module> is the subdirectory from core_src_dir
-
-graphics_api_src_dir = ../../../../dali/graphics-api
-include ../../../../dali/graphics-api/file.list
-
-graphics_src_dir = ../../../../dali/graphics
-include ../../../../dali/graphics/file.list
-
-graphics_integration_dir = ../../../../dali/integration-api/graphics
-include ../../../../dali/integration-api/graphics/file.list
-
-# Build the graphics library
-noinst_LIBRARIES = libdali-graphics.a
-
-libdali_graphics_a_SOURCES = $(graphics_api_src_files) \
-                             $(graphics_src_files) \
-                             $(graphics_integration_src_files)
-
-#libdali_graphics_a_LDFLAGS = -fPIC
-
-
-dali_core_includes = \
-                     -I../../../..
-
-
-gcc_flags = -Wno-return-local-addr -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override \
-            -Wstack-usage=256 -Wunsafe-loop-optimizations -Wzero-as-null-pointer-constant -Wuseless-cast
-
-# -Wfloat-equal causes issues with vulkan.hpp, removed for now
-cxx_more_warnings = -Wold-style-cast -Woverloaded-virtual -Wdouble-promotion -Wswitch-enum \
-                    -Wshadow \
-                    -Wcast-qual -Wcast-align \
-                    -Wconversion -Wsign-conversion
-
-#-Wlarger-than=1024  # Conflicts with --coverage
-
-# the following warnings should not be enforced
-cxx_warnings_to_remove = \
-                         -Wno-c++98-compat \
-                         -Wno-unused-parameter \
-                         -Wno-unknown-warning-option \
-                         -Wno-switch \
-                         -Wno-switch-enum \
-                         -Wno-error=switch \
-                         -Wno-error=switch-enum
-
-#the following warnings should be added back when possible
-cxx_warnings_to_preserve = \
-                           -Wno-weak-vtables
-
-#cxx_flags = -fPIC -std=c++14 -Werror -Wall -Wextra -Weffc++ -Wpedantic \
-#            $(cxx_more_warnings) $(cxx_warnings_to_remove) $(cxx_warnings_to_preserve)
-# vulkan.hpp doesn't pass all c++ checks
-cxx_flags = -fPIC -std=c++14 -Werror -Wall -Wextra -Wpedantic \
-            $(cxx_more_warnings) $(cxx_warnings_to_remove) $(cxx_warnings_to_preserve)
-
-if VULKAN_SDK_SET
-    vulkan_flags = -DVULKAN_HPP_NO_EXCEPTIONS
-endif
-
-libdali_graphics_a_CXXFLAGS = $(cxx_flags) \
-                              $(dali_core_includes) \
-                              $(DALI_CFLAGS) \
-                              $(vulkan_flags)
similarity index 81%
rename from build/tizen/dali-core/linker-test.cpp
rename to build/tizen/linker-test.cpp
index 274c0dc..47ae499 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include "dali/public-api/dali-core.h"
 
-#include <cstdio>
 #include <stdarg.h>
+#include <cstdio>
 
 // Link with TET Test application, need to redefine TET functions
-void tet_infoline(const char* str)
+extern "C"
 {
-  puts(str);
+  void tet_infoline(const char* str)
+  {
+    puts(str);
+  }
+
+  void tet_printf(const char* str, ...)
+  {
+    va_list args;
+    va_start(args, str);
+    vprintf(str, args);
+    va_end(args);
+  }
 }
 
-void tet_printf(const char* str, ...)
-{
-  va_list args;
-  va_start(args, str);
-  vprintf(str, args);
-  va_end(args);
-}
-
-
 #include "test-application.h"
 
 /*****************************************************************************
@@ -46,10 +48,11 @@ void tet_printf(const char* str, ...)
  * Also ensures TET Test Application is kept up-to-date.
  */
 
-int main(int argc, char **argv)
+int main(int argc, char** argv)
 {
 #ifndef _ARCH_ARM_
   Dali::TestApplication application;
 #endif
+
   return 0;
 }
diff --git a/build/tizen/rename-cov-data b/build/tizen/rename-cov-data
new file mode 100755 (executable)
index 0000000..a29f21b
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+COVERAGE_DIR=.cov
+[[ -d ${COVERAGE_DIR} ]] || mkdir ${COVERAGE_DIR}
+rm -f ${COVERAGE_DIR}/*
+
+COVERAGE_EXTENSIONS="
+  gcda
+  gcno
+"
+
+SOURCE_EXTENSIONS="
+ c
+ cpp
+"
+
+for covExt in $COVERAGE_EXTENSIONS
+do
+  # Move into .cov directory
+  for file in `find -name *.${covExt}`
+  do
+    cp $file ${COVERAGE_DIR}
+  done
+
+  # strip source extensions liks .cpp as that's the format expected by patch-coverage.pl
+  for srcExt in $SOURCE_EXTENSIONS
+  do
+    for file in `find ${COVERAGE_DIR} -name *.${srcExt}.${covExt}`
+    do
+      name=`echo $file | sed "s/.${srcExt}.${covExt}//g"`
+      mv $file $name.${covExt}
+    done
+  done
+
+done
diff --git a/dali/devel-api/CMakeLists.txt b/dali/devel-api/CMakeLists.txt
deleted file mode 100644 (file)
index d0663c3..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-
-SET( SOURCES ${SOURCES}
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/actor-devel.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/custom-actor-devel.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/animation-data.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/animation-devel.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/path-constrainer.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/hash.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/stage-devel.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/hit-test-algorithm.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/distance-field.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/texture-set-image.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/nine-patch-image.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/pixel-data-devel.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/handle-devel.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/csharp-type-registry.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/scripting/scripting.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/signal-delegate.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/threading/conditional-wait.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/threading/mutex.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/threading/thread.cpp
-
-  PARENT_SCOPE )
-
-SET( DEVEL_API_HEADERS
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/actor-devel.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/custom-actor-devel.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/layer-devel.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/animation-data.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/path-constrainer.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/animation-devel.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/circular-queue.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/hash.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/map-wrapper.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/owner-container.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/ref-counted-dali-vector.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/set-wrapper.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/stage-devel.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/hit-test-algorithm.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/distance-field.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/native-image-interface-extension.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/nine-patch-image.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/texture-set-image.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/pixel-data-devel.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/csharp-type-info.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/csharp-type-registry.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/handle-devel.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-helper-devel.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderer-devel.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/signal-delegate.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/scripting/enum-helper.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/scripting/scripting.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/threading/conditional-wait.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/threading/mutex.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/threading/thread.h
-
-  PARENT_SCOPE )
index 591130c..9e89f7c 100644 (file)
@@ -40,6 +40,11 @@ ChildChangedSignalType& ChildRemovedSignal( Actor actor )
   return GetImplementation( actor ).ChildRemovedSignal();
 }
 
+ChildOrderChangedSignalType& ChildOrderChangedSignal( Actor actor )
+{
+  return GetImplementation( actor ).ChildOrderChangedSignal();
+}
+
 
 
 } // namespace DevelActor
index 84a712e..6b6ff23 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_ACTOR_DEVEL_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -73,7 +73,7 @@ enum Type
   INHERIT_ORIENTATION         = Dali::Actor::Property::INHERIT_ORIENTATION,
   INHERIT_SCALE               = Dali::Actor::Property::INHERIT_SCALE,
   COLOR_MODE                  = Dali::Actor::Property::COLOR_MODE,
-  POSITION_INHERITANCE        = Dali::Actor::Property::POSITION_INHERITANCE,
+  RESERVED_PROPERTY_01        = Dali::Actor::Property::RESERVED_PROPERTY_01,
   DRAW_MODE                   = Dali::Actor::Property::DRAW_MODE,
   SIZE_MODE_FACTOR            = Dali::Actor::Property::SIZE_MODE_FACTOR,
   WIDTH_RESIZE_POLICY         = Dali::Actor::Property::WIDTH_RESIZE_POLICY,
@@ -119,6 +119,13 @@ enum Type
    * @note Setting this to false will allow scaling or rotation around the anchor-point without affecting the actor's position.
    */
   POSITION_USES_ANCHOR_POINT = INHERIT_LAYOUT_DIRECTION + 4,
+
+  /**
+   * @brief Returns whether the actor is culled or not.
+   * @details Name "culled", type Property::BOOLEAN. Read-only
+   * @note True means that the actor is out of the view frustum.
+   */
+  CULLED = INHERIT_LAYOUT_DIRECTION + 5,
 };
 
 } // namespace Property
@@ -196,6 +203,24 @@ DALI_CORE_API ChildChangedSignalType& ChildAddedSignal( Actor actor );
 DALI_CORE_API ChildChangedSignalType& ChildRemovedSignal( Actor actor );
 
 
+typedef Signal< void (Actor) > ChildOrderChangedSignalType; ///< Used when the actor's children have changed order
+
+/**
+ * @brief This signal is emitted when an actor's children change their sibling order
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void MyCallbackName( Actor parent );
+ * @endcode
+ * parent The parent actor of the moved children
+ *
+ * @return The signal to connect to
+ * @pre The Actor has been initialized
+ */
+DALI_CORE_API ChildOrderChangedSignalType& ChildOrderChangedSignal( Actor actor );
+
+
+
 } // namespace DevelActor
 
 } // namespace Dali
diff --git a/dali/devel-api/common/bitwise-enum.h b/dali/devel-api/common/bitwise-enum.h
new file mode 100644 (file)
index 0000000..2717a92
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef DALI_BITWISE_ENUM_H
+#define DALI_BITWISE_ENUM_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <type_traits> // std::enable_if, std::underlying_type
+
+namespace Dali
+{
+
+/**
+ * Type traits and methods to enable type safe bit field operators for an enum.
+ * usage:
+ *   template<> struct EnableBitMaskOperators< MyEnumType > { static const bool ENABLE = true; };
+ * after this one can set bitfields with | and |=, like
+ *   MyEnumType value = FLAG1 | FLAG2;
+ * and test them with &, like:
+ *   if( myFlag & FLAG2 )
+ *    // do something
+ */
+template< typename Enum >
+struct EnableBitMaskOperators
+{
+  static const bool ENABLE = false; // can't be constexpr as it's a data member
+};
+
+/**
+ * Combine two bitfields
+ * @param lhs bitfield to or
+ * @param rhs bitfield to or
+ * @return EnumType with both flags set
+ */
+template < typename EnumType >
+inline typename std::enable_if< EnableBitMaskOperators< EnumType >::ENABLE, EnumType >::type operator|( EnumType lhs, EnumType rhs )
+{
+  using UnderlyingType = typename std::underlying_type<EnumType>::type;
+  return static_cast<EnumType>( static_cast<UnderlyingType>( lhs ) | static_cast<UnderlyingType>(rhs ) );
+}
+
+/**
+ * Combine two bitfields
+ * @param lhs bitfield to or
+ * @param rhs bitfield to or
+ * @return reference to lhs with both flags set
+ */
+template < typename EnumType >
+inline typename std::enable_if< EnableBitMaskOperators< EnumType >::ENABLE, EnumType& >::type operator|=( EnumType& lhs, EnumType rhs )
+{
+  using UnderlyingType = typename std::underlying_type<EnumType>::type;
+  lhs = static_cast<EnumType>(static_cast<UnderlyingType>( lhs ) | static_cast<UnderlyingType>( rhs ) );
+  return lhs;
+}
+
+/**
+ * Test two bitfields.
+ * @param lhs bitfield to AND
+ * @param rhs bitfield to AND
+ * @return true if at least one flag is same in both
+ */
+template < typename EnumType >
+inline typename std::enable_if< EnableBitMaskOperators< EnumType >::ENABLE, bool >::type operator&( EnumType lhs, EnumType rhs )
+{
+  using UnderlyingType = typename std::underlying_type<EnumType>::type;
+  return static_cast<bool>( static_cast<UnderlyingType>( lhs ) & static_cast<UnderlyingType>(rhs ) );
+}
+
+} // namespace Dali
+
+#endif // DALI_BITWISE_ENUM_H
index dc363c1..c02dd39 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_MAP_H__
-#define __DALI_MAP_H__
+#ifndef DALI_MAP_WRAPPER_H
+#define DALI_MAP_WRAPPER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-
-
 #ifndef HIDE_DALI_INTERNALS
 
-# include <map>
+#include <map>
 
 #else
 
+// Ensure that default visibility is used with any class that is used as an exception type
+#include <memory>
+#include <new>
+#include <stdexcept>
+
 #if defined(__clang__)
 
 #undef _LIBCPP_INLINE_VISIBILITY
 
 #else
 
-// ensure that default visibility is used with any class that is used as an exception type
-# include <memory>
-# include <new>
-# include <stdexcept>
-
-# include <bits/c++config.h>
-# include <bits/stl_tree.h>
-# undef _GLIBCXX_VISIBILITY_ATTR
-# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden")))
-# include <map>
-# undef _GLIBCXX_VISIBILITY_ATTR
-# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR`
-
-#endif //ifdef __clang__
+#include <bits/c++config.h>
+#include <bits/stl_tree.h>
+#undef _GLIBCXX_VISIBILITY_ATTR
+#undef _GLIBCXX_VISIBILITY
+#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden")))
+#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ ("hidden")))
+#include <map>
+#undef _GLIBCXX_VISIBILITY_ATTR
+#undef _GLIBCXX_VISIBILITY
+#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR`
+#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY`
 
-#endif //ifndef HIDE_DALI_INTERNALS
+#endif // #ifdef __clang__
 
+#endif // #ifndef HIDE_DALI_INTERNALS
 
-#endif /* __DALI_MAP_H__ */
+#endif // DALI_MAP_WRAPPER_H
index e2eb2a3..13ad9f1 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_SET_H__
-#define __DALI_SET_H__
+#ifndef DALI_SET_WRAPPER_H
+#define DALI_SET_WRAPPER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-
-// EXTERNAL INCLUDES
-
 #ifndef HIDE_DALI_INTERNALS
 
-# include <set>
+#include <set>
 
 #else
 
+// Ensure that default visibility is used with any class that is used as an exception type
+#include <memory>
+#include <new>
+#include <stdexcept>
+
 #if defined(__clang__)
 
 #undef _LIBCPP_INLINE_VISIBILITY
 
 #else
 
+#include <bits/c++config.h>
+#include <bits/stl_tree.h>
+#undef _GLIBCXX_VISIBILITY_ATTR
+#undef _GLIBCXX_VISIBILITY
+#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden")))
+#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ ("hidden")))
+#include <set>
+#undef _GLIBCXX_VISIBILITY_ATTR
+#undef _GLIBCXX_VISIBILITY
+#define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR`
+#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY`
 
-// ensure that default visibility is used with any class that is used as an exception type
-# include <memory>
-# include <new>
-# include <stdexcept>
-
-
-# include <bits/c++config.h>
-# include <bits/stl_tree.h>
-# undef _GLIBCXX_VISIBILITY_ATTR
-# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden")))
-# include <set>
-# undef _GLIBCXX_VISIBILITY_ATTR
-# define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR`
-
-#endif //ifdef __clang__
+#endif // #ifdef __clang__
 
-#endif //ifndef HIDE_DALI_INTERNALS
+#endif // #ifndef HIDE_DALI_INTERNALS
 
-#endif /* __DALI_SET_H__ */
+#endif // DALI_SET_WRAPPER_H
index d68a5a0..0046d40 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,6 +30,26 @@ KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Dali::Stage stage )
   return GetImplementation( stage ).KeyEventGeneratedSignal();
 }
 
+void SetRenderingBehavior( Dali::Stage stage, Rendering renderingBehavior )
+{
+  GetImplementation( stage ).SetRenderingBehavior( renderingBehavior );
+}
+
+Rendering GetRenderingBehavior( Dali::Stage stage )
+{
+  return GetImplementation( stage ).GetRenderingBehavior();
+}
+
+void AddFrameCallback( Dali::Stage stage, FrameCallbackInterface& frameCallback, Actor rootActor )
+{
+  GetImplementation( stage ).AddFrameCallback( frameCallback, GetImplementation( rootActor ) );
+}
+
+void RemoveFrameCallback( Dali::Stage stage, FrameCallbackInterface& frameCallback )
+{
+  GetImplementation( stage ).RemoveFrameCallback( frameCallback );
+}
+
 } // namespace DevelStage
 
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index 017797e..1ac8f20
 namespace Dali
 {
 
+class FrameCallbackInterface;
+
 namespace DevelStage
 {
 
+/**
+ * @brief The DALi rendering behavior.
+ */
+enum class Rendering
+{
+  IF_REQUIRED,  ///< Default. Will only render if required to do so.
+  CONTINUOUSLY, ///< Will render continuously.
+};
+
 typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType;      ///< Stage key event generated signal type
 
 /**
@@ -37,6 +48,50 @@ typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType;      ///<
  */
 DALI_CORE_API KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Dali::Stage stage );
 
+/**
+ * @brief Gives the user the ability to set the rendering behavior of DALi.
+ *
+ * @param[in] stage The stage
+ * @param[in] renderingBehavior The rendering behavior required.
+ *
+ * @note By default, DALi uses Rendering::IF_REQUIRED.
+ * @see Rendering
+ */
+DALI_CORE_API void SetRenderingBehavior( Dali::Stage stage, Rendering renderingBehavior );
+
+/**
+ * @brief Retrieves the rendering behavior of DALi.
+ *
+ * @param[in] stage The stage
+ * @return The rendering behavior of DALi.
+ */
+DALI_CORE_API Rendering GetRenderingBehavior( Dali::Stage stage );
+
+/*
+ * @brief The FrameCallbackInterface implementation added gets called on every frame from the update-thread.
+ *
+ * @param[in] stage The stage to set the FrameCallbackInterface implementation on
+ * @param[in] frameCallback An implementation of the FrameCallbackInterface
+ * @param[in] rootActor The root-actor in the scene that the callback applies to
+ *
+ * @note The frameCallback cannot be added more than once. This will assert if that is attempted.
+ * @note Only the rootActor and it's children will be parsed by the UpdateProxy.
+ * @note If the rootActor is destroyed, then the callback is automatically removed
+ * @see FrameCallbackInterface
+ */
+DALI_CORE_API void AddFrameCallback( Dali::Stage stage, FrameCallbackInterface& frameCallback, Actor rootActor );
+
+/**
+ * @brief Removes the specified FrameCallbackInterface implementation from being called on every frame.
+ *
+ * @param[in] stage The stage to clear the FrameCallbackInterface on
+ * @param[in] frameCallback The FrameCallbackInterface implementation to remove
+ *
+ * @note This function will block if the FrameCallbackInterface::Update method is being processed in the update-thread.
+ * @note If the callback implementation has already been removed, then this is a no-op.
+ */
+DALI_CORE_API void RemoveFrameCallback( Dali::Stage stage, FrameCallbackInterface& frameCallback );
+
 } // namespace DevelStage
 
 } // namespace Dali
index 666143c..70377fe 100644 (file)
@@ -21,6 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/internal/event/events/hit-test-algorithm-impl.h>
 #include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
@@ -31,13 +32,8 @@ namespace HitTestAlgorithm
 
 bool HitTest( Stage stage, const Vector2& screenCoordinates, Results& results, HitTestFunction func )
 {
-  return Internal::HitTestAlgorithm::HitTest( GetImplementation(stage), screenCoordinates, results, func );
-}
-
-bool HitTest( RenderTask& renderTask, const Vector2& screenCoordinates, Results& results, HitTestFunction func )
-{
-  Stage stage = Stage::GetCurrent();
-  return Internal::HitTestAlgorithm::HitTest( GetImplementation( stage ), GetImplementation(renderTask), screenCoordinates, results, func );
+  Internal::Stage& stageImpl = GetImplementation( stage );
+  return Internal::HitTestAlgorithm::HitTest( stageImpl.GetSize(), stageImpl.GetRenderTaskList(), stageImpl.GetLayerList(), screenCoordinates, results, func );
 }
 
 } // namespace HitTestAlgorithm
index 20dfc22..f3b5774 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/common/stage.h>
+#include <dali/integration-api/scene.h>
 
 
 namespace Dali
@@ -145,17 +146,6 @@ typedef bool (*HitTestFunction)(Actor actor, TraverseType type);
  */
 DALI_CORE_API bool HitTest( Stage stage, const Vector2& screenCoordinates, Results& results, HitTestFunction func );
 
-/**
- * @brief Hit test specific to a given RenderTask.
- *
- * @param[in] renderTask The render task for hit test
- * @param[in] screenCoordinates The screen coordinates.
- * @param[out] results The results of the hit-test, only modified if something is hit
- * @param[in] func The function to use in the hit-test algorithm.
- * @return true if something was hit
- */
-DALI_CORE_API bool HitTest( RenderTask& renderTask, const Vector2& screenCoordinates, Results& results, HitTestFunction func );
-
 } // namespace HitTestAlgorithm
 
 } // namespace Dali
diff --git a/dali/devel-api/events/touch-data-devel.cpp b/dali/devel-api/events/touch-data-devel.cpp
new file mode 100755 (executable)
index 0000000..e9a953d
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/events/touch-data.h>
+#include <dali/public-api/events/touch-event.h>
+#include <dali/devel-api/events/touch-data-devel.h>
+#include <dali/internal/event/events/touch-data-impl.h>
+
+namespace Dali
+{
+
+namespace DevelTouchData
+{
+
+TouchData Convert( const TouchEvent& touchEvent )
+{
+  Internal::TouchDataPtr touchDataImpl( new Internal::TouchData(touchEvent.time ) );
+
+  for( auto&& touchEventPoint : touchEvent.points )
+  {
+    touchDataImpl->AddPoint( Integration::Point( touchEventPoint ) );
+  }
+
+  return TouchData( touchDataImpl.Get() );
+}
+
+} // namespace DevelTouchData
+
+} // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
similarity index 53%
rename from dali/graphics/vulkan/vulkan-hpp-wrapper.h
rename to dali/devel-api/events/touch-data-devel.h
index 7fc38bf..c63dc2d
@@ -1,8 +1,8 @@
-#ifndef DALI_GRAPHICS_VULKAN_HPP_WRAPPER_H
-#define DALI_GRAPHICS_VULKAN_HPP_WRAPPER_H
+#ifndef DALI_TOUCH_DATA_DEVEL_H
+#define DALI_TOUCH_DATA_DEVEL_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-// Vulkan without exceptions
-#ifndef VULKAN_HPP_NO_EXCEPTIONS
-#define VULKAN_HPP_NO_EXCEPTIONS
-#endif
+namespace Dali
+{
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wfloat-equal"
-#pragma GCC diagnostic ignored "-Wswitch-enum"
-#include <vulkan/vulkan.hpp>
-#pragma GCC diagnostic pop
+class TouchData;
+struct TouchEvent;
 
-#endif // DALI_GRAPHICS_VULKAN_HPP_WRAPPER_H
+namespace DevelTouchData
+{
+
+/**
+ * @brief Convert TouchEvent to TouchData.
+ *
+ * @return The TouchData convert from Dali::TouchEvent
+ *
+ * @note Use this API with caution.
+*/
+DALI_CORE_API TouchData Convert( const TouchEvent& touchEvent );
+
+} // namespace DevelTouchData
+
+} // namespace Dali
+
+
+
+#endif // DALI_TOUCH_DATA_DEVEL_H
old mode 100644 (file)
new mode 100755 (executable)
index 55cbf67..d8e4944
+# Set the source directory
+SET( devel_api_src_dir ${ROOT_SRC_DIR}/dali/devel-api )
+
 # Add devel source files here for DALi internal developer files used by Adaptor & Toolkit
-devel_api_src_files = \
-  $(devel_api_src_dir)/actors/actor-devel.cpp \
-  $(devel_api_src_dir)/rendering/shader-devel.cpp \
-  $(devel_api_src_dir)/actors/custom-actor-devel.cpp \
-  $(devel_api_src_dir)/animation/animation-data.cpp \
-  $(devel_api_src_dir)/animation/animation-devel.cpp \
-  $(devel_api_src_dir)/animation/path-constrainer.cpp \
-  $(devel_api_src_dir)/common/hash.cpp \
-  $(devel_api_src_dir)/common/stage-devel.cpp \
-  $(devel_api_src_dir)/events/hit-test-algorithm.cpp \
-  $(devel_api_src_dir)/images/distance-field.cpp \
-  $(devel_api_src_dir)/images/texture-set-image.cpp \
-  $(devel_api_src_dir)/images/nine-patch-image.cpp \
-  $(devel_api_src_dir)/images/pixel-data-devel.cpp \
-  $(devel_api_src_dir)/object/handle-devel.cpp \
-  $(devel_api_src_dir)/object/csharp-type-registry.cpp \
-  $(devel_api_src_dir)/scripting/scripting.cpp \
-  $(devel_api_src_dir)/signals/signal-delegate.cpp \
-  $(devel_api_src_dir)/threading/conditional-wait.cpp \
-  $(devel_api_src_dir)/threading/mutex.cpp \
-  $(devel_api_src_dir)/threading/thread.cpp
+SET( devel_api_src_files
+  ${devel_api_src_dir}/actors/actor-devel.cpp
+  ${devel_api_src_dir}/rendering/shader-devel.cpp
+  ${devel_api_src_dir}/actors/custom-actor-devel.cpp
+  ${devel_api_src_dir}/animation/animation-data.cpp
+  ${devel_api_src_dir}/animation/animation-devel.cpp
+  ${devel_api_src_dir}/animation/path-constrainer.cpp
+  ${devel_api_src_dir}/common/hash.cpp
+  ${devel_api_src_dir}/common/stage-devel.cpp
+  ${devel_api_src_dir}/events/hit-test-algorithm.cpp
+  ${devel_api_src_dir}/events/touch-data-devel.cpp
+  ${devel_api_src_dir}/images/distance-field.cpp
+  ${devel_api_src_dir}/images/texture-set-image.cpp
+  ${devel_api_src_dir}/images/nine-patch-image.cpp
+  ${devel_api_src_dir}/images/pixel-data-devel.cpp
+  ${devel_api_src_dir}/object/handle-devel.cpp
+  ${devel_api_src_dir}/object/csharp-type-registry.cpp
+  ${devel_api_src_dir}/scripting/scripting.cpp
+  ${devel_api_src_dir}/signals/signal-delegate.cpp
+  ${devel_api_src_dir}/threading/conditional-wait.cpp
+  ${devel_api_src_dir}/threading/mutex.cpp
+  ${devel_api_src_dir}/threading/thread.cpp
+  ${devel_api_src_dir}/threading/thread-pool.cpp
+  ${devel_api_src_dir}/update/frame-callback-interface.cpp
+  ${devel_api_src_dir}/update/update-proxy.cpp
+)
 
 # Add devel header files here DALi internal developer files used by Adaptor & Toolkit
+SET( devel_api_core_actors_header_files
+  ${devel_api_src_dir}/actors/actor-devel.h
+  ${devel_api_src_dir}/actors/custom-actor-devel.h
+  ${devel_api_src_dir}/actors/layer-devel.h
+)
+
+SET( devel_api_core_animation_header_files
+  ${devel_api_src_dir}/animation/animation-data.h
+  ${devel_api_src_dir}/animation/path-constrainer.h
+  ${devel_api_src_dir}/animation/animation-devel.h
+)
+
+SET( devel_api_core_common_header_files
+  ${devel_api_src_dir}/common/bitwise-enum.h
+  ${devel_api_src_dir}/common/circular-queue.h
+  ${devel_api_src_dir}/common/hash.h
+  ${devel_api_src_dir}/common/map-wrapper.h
+  ${devel_api_src_dir}/common/owner-container.h
+  ${devel_api_src_dir}/common/ref-counted-dali-vector.h
+  ${devel_api_src_dir}/common/set-wrapper.h
+  ${devel_api_src_dir}/common/stage-devel.h
+)
+
+SET(devel_api_core_events_header_files
+  ${devel_api_src_dir}/events/hit-test-algorithm.h
+  ${devel_api_src_dir}/events/touch-data-devel.h
+)
 
-devel_api_core_actors_header_files = \
-  $(devel_api_src_dir)/actors/actor-devel.h \
-  $(devel_api_src_dir)/actors/custom-actor-devel.h \
-  $(devel_api_src_dir)/actors/layer-devel.h
+SET(devel_api_core_images_header_files
+  ${devel_api_src_dir}/images/distance-field.h
+  ${devel_api_src_dir}/images/native-image-interface-extension.h
+  ${devel_api_src_dir}/images/nine-patch-image.h
+  ${devel_api_src_dir}/images/texture-set-image.h
+  ${devel_api_src_dir}/images/pixel-data-devel.h
+)
 
-devel_api_core_animation_header_files = \
-  $(devel_api_src_dir)/animation/animation-data.h \
-  $(devel_api_src_dir)/animation/path-constrainer.h \
-  $(devel_api_src_dir)/animation/animation-devel.h
+SET( devel_api_core_object_header_files
+  ${devel_api_src_dir}/object/csharp-type-info.h
+  ${devel_api_src_dir}/object/csharp-type-registry.h
+  ${devel_api_src_dir}/object/handle-devel.h
+  ${devel_api_src_dir}/object/property-helper-devel.h
+)
 
-devel_api_core_common_header_files = \
-  $(devel_api_src_dir)/common/circular-queue.h \
-  $(devel_api_src_dir)/common/hash.h \
-  $(devel_api_src_dir)/common/map-wrapper.h \
-  $(devel_api_src_dir)/common/owner-container.h \
-  $(devel_api_src_dir)/common/ref-counted-dali-vector.h \
-  $(devel_api_src_dir)/common/set-wrapper.h \
-  $(devel_api_src_dir)/common/stage-devel.h
+SET(devel_api_core_rendering_header_files
+  ${devel_api_src_dir}/rendering/renderer-devel.h
+  ${devel_api_src_dir}/rendering/shader-devel.h
+)
 
-devel_api_core_events_header_files = \
-  $(devel_api_src_dir)/events/hit-test-algorithm.h
+SET(devel_api_core_signals_header_files
+  ${devel_api_src_dir}/signals/signal-delegate.h
+)
 
-devel_api_core_images_header_files = \
-  $(devel_api_src_dir)/images/distance-field.h \
-  $(devel_api_src_dir)/images/native-image-interface-extension.h \
-  $(devel_api_src_dir)/images/nine-patch-image.h \
-  $(devel_api_src_dir)/images/texture-set-image.h \
-  $(devel_api_src_dir)/images/pixel-data-devel.h
+SET(devel_api_core_scripting_header_files
+  ${devel_api_src_dir}/scripting/enum-helper.h
+  ${devel_api_src_dir}/scripting/scripting.h
+)
 
-devel_api_core_object_header_files = \
-  $(devel_api_src_dir)/object/csharp-type-info.h \
-  $(devel_api_src_dir)/object/csharp-type-registry.h \
-  $(devel_api_src_dir)/object/handle-devel.h \
-  $(devel_api_src_dir)/object/property-helper-devel.h
+SET(devel_api_core_threading_header_files
+  ${devel_api_src_dir}/threading/conditional-wait.h
+  ${devel_api_src_dir}/threading/mutex.h
+  ${devel_api_src_dir}/threading/thread.h
+  ${devel_api_src_dir}/threading/thread-pool.h
+)
 
-devel_api_core_rendering_header_files = \
-  $(devel_api_src_dir)/rendering/renderer-devel.h \
-  $(devel_api_src_dir)/rendering/shader-devel.h
+SET(devel_api_core_update_header_files
+  ${devel_api_src_dir}/update/frame-callback-interface.h
+  ${devel_api_src_dir}/update/update-proxy.h
+)
 
-devel_api_core_signals_header_files = \
-  $(devel_api_src_dir)/signals/signal-delegate.h
 
-devel_api_core_scripting_header_files = \
-  $(devel_api_src_dir)/scripting/enum-helper.h \
-  $(devel_api_src_dir)/scripting/scripting.h
+SET( SOURCES ${SOURCES}
+  ${devel_api_src_files}
+)
 
-devel_api_core_threading_header_files = \
-  $(devel_api_src_dir)/threading/conditional-wait.h \
-  $(devel_api_src_dir)/threading/mutex.h \
-  $(devel_api_src_dir)/threading/thread.h
+SET( DEVEL_API_HEADERS ${DEVEL_API_HEADERS}
+  ${devel_api_core_actors_header_files}
+  ${devel_api_core_animation_header_files}
+  ${devel_api_core_common_header_files}
+  ${devel_api_core_events_header_files}
+  ${devel_api_core_images_header_files}
+  ${devel_api_core_object_header_files}
+  ${devel_api_core_rendering_header_files}
+  ${devel_api_core_signals_header_files}
+  ${devel_api_core_scripting_header_files}
+  ${devel_api_core_threading_header_files}
+  ${devel_api_core_update_header_files}
+)
old mode 100644 (file)
new mode 100755 (executable)
index 6e4346d..7c2a524
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,24 +46,24 @@ float Bilinear( float a, float b, float c, float d, float dx, float dy )
   return Interpolate( Interpolate( a, b, dx), Interpolate( c, d, dx ), dy );
 }
 
-void ScaleField( int width, int height, float* in, int targetWidth, int targetHeight, float* out )
+void ScaleField( int width, int height, float* in, uint32_t targetWidth, uint32_t targetHeight, float* out )
 {
-  float xScale = static_cast< float >(width) / targetWidth;
-  float yScale = static_cast< float >(height) / targetHeight;
+  float xScale = static_cast<float>( width ) / static_cast<float>( targetWidth );
+  float yScale = static_cast<float>( height ) / static_cast<float>( targetHeight );
 
   // for each row in target
-  for(int y = 0; y < targetHeight; ++y)
+  for(uint32_t y = 0; y < targetHeight; ++y)
   {
-    const int sampleY = static_cast< int >( yScale * y );
-    const int otherY = std::min( sampleY + 1, height - 1 );
-    const float dy = (yScale * y ) - sampleY;
+    const int32_t sampleY = static_cast< int32_t >( yScale * static_cast<float>( y ) );
+    const int32_t otherY = std::min( sampleY + 1, height - 1 );
+    const float dy = (yScale * static_cast<float>( y ) ) - static_cast<float>( sampleY );
 
     // for each column in target
-    for (int x = 0; x < targetWidth; ++x)
+    for (uint32_t x = 0; x < targetWidth; ++x)
     {
-      const int sampleX = static_cast< int >( xScale * x );
-      const int otherX = std::min( sampleX + 1, width - 1 );
-      const float dx = (xScale * x) - sampleX;
+      const int32_t sampleX = static_cast< int32_t >( xScale * static_cast<float>( x ) );
+      const int32_t otherX = std::min( sampleX + 1, width - 1 );
+      const float dx = (xScale * static_cast<float>( x ) ) - static_cast<float>( sampleX );
 
       float value = Bilinear( in[ sampleY * width + sampleX ],
                               in[ sampleY * width + otherX ],
@@ -77,30 +77,31 @@ void ScaleField( int width, int height, float* in, int targetWidth, int targetHe
 }
 
 #define SQUARE(a) ((a) * (a))
-const float MAX_DISTANCE( 1e20 );
+const float MAX_DISTANCE = static_cast<float>( 1e20 );
 
 /**
  * Distance transform of 1D function using squared distance
  */
-void DistanceTransform( float *source, float* dest, unsigned int length )
+void DistanceTransform( float *source, float* dest, uint32_t length )
 {
-  int parabolas[length];    // Locations of parabolas in lower envelope
-  float edge[length + 1];   // Locations of boundaries between parabolas
-  int rightmost(0);         // Index of rightmost parabola in lower envelope
+  std::vector<int32_t> parabolas(length);    // Locations of parabolas in lower envelope
+  std::vector<float> edge(length + 1);   // Locations of boundaries between parabolas
+
+  int32_t rightmost(0);         // Index of rightmost parabola in lower envelope
 
   parabolas[0] = 0;
   edge[0] = -MAX_DISTANCE;
   edge[1] = +MAX_DISTANCE;
-  for( unsigned int i = 1; i <= length - 1; i++ )
+  for( uint32_t i = 1; i <= length - 1; i++ )
   {
-    const float initialDistance( source[i] + SQUARE( i ) );
-    int parabola = parabolas[rightmost];
-    float newDistance( (initialDistance - (source[parabola] + SQUARE( parabola ))) / (2 * i - 2 * parabola) );
+    const float initialDistance( source[i] + static_cast<float>( i*i ) );
+    int32_t parabola = parabolas[rightmost];
+    float newDistance( (initialDistance - (source[parabola] + static_cast<float>( parabola * parabola ))) / static_cast<float>(2 * i - 2 * parabola) );
     while( rightmost > 0 && newDistance <= edge[rightmost] )
     {
       rightmost--;
       parabola = parabolas[rightmost];
-      newDistance = (initialDistance - (source[parabola] + SQUARE( parabola ))) / (2 * i - 2 * parabola);
+      newDistance = (initialDistance - (source[parabola] + static_cast<float>( parabola * parabola ))) / static_cast<float>(2 * i - 2 * parabola);
     }
 
     rightmost++;
@@ -110,48 +111,48 @@ void DistanceTransform( float *source, float* dest, unsigned int length )
   }
 
   rightmost = 0;
-  for( unsigned int i = 0; i <= length - 1; ++i )
+  for( uint32_t i = 0; i <= length - 1; ++i )
   {
-    while( edge[rightmost + 1] < i )
+    while( edge[rightmost + 1] < static_cast<float>( i ) )
     {
       ++rightmost;
     }
-    dest[i] = SQUARE( static_cast< int >( i ) - parabolas[rightmost] ) + source[parabolas[rightmost]];
+    dest[i] = static_cast<float>( SQUARE( static_cast< int32_t >( i ) - parabolas[rightmost] ) ) + source[parabolas[rightmost]];
   }
 }
 
 /**
  * Distance transform of 2D function using squared distance
  */
-void DistanceTransform( float* data, unsigned int width, unsigned int height, float* sourceBuffer, float* destBuffer )
+void DistanceTransform( float* data, uint32_t width, uint32_t height, float* sourceBuffer, float* destBuffer )
 {
   // transform along columns
-  for( unsigned int x = 0; x < width; ++x )
+  for( uint32_t x = 0; x < width; ++x )
   {
-    for( unsigned int y = 0; y < height; ++y )
+    for( uint32_t y = 0; y < height; ++y )
     {
       sourceBuffer[y] = data[ y * width + x ];
     }
 
     DistanceTransform( sourceBuffer, destBuffer, height );
 
-    for( unsigned int y = 0; y < height; y++ )
+    for( uint32_t y = 0; y < height; y++ )
     {
       data[y * width + x] = destBuffer[y];
     }
   }
 
   // transform along rows
-  for( unsigned int y = 0; y < height; ++y )
+  for( uint32_t y = 0; y < height; ++y )
   {
-    for( unsigned int x = 0; x < width; ++x )
+    for( uint32_t x = 0; x < width; ++x )
     {
       sourceBuffer[x] = data[ y * width + x ];
     }
 
     DistanceTransform( sourceBuffer, destBuffer, width );
 
-    for( unsigned int x = 0; x < width; x++ )
+    for( uint32_t x = 0; x < width; x++ )
     {
       data[y * width + x] = destBuffer[x];
     }
@@ -160,31 +161,31 @@ void DistanceTransform( float* data, unsigned int width, unsigned int height, fl
 
 } // namespace
 
-void GenerateDistanceFieldMap(const unsigned char* const imagePixels, const Size& imageSize,
-                              unsigned char* const distanceMap, const Size& distanceMapSize,
-                              const float fieldRadius, const unsigned int fieldBorder, bool highQuality)
+void GenerateDistanceFieldMap(const uint8_t* const imagePixels, const Size& imageSize,
+                              uint8_t* const distanceMap, const Size& distanceMapSize,
+                              const float fieldRadius, const uint32_t fieldBorder, bool highQuality)
 {
   GenerateDistanceFieldMap( imagePixels, imageSize, distanceMap, distanceMapSize, fieldBorder, imageSize, highQuality );
 }
 
-void GenerateDistanceFieldMap(const unsigned char* const imagePixels, const Size& imageSize,
-                              unsigned char* const distanceMap, const Size& distanceMapSize,
-                              const unsigned int fieldBorder,
-                              const Vector2& maxSize,
-                              bool highQuality)
+void GenerateDistanceFieldMap( const uint8_t* const imagePixels, const Size& imageSize,
+                               uint8_t* const distanceMap, const Size& distanceMapSize,
+                               const uint32_t fieldBorder,
+                               const Vector2& maxSize,
+                               bool highQuality )
 {
   // constants to reduce redundant calculations
-  const int originalWidth( static_cast<int>(imageSize.width) );
-  const int originalHeight( static_cast<int>(imageSize.height) );
-  const int paddedWidth( originalWidth + (fieldBorder * 2 ) );
-  const int paddedHeight( originalHeight + (fieldBorder * 2 ) );
-  const int scaledWidth( static_cast<int>(distanceMapSize.width) );
-  const int scaledHeight( static_cast<int>(distanceMapSize.height) );
-  const int maxWidth( static_cast<int>(maxSize.width) + (fieldBorder * 2 ));
-  const int maxHeight( static_cast<int>(maxSize.height) + (fieldBorder * 2 ) );
-
-  const int bufferLength( std::max( maxWidth, std::max(paddedWidth, scaledWidth) ) *
-                          std::max( maxHeight, std::max(paddedHeight, scaledHeight) ) );
+  const uint32_t originalWidth( static_cast<int32_t>(imageSize.width) );
+  const uint32_t originalHeight( static_cast<int32_t>(imageSize.height) );
+  const uint32_t paddedWidth( originalWidth + (fieldBorder * 2 ) );
+  const uint32_t paddedHeight( originalHeight + (fieldBorder * 2 ) );
+  const uint32_t scaledWidth( static_cast<int32_t>(distanceMapSize.width) );
+  const uint32_t scaledHeight( static_cast<int32_t>(distanceMapSize.height) );
+  const uint32_t maxWidth( static_cast<int32_t>(maxSize.width) + (fieldBorder * 2 ));
+  const uint32_t maxHeight( static_cast<int32_t>(maxSize.height) + (fieldBorder * 2 ) );
+
+  const uint32_t bufferLength( std::max( maxWidth, std::max(paddedWidth, scaledWidth) ) *
+                               std::max( maxHeight, std::max(paddedHeight, scaledHeight) ) );
 
   std::vector<float> outsidePixels( bufferLength, 0.0f );
   std::vector<float> insidePixels( bufferLength, 0.0f );
@@ -192,21 +193,21 @@ void GenerateDistanceFieldMap(const unsigned char* const imagePixels, const Size
   float* outside( outsidePixels.data() );
   float* inside( insidePixels.data() );
 
-  for( int y = 0; y < paddedHeight; ++y )
+  for( uint32_t y = 0; y < paddedHeight; ++y )
   {
-    for ( int x = 0; x < paddedWidth; ++x)
+    for ( uint32_t x = 0; x < paddedWidth; ++x)
     {
-      if( y < static_cast< int >( fieldBorder ) || y >= ( paddedHeight - static_cast< int >( fieldBorder ) ) ||
-          x < static_cast< int >( fieldBorder ) || x >= ( paddedWidth - static_cast< int >( fieldBorder ) ) )
+      if( y < static_cast< uint32_t >( fieldBorder ) || y >= ( paddedHeight - static_cast< uint32_t >( fieldBorder ) ) ||
+          x < static_cast< uint32_t >( fieldBorder ) || x >= ( paddedWidth - static_cast< uint32_t >( fieldBorder ) ) )
       {
         outside[ y * paddedWidth + x ] = MAX_DISTANCE;
         inside[ y * paddedWidth + x ] = 0.0f;
       }
       else
       {
-        unsigned int pixel( imagePixels[ (y - fieldBorder) * originalWidth + (x - fieldBorder) ] );
-        outside[ y * paddedWidth + x ] = (pixel == 0) ? MAX_DISTANCE : SQUARE((255 - pixel) / 255.0f);
-        inside[ y * paddedWidth + x ] = (pixel == 255) ? MAX_DISTANCE : SQUARE(pixel / 255.0f);
+        uint32_t pixel( imagePixels[ (y - fieldBorder) * originalWidth + (x - fieldBorder) ] );
+        outside[ y * paddedWidth + x ] = (pixel == 0) ? MAX_DISTANCE : SQUARE( static_cast<float>(255 - pixel) / 255.0f);
+        inside[ y * paddedWidth + x ] = (pixel == 255) ? MAX_DISTANCE : SQUARE( static_cast<float>(pixel) / 255.0f);
       }
     }
   }
@@ -215,7 +216,7 @@ void GenerateDistanceFieldMap(const unsigned char* const imagePixels, const Size
   if( highQuality )
   {
     // create temporary buffers for DistanceTransform()
-    const int tempBufferLength( std::max(paddedWidth, paddedHeight) );
+    const uint32_t tempBufferLength( std::max(paddedWidth, paddedHeight) );
     std::vector<float> tempSourceBuffer( tempBufferLength, 0.0f );
     std::vector<float> tempDestBuffer( tempBufferLength, 0.0f );
 
@@ -227,11 +228,11 @@ void GenerateDistanceFieldMap(const unsigned char* const imagePixels, const Size
   }
 
   // distmap = outside - inside; % Bipolar distance field
-  for( int y = 0; y < paddedHeight; ++y)
+  for( uint32_t y = 0; y < paddedHeight; ++y)
   {
-    for( int x = 0; x < paddedWidth; ++x )
+    for( uint32_t x = 0; x < paddedWidth; ++x )
     {
-      const int offset( y * paddedWidth + x );
+      const int32_t offset( y * paddedWidth + x );
       float pixel( sqrtf(outside[offset]) - sqrtf(inside[offset]) );
       pixel = 128.0f + pixel * 16.0f;
       pixel = Clamp( pixel, 0.0f, 255.0f );
@@ -243,12 +244,12 @@ void GenerateDistanceFieldMap(const unsigned char* const imagePixels, const Size
   ScaleField( paddedWidth, paddedHeight, outside, scaledWidth, scaledHeight, inside );
 
   // convert from floats to integers
-  for( int y = 0; y < scaledHeight; ++y )
+  for( uint32_t y = 0; y < scaledHeight; ++y )
   {
-    for( int x = 0; x < scaledWidth; ++x )
+    for( uint32_t x = 0; x < scaledWidth; ++x )
     {
       float pixel( inside[ y * scaledWidth + x ] );
-      distanceMap[y * scaledWidth + x ] = static_cast< unsigned char >(pixel * 255.0f);
+      distanceMap[y * scaledWidth + x ] = static_cast< uint8_t >(pixel * 255.0f);
     }
   }
 }
index 51ca056..3b802eb 100644 (file)
@@ -18,6 +18,8 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint8_t, uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -39,11 +41,11 @@ struct Vector2;
  * @param[in]  maxSize         The image is scaled from this size to distanceMapSize
  * @param[in]  highQuality     Set true to generate high quality distance fields
  */
-DALI_CORE_API void GenerateDistanceFieldMap( const unsigned char* const imagePixels, const Vector2& imageSize,
-                                               unsigned char* const distanceMap, const Vector2& distanceMapSize,
-                                               const unsigned int fieldBorder,
-                                               const Vector2& maxSize,
-                                               bool highQuality = true);
+DALI_CORE_API void GenerateDistanceFieldMap( const uint8_t* const imagePixels, const Vector2& imageSize,
+                                             uint8_t* const distanceMap, const Vector2& distanceMapSize,
+                                             const uint32_t fieldBorder,
+                                             const Vector2& maxSize,
+                                             bool highQuality = true );
 
 } //namespace Dali
 
index dfc60d4..c475012 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include <dali/public-api/images/native-image-interface.h>
+#include <dali/public-api/object/any.h>
 
 namespace Dali
 {
@@ -55,6 +56,20 @@ public:
   virtual int GetEglImageTextureTarget() = 0;
 
   /**
+   * @brief Retrieves the internal native image.
+   *
+   * @return Any object containing the internal native image source
+   */
+  virtual Any GetNativeImageHandle() const = 0;
+
+  /**
+   * @brief Retrieves the internal native image.
+   *
+   * @return Any object containing the internal native image source
+   */
+  virtual bool IsSetSource() const = 0;
+
+  /**
    * @brief Retrieve the extension for the interface.
    *
    * @return Extension2 pointer if available, NULL otherwise
index 551c25d..dd7dbc5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -72,10 +72,10 @@ Vector4 NinePatchImage::GetStretchBorders()
   if( stretchPixelsX.Size() > 0 && stretchPixelsY.Size() > 0 )
   {
     //The NinePatchImage stretch pixels are in the cropped image space, inset by 1 to get it to uncropped image space
-    border.x = stretchPixelsX[ 0 ].GetX() + 1;
-    border.y = stretchPixelsY[ 0 ].GetX() + 1;
-    border.z = GetWidth() - stretchPixelsX[ 0 ].GetY() - 1;
-    border.w = GetHeight() - stretchPixelsY[ 0 ].GetY() - 1;
+    border.x = static_cast<float>( stretchPixelsX[ 0 ].GetX() + 1 );
+    border.y = static_cast<float>( stretchPixelsY[ 0 ].GetX() + 1 );
+    border.z = static_cast<float>( GetWidth() - stretchPixelsX[ 0 ].GetY() - 1 );
+    border.w = static_cast<float>( GetHeight() - stretchPixelsY[ 0 ].GetY() - 1 );
   }
 
   return border;
index 41dafa3..eb0ac1f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 506efb7..8400a97 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PIXEL_DATA_DEVEL_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-// INTERNAL INCLUDES
-#include <dali/public-api/images/pixel-data.h>
+// EXTERNAL INCLUDES
+#include <cstdint>
 
 // INTERNAL INCLUDES
+#include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/images/pixel.h>
 
 namespace Dali
@@ -39,12 +40,12 @@ namespace DevelPixelData
  */
 struct PixelDataBuffer
 {
-  unsigned char* buffer;
-  unsigned int bufferSize;
+  uint8_t* buffer;
+  uint32_t bufferSize;
   PixelData::ReleaseFunction releaseFunction;
 
-  PixelDataBuffer(  unsigned char* buffer,
-                    unsigned int bufferSize,
+  PixelDataBuffer(  uint8_t* buffer,
+                    uint32_t bufferSize,
                     PixelData::ReleaseFunction releaseFunction )
   : buffer(buffer),
     bufferSize(bufferSize),
index 84411ce..af67132 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ void TextureSetImage( TextureSet textureSet, size_t index, Image image )
     texture = GetImplementation( image ).GetTexture();
   }
 
-  GetImplementation( textureSet ).SetTexture( index, texture );
+  GetImplementation( textureSet ).SetTexture( static_cast<uint32_t>( index ), texture );
 }
 
 } // namespace Dali
index bee45d8..c51f661 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,7 +31,9 @@ bool RegisterType( const std::string& name, const std::type_info& baseType, CSha
 {
   Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
 
-  return impl->Register( name, baseType, f );
+  impl->Register( name, baseType, f );
+
+  return true;
 }
 
 bool RegisterProperty( const std::string& objectName,
index 8b4013c..7460595 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_RENDERER_DEVEL_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -62,9 +62,29 @@ namespace Property
      * @details Name "opacity", type Property::FLOAT.
      */
     OPACITY = STENCIL_OPERATION_ON_Z_PASS + 1,
+
+    /**
+     * @brief The rendering behavior of the renderer.
+     * @details Name "renderingBehavior", type Property::INTEGER.
+     */
+    RENDERING_BEHAVIOR = STENCIL_OPERATION_ON_Z_PASS + 2,
   };
 } // namespace Property
 
+namespace Rendering
+{
+
+/**
+ * @brief Enumeration for the rendering behavior
+ */
+enum Type
+{
+  IF_REQUIRED,  ///< Default. Will only render if required to do so.
+  CONTINUOUSLY  ///< Will render continuously.
+};
+
+} // namespace Rendering
+
 } // namespace DevelRenderer
 
 } // namespace Dali
index 944ec99..7c69e4d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,13 +26,12 @@ namespace DevelShader
 Dali::Shader New( std::vector<char>& vertexShader,
                   std::vector<char>& fragmentShader,
                   ShaderLanguage language,
-                  const Property::Map& specializationConstants )
+                  const Property::Map& specializationConstants,
+                  Shader::Hint::Value hints )
 {
-  auto impl = Dali::Internal::Shader::New( vertexShader, fragmentShader, language, specializationConstants );
+  auto impl = Dali::Internal::Shader::New( vertexShader, fragmentShader, language, specializationConstants, hints );
   return Shader( impl.Get() );
 }
 
-
 }
 }
-
index d2ee721..223d738 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SHADER_DEVEL_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,32 +38,118 @@ enum class ShaderLanguage
 
 /**
  * Creates shader with binary or text source
- * @param vertexShader
- * @param fragmentShader
- * @param language
- * @param specializationConstants
+ * @param[in] vertexShader
+ * @param[in] fragmentShader
+ * @param[in] language
+ * @param[in] specializationConstants
+ * @param[in] hints Hints to define the geometry of the rendered object
  * @return
  */
-DALI_IMPORT_API Dali::Shader New( std::vector<char>& vertexShader, std::vector<char>& fragmentShader, ShaderLanguage language, const Property::Map& specializationConstants );
+DALI_IMPORT_API Dali::Shader New(
+  std::vector<char>& vertexShader,
+  std::vector<char>& fragmentShader,
+  ShaderLanguage language,
+  const Property::Map& specializationConstants,
+  Shader::Hint::Value hints );
 
+/**
+ * Template method to utilize any vector type to generate shader data.
+ * Treats the vector as a block of memory.
+ *
+ * @tparam T The type of vector used to define vertexShader and fragmentShader
+ * @param[in] vertexShader The pre-compiled vertex shader as a block of memory
+ * @param[in] fragmentShader The pre-compiled vertex shader as a block of memory
+ * @param[in] language The language used to create the shader.
+ * @param[in] specializationConstants Any specialization constants that the shaders use (e.g. for conditional compiliation, or for uniform array sizes, etc.)
+ */
+template<class T>
+DALI_IMPORT_API Dali::Shader New(
+  std::vector<T>& vertexShader,
+  std::vector<T>& fragmentShader,
+  ShaderLanguage language,
+  const Property::Map& specializationConstants )
+{
+  auto vsh = std::vector<char>();
+  auto fsh = std::vector<char>();
+  vsh.insert( vsh.begin(), reinterpret_cast<char*>(&vertexShader[0]), reinterpret_cast<char*>(&vertexShader[0])+vertexShader.size()*sizeof(T) );
+  fsh.insert( fsh.begin(), reinterpret_cast<char*>(&fragmentShader[0]), reinterpret_cast<char*>(&fragmentShader[0])+fragmentShader.size()*sizeof(T) );
+  return New( vsh, fsh, language, specializationConstants, Shader::Hint::NONE );
+}
+
+/**
+ * Template method to utilize any vector type to generate shader data.
+ * Treats the vector as a block of memory.
+ *
+ * @tparam T The type of vector used to define vertexShader and fragmentShader
+ * @param[in] vertexShader The pre-compiled vertex shader as a block of memory
+ * @param[in] fragmentShader The pre-compiled vertex shader as a block of memory
+ * @param[in] language The language used to create the shader.
+ * @param[in] specializationConstants Any specialization constants that the shaders use (e.g. for conditional compiliation, or for uniform array sizes, etc.)
+ * @param[in] hints Hints to define the geometry of the rendered object
+ */
 template<class T>
-DALI_IMPORT_API Dali::Shader New( std::vector<T>& vertexShader, std::vector<T>& fragmentShader, ShaderLanguage language, const Property::Map& specializationConstants )
+DALI_IMPORT_API Dali::Shader New(
+  std::vector<T>& vertexShader,
+  std::vector<T>& fragmentShader,
+  ShaderLanguage language,
+  const Property::Map& specializationConstants,
+  Shader::Hint::Value hints )
 {
   auto vsh = std::vector<char>();
   auto fsh = std::vector<char>();
   vsh.insert( vsh.begin(), reinterpret_cast<char*>(&vertexShader[0]), reinterpret_cast<char*>(&vertexShader[0])+vertexShader.size()*sizeof(T) );
   fsh.insert( fsh.begin(), reinterpret_cast<char*>(&fragmentShader[0]), reinterpret_cast<char*>(&fragmentShader[0])+fragmentShader.size()*sizeof(T) );
-  return New( vsh, fsh, language, specializationConstants );
+  return New( vsh, fsh, language, specializationConstants, hints );
 }
 
+/**
+ * Template method to utilize any vector type to generate shader data.
+ * Treats the vector as a block of memory.
+ *
+ * @tparam T The type of vector used to define vertexShader and fragmentShader
+ * @param[in] vertexShader The pre-compiled vertex shader as a block of memory, as an RValue
+ * @param[in] fragmentShader The pre-compiled vertex shader as a block of memory, as an RValu
+ * @param[in] language The language used to create the shader.
+ * @param[in] specializationConstants Any specialization constants that the shaders use (e.g. for conditional compiliation, or for uniform array sizes, etc.)
+ */
+template<class T>
+DALI_IMPORT_API Dali::Shader New(
+  std::vector<T>&& vertexShader,
+  std::vector<T>&& fragmentShader,
+  ShaderLanguage language,
+  const Property::Map& specializationConstants )
+{
+  auto vsh = std::vector<char>();
+  auto fsh = std::vector<char>();
+  vsh.insert( vsh.begin(), reinterpret_cast<char*>(&vertexShader[0]), reinterpret_cast<char*>(&vertexShader[0])+vertexShader.size()*sizeof(T) );
+  fsh.insert( fsh.begin(), reinterpret_cast<char*>(&fragmentShader[0]), reinterpret_cast<char*>(&fragmentShader[0])+fragmentShader.size()*sizeof(T) );
+  return New( vsh, fsh, language, specializationConstants, Shader::Hint::NONE );
+}
+
+/**
+ * Template method to utilize any vector type to generate shader data.
+ * Treats the vector as a block of memory.
+ *
+ * @tparam T The type of vector used to define vertexShader and fragmentShader
+ * @param[in] vertexShader The pre-compiled vertex shader as a block of memory, as an RValue
+ * @param[in] fragmentShader The pre-compiled vertex shader as a block of memory, as an RValu
+ * @param[in] language The language used to create the shader.
+ * @param[in] specializationConstants Any specialization constants that the shaders use (e.g. for conditional compiliation, or for uniform array sizes, etc.)
+ * @param[in] hints Hints to define the geometry of the rendered object
+ */
 template<class T>
-DALI_IMPORT_API Dali::Shader New( std::vector<T>&& vertexShader, std::vector<T>&& fragmentShader, ShaderLanguage language, const Property::Map& specializationConstants )
+DALI_IMPORT_API Dali::Shader New(
+  std::vector<T>&& vertexShader,
+  std::vector<T>&& fragmentShader,
+  ShaderLanguage language,
+  const Property::Map& specializationConstants,
+  Shader::Hint::Value hints )
 {
   auto vsh = std::vector<char>();
   auto fsh = std::vector<char>();
   vsh.insert( vsh.begin(), reinterpret_cast<char*>(&vertexShader[0]), reinterpret_cast<char*>(&vertexShader[0])+vertexShader.size()*sizeof(T) );
   fsh.insert( fsh.begin(), reinterpret_cast<char*>(&fragmentShader[0]), reinterpret_cast<char*>(&fragmentShader[0])+fragmentShader.size()*sizeof(T) );
-  return New( vsh, fsh, language, specializationConstants );
+  return New( vsh, fsh, language, specializationConstants, hints );
 }
 
 
index 89beaa4..64e94cd 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_ENUM_HELPER_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -44,12 +44,12 @@ namespace Dali
  */
 #define DALI_ENUM_TO_STRING_TABLE_BEGIN_WITH_TYPE( type, t ) const type t##_TABLE[] = {
 #define DALI_ENUM_TO_STRING_TABLE_BEGIN( t ) DALI_ENUM_TO_STRING_TABLE_BEGIN_WITH_TYPE( Dali::Scripting::StringEnum, t )
-#define DALI_ENUM_TO_STRING_TABLE_END( t )   }; const unsigned int t##_TABLE_COUNT = sizeof( t##_TABLE ) / sizeof( t##_TABLE[0] );
+#define DALI_ENUM_TO_STRING_TABLE_END( t )   }; const uint32_t t##_TABLE_COUNT = static_cast<uint32_t>( sizeof( t##_TABLE ) / sizeof( t##_TABLE[0] ) );
 #define DALI_ENUM_TO_STRING( s ) { #s, s },
 
 /**
  * Adds a value, typically an enum, to the table within a scope but without the scope name
- * Example converts ( Layer, LAYER_2D ) to ( "LAYER_2D", Layer::Layer2D )
+ * Example converts ( Layer, LAYER_UI ) to ( "LAYER_UI", Layer::LayerUI )
  */
 #define DALI_ENUM_TO_STRING_WITH_SCOPE( className, enumName ) { #enumName, className::enumName },
 
index 2860841..ed63372 100644 (file)
@@ -67,7 +67,7 @@ const StringEnum PIXEL_FORMAT_TABLE[] =
   { "COMPRESSED_RGB8_ETC1",                         Pixel::COMPRESSED_RGB8_ETC1                         },
   { "COMPRESSED_RGB_PVRTC_4BPPV1",                  Pixel::COMPRESSED_RGB_PVRTC_4BPPV1                  },
 };
-const unsigned int PIXEL_FORMAT_TABLE_COUNT = sizeof( PIXEL_FORMAT_TABLE ) / sizeof( PIXEL_FORMAT_TABLE[0] );
+const uint32_t PIXEL_FORMAT_TABLE_COUNT = static_cast<uint32_t>( sizeof( PIXEL_FORMAT_TABLE ) / sizeof( PIXEL_FORMAT_TABLE[0] ) );
 
 const StringEnum IMAGE_FITTING_MODE_TABLE[] =
 {
@@ -76,7 +76,7 @@ const StringEnum IMAGE_FITTING_MODE_TABLE[] =
   { "FIT_WIDTH",     FittingMode::FIT_WIDTH    },
   { "FIT_HEIGHT",    FittingMode::FIT_HEIGHT   },
 };
-const unsigned int IMAGE_FITTING_MODE_TABLE_COUNT = sizeof( IMAGE_FITTING_MODE_TABLE ) / sizeof( IMAGE_FITTING_MODE_TABLE[0] );
+const uint32_t IMAGE_FITTING_MODE_TABLE_COUNT = static_cast<uint32_t>( sizeof( IMAGE_FITTING_MODE_TABLE ) / sizeof( IMAGE_FITTING_MODE_TABLE[0] ) );
 
 const StringEnum IMAGE_SAMPLING_MODE_TABLE[] =
 {
@@ -88,15 +88,15 @@ const StringEnum IMAGE_SAMPLING_MODE_TABLE[] =
   { "NO_FILTER",        SamplingMode::NO_FILTER       },
   { "DONT_CARE",        SamplingMode::DONT_CARE       },
 };
-const unsigned int IMAGE_SAMPLING_MODE_TABLE_COUNT = sizeof( IMAGE_SAMPLING_MODE_TABLE ) / sizeof( IMAGE_SAMPLING_MODE_TABLE[0] );
+const uint32_t IMAGE_SAMPLING_MODE_TABLE_COUNT = static_cast<uint32_t>( sizeof( IMAGE_SAMPLING_MODE_TABLE ) / sizeof( IMAGE_SAMPLING_MODE_TABLE[0] ) );
 
 const char* ImageTypeName[] = { "ResourceImage", "FrameBufferImage", "BufferImage" };
 enum ImageType                { RESOURCE_IMAGE,  FRAME_BUFFER_IMAGE, BUFFER_IMAGE };
-const unsigned int imageTypeCount = sizeof( ImageTypeName ) / sizeof( const char* );
+const uint32_t imageTypeCount = static_cast<uint32_t>( sizeof( ImageTypeName ) / sizeof( const char* ) );
 
 } // unnamed namespace
 
-bool EnumStringToInteger( const char * const value, const StringEnum* const enumTable, unsigned int tableCount, int& integerEnum )
+bool EnumStringToInteger( const char * const value, const StringEnum* const enumTable, uint32_t tableCount, int& integerEnum )
 {
   int ret = 0;
 
@@ -109,11 +109,11 @@ bool EnumStringToInteger( const char * const value, const StringEnum* const enum
 
     while(!done)
     {
-      size_t size = 0;
+      uint32_t size = 0;
 
       const StringEnum* table = enumTable;
 
-      for ( unsigned int i = 0; i < tableCount; ++i )
+      for ( uint32_t i = 0; i < tableCount; ++i )
       {
         if( Internal::CompareTokens( pValue, table->string, size ) )
         {
@@ -148,13 +148,13 @@ bool EnumStringToInteger( const char * const value, const StringEnum* const enum
   return found;
 }
 
-unsigned int FindEnumIndex( const char* value, const StringEnum* table, unsigned int tableCount )
+uint32_t FindEnumIndex( const char* value, const StringEnum* table, uint32_t tableCount )
 {
-  unsigned int index = 0;
+  uint32_t index = 0;
   bool found = false;
-  for ( unsigned int i = 0; i < tableCount; ++i, ++index )
+  for ( uint32_t i = 0; i < tableCount; ++i, ++index )
   {
-    size_t sizeIgnored = 0;
+    uint32_t sizeIgnored = 0;
     if( Internal::CompareTokens( value, table->string, sizeIgnored ) )
     {
       found = true;
@@ -187,7 +187,7 @@ Image NewImage( const Property::Value& property )
     {
       std::string type;
       value->Get( type );
-      for( unsigned int i = 0; i < imageTypeCount; ++i )
+      for( uint32_t i = 0; i < imageTypeCount; ++i )
       {
         if( 0 == type.compare( ImageTypeName[ i ] ) )
         {
@@ -215,7 +215,7 @@ Image NewImage( const Property::Value& property )
 
     // Width and height can be set individually. Dali derives the unspecified
     // dimension from the aspect ratio of the raw image.
-    int width = 0, height = 0;
+    int32_t width = 0, height = 0;
 
     value = map->Find( "width" );
     if( value )
@@ -223,7 +223,7 @@ Image NewImage( const Property::Value& property )
       // handle floats and integer the same for json script
       if( value->GetType() == Property::FLOAT )
       {
-        width = static_cast<unsigned int>( value->Get<float>() );
+        width = static_cast<uint32_t>( value->Get<float>() );
       }
       else
       {
@@ -235,7 +235,7 @@ Image NewImage( const Property::Value& property )
     {
       if( value->GetType() == Property::FLOAT )
       {
-        height = static_cast<int>( value->Get<float>() );
+        height = static_cast<int32_t>( value->Get<float>() );
       }
       else
       {
@@ -288,7 +288,7 @@ Image NewImage( const Property::Value& property )
     {
       case RESOURCE_IMAGE :
       {
-        ret = ResourceImage::New( filename, ImageDimensions( attributes.GetSize().x, attributes.GetSize().y ),
+        ret = ResourceImage::New( filename, ImageDimensions( static_cast<uint32_t>( attributes.GetSize().x ), static_cast<uint32_t>( attributes.GetSize().y ) ),
                                   attributes.GetScalingMode(), attributes.GetFilterMode(), attributes.GetOrientationCorrection() );
         break;
       }
@@ -340,7 +340,7 @@ Actor NewActor( const Property::Map& map )
   if ( actor )
   {
     // Now set the properties, or create children
-    for ( unsigned int i = 0, mapCount = map.Count(); i < mapCount; ++i )
+    for ( Property::Map::SizeType i = 0, mapCount = map.Count(); i < mapCount; ++i )
     {
       const KeyValuePair pair( map.GetKeyValue( i ) );
       if( pair.first.type == Property::Key::INDEX )
@@ -398,11 +398,11 @@ void CreatePropertyMap( Actor actor, Property::Map& map )
     }
 
     // Children
-    unsigned int childCount( actor.GetChildCount() );
+    std::size_t childCount( actor.GetChildCount() );
     if ( childCount )
     {
       Property::Array childArray;
-      for ( unsigned int child = 0; child < childCount; ++child )
+      for ( uint32_t child = 0; child < childCount; ++child )
       {
         Property::Map childMap;
         CreatePropertyMap( actor.GetChildAt( child ), childMap );
@@ -441,8 +441,8 @@ void CreatePropertyMap( Image image, Property::Map& map )
       map[ "filename" ] = resourceImage.GetUrl();
     }
 
-    int width( image.GetWidth() );
-    int height( image.GetHeight() );
+    int32_t width( image.GetWidth() );
+    int32_t height( image.GetHeight() );
 
     if ( width && height )
     {
@@ -461,7 +461,7 @@ void NewAnimation( const Property::Map& map, Dali::AnimationData& outputAnimatio
   element->timePeriodDuration = 1.0f;
 
   // Now set the properties, or create children
-  for( unsigned int i = 0, animationMapCount = map.Count(); i < animationMapCount; ++i )
+  for( Property::Map::SizeType i = 0, animationMapCount = map.Count(); i < animationMapCount; ++i )
   {
     const KeyValuePair pair( map.GetKeyValue( i ) );
     if( pair.first.type == Property::Key::INDEX )
@@ -544,7 +544,7 @@ void NewAnimation( const Property::Map& map, Dali::AnimationData& outputAnimatio
     else if( key == "timePeriod" )
     {
       Property::Map timeMap = value.Get< Property::Map >();
-      for( unsigned int i = 0; i < timeMap.Count(); ++i )
+      for( Property::Map::SizeType i = 0; i < timeMap.Count(); ++i )
       {
         const KeyValuePair timePair( timeMap.GetKeyValue( i ) );
         if( timePair.first.type == Property::Key::INDEX )
index e7c51ba..01cf485 100644 (file)
@@ -43,8 +43,8 @@ namespace Scripting
  */
 struct StringEnum
 {
-  const char* string; ///< The string representation
-  const int value;    ///< The enumeration value wrapped in int
+  const char* string;  ///< The string representation
+  const int32_t value; ///< The enumeration value wrapped in int
 };
 
 /**
@@ -55,7 +55,7 @@ struct StringEnum
  * @param[in]  tableCount  Number of items in the array.
  * @return     The index of the enumeration. If enumeration is not found, logs an error and returns tableCount.
  */
-DALI_CORE_API unsigned int FindEnumIndex( const char* value, const StringEnum* table, unsigned int tableCount );
+DALI_CORE_API uint32_t FindEnumIndex( const char* value, const StringEnum* table, uint32_t tableCount );
 
 /**
  * @brief Find the enum as an integer from the table
@@ -68,7 +68,7 @@ DALI_CORE_API unsigned int FindEnumIndex( const char* value, const StringEnum* t
  * @param[out] integerEnum The value of the enum.
  * @return     true if one or more enums in value.
  */
-DALI_CORE_API bool EnumStringToInteger( const char* const value, const StringEnum* const table, unsigned int tableCount, int& integerEnum );
+DALI_CORE_API bool EnumStringToInteger( const char* const value, const StringEnum* const table, uint32_t tableCount, int& integerEnum );
 
 /**
  * @brief Chooses the appropriate enumeration for the provided string from the given table.
@@ -81,7 +81,7 @@ DALI_CORE_API bool EnumStringToInteger( const char* const value, const StringEnu
  * @return     True if the value was found from the table
  */
 template< typename T >
-bool GetEnumeration( const char* value, const StringEnum* table, unsigned int tableCount, T& result )
+bool GetEnumeration( const char* value, const StringEnum* table, uint32_t tableCount, T& result )
 {
   bool retVal( false );
   if( table )
@@ -108,7 +108,7 @@ bool GetEnumeration( const char* value, const StringEnum* table, unsigned int ta
  * @return     True if the value was found successfully AND the value has changed. This is to allow the caller to do nothing if there is no change.
  */
 template< typename T >
-bool GetEnumerationProperty( const Property::Value& propertyValue, const StringEnum* table, unsigned int tableCount, T& result )
+bool GetEnumerationProperty( const Property::Value& propertyValue, const StringEnum* table, uint32_t tableCount, T& result )
 {
   int newValue;
   bool set = false;
@@ -156,7 +156,7 @@ bool GetEnumerationProperty( const Property::Value& propertyValue, const StringE
  * @return     True if the value was found successfully AND the value has changed. This is to allow the caller to do nothing if there is no change.
  */
 template< typename T >
-bool GetBitmaskEnumerationProperty( const Property::Value& propertyValue, const Scripting::StringEnum* table, unsigned int tableCount, T& result )
+bool GetBitmaskEnumerationProperty( const Property::Value& propertyValue, const Scripting::StringEnum* table, uint32_t tableCount, T& result )
 {
   bool returnValue = true;
 
@@ -215,11 +215,11 @@ bool GetBitmaskEnumerationProperty( const Property::Value& propertyValue, const
  * @note The caller is NOT responsible for cleaning up the returned pointer as it is statically allocated.
  */
 template< typename T >
-const char* GetEnumerationName( T value, const StringEnum* table, unsigned int tableCount )
+const char* GetEnumerationName( T value, const StringEnum* table, uint32_t tableCount )
 {
   if( table )
   {
-    for ( unsigned int i = 0; i < tableCount; ++i )
+    for ( uint32_t i = 0; i < tableCount; ++i )
     {
       if ( value == T(table[ i ].value) )
       {
@@ -243,7 +243,7 @@ const char* GetEnumerationName( T value, const StringEnum* table, unsigned int t
  * @note The caller is NOT responsible for cleaning up the returned pointer as it is statically allocated.
  */
 template< typename T >
-const char * GetLinearEnumerationName( T value, const StringEnum* table, unsigned int tableCount )
+const char * GetLinearEnumerationName( T value, const StringEnum* table, uint32_t tableCount )
 {
   if ( table && ( value > 0 || value <= static_cast<int>( tableCount ) ) )
   {
old mode 100644 (file)
new mode 100755 (executable)
index 24a0874..79de016
@@ -35,7 +35,7 @@ public:
    * @brief Allows client code to synchronize updates to its own state with the
    * internal state of a ConditionalWait object.
    */
-  class ScopedLock
+  class DALI_CORE_API ScopedLock
   {
   public:
     /**
old mode 100644 (file)
new mode 100755 (executable)
index 26dfe11..2173edc
@@ -57,7 +57,7 @@ public:
    * Note! this class *does not* prevent a deadlock in the case when same thread is
    * locking the same mutex twice.
    */
-  class ScopedLock
+  class DALI_CORE_API ScopedLock
   {
   public:
 
diff --git a/dali/devel-api/threading/thread-pool.cpp b/dali/devel-api/threading/thread-pool.cpp
new file mode 100644 (file)
index 0000000..1a97f69
--- /dev/null
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "thread-pool.h"
+#include <cmath>
+
+namespace Dali
+{
+
+void WorkerThread::WaitAndExecute()
+{
+  while( true )
+  {
+    Task task;
+
+    {
+      std::unique_lock< std::mutex > lock{ mTaskQueueMutex };
+
+      mConditionVariable.wait( lock, [ this ]() -> bool {
+        return !mTaskQueue.empty() || mTerminating;
+      } );
+
+      if( mTerminating )
+      {
+        break;
+      }
+
+      task = mTaskQueue.front();
+    }
+
+    task( mIndex );
+
+    {
+      std::lock_guard< std::mutex > lock{ mTaskQueueMutex };
+
+      mTaskQueue.pop();
+
+      mConditionVariable.notify_one();
+    }
+  }
+}
+
+WorkerThread::WorkerThread(uint32_t index) : mIndex( index )
+{
+  // Have to pass "this" as an argument because WaitAndExecute is a member function.
+  mWorker = std::thread{ &WorkerThread::WaitAndExecute, this };
+}
+
+WorkerThread::~WorkerThread()
+{
+  if( mWorker.joinable() )
+  {
+    Notify();
+    Wait();
+
+    {
+      std::lock_guard< std::mutex > lock{ mTaskQueueMutex };
+      mTerminating = true;
+      mConditionVariable.notify_one();
+    }
+
+    mWorker.join();
+  }
+}
+
+void WorkerThread::AddTask( Task task )
+{
+  std::lock_guard< std::mutex > lock{ mTaskQueueMutex };
+  mTaskQueue.push( std::move( task ) );
+  mConditionVariable.notify_one();
+}
+
+void WorkerThread::AddTask( Task task, bool doNotify )
+{
+  std::lock_guard< std::mutex > lock{ mTaskQueueMutex };
+  mTaskQueue.push( std::move( task ) );
+  if( doNotify )
+  {
+    mConditionVariable.notify_one();
+  }
+}
+
+void WorkerThread::Notify()
+{
+  std::lock_guard< std::mutex > lock{ mTaskQueueMutex };
+  mConditionVariable.notify_one();
+}
+
+void WorkerThread::Wait()
+{
+  std::unique_lock< std::mutex > lock{ mTaskQueueMutex };
+  mConditionVariable.wait( lock, [ this ]() -> bool {
+    return mTaskQueue.empty();
+  } );
+}
+
+// ThreadPool -----------------------------------------------------------------------------------------------
+
+bool ThreadPool::Initialize( uint32_t threadCount )
+{
+//  LOG( "Initializing thread pool..." );
+
+  /**
+   * Get the system's supported thread count.
+   */
+  auto thread_count = threadCount + 1;
+  if( !threadCount )
+  {
+    thread_count = std::thread::hardware_concurrency();
+    if( !thread_count )
+    {
+      return false;
+    }
+  }
+
+  /**
+   * Spawn the worker threads.
+   */
+  for( auto i = 0u; i < thread_count - 1; i++ )
+  {
+    /**
+    * The workers will execute an infinite loop function
+    * and will wait for a job to enter the job queue. Once a job is in the the queue
+    * the threads will wake up to acquire and execute it.
+    */
+    mWorkers.push_back( std::unique_ptr< WorkerThread >( new WorkerThread( i ) ) );
+  }
+
+  return true;
+}
+
+
+void ThreadPool::Wait()
+{
+  for( auto& worker : mWorkers )
+  {
+    worker->Wait();
+  }
+}
+
+std::shared_ptr< Future< void > > ThreadPool::SubmitTask( uint32_t workerIndex, const Task& task )
+{
+  auto future = std::shared_ptr< Future< void > >( new Future< void > );
+  mWorkers[workerIndex]->AddTask( [task, future]( uint32_t index )
+                                  {
+                                    task( index );
+
+                                    future->mPromise.set_value();
+                                  });
+
+  return future;
+}
+
+std::shared_ptr< Future< void > > ThreadPool::SubmitTasks( const std::vector< Task >& tasks )
+{
+  auto future = std::shared_ptr< Future< void > >( new Future< void > );
+
+  mWorkers[ mWorkerIndex++ % static_cast< uint32_t >( mWorkers.size() )]->AddTask(
+    [ future, tasks ]( uint32_t index ) {
+      for( auto& task : tasks )
+      {
+        task( index );
+      }
+
+      future->mPromise.set_value();
+
+    } );
+
+  return future;
+}
+
+std::unique_ptr<FutureGroup<void>> ThreadPool::SubmitTasks( const std::vector< Task >& tasks, uint32_t threadMask )
+{
+  std::unique_ptr<FutureGroup<void>> retval = std::make_unique<FutureGroup<void>>();
+
+  /**
+   * Use square root of number of sumbitted tasks to estimate optimal number of threads
+   * used to execute jobs
+   */
+  auto threads = uint32_t(std::log2(float(tasks.size())));
+
+  if( threadMask != 0 )
+  {
+    threads = threadMask;
+  }
+
+  if( threads > mWorkers.size() )
+  {
+    threads = uint32_t(mWorkers.size());
+  }
+  else if( !threads )
+  {
+    threads = 1;
+  }
+
+  auto payloadPerThread = uint32_t(tasks.size() / threads);
+  auto remaining = uint32_t(tasks.size() % threads);
+
+  uint32_t taskIndex = 0;
+  uint32_t taskSize = uint32_t(remaining + payloadPerThread); // add 'remaining' tasks to the very first job list
+
+  for( auto wt = 0u; wt < threads; ++wt )
+  {
+    auto future = std::shared_ptr< Future< void > >( new Future< void > );
+    retval->mFutures.emplace_back( future );
+    mWorkers[ mWorkerIndex++ % static_cast< uint32_t >( mWorkers.size() )]->AddTask(
+      [ future, tasks, taskIndex, taskSize ]( uint32_t index ) {
+        auto begin = tasks.begin() + int(taskIndex);
+        auto end = begin + int(taskSize);
+        for( auto it = begin; it < end; ++it )
+        {
+          (*it)( index );
+        }
+        future->mPromise.set_value();
+      } );
+
+    taskIndex += taskSize;
+    taskSize = payloadPerThread;
+  }
+
+  return retval;
+}
+
+size_t ThreadPool::GetWorkerCount() const
+{
+  return mWorkers.size();
+}
+
+} //namespace Dali
diff --git a/dali/devel-api/threading/thread-pool.h b/dali/devel-api/threading/thread-pool.h
new file mode 100644 (file)
index 0000000..d586cf6
--- /dev/null
@@ -0,0 +1,166 @@
+#ifndef DALI_THREAD_POOL_H
+#define DALI_THREAD_POOL_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include <dali/public-api/common/dali-common.h>
+
+#include <thread>
+#include <functional>
+#include <mutex>
+#include <queue>
+#include <condition_variable>
+#include <future>
+#include <algorithm>
+#include <iostream>
+
+namespace Dali
+{
+using Task = std::function< void(uint32_t) >;
+
+using TaskQueue = std::queue< Task >;
+
+template< typename T >
+class DALI_CORE_API Future final
+{
+  friend class ThreadPool;
+
+private:
+  std::promise< T > mPromise{};
+  std::future< T > mFuture{};
+
+public:
+
+  Future()
+  {
+    mFuture = mPromise.get_future();
+  }
+
+  ~Future()
+  {
+    Wait();
+  }
+
+  T Get() const
+  {
+    return mFuture.get();
+  }
+
+  void Wait() const
+  {
+    if( IsValid() )
+    {
+      mFuture.wait();
+    }
+  }
+
+  bool IsValid() const
+  {
+    return mFuture.valid();
+  }
+
+  void Reset()
+  {
+    mPromise = std::promise< T >();
+    mFuture = mPromise.get_future();
+  }
+};
+
+using SharedFuture = std::shared_ptr< Future< void > >;
+
+template< typename T >
+class DALI_CORE_API FutureGroup final
+{
+  friend class ThreadPool;
+
+private:
+  std::vector< std::shared_ptr< Future< T > > > mFutures;
+
+public:
+
+  void Wait()
+  {
+    for( auto& future : mFutures )
+    {
+      future->Wait();
+    }
+  }
+
+};
+
+using UniqueFutureGroup = std::unique_ptr< FutureGroup<void>>;
+
+class DALI_CORE_API WorkerThread
+{
+private:
+  std::thread mWorker;
+
+  uint32_t mIndex;
+
+  TaskQueue mTaskQueue;
+
+  std::mutex mTaskQueueMutex;
+
+  std::condition_variable mConditionVariable;
+
+  bool mTerminating{ false };
+
+  void WaitAndExecute();
+
+public:
+  WorkerThread(uint32_t index);
+
+  WorkerThread( const WorkerThread& other ) = delete;
+
+  WorkerThread& operator=( const WorkerThread& other ) = delete;
+
+  ~WorkerThread();
+
+  void AddTask( Task task );
+
+  void AddTask( Task task, bool doNotify );
+
+  void Notify();
+
+  void Wait();
+};
+
+class DALI_CORE_API ThreadPool
+{
+private:
+  std::vector< std::unique_ptr< WorkerThread>> mWorkers;
+
+  uint32_t mWorkerIndex {0u};
+
+public:
+
+  bool Initialize( uint32_t threadCount = 0u );
+
+  void Wait();
+
+  std::shared_ptr< Future< void > > SubmitTask( uint32_t workerIndex, const Task& task );
+
+  std::shared_ptr< Future< void > > SubmitTasks( const std::vector< Task >& tasks );
+
+  std::unique_ptr<FutureGroup<void>> SubmitTasks( const std::vector< Task >& tasks, uint32_t threadMask );
+
+  size_t GetWorkerCount() const;
+};
+
+} //namespace Dali
+
+#endif // DALI_THREAD_POOL_H
similarity index 51%
rename from dali/graphics/vulkan/vulkan-fence.h
rename to dali/devel-api/update/frame-callback-interface.cpp
index 4544542..238f881 100644 (file)
@@ -1,6 +1,3 @@
-#ifndef DALI_GRAPHICS_VULKAN_FENCE
-#define DALI_GRAPHICS_VULKAN_FENCE
-
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  *
  */
 
+// CLASS HEADER
+#include <dali/devel-api/update/frame-callback-interface.h>
+
 // INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
+#include <dali/devel-api/update/update-proxy.h>
+#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/update/frame-callback-interface-impl.h>
 
 namespace Dali
 {
-namespace Graphics
-{
-namespace Vulkan
-{
 
-class Graphics;
-class Fence : public VkManaged
+FrameCallbackInterface::FrameCallbackInterface()
+: mImpl( std::unique_ptr< Impl >( new Impl ) )
 {
-public:
-
-  static RefCountedFence New( Graphics& graphics );
-
-  ~Fence() override;
-
-  const Fence& ConstRef() const;
-
-  Fence& Ref();
+}
 
-  vk::Fence GetVkHandle() const;
-
-  operator vk::Fence*();
-
-  bool OnDestroy() override;
-
-private:
-  explicit Fence( Graphics& graphics );
-
-private:
-
-  Graphics* mGraphics;
-  vk::Fence mFence;
-};
+FrameCallbackInterface::~FrameCallbackInterface()
+{
+  if( Internal::Stage::IsInstalled() )
+  {
+    Internal::StagePtr stage = Internal::Stage::GetCurrent();
+    if( stage )
+    {
+      // This will be a no-op if the callback has already been removed
+      stage->RemoveFrameCallback( *this );
+    }
+  }
+}
 
-} // namespace Vulkan
-} // namespace Graphics
 } // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_FENCE
diff --git a/dali/devel-api/update/frame-callback-interface.h b/dali/devel-api/update/frame-callback-interface.h
new file mode 100644 (file)
index 0000000..eed5ad3
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef DALI_FRAME_CALLBACK_INTERFACE_H
+#define DALI_FRAME_CALLBACK_INTERFACE_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+
+namespace Dali
+{
+
+class UpdateProxy;
+
+/**
+ * @brief This interface should be implemented if a callback is required on every frame.
+ *
+ * The Update() method is called from the update-thread after the scene has been updated, and is ready to render.
+ *
+ * As this method is called from the update-thread, no event thread APIs (e.g. Actor::Get...) can be called.
+ * This will invariably lead to crashes.
+ *
+ * Instead, setting and retrieving the values should be done by using the UpdateProxy class returned as a parameter to
+ * the Update() method.
+ *
+ * Actors can be identified using Actor IDs which can be retrieved using Actor::GetId() in the event-thread.
+ * However, calling Actor::GetId() will lead to problems if it is called from the update-thread.
+ * Instead, the Actor IDs should be stored by the implementation of this class or passed via a thread-safe manner from
+ * the event-thread.
+ */
+class DALI_CORE_API FrameCallbackInterface
+{
+public:
+
+  /**
+   * @brief Called from the update-thread after the scene has been updated, and is ready to render.
+   * @param[in]  updateProxy  Use this to get/set required values for the Actor.
+   * @param[in]  elapsedSeconds  Time elapsed time since the last frame (in seconds)
+   * @see FrameCallbackInterface
+   */
+  virtual void Update( UpdateProxy& updateProxy, float elapsedSeconds ) = 0;
+
+protected:
+
+  /**
+   * @brief Protected constructor.
+   */
+  FrameCallbackInterface();
+
+  /**
+   * @brief Protected virtual destructor.
+   */
+  virtual ~FrameCallbackInterface();
+
+public:
+  /// @cond internal
+  class Impl;
+
+private:
+  std::unique_ptr< Impl > mImpl;
+  /// @endcond
+};
+
+} // namespace Dali
+
+#endif // DALI_FRAME_CALLBACK_INTERFACE_H
diff --git a/dali/devel-api/update/update-proxy.cpp b/dali/devel-api/update/update-proxy.cpp
new file mode 100644 (file)
index 0000000..92b788c
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/devel-api/update/update-proxy.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/update/manager/update-proxy-impl.h>
+
+namespace Dali
+{
+
+bool UpdateProxy::GetPosition( uint32_t id, Vector3& position ) const
+{
+  return mImpl.GetPosition( id, position );
+}
+
+bool UpdateProxy::SetPosition( uint32_t id, const Vector3& position )
+{
+  return mImpl.SetPosition( id, position );
+}
+
+bool UpdateProxy::BakePosition( uint32_t id, const Vector3& position )
+{
+  return mImpl.BakePosition( id, position );
+}
+
+bool UpdateProxy::GetSize( uint32_t id, Vector3& size ) const
+{
+  return mImpl.GetSize( id, size );
+}
+
+bool UpdateProxy::SetSize( uint32_t id, const Vector3& size )
+{
+  return mImpl.SetSize( id, size );
+}
+
+bool UpdateProxy::BakeSize( uint32_t id, const Vector3& size )
+{
+  return mImpl.BakeSize( id, size );
+}
+
+bool UpdateProxy::GetPositionAndSize( uint32_t id, Vector3& position, Vector3& size ) const
+{
+  return mImpl.GetPositionAndSize( id, position, size );
+}
+
+bool UpdateProxy::GetScale( uint32_t id, Vector3& scale ) const
+{
+  return mImpl.GetScale( id, scale );
+}
+
+bool UpdateProxy::SetScale( uint32_t id, const Vector3& scale )
+{
+  return mImpl.SetScale( id, scale );
+}
+
+bool UpdateProxy::BakeScale( uint32_t id, const Vector3& scale )
+{
+  return mImpl.BakeScale( id, scale );
+}
+
+bool UpdateProxy::GetColor( uint32_t id, Vector4& color ) const
+{
+  return mImpl.GetColor( id, color );
+}
+
+bool UpdateProxy::SetColor( uint32_t id, const Vector4& color )
+{
+  return mImpl.SetColor( id, color );
+}
+
+bool UpdateProxy::BakeColor( uint32_t id, const Vector4& color )
+{
+  return mImpl.BakeColor( id, color );
+}
+
+UpdateProxy::UpdateProxy( Internal::UpdateProxy& impl )
+: mImpl( impl )
+{
+}
+
+UpdateProxy::~UpdateProxy()
+{
+}
+
+} // namespace Dali
diff --git a/dali/devel-api/update/update-proxy.h b/dali/devel-api/update/update-proxy.h
new file mode 100644 (file)
index 0000000..40be070
--- /dev/null
@@ -0,0 +1,196 @@
+#ifndef DALI_UPDATE_PROXY_H
+#define DALI_UPDATE_PROXY_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <cstdint>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/math/matrix.h>
+#include <dali/public-api/math/vector3.h>
+
+namespace Dali
+{
+
+namespace Internal DALI_INTERNAL
+{
+class UpdateProxy;
+}
+
+/**
+ * @brief This class is used to access data of the actors from the update-thread.
+ *
+ * The Actor API _CANNOT_ be called directly from the update-thread.
+ * This class can be used as a proxy to that required Actor data.
+ * An actor's data can be accessed using the Actor's Unique ID.
+ * The unique ID should be passed to the callback using this class in a thread-safe manner
+ * (as you cannot call Actor::GetId from the update-thread).
+ */
+class DALI_CORE_API UpdateProxy
+{
+public:
+
+  /**
+   * @brief Given the Actor ID, this retrieves that Actor's local position.
+   * @param[in]   id        The Actor ID
+   * @param[out]  position  Set to the Actor's current position, if Actor ID is valid
+   * @return Whether the method call was successful or not.
+   */
+  bool GetPosition( uint32_t id, Vector3& position ) const;
+
+  /**
+   * @brief Allows setting an Actor's local position from the Frame callback function for the current frame only.
+   * @param[in]  id        The Actor ID
+   * @param[in]  position  The position to set
+   * @return Whether the method call was successful or not.
+   * @note This will get reset to the internally calculated or previously baked value in the next frame, so will have to be set again.
+   */
+  bool SetPosition( uint32_t id, const Vector3& position );
+
+  /**
+   * @brief Allows baking an Actor's local position from the Frame callback function.
+   * @param[in]  id        The Actor ID
+   * @param[in]  position  The position to bake
+   * @return Whether the method call was successful or not.
+   * @note The value is saved so will cause undesired effects if this property is being animated.
+   */
+  bool BakePosition( uint32_t id, const Vector3& position );
+
+  /**
+   * @brief Given the Actor ID, this retrieves that Actor's size.
+   * @param[in]   id    The Actor ID
+   * @param[out]  size  Set to the Actor's current size, if Actor ID is valid
+   * @return Whether the method call was successful or not.
+   */
+  bool GetSize( uint32_t id, Vector3& size ) const;
+
+  /**
+   * @brief Allows setting an Actor's size from the Frame callback function for the current frame only.
+   * @param[in]  id    The Actor ID
+   * @param[in]  size  The size to set
+   * @return Whether the method call was successful or not.
+   * @note This will get reset to the internally calculated or previously baked value in the next frame, so will have to be set again.
+   */
+  bool SetSize( uint32_t id, const Vector3& size );
+
+  /**
+   * @brief Allows baking an Actor's size from the Frame callback function.
+   * @param[in]  id    The Actor ID
+   * @param[in]  size  The size to bake
+   * @return Whether the method call was successful or not.
+   * @note The value is saved so will cause undesired effects if this property is being animated.
+   */
+  bool BakeSize( uint32_t id, const Vector3& size );
+
+  /**
+   * @brief Given the Actor ID, this retrieves that Actor's local position and size.
+   * @param[in]   id        The Actor ID
+   * @param[out]  position  Set to the Actor's current position, if Actor ID is valid
+   * @param[out]  size      Set to the Actor's current size, if Actor ID is valid
+   * @return Whether the method call was successful or not.
+   */
+  bool GetPositionAndSize( uint32_t id, Vector3& position, Vector3& size ) const;
+
+  /**
+   * @brief Given the Actor ID, this retrieves that Actor's local scale.
+   * @param[in]   id     The Actor ID
+   * @param[out]  scale  Set to the Actor's current scale, if Actor ID is valid
+   * @return Whether the method call was successful or not.
+   */
+  bool GetScale( uint32_t id, Vector3& scale ) const;
+
+  /**
+   * @brief Allows setting an Actor's local scale from the Frame callback function for the current frame only.
+   * @param[in]  id     The Actor ID
+   * @param[in]  scale  The scale to set
+   * @return Whether the method call was successful or not.
+   * @note This will get reset to the internally calculated or previously baked value in the next frame, so will have to be set again.
+   */
+  bool SetScale( uint32_t id, const Vector3& scale );
+
+  /**
+   * @brief Allows baking an Actor's local scale from the Frame callback function.
+   * @param[in]  id     The Actor ID
+   * @param[in]  scale  The scale to bake
+   * @return Whether the method call was successful or not.
+   * @note The value is saved so will cause undesired effects if this property is being animated.
+   */
+  bool BakeScale( uint32_t id, const Vector3& scale );
+
+  /**
+   * @brief Given the Actor ID, this retrieves that Actor's local color.
+   * @param[in]   id     The Actor ID
+   * @param[out]  color  Set to the Actor's current color, if Actor ID is valid
+   * @return Whether the method call was successful or not.
+   */
+  bool GetColor( uint32_t id, Vector4& color ) const;
+
+  /**
+   * @brief Allows setting an Actor's local color from the Frame callback function for the current frame only.
+   * @param[in]  id     The Actor ID
+   * @param[in]  color  The color to set
+   * @return Whether the method call was successful or not.
+   * @note This will get reset to the internally calculated or previously baked value in the next frame, so will have to be set again.
+   */
+  bool SetColor( uint32_t id, const Vector4& color );
+
+  /**
+   * @brief Allows baking an Actor's local color from the Frame callback function.
+   * @param[in]  id     The Actor ID
+   * @param[in]  color  The color to bake
+   * @return Whether the method call was successful or not.
+   * @note The value is saved so will cause undesired effects if this property is being animated.
+   */
+  bool BakeColor( uint32_t id, const Vector4& color );
+
+public: // Not intended for application developers
+
+  /// @cond internal
+
+  /**
+   * @brief Constructor.
+   * @param[in]  impl  A reference to the internal object.
+   */
+  DALI_INTERNAL UpdateProxy( Internal::UpdateProxy& impl );
+
+  /**
+   * @brief Destructor.
+   */
+  DALI_INTERNAL ~UpdateProxy();
+
+  // Not copyable or movable
+
+  UpdateProxy( const UpdateProxy& )            = delete; ///< Deleted copy constructor
+  UpdateProxy( UpdateProxy&& )                 = delete; ///< Deleted move constructor
+  UpdateProxy& operator=( const UpdateProxy& ) = delete; ///< Deleted copy assignment operator
+  UpdateProxy& operator=( UpdateProxy&& )      = delete; ///< Deleted move assignment operator
+
+  /// @endcond
+
+private:
+
+  /// @cond internal
+  Internal::UpdateProxy& mImpl;
+  /// @endcond
+};
+
+} // namespace Dali
+
+#endif // DALI_UPDATE_PROXY_H
index 95b0717..31a404f 100644 (file)
@@ -1,6 +1,26 @@
 #
 # Add graphics-api source files here
 #
+SET( graphics_api_src_dir ${ROOT_SRC_DIR}/dali/graphics-api )
 
-graphics_api_src_files =
-
+SET( GRAPHICS_API_HEADERS ${GRAPHICS_API_HEADERS}
+    ${graphics_api_src_dir}/graphics-api-base-factory.h
+    ${graphics_api_src_dir}/graphics-api-buffer-factory.h
+    ${graphics_api_src_dir}/graphics-api-buffer.h
+    ${graphics_api_src_dir}/graphics-api-controller.h
+    ${graphics_api_src_dir}/graphics-api-framebuffer-factory.h
+    ${graphics_api_src_dir}/graphics-api-framebuffer.h
+    ${graphics_api_src_dir}/graphics-api-pipeline-factory.h
+    ${graphics_api_src_dir}/graphics-api-pipeline.h
+    ${graphics_api_src_dir}/graphics-api-render-command.h
+    ${graphics_api_src_dir}/graphics-api-sampler-factory.h
+    ${graphics_api_src_dir}/graphics-api-sampler.h
+    ${graphics_api_src_dir}/graphics-api-shader-details.h
+    ${graphics_api_src_dir}/graphics-api-shader-factory.h
+    ${graphics_api_src_dir}/graphics-api-shader.h
+    ${graphics_api_src_dir}/graphics-api-texture-details.h
+    ${graphics_api_src_dir}/graphics-api-texture-factory.h
+    ${graphics_api_src_dir}/graphics-api-texture.h
+    ${graphics_api_src_dir}/graphics-api-types-debug.h
+    ${graphics_api_src_dir}/graphics-api-types.h
+)
diff --git a/dali/graphics-api/graphics-api-accessor.h b/dali/graphics-api/graphics-api-accessor.h
deleted file mode 100644 (file)
index 1f261d5..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef DALI_GRAPHICS_API_ACCESSOR_H
-#define DALI_GRAPHICS_API_ACCESSOR_H
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <memory>
-
-#include <dali/graphics/graphics-object-owner.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace API
-{
-
-template< typename T >
-class Accessor
-{
-public:
-  Accessor(ObjectOwner< T >& owner, typename ObjectOwner< T >::Handle handle)
-  : mOwner(&owner),  // save owner to access object
-    mHandle(handle) // handle to the object
-  {
-  }
-
-  Accessor(std::nullptr_t)
-  : mOwner( nullptr ),
-    mHandle( 0u )
-  {
-  }
-
-  bool Exists() const
-  {
-    if( !mOwner )
-    {
-      return false;
-    }
-    return GetOwner().Contains(mHandle);
-  }
-
-  operator bool() const
-  {
-    return Exists();
-  }
-
-  T& Get()
-  {
-    return (GetOwner())[mHandle];
-  }
-
-  const T& Get() const
-  {
-    return (GetOwner())[mHandle];
-  }
-
-  typename ObjectOwner< T >::Handle GetHandle() const
-  {
-    return mHandle;
-  }
-
-  Accessor(const Accessor&) = default;
-  Accessor& operator=(const Accessor&) = default;
-
-  Accessor(Accessor&&) = default;
-  Accessor& operator=(Accessor&&) = default;
-
-private:
-
-  ObjectOwner< T >& GetOwner() const
-  {
-    assert( mOwner );
-    return *mOwner;
-  }
-
-  ObjectOwner< T >*                 mOwner;
-  typename ObjectOwner< T >::Handle mHandle;
-};
-
-} // namespace API
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_API_ACCESSOR_H
index f9cb189..2522721 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_GRAPHICS_API_BASE_FACTORY_H
 #define DALI_GRAPHICS_API_BASE_FACTORY_H
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,8 +26,6 @@ namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 
 template< typename T, typename... Params >
 class BaseFactory
@@ -54,7 +52,6 @@ private:
   std::tuple< Params... > mParams;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
diff --git a/dali/graphics-api/graphics-api-base-object-owner.h b/dali/graphics-api/graphics-api-base-object-owner.h
deleted file mode 100644 (file)
index e51f267..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef DALI_GRAPHICS_API_BASE_OBJECT_OWNER_H
-#define DALI_GRAPHICS_API_BASE_OBJECT_OWNER_H
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <cassert>
-#include <memory>
-#include <unordered_map>
-#include <utility>
-
-#include <dali/graphics-api/graphics-api-base-factory.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace API
-{
-template< typename T >
-class ObjectOwnerBase
-{
-public:
-  using Handle = size_t;
-
-  /**
-   * @brief Create an new object using the provided factory and store it.
-   *
-   * @param[in] factory Factory that will be used to create the object\
-   * @return Handle that identifies the object
-   */
-  virtual Handle CreateObject(const BaseFactory< T >& factory) = 0;
-
-  // @brief default constructor
-  ObjectOwnerBase() = default;
-
-  // @brief virtual destructor
-  virtual ~ObjectOwnerBase() = default;
-
-  // delete copy constructor/assignment
-  ObjectOwnerBase(const ObjectOwnerBase&) = delete;
-  ObjectOwnerBase& operator=(const ObjectOwnerBase&) = delete;
-
-protected:
-  // protected move constructor/assignment
-  ObjectOwnerBase(ObjectOwnerBase&&) = default;
-  ObjectOwnerBase& operator=(ObjectOwnerBase&&) = default;
-};
-} // namespace API
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_API_BASE_OBJECT_OWNER_H
index 497b088..2ff98a1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_BUFFER_FACTORY_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali/graphics-api/graphics-api-types.h>
 #include <dali/graphics-api/graphics-api-base-factory.h>
 #include <dali/graphics-api/graphics-api-buffer.h>
 
@@ -26,9 +27,8 @@ namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
-class BufferFactory : public API::BaseFactory<API::Buffer>
+
+class BufferFactory : public BaseFactory<Buffer>
 {
 public:
 
@@ -43,7 +43,7 @@ public:
    * @param usage
    * @return
    */
-  virtual BufferFactory& SetUsage( Buffer::UsageHint usage ) = 0;
+  virtual BufferFactory& SetUsageFlags( BufferUsageFlags usage ) = 0;
 
   /**
    * Sets size of the buffer
@@ -62,8 +62,7 @@ protected:
   BufferFactory& operator=(BufferFactory&&) = default;
 };
 
-}
-}
-}
+} // Graphics
+} // Dali
 
 #endif //DALI_GRAPHICS_API_BUFFER_FACTORY_H
index 8a3c9da..957e29d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_BUFFER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,8 +24,6 @@ namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 
 /**
  * @brief Interface class for Buffer types in the graphics API.
@@ -51,13 +49,20 @@ public:
 
   virtual ~Buffer() = default;
 
-
   virtual void* Map() = 0;
 
   virtual void Unmap() = 0;
 
   virtual void Write( void* src, uint32_t srcSize, uint32_t dstOffset ) = 0;
 
+  virtual void Flush() = 0;
+
+  /**
+   * @brief Destroying buffer immediately
+   * @note May be unsafe
+   */
+  virtual void DestroyNow() = 0;
+
 protected:
   // derived types should not be moved directly to prevent slicing
   Buffer(Buffer&&) = default;
@@ -69,7 +74,6 @@ protected:
   Buffer() = default;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
index a5825c0..9254955 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_CONTROLLER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/graphics-api/graphics-api-accessor.h>
 #include <dali/graphics-api/graphics-api-base-factory.h>
 #include <dali/graphics-api/graphics-api-framebuffer.h>
+#include <dali/graphics-api/graphics-api-framebuffer-factory.h>
 #include <dali/graphics-api/graphics-api-render-command.h>
 #include <dali/graphics-api/graphics-api-sampler.h>
 #include <dali/graphics-api/graphics-api-shader.h>
 #include <dali/graphics-api/graphics-api-buffer-factory.h>
 #include <dali/graphics-api/graphics-api-pipeline-factory.h>
 #include <dali/graphics-api/graphics-api-pipeline.h>
-#include <dali/graphics-api/utility/utility-builder.h>
+#include <dali/graphics-api/graphics-api-sampler-factory.h>
 
 namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 class ShaderFactory;
+
+
 /**
  * @brief Interface class for Manager types in the graphics API.
  */
@@ -54,32 +54,32 @@ public:
   /**
    * @brief Create a new object
    */
-  virtual Accessor<Shader> CreateShader( const BaseFactory<Shader>& factory ) = 0;
+  virtual std::unique_ptr<Shader> CreateShader( const BaseFactory<Shader>& factory ) = 0;
 
   /**
    * @brief Create a new object
    */
-  virtual Accessor<Texture> CreateTexture( const BaseFactory<Texture>& factory ) = 0;
+  virtual std::unique_ptr<Texture> CreateTexture( const BaseFactory<Texture>& factory ) = 0;
 
   /**
    * @brief Create a new object
    */
-  virtual Accessor<Buffer> CreateBuffer( const BaseFactory<Buffer>& factory ) = 0;
+  virtual std::unique_ptr<Buffer> CreateBuffer( const BaseFactory<Buffer>& factory ) = 0;
 
   /**
    * @brief Create a new object
    */
-  virtual Accessor<Sampler> CreateSampler( const BaseFactory<Sampler>& factory ) = 0;
+  virtual std::unique_ptr<Sampler> CreateSampler( const BaseFactory<Sampler>& factory ) = 0;
 
   /**
    * @brief Create a new object
    */
-  virtual Accessor<Framebuffer> CreateFramebuffer( const BaseFactory<Framebuffer>& factory ) = 0;
+  virtual std::unique_ptr<Framebuffer> CreateFramebuffer( const BaseFactory<Framebuffer>& factory ) = 0;
 
   /**
    * Creates new pipeline
    */
-  virtual std::unique_ptr<Pipeline> CreatePipeline( const BaseFactory<Pipeline>& factory ) = 0;
+  virtual std::unique_ptr<Pipeline> CreatePipeline( const PipelineFactory& factory ) = 0;
 
   /**
    * @brief Returns texture factory
@@ -94,7 +94,13 @@ public:
   virtual ShaderFactory& GetShaderFactory() const = 0;
 
   /**
-   * @brief Returns buffer factory
+   * @brief Returns Framebuffer factory
+   * @return
+   */
+  virtual FramebufferFactory& GetFramebufferFactory() const = 0;
+
+  /**
+   * @brief Returns shader factory
    * @return
    */
   virtual BufferFactory& GetBufferFactory() const = 0;
@@ -105,18 +111,23 @@ public:
    */
   virtual PipelineFactory& GetPipelineFactory() = 0;
 
+  /**
+   * @brief Returns sampler factory
+   * @return
+   */
+  virtual SamplerFactory& GetSamplerFactory() = 0;
 
   /**
-   * @brief alAllocates render command ( depends on implementation );
+   * @brief Allocates render command ( depends on implementation );
    * @return
    */
-  virtual std::unique_ptr<API::RenderCommand> AllocateRenderCommand() = 0;
+  virtual std::unique_ptr<RenderCommand> AllocateRenderCommand() = 0;
 
   /**
    * @brief Submits a list of commands
    * @param commands
    */
-  virtual void SubmitCommands( std::vector<API::RenderCommand*> commands ) = 0;
+  virtual void SubmitCommands( std::vector<RenderCommand*> commands ) = 0;
 
   /**
    * @brief Mark the beginning of a frame
@@ -128,6 +139,75 @@ public:
    */
   virtual void EndFrame() = 0;
 
+  /**
+   * @brief Respond to pause lifecycle event
+   */
+  virtual void Pause() = 0;
+
+  /**
+   * @brief Respond to resume lifecycle event
+   */
+  virtual void Resume() = 0;
+
+  /**
+   * @brief Enables depth/stencil buffer if supported
+   *
+   * @return True if state changed, False otherwise
+   */
+  virtual bool EnableDepthStencilBuffer( bool enableDepth, bool enableStencil ) = 0;
+
+  /**
+   * @brief Inform graphics backend if renderers have been discarded.
+   *
+   * @note The graphics backend does not have to run the GC if it is not overly fragmented
+   */
+  virtual void RunGarbageCollector( size_t numberOfDiscardedRenderers ) = 0;
+
+  /**
+   * @brief Discards all the graphics resources by forcing full
+   * garbage collection.
+   */
+  virtual void DiscardUnusedResources() = 0;
+
+  /**
+   * @brief Tests whether the graphics discard queue doesn't contain any resources
+   * to be released.
+   *
+   * @return True if queue is empty
+   */
+  virtual bool IsDiscardQueueEmpty() = 0;
+
+  /**
+   * @brief Test if the graphics subsystem has resumed & should force a draw
+   *
+   * @return true if the graphics subsystem requires a re-draw
+   */
+  virtual bool IsDrawOnResumeRequired() = 0;
+
+  /**
+   * @brief Waits until all previously submitted commands have been fully
+   * executed.
+   */
+  virtual void WaitIdle() = 0;
+
+  /**
+   * @brief Swaps graphics buffers
+   */
+  virtual void SwapBuffers() = 0;
+
+  /**
+   * Updates multiple textures
+   * @param updateInfoList list of update info structures
+   * @param sourceList  list of source info structures
+   */
+  virtual void UpdateTextures( const std::vector<TextureUpdateInfo>& updateInfoList, const std::vector<TextureUpdateSourceInfo>& sourceList ) = 0;
+
+  /**
+   * Returns number of buffers allocated by the swapchain
+   * @return
+   */
+  virtual uint32_t GetSwapchainBufferCount() = 0;
+
 public:
   // not copyable
   Controller( const Controller& ) = delete;
@@ -139,19 +219,11 @@ protected:
   Controller& operator=( Controller&& ) = default;
 
   /**
-   * Objects of this type should not directly.
+   * Objects of this type should not be directly instantiated.
    */
   Controller() = default;
-
-  /**
-   * @brief create an element for the given number of elements and element size
-   */
-  virtual std::unique_ptr<char> CreateBuffer( size_t numberOfElements, size_t elementSize ) = 0;
-
-private:
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
index 011f6b1..d990d99 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_FRAMEBUFFER_FACTORY_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 #include <dali/graphics-api/graphics-api-base-factory.h>
+#include <dali/graphics-api/graphics-api-framebuffer.h>
 #include <dali/graphics-api/graphics-api-texture-details.h>
 #include <dali/graphics-api/graphics-api-texture.h>
-#include <dali/graphics-api/graphics-api-utility.h>
 
 namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 
 /**
  * @brief Interface class for FramebufferFactory types in the graphics API.
  */
-class FramebufferFactory : BaseFactory< Framebuffer >
+class FramebufferFactory : public BaseFactory< Framebuffer >
 {
 public:
   /**
    * @brief Set the size of framebuffer
    */
-  virtual void SetSize(const RectSize& size) = 0;
+  virtual FramebufferFactory& SetSize( const Extent2D& size ) = 0;
 
   /**
-   *@brief Set a color attachment texture on the framebuffer
+   * @brief Set a color attachment texture on the framebuffer
    */
-  virtual void SetColorAttachment(TextureDetails::AttachmentId attachment,
-                                  const Texture&               texture,
-                                  TextureDetails::LayerId      layer,
-                                  TextureDetails::LevelId      level) = 0;
+  virtual FramebufferFactory& SetColorAttachment( TextureDetails::AttachmentId attachmentIndex,
+                                                  const Texture&               texture,
+                                                  TextureDetails::LayerId      layer,
+                                                  TextureDetails::LevelId      level ) = 0;
 
   /**
-   * @brief Set the depth stencil flags on the framebuffer
+   * @brief Set a depth/stencil attachment texture on the framebuffer. Queries driver to provide
+   * optimal format.
    */
-  virtual void SetDepthStencilFlag(TextureDetails::DepthStencilFlag depthStencilFlag) = 0;
+  virtual FramebufferFactory& SetDepthStencilAttachment( const Texture&                   texture,
+                                                         TextureDetails::LayerId          layer,
+                                                         TextureDetails::LevelId          level,
+                                                         TextureDetails::DepthStencilFlag depthStencilFlag ) = 0;
 
   // not copyable
   FramebufferFactory(const FramebufferFactory&) = delete;
@@ -69,7 +71,6 @@ protected:
   FramebufferFactory& operator=(FramebufferFactory&&) = default;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
index 520319b..3ac5919 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_FRAMEBUFFER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+#include <cstdint>
+
 namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 
 /**
  * @brief Interface class for Framebuffer types in the graphics API.
@@ -56,12 +56,11 @@ protected:
   Framebuffer& operator=(Framebuffer&&) = default;
 
   /**
-   * Objects of this type should not directly.
+   * Objects of this type should not be directly instantiated.
    */
   Framebuffer() = default;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
index 301544d..e6add78 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_PIPELINE_FACTORY_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,14 +25,11 @@ namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
-class PipelineCache;
 
 /**
- * @brief Interface class for ShaderFactory types in the graphics API.
+ * @brief Interface class for generating Pipeline types in the graphics API.
  */
-class PipelineFactory : public BaseFactory<Pipeline>
+class PipelineFactory
 {
 public:
 
@@ -48,6 +45,8 @@ public:
 
   virtual PipelineFactory& SetViewportState( const ViewportState& state ) = 0;
 
+  virtual PipelineFactory& SetFramebufferState( const FramebufferState& state ) = 0;
+
   virtual PipelineFactory& SetBasePipeline( Pipeline& pipeline ) = 0;
 
   virtual PipelineFactory& SetDepthStencilState( DepthStencilState state ) = 0;
@@ -58,6 +57,12 @@ public:
 
   virtual PipelineFactory& SetInputAssemblyState( const InputAssemblyState& state ) = 0;
 
+  virtual PipelineFactory& SetDynamicStateMask( const PipelineDynamicStateMask mask ) = 0;
+
+  virtual PipelineFactory& SetOldPipeline( std::unique_ptr<Pipeline> oldPipeline ) = 0;
+
+  virtual std::unique_ptr<Pipeline> Create() = 0;
+
 protected:
   /// @brief default constructor
   PipelineFactory() = default;
@@ -66,9 +71,7 @@ protected:
   PipelineFactory& operator=(PipelineFactory&&) = default;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
 #endif // DALI_GRAPHICS_API_PIPELINE_FACTORY_H
-
index cf16a72..4b560bc 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_PIPELINE_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,8 +24,6 @@ namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 
 class Pipeline
 {
@@ -36,15 +34,17 @@ public:
 
   virtual ~Pipeline() = default;
 
+  virtual bool Equals(const Pipeline&) const { return false; }
+
 protected:
 
   Pipeline(Pipeline&&) = default;
   Pipeline& operator=(Pipeline&&) = default;
 
   Pipeline() = default;
-
 };
-}
-}
-}
+
+} // Graphics
+} // Dali
+
 #endif // DALI_GRAPHICS_API_PIPELINE_H
index 6d022af..7cbc5e2 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_RENDER_COMMAND_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // INTERNAL INCLUDES
 #include <dali/graphics-api/graphics-api-shader-details.h>
-#include <dali/graphics-api/graphics-api-accessor.h>
 #include <dali/graphics-api/graphics-api-framebuffer.h>
 #include <dali/graphics-api/graphics-api-buffer.h>
+#include <dali/graphics-api/graphics-api-types.h>
+#include <dali/graphics-api/graphics-api-pipeline.h>
 
+#include <cstring>
 namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 class Shader;
 class Texture;
 class Buffer;
 class Sampler;
 class Pipeline;
 
-
 /**
- * @brief Interface class for RenderCommand types in the graphics API.
- *
- * @startuml
- *
- * skinparam defaultFontName Ubuntu Mono
- * class RenderCommand {
- *  -- protected --
- *  #VertexAttributeBufferBinding[]  mVertexBufferBindings
- *  #UniformBufferBinding[]          mUniformBufferBindings
- *  #TextureBinding[]                mTextureBindings
- *  #SamplerBinding[]                mSamplerBindings
- *  #IndexBufferBinding              mIndexBufferBinding
- *  #RenderTargetBinding             mRenderTargetBinding
- *  #DrawCommand                     mDrawCommand
- *  #PushConstantsBinding[]          mPushConstantsBindings
- *  #RenderState                     mRenderState
- *
- * -- public API --
- *  +RenderCommand& BindVertextBuffers()
- *  +RenderCommand& BindUniformBuffers()
- *  +RenderCommand& BindTextures()
- *  +RenderCommand& BindSamplers()
- *  +RenderCommand& PushConstants()
- *  +RenderCommand& BindRenderState()
- *  +RenderCommand& Draw()
- *  -- static API ( helper functions )--
- *  {static} NewVertexAttributeBufferBindings()
- *  {static} NewVertexAttributeBufferBindings()
- *  {static} NewVertexAttributeBufferBindings()
- *  {static} NewTextureBindings()
- *  {static} NewPushConstantsBindings()
- * }
- *
- * class VertexAttributeBufferBinding {
- * Accessor<Buffer>   buffer
- * uint32_t           location
- * uint32_t           offset
- * uint32_t           stride
- * InputAttributeRate rate
- * void*              pNext
- * }
- *
- * class UniformBufferBinding {
- *   #Accessor<Buffer> buffer
- *   #uint32_t         offset
- *   #uint32_t         dataSize
- *   #uint32_t         binding
- *   #void*            pNext
- * }
- *
-  class IndexBufferBinding {
-    #Accessor<Buffer> buffer
-    #uint32_t         offset
-    #IndexType        type
-    #void*            pNext
-  }
-
-  class RenderTargetBinding {
-    #Accessor<Framebuffer>                 framebuffer
-    #std::vector<Framebuffer::ClearColor>  clearColors
-    #Framebuffer::DepthStencilClearColor   dsClearColor
-    #void*                                 pNext
-  }
-
-  class DrawCommand {
-      #DrawType drawType;
-      #uint32_t firstVertex
-      #uint32_t firstIndex
-      #uint32_t vertexCount
-      #uint32_t indicesCount
-      #uint32_t firstInstance
-      #uint32_t instanceCount
-      #void*    pNext
-  }
-
-  class PushConstantsBinding {
-    #void*     data
-    #uint32_t  size
-    #uint32_t  binding
-    #void*    pNext
-  }
-
-  class RenderState {
-    #Accessor<Shader> shader
-    #void*    pNext
-  }
-
-  class TextureBinding {
-    #Accessor<Texture> texture
-    #Accessor<Sampler> sampler
-    #uint32_t          binding
-    #void*             pNext
-  }
-
-  class SamplerBinding {
-    #Accessor<Sampler> sampler
-    #uint32_t binding
-    #void*    pNext
-  }
-
- note as RenderStateWIP
- Other render states like
- blending etc. should be added
- as public fields of this structure.
- end note
-
- RenderStateWIP .. RenderState
-
- * note as N1
- * Each state is described as POD
- * structure which is a Vulkan
- * approach.
- * end note
- *
- * note as N2
- * Field pNext may be used by the
- * implementation to pass additional
- * data.
- * end note
- *
- * N2 .. VertexAttributeBufferBinding::pNext
- * N1 .. VertexAttributeBufferBinding
- * N1 .. UniformBufferBinding
- * N1 .. IndexBufferBinding
- * N1 .. RenderTargetBinding
- *
+ * RenderCommand update flag bits
+ */
+constexpr uint32_t RENDER_COMMAND_UPDATE_PIPELINE_BIT           = 1 << 0;
+constexpr uint32_t RENDER_COMMAND_UPDATE_UNIFORM_BUFFER_BIT     = 1 << 1;
+constexpr uint32_t RENDER_COMMAND_UPDATE_VERTEX_ATTRIBUTE_BIT   = 1 << 2;
+constexpr uint32_t RENDER_COMMAND_UPDATE_TEXTURE_BIT            = 1 << 3;
+constexpr uint32_t RENDER_COMMAND_UPDATE_SAMPLER_BIT            = 1 << 4;
+constexpr uint32_t RENDER_COMMAND_UPDATE_INDEX_BUFFER_BIT       = 1 << 5;
+constexpr uint32_t RENDER_COMMAND_UPDATE_RENDER_TARGET_BIT      = 1 << 6;
+constexpr uint32_t RENDER_COMMAND_UPDATE_DRAW_BIT               = 1 << 7;
+constexpr uint32_t RENDER_COMMAND_UPDATE_PUSH_CONSTANTS_BIT     = 1 << 8;
+constexpr uint32_t RENDER_COMMAND_UPDATE_ALL_BITS               = 0xffff;
 
- *
- * RenderCommand *-right- VertexAttributeBufferBinding
- * RenderCommand *-right- UniformBufferBinding
- * RenderCommand *-left- IndexBufferBinding
- * RenderCommand *-left- RenderTargetBinding
- * RenderCommand *-up- RenderState
- * RenderCommand *-up- DrawCommand
- * RenderCommand *-down- PushConstantsBinding
- * RenderCommand *-down- SamplerBinding
- * RenderCommand *-down- TextureBinding
- * @enduml
+/**
+ * Class which defines a render operation.
+ * First, bind the relevant graphics objects to the command, finally call the Draw method.
  */
 class RenderCommand
 {
@@ -188,18 +65,15 @@ public:
 
   static constexpr uint32_t BINDING_INDEX_DONT_CARE { 0xffffffff };
 
-  enum class InputAttributeRate
-  {
-    PER_VERTEX,
-    PER_INSTANCE
-  };
-
   enum class IndexType
   {
     INDEX_TYPE_UINT16,
     INDEX_TYPE_UINT32,
   };
 
+  /**
+   * DrawType defines whether vertices are read contiguously, or use a secondary index
+   */
   enum class DrawType
   {
     UNDEFINED_DRAW,
@@ -207,77 +81,26 @@ public:
     INDEXED_DRAW,
   };
 
-  enum class Topology
-  {
-    TRIANGLES,
-    TRIANGLE_FAN,
-    TRIANGLE_STRIP,
-    LINES
-  };
-
   /**
-   * Describes buffer attribute binding
-   *
+   * Structure describes uniform buffer binding
    */
-  struct VertexAttributeBufferBinding
+  struct UniformBufferBinding
   {
-    VertexAttributeBufferBinding() = default;
-
-    Accessor<Buffer> buffer{ nullptr };
-    uint32_t location { 0u };
-    uint32_t offset { 0u };
-    uint32_t stride { 0u };
-    InputAttributeRate rate { InputAttributeRate::PER_VERTEX };
-
-    uint32_t binding { 0u };
-    void*    pNext{ nullptr };
-
-    VertexAttributeBufferBinding& SetBuffer( Accessor<Buffer> value )
-    {
-      buffer = value;
-      return *this;
-    }
-    VertexAttributeBufferBinding& SetLocation( uint32_t value )
-    {
-      location = value;
-      return *this;
-    }
-    VertexAttributeBufferBinding& SetOffset( uint32_t value )
+    UniformBufferBinding()
+    : buffer( nullptr ),
+      offset( 0u ),
+      dataSize( 0u ),
+      binding( 0u )
     {
-      offset = value;
-      return *this;
-    }
-    VertexAttributeBufferBinding& SetStride( uint32_t value )
-    {
-      stride = value;
-      return *this;
-    }
-    VertexAttributeBufferBinding& SetBinding( uint32_t value )
-    {
-      binding = value;
-      return *this;
-    }
-    VertexAttributeBufferBinding& SetInputAttributeRate( InputAttributeRate value)
-    {
-      rate = value;
-      return *this;
     }
-  };
 
-  /**
-   * Structure describes uniform buffer binding
-   */
-  struct UniformBufferBinding
-  {
-    UniformBufferBinding() :
-    buffer( nullptr ), offset( 0u ), dataSize( 0u ), binding( 0u ) {}
-    Accessor<Buffer> buffer;
+    const Buffer*  buffer;
     uint32_t offset;
     uint32_t dataSize;
     uint32_t binding;
     void*    pNext{ nullptr };
 
-    UniformBufferBinding& SetBuffer( Accessor<Buffer> value )
+    UniformBufferBinding& SetBuffer( const Buffer* value )
     {
       buffer = value;
       return *this;
@@ -297,45 +120,57 @@ public:
       binding = value;
       return *this;
     }
+
+    friend std::ostream& operator<<(std::ostream& ss, const UniformBufferBinding& object);
   };
 
   /**
-   *
+   * Structure describes texture binding
    */
   struct TextureBinding
   {
-    Accessor<Texture> texture;
-    Accessor<Sampler> sampler;
-    uint32_t binding;
-    void*    pNext{ nullptr };
-    TextureBinding() : texture(nullptr), sampler( nullptr ), binding( 0u ) {}
+    const Texture*  texture { nullptr };
+    const Sampler*  sampler { nullptr };
+    uint32_t        binding { 0u };
+    void*           pNext   { nullptr };
+    TextureBinding() = default;
 
-    TextureBinding& SetTexture( Accessor<Texture> value )
+    TextureBinding& SetTexture( const Texture* value )
     {
       texture = value;
       return *this;
     }
-    TextureBinding& SetSampler( Accessor<Sampler> value )
+
+    TextureBinding& SetSampler( const Sampler* value )
     {
       sampler = value;
       return *this;
     }
+
     TextureBinding& SetBinding( uint32_t value )
     {
       binding = value;
       return *this;
     }
+
+    bool operator==( const TextureBinding& rhs)
+    {
+      return (texture == rhs.texture) && (sampler == rhs.sampler);
+    }
+
+    friend std::ostream& operator<<(std::ostream& ss, const TextureBinding& object);
   };
 
   /**
-   *
+   * structure defining the sampler binding
    */
   struct SamplerBinding
   {
-    Accessor<Sampler> sampler;
-    uint32_t binding;
-    void*    pNext{ nullptr };
-    SamplerBinding& SetSampler( Accessor<Sampler> value )
+    const Sampler* sampler { nullptr };
+    uint32_t       binding { 0u };
+    void*          pNext   { nullptr };
+
+    SamplerBinding& SetSampler( const Sampler* value )
     {
       sampler = value;
       return *this;
@@ -345,20 +180,22 @@ public:
       binding = value;
       return *this;
     }
+    friend std::ostream& operator<<(std::ostream& ss, const SamplerBinding& object);
   };
 
   /**
-   *
+   * structure defining the index buffer binding
    */
   struct IndexBufferBinding
   {
-    Accessor<Buffer> buffer { nullptr };
-    uint32_t offset { 0u };
-    IndexType type { IndexType::INDEX_TYPE_UINT16 };
-    void*    pNext{ nullptr };
+    const Buffer* buffer { nullptr };
+    uint32_t      offset { 0u };
+    IndexType     type   { IndexType::INDEX_TYPE_UINT16 };
+    void*         pNext  { nullptr };
+
     IndexBufferBinding() = default;
 
-    IndexBufferBinding& SetBuffer( Accessor<Buffer> value )
+    IndexBufferBinding& SetBuffer( const Buffer* value )
     {
       buffer = value;
       return *this;
@@ -375,17 +212,25 @@ public:
       type = value;
       return *this;
     }
+
+    friend std::ostream& operator<<(std::ostream& ss, const IndexBufferBinding&);
   };
 
+  /**
+   * structure defining the framebuffer (if any) of the render target
+   */
   struct RenderTargetBinding
   {
-    Accessor<Framebuffer>                 framebuffer { nullptr };
+    const Framebuffer*                    framebuffer { nullptr };
     std::vector<Framebuffer::ClearColor>  clearColors {};
-    Framebuffer::DepthStencilClearColor   dsClearColor {};
-    void*    pNext{ nullptr };
+    Framebuffer::DepthStencilClearColor   depthStencilClearColor {};
+    float framebufferWidth; // Store the framebuffer size in case we need to set viewport
+    float framebufferHeight;
+    void* pNext{ nullptr };
+
     RenderTargetBinding() = default;
 
-    RenderTargetBinding& SetFramebuffer( Accessor<Framebuffer> value )
+    RenderTargetBinding& SetFramebuffer( const Framebuffer* value )
     {
       framebuffer = value;
       return *this;
@@ -397,17 +242,23 @@ public:
       return *this;
     }
 
-    RenderTargetBinding& SetFramebuffer( Framebuffer::DepthStencilClearColor value )
+    RenderTargetBinding& SetDepthStencilClearColor( Framebuffer::DepthStencilClearColor value )
     {
-      dsClearColor = value;
+      depthStencilClearColor = value;
       return *this;
     }
+
+    friend std::ostream& operator<<(std::ostream& ss, const RenderTargetBinding&);
   };
 
+  /**
+   * Structure defining the draw command
+   */
   struct DrawCommand
   {
-    DrawCommand() :
-     drawType( DrawType::UNDEFINED_DRAW ){}
+    DrawCommand() : drawType( DrawType::UNDEFINED_DRAW )
+    {}
+
     DrawType drawType;
     union
     {
@@ -421,6 +272,15 @@ public:
     };
     uint32_t firstInstance;
     uint32_t instanceCount;
+
+    // dynamic scissor state
+    bool        scissorTestEnable { false };
+    Rect2D      scissor {};
+
+    // dynamic viewport state
+    bool        viewportEnable { false };
+    Viewport    viewport {};
+
     void*    pNext{ nullptr };
     DrawCommand& SetDrawType( DrawType value )
     {
@@ -457,73 +317,69 @@ public:
       instanceCount = value;
       return *this;
     }
-  };
 
-  /**
-   *
-   */
-  struct PushConstantsBinding
-  {
-    void*     data;
-    uint32_t  size;
-    uint32_t  binding;
-    void*    pNext{ nullptr };
-    PushConstantsBinding() = default;
+    DrawCommand& SetScissor( Rect2D value )
+    {
+      scissor = value;
+      return *this;
+    }
 
-    PushConstantsBinding& SetData( void* value )
+    DrawCommand& SetScissorTestEnable( bool value )
     {
-      data = value;
+      scissorTestEnable = value;
       return *this;
     }
-    PushConstantsBinding& SetSize( uint32_t value )
+
+    DrawCommand& SetViewport( Viewport value )
     {
-      size = value;
+      viewport = value;
       return *this;
     }
-    PushConstantsBinding& SetBinding( uint32_t value )
+
+    DrawCommand& SetViewportEnable( bool value )
     {
-      binding = value;
+      viewportEnable = value;
       return *this;
     }
+
+
+    friend std::ostream& operator<<(std::ostream& ss, const DrawCommand&);
   };
 
   /**
-   *
+   * Structure defining the push constants
    */
-  struct RenderState
+  struct PushConstantsBinding
   {
-    struct BlendState
-    {
-      bool blendingEnabled { false };
-    };
-
-    RenderState() = default;
+    void*     data      { nullptr };
+    uint32_t  size      { 0u };
+    uint32_t  binding   { 0u };
+    void*     pNext     { nullptr };
 
-    Accessor<Shader> shader { nullptr };
-    BlendState blendState {};
-    Topology topology{ Topology::TRIANGLES };
+    PushConstantsBinding() = default;
 
-    RenderState& SetShader( Accessor<Shader> value )
+    PushConstantsBinding& SetData( void* value )
     {
-      shader = value;
+      data = value;
       return *this;
     }
-
-    RenderState& SetBlendState( BlendState value )
+    PushConstantsBinding& SetSize( uint32_t value )
     {
-      blendState = value;
+      size = value;
       return *this;
     }
-
-    RenderState& SetTopology( Topology value )
+    PushConstantsBinding& SetBinding( uint32_t value )
     {
-      topology = value;
+      binding = value;
       return *this;
     }
 
-    void*    pNext{ nullptr };
+    friend std::ostream& operator<<(std::ostream& ss, const PushConstantsBinding&);
   };
 
+  /**
+   * Constructor
+   */
   RenderCommand()
   : mVertexBufferBindings(),
     mUniformBufferBindings(),
@@ -532,8 +388,8 @@ public:
     mRenderTargetBinding(),
     mDrawCommand(),
     mPushConstantsBindings(),
-    mRenderState(),
-    mPipeline( nullptr )
+    mPipeline( nullptr ),
+    mUpdateFlags( 0u )
   {
   }
 
@@ -550,90 +406,78 @@ public:
   /**
    * Resource binding API
    */
-  RenderCommand& BindVertexBuffers( std::vector<Accessor<Buffer>>&& buffers )
+  RenderCommand& BindVertexBuffers( std::vector<const Buffer*>&& buffers )
   {
     mVertexBufferBindings = std::move( buffers );
+    mUpdateFlags |= RENDER_COMMAND_UPDATE_VERTEX_ATTRIBUTE_BIT;
     return *this;
   }
 
-  RenderCommand& BindUniformBuffers( std::vector<UniformBufferBinding>&& bindings )
+  RenderCommand& BindUniformBuffers( const std::vector<UniformBufferBinding>* bindings )
   {
-    mUniformBufferBindings = std::move( bindings );
+    mUniformBufferBindings = bindings;
+    mUpdateFlags |= RENDER_COMMAND_UPDATE_UNIFORM_BUFFER_BIT;
     return *this;
   }
 
-  RenderCommand& BindTextures( std::vector<TextureBinding>&& bindings )
+  RenderCommand& BindTextures( const std::vector<TextureBinding>* bindings )
   {
-    mTextureBindings = std::move( bindings );
+    // compare bindings
+    mTextureBindings = bindings;
+    mUpdateFlags |= RENDER_COMMAND_UPDATE_TEXTURE_BIT;
     return *this;
   }
 
   RenderCommand& BindSamplers( std::vector<SamplerBinding>&& bindings )
   {
     mSamplerBindings = std::move( bindings );
+    mUpdateFlags |= RENDER_COMMAND_UPDATE_SAMPLER_BIT;
     return *this;
   }
 
   RenderCommand& PushConstants( std::vector<PushConstantsBinding>&& bindings )
   {
     mPushConstantsBindings = bindings;
-    return *this;
-  }
-
-  RenderCommand& BindRenderState( RenderState& renderState )
-  {
-    mRenderState = renderState;
+    mUpdateFlags |= RENDER_COMMAND_UPDATE_PUSH_CONSTANTS_BIT;
     return *this;
   }
 
   RenderCommand& BindRenderTarget( const RenderTargetBinding& binding )
   {
     mRenderTargetBinding = binding;
+    mUpdateFlags |= RENDER_COMMAND_UPDATE_RENDER_TARGET_BIT;
     return *this;
   }
 
   RenderCommand& BindRenderTarget( RenderTargetBinding&& binding )
   {
     mRenderTargetBinding = std::move(binding);
+    mUpdateFlags |= RENDER_COMMAND_UPDATE_RENDER_TARGET_BIT;
     return *this;
   }
 
-  RenderCommand& Draw( DrawCommand&& drawCommand )
+  RenderCommand& BindPipeline( const Pipeline* pipeline )
   {
-    mDrawCommand = drawCommand;
-    return *this;
-  }
-
-  RenderCommand& BindPipeline( const Pipeline& pipeline )
-  {
-    mPipeline = &pipeline;
+    if( !mPipeline || mPipeline != pipeline )
+    {
+      mPipeline = pipeline;
+      mUpdateFlags |= RENDER_COMMAND_UPDATE_PIPELINE_BIT;
+    }
     return *this;
   }
 
   RenderCommand& BindIndexBuffer( const IndexBufferBinding& binding )
   {
     mIndexBufferBinding = binding;
+    mUpdateFlags |= RENDER_COMMAND_UPDATE_INDEX_BUFFER_BIT;
     return *this;
   }
 
-  static std::vector<VertexAttributeBufferBinding> NewVertexAttributeBufferBindings()
-  {
-    return std::vector<VertexAttributeBufferBinding>{};
-  }
-
-  /**
-   * Makes a copy ( or moves ) all bindings from the source array
-   * @param bindings
-   * @return
-   */
-  static std::vector<VertexAttributeBufferBinding> NewVertexAttributeBufferBindings( std::vector<VertexAttributeBufferBinding>&& bindings )
-  {
-    return std::vector<VertexAttributeBufferBinding>{ std::move(bindings) };
-  }
-
-  static std::vector<VertexAttributeBufferBinding> NewVertexAttributeBufferBindings( const std::vector<VertexAttributeBufferBinding>& bindings )
+  RenderCommand& Draw( DrawCommand&& drawCommand )
   {
-    return std::vector<VertexAttributeBufferBinding>{ bindings };
+    mDrawCommand = drawCommand;
+    mUpdateFlags |= RENDER_COMMAND_UPDATE_DRAW_BIT;
+    return *this;
   }
 
   static std::vector<TextureBinding> NewTextureBindings()
@@ -648,8 +492,15 @@ public:
     return retval;
   }
 
+  static std::vector<UniformBufferBinding> NewUniformBufferBindings( uint32_t count )
+  {
+    auto retval = std::vector<UniformBufferBinding>{};
+    retval.resize( count );
+    return retval;
+  }
+
   // Getters
-  const std::vector<Accessor<Buffer>>& GetVertexBufferBindings() const
+  const std::vector<const Buffer*>& GetVertexBufferBindings() const
   {
     return mVertexBufferBindings;
   }
@@ -659,7 +510,7 @@ public:
     return mUniformBufferBindings;
   }
 
-  const std::vector<TextureBinding>& GetTextureBindings() const
+  const std::vector<TextureBinding>* GetTextureBindings() const
   {
     return mTextureBindings;
   }
@@ -684,179 +535,47 @@ public:
     return mPushConstantsBindings;
   }
 
-  const RenderState& GetRenderState() const
-  {
-    return mRenderState;
-  }
-
   const Pipeline* GetPipeline() const
   {
     return mPipeline;
   }
 
+  friend std::ostream& operator<<(std::ostream& ss, const RenderCommand& object);
+
 public:
 
   // list of resources
-  std::vector<Accessor<Buffer>>             mVertexBufferBindings;
-  std::vector<UniformBufferBinding>         mUniformBufferBindings;
-  std::vector<TextureBinding>               mTextureBindings;
+  std::vector<const Buffer*>                mVertexBufferBindings;
+  const std::vector<UniformBufferBinding>*  mUniformBufferBindings;
+  const std::vector<TextureBinding>*        mTextureBindings;
   std::vector<SamplerBinding>               mSamplerBindings;
 
-
   IndexBufferBinding                        mIndexBufferBinding;
   RenderTargetBinding                       mRenderTargetBinding;
   DrawCommand                               mDrawCommand;
   std::vector<PushConstantsBinding>         mPushConstantsBindings;
-  RenderState                               mRenderState;
   const Pipeline*                           mPipeline;
 
+protected:
+  uint32_t mUpdateFlags; // update flags to be handled by implementation
 };
 
-} // namespace API
-} // namespace Graphics
-} // namespace Dali
-
-
-#endif // DALI_GRAPHICS_API_RENDER_COMMAND_H
-
-
-/**
- * @brief Interface class for RenderCommand types in the graphics API.
- *
- * @startuml
- *
- * skinparam defaultFontName Ubuntu Mono
- * class RenderCommand {
- *  -- protected --
- *  #VertexAttributeBufferBinding[]  mVertexBufferBindings
- *  #UniformBufferBinding[]          mUniformBufferBindings
- *  #TextureBinding[]                mTextureBindings
- *  #SamplerBinding[]                mSamplerBindings
- *  #IndexBufferBinding              mIndexBufferBinding
- *  #RenderTargetBinding             mRenderTargetBinding
- *  #DrawCommand                     mDrawCommand
- *  #PushConstantsBinding[]          mPushConstantsBindings
- *  #RenderState                     mRenderState
- *
- * -- public API --
- *  +RenderCommand& BindVertextBuffers()
- *  +RenderCommand& BindUniformBuffers()
- *  +RenderCommand& BindTextures()
- *  +RenderCommand& BindSamplers()
- *  +RenderCommand& PushConstants()
- *  +RenderCommand& BindRenderState()
- *  +RenderCommand& Draw()
- *  -- static API ( helper functions )--
- *  {static} NewVertexAttributeBufferBindings()
- *  {static} NewVertexAttributeBufferBindings()
- *  {static} NewVertexAttributeBufferBindings()
- *  {static} NewTextureBindings()
- *  {static} NewPushConstantsBindings()
- * }
- *
- * class VertexAttributeBufferBinding {
- * Accessor<Buffer>   buffer
- * uint32_t           location
- * uint32_t           offset
- * uint32_t           stride
- * InputAttributeRate rate
- * void*              pNext
- * }
- *
- * class UniformBufferBinding {
- *   #Accessor<Buffer> buffer
- *   #uint32_t         offset
- *   #uint32_t         dataSize
- *   #uint32_t         binding
- *   #void*            pNext
- * }
- *
-  class IndexBufferBinding {
-    #Accessor<Buffer> buffer
-    #uint32_t         offset
-    #IndexType        type
-    #void*            pNext
-  }
-
-  class RenderTargetBinding {
-    #Accessor<Framebuffer>                 framebuffer
-    #std::vector<Framebuffer::ClearColor>  clearColors
-    #Framebuffer::DepthStencilClearColor   dsClearColor
-    #void*                                 pNext
-  }
-
-  class DrawCommand {
-      #DrawType drawType;
-      #uint32_t firstVertex
-      #uint32_t firstIndex
-      #uint32_t vertexCount
-      #uint32_t indicesCount
-      #uint32_t firstInstance
-      #uint32_t instanceCount
-      #void*    pNext
-  }
-
-  class PushConstantsBinding {
-    #void*     data
-    #uint32_t  size
-    #uint32_t  binding
-    #void*    pNext
-  }
+//@todo Move to a better place? (can't go in graphics-api-types, it's a cyclic dependency)
+struct TextureBindingState
+{
+  std::vector<RenderCommand::TextureBinding> textureBindings {};
 
-  class RenderState {
-    #Accessor<Shader> shader
-    #void*    pNext
-  }
+  Extension extension{ nullptr };
 
-  class TextureBinding {
-    #Accessor<Texture> texture
-    #Accessor<Sampler> sampler
-    #uint32_t          binding
-    #void*             pNext
-  }
-
-  class SamplerBinding {
-    #Accessor<Sampler> sampler
-    #uint32_t binding
-    #void*    pNext
+  TextureBindingState& SetTextureBindings( const std::vector<RenderCommand::TextureBinding>& theTextureBindings )
+  {
+    textureBindings = theTextureBindings;
+    return *this;
   }
+};
 
- note as RenderStateWIP
- Other render states like
- blending etc. should be added
- as public fields of this structure.
- end note
-
- RenderStateWIP .. RenderState
+} // namespace Graphics
+} // namespace Dali
 
- * note as N1
- * Each state is described as POD
- * structure which is a Vulkan
- * approach.
- * end note
- *
- * note as N2
- * Field pNext may be used by the
- * implementation to pass additional
- * data.
- * end note
- *
- * N2 .. VertexAttributeBufferBinding::pNext
- * N1 .. VertexAttributeBufferBinding
- * N1 .. UniformBufferBinding
- * N1 .. IndexBufferBinding
- * N1 .. RenderTargetBinding
- *
 
- *
- * RenderCommand *-right- VertexAttributeBufferBinding
- * RenderCommand *-right- UniformBufferBinding
- * RenderCommand *-left- IndexBufferBinding
- * RenderCommand *-left- RenderTargetBinding
- * RenderCommand *-up- RenderState
- * RenderCommand *-up- DrawCommand
- * RenderCommand *-down- PushConstantsBinding
- * RenderCommand *-down- SamplerBinding
- * RenderCommand *-down- TextureBinding
- * @enduml
- */
\ No newline at end of file
+#endif // DALI_GRAPHICS_API_RENDER_COMMAND_H
diff --git a/dali/graphics-api/graphics-api-sampler-factory.h b/dali/graphics-api/graphics-api-sampler-factory.h
new file mode 100644 (file)
index 0000000..856c37e
--- /dev/null
@@ -0,0 +1,82 @@
+#ifndef DALI_GRAPHICS_API_SAMPLER_FACTORY_H
+#define DALI_GRAPHICS_API_SAMPLER_FACTORY_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/graphics-api/graphics-api-base-factory.h>
+#include <dali/graphics-api/graphics-api-sampler.h>
+#include <dali/graphics-api/graphics-api-types.h>
+
+namespace Dali
+{
+namespace Graphics
+{
+
+/**
+ * @brief Interface class for ShaderFactory types in the graphics API.
+ */
+class SamplerFactory : public BaseFactory<Sampler>
+{
+public:
+
+  virtual SamplerFactory& SetAddressModeU( SamplerAddressMode mode ) = 0;
+
+  virtual SamplerFactory& SetAddressModeV( SamplerAddressMode mode ) = 0;
+
+  virtual SamplerFactory& SetAddressModeW( SamplerAddressMode mode ) = 0;
+
+  virtual SamplerFactory& SetMinFilter( SamplerFilter filter ) = 0;
+
+  virtual SamplerFactory& SetMagFilter( SamplerFilter filter ) = 0;
+
+  virtual SamplerFactory& SetMipmapMode( SamplerMipmapMode mipmapMode ) = 0;
+
+  virtual SamplerFactory& SetAnisotropyEnable( bool anisotropyEnable ) = 0;
+
+  virtual SamplerFactory& SetMaxAnisotropy( float maxAnisotropy ) = 0;
+
+  virtual SamplerFactory& SetMinLod( float minLod ) = 0;
+
+  virtual SamplerFactory& SetMaxLod( float maxLod ) = 0;
+
+  virtual SamplerFactory& SetUnnormalizeCoordinates( bool unnormalizedCoordinates ) = 0;
+
+  virtual SamplerFactory& SetCompareEnable( bool compareEnable ) = 0;
+
+  virtual SamplerFactory& SetCompareOp( CompareOp compareOp ) = 0;
+
+  // not copyable
+  SamplerFactory(const SamplerFactory&) = delete;
+  SamplerFactory& operator=(const SamplerFactory&) = delete;
+
+  virtual ~SamplerFactory() = default;
+
+protected:
+
+  /// @brief default constructor
+  SamplerFactory() = default;
+
+  // derived types should not be moved directly to prevent slicing
+  SamplerFactory(SamplerFactory&&) = default;
+  SamplerFactory& operator=(SamplerFactory&&) = default;
+};
+
+} // namespace Graphics
+} // namespace Dali
+
+#endif // DALI_GRAPHICS_API_SHADER_FACTORY_H
index d66d106..e739a96 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_SAMPLER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,8 +22,6 @@ namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 
 /**
  * @brief Interface class for Sampler types in the graphics API.
@@ -48,7 +46,6 @@ protected:
   Sampler() = default;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
index 73aa95e..3b934f6 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_SHADER_DETAILS_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,8 +26,6 @@ namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 namespace ShaderDetails
 {
 
@@ -169,6 +167,16 @@ struct UniformInfo
   uint32_t      bufferIndex { 0u };
   uint32_t      offset { 0u };
   uint32_t      location { 0u };
+
+  inline bool operator==( const UniformInfo& rhs )
+  {
+    return name == rhs.name &&
+           uniformClass == rhs.uniformClass &&
+           binding == rhs.binding &&
+           bufferIndex == rhs.bufferIndex &&
+           offset == rhs.offset &&
+           location == rhs.location;
+  }
 };
 
 struct UniformBlockInfo
@@ -180,8 +188,7 @@ struct UniformBlockInfo
   std::vector<UniformInfo> members {};
 };
 
-} // namespace TextureDetails
-} // namespace API
+} // namespace ShaderDetails
 } // namespace Graphics
 } // namespace Dali
 
index 301e4ce..4deb463 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_SHADER_FACTORY_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,8 +26,6 @@ namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 
 /**
  * @brief Interface class for ShaderFactory types in the graphics API.
@@ -57,7 +55,6 @@ protected:
   ShaderFactory& operator=(ShaderFactory&&) = default;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
index ccfbb2c..11e2b39 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_SHADER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,8 +27,6 @@ namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 
 /**
  * @brief Interface class for Shader types in the graphics API.
@@ -84,6 +82,16 @@ public:
     return 0u;
   }
 
+  virtual uint32_t GetUniformBlockBinding( uint32_t index ) const
+  {
+    return 0u;
+  }
+
+  virtual uint32_t GetUniformBlockSize( uint32_t index ) const
+  {
+    return 0u;
+  }
+
   virtual bool GetUniformBlock( uint32_t index, ShaderDetails::UniformBlockInfo& out ) const
   {
     return false;
@@ -95,12 +103,11 @@ protected:
   Shader& operator=(Shader&&) = default;
 
   /**
-   * Objects of this type should not directly.
+   * Objects of this type should not be directly instantiated.
    */
   Shader() = default;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
index 62efb33..18072e3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_TEXTURE_DETAILS_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+#include <dali/graphics-api/graphics-api-types.h>
+
 namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 namespace TextureDetails
 {
 
@@ -31,52 +31,67 @@ using AttachmentId = size_t;
 using LayerId = size_t;
 using LevelId = size_t;
 
-enum class Type {
+enum class Type
+{
   TEXTURE_2D,
   TEXTURE_3D,
   TEXTURE_CUBEMAP,
 };
 
-enum class Format {
-
-  // texture color formats
-  RGBA8,
-  L8,
-  ETC2_RGBA8,
-
-  // compressed color formats
-  ETC2,
-  ASTC_4x4,
-  ASTC_5x5,
-  ASTC_6x6,
-  ASTC_8x8,
-  ASTC_10x10,
-  ASTC_12x12,
-
-  // depth /stencil formats
-  D16_UNORM,
-  D16_UNORM_S8_UINT,
-  D32_SFLOAT,
-  D32_SFLOAT_S8_UINT,
-  D24_UNORM_S8_UINT,
-
-  // TODO: copy
+enum class Usage
+{
+  SAMPLE,
+  COLOR_ATTACHMENT,
+  DEPTH_ATTACHMENT
 };
 
-enum class MipMapFlag {
+using Format = Dali::Graphics::Format;
+
+enum class MipMapFlag
+{
   ENABLED,
   DISABLED,
 };
 
-enum class DepthStencilFlag {
+enum class DepthStencilFlag
+{
   NONE,
   DEPTH,
   STENCIL,
   DEPTH_STENCIL,
 };
 
+/**
+ * Texture update mode
+ */
+enum class UpdateMode
+{
+  /**
+   * Update mode preferred by the Texture implementation.
+   * Setting mode as UNDEFINED allows the implementation to decide
+   * whether the texture data update will be deferred or immediate.
+   * It may heavily depend on the use cases. If possible, the UNDEFINED
+   * mode should be preferred by the developers.
+   */
+  UNDEFINED,
+
+  /**
+   * Textures are updated on the render commands submission ( bulk update ).
+   * In certain cases it may allow the implementation to optimize the way
+   * the resources are accessed and synchronize writes more efficiently.
+   */
+  DEFERRED,
+
+  /**
+   * Textures are updated when any Copy...() function is called.
+   * This mode may be useful whenever we want to make sure the texture
+   * data has been uploaded early and upload has finished before using
+   * the resource for other purposes ( ie. generating mipmaps ).
+   */
+  IMMEDIATE,
+};
+
 } // namespace TextureDetails
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
index 3ed87b1..6f704e3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_TEXTURE_FACTORY_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/graphics-api/graphics-api-base-factory.h>
 #include <dali/graphics-api/graphics-api-texture-details.h>
 #include <dali/graphics-api/graphics-api-texture.h>
-#include <dali/graphics-api/graphics-api-utility.h>
+#include <dali/public-api/images/native-image-interface.h>
 
 namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
 
 /**
  * @brief Interface class for TextureFactory types in the graphics API.
@@ -37,11 +35,14 @@ class TextureFactory : public BaseFactory<Texture>
 {
 public:
   virtual TextureFactory& SetType(TextureDetails::Type type)             = 0;
-  virtual TextureFactory& SetSize(const RectSize& size)                  = 0;
-  virtual TextureFactory& SetFormat(TextureDetails::Format format)       = 0;
-  virtual TextureFactory& SetMipMapFlag(TextureDetails::MipMapFlag mipMSapFlag) = 0;
+  virtual TextureFactory& SetSize(const Extent2D& size)                  = 0;
+  virtual TextureFactory& SetFormat(Format format)                       = 0;
+  virtual TextureFactory& SetMipMapFlag(TextureDetails::MipMapFlag mipMapFlag) = 0;
+  virtual TextureFactory& SetUsage( TextureDetails::Usage usage )        = 0;
   virtual TextureFactory& SetData( void* pData )                         = 0;
   virtual TextureFactory& SetDataSize( uint32_t dataSizeInBytes )        = 0;
+  virtual TextureFactory& SetNativeImage( NativeImageInterfacePtr nativeImageInterface ) = 0;
+  virtual TextureFactory& SetTiling( TextureTiling tiling )              = 0;
 
   // not copyable
   TextureFactory(const TextureFactory&) = delete;
@@ -58,7 +59,6 @@ protected:
   TextureFactory& operator=(TextureFactory&&) = default;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
index 1d8f84b..2285127 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_TEXTURE_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+#include <dali/graphics-api/graphics-api-types.h>
+#include <dali/graphics-api/graphics-api-texture-details.h>
+
 namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
+
+class Buffer;
 
 /**
  * @brief Interface class for Texture types in the graphics API.
@@ -38,6 +41,61 @@ public:
 
   virtual ~Texture() = default;
 
+  /**
+   * Copies memory into specified region of texture. The format of source data
+   * must match the texture format.
+   *
+   * @param srcMemory Valid pointer to the memory containing image data
+   * @param srcMemorySize Size of source buffer in bytes
+   * @param srcExtent Image dimensions
+   * @param dstOffset Destination offset
+   * @param layer Layer
+   * @param level Mipmap level
+   */
+  virtual void CopyMemory( const void *srcMemory, uint32_t srcMemorySize, Extent2D srcExtent, Offset2D dstOffset, uint32_t layer, uint32_t level, TextureDetails::UpdateMode updateMode ) = 0;
+
+  /**
+   * Copies region of source texture at the offset.
+   *
+   * @param srcTexture Source texture
+   * @param srcRegion Source region
+   * @param dstOffset Destination offset
+   * @param layer Layer to copy
+   * @param level Mipmap level to copy
+   */
+  virtual void CopyTexture(const Texture &srcTexture, Rect2D srcRegion, Offset2D dstOffset, uint32_t layer, uint32_t level, TextureDetails::UpdateMode updateMode ) = 0;
+
+  /**
+   * Copies buffer content into the texture
+   * @param buffer source buffer
+   * @param bufferOffset offset in bytes in the buffer
+   * @param extent2D extents of source image ( width, height )
+   * @param textureOffset2D destination blitting offset
+   * @param layer destination layer
+   * @param level destination mipmap leve;
+   * @param flags additional flags
+   */
+  virtual void CopyBuffer(const Dali::Graphics::Buffer& buffer,
+                          uint32_t bufferOffset,
+                          Extent2D extent2D,
+                          Offset2D textureOffset2D,
+                          uint32_t layer,
+                          uint32_t level,
+                          TextureUpdateFlags flags ) = 0;
+
+  /**
+   * Returns memory requirements for the texture
+   *
+   * @return Instance of memory requirements
+   */
+  virtual MemoryRequirements GetMemoryRequirements() const = 0;
+
+  /**
+   * Returns texture properties
+   * @return texture properties structure
+   */
+  virtual const TextureProperties& GetProperties() = 0;
+
 protected:
   // derived types should not be moved directly to prevent slicing
   Texture(Texture&&) = default;
@@ -49,7 +107,6 @@ protected:
   Texture() = default;
 };
 
-} // namespace API
 } // namespace Graphics
 } // namespace Dali
 
diff --git a/dali/graphics-api/graphics-api-types-debug.h b/dali/graphics-api/graphics-api-types-debug.h
new file mode 100644 (file)
index 0000000..faf95eb
--- /dev/null
@@ -0,0 +1,354 @@
+#ifndef DALI_GRAPHICS_API_TYPES_DEBUG_H
+#define DALI_GRAPHICS_API_TYPES_DEBUG_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include <dali/graphics-api/graphics-api-types.h>
+
+namespace Dali
+{
+namespace Graphics
+{
+
+namespace Debug
+{
+#if defined(DEBUG_ENABLED)
+
+#define CASE(TYPE, VALUE) case TYPE::VALUE: return std::string(#VALUE)
+
+inline std::string str( const VertexInputRate& rate )
+{
+  switch( rate )
+  {
+    CASE( VertexInputRate, PER_INSTANCE );
+    CASE( VertexInputRate, PER_VERTEX );
+  }
+  return "UNDEFINED";
+}
+
+inline std::string str( const PrimitiveTopology& topology )
+{
+  switch( topology )
+  {
+    CASE( PrimitiveTopology, LINE_STRIP);
+    CASE( PrimitiveTopology, POINT_LIST);
+    CASE( PrimitiveTopology, LINE_LIST);
+    CASE( PrimitiveTopology, TRIANGLE_LIST);
+    CASE( PrimitiveTopology, TRIANGLE_STRIP);
+    CASE( PrimitiveTopology, TRIANGLE_FAN);
+  }
+  return "UNDEFINED";
+}
+
+inline std::string str( const CompareOp& op )
+{
+  switch( op )
+  {
+    CASE( CompareOp, NEVER);
+    CASE( CompareOp, LESS);
+    CASE( CompareOp, EQUAL);
+    CASE( CompareOp, LESS_OR_EQUAL);
+    CASE( CompareOp, GREATER);
+    CASE( CompareOp, NOT_EQUAL);
+    CASE( CompareOp, GREATER_OR_EQUAL);
+    CASE( CompareOp, ALWAYS);
+  }
+  return "UNDEFINED";
+}
+
+inline std::string str( const CullMode& mode )
+{
+  switch( mode )
+  {
+    CASE( CullMode, NONE);
+    CASE( CullMode, FRONT);
+    CASE( CullMode, BACK);
+    CASE( CullMode, FRONT_AND_BACK);
+  }
+  return "UNDEFINED";
+}
+
+inline std::string str( const PolygonMode& mode )
+{
+  switch( mode )
+  {
+    CASE( PolygonMode, FILL);
+    CASE( PolygonMode, LINE);
+    CASE( PolygonMode, POINT);
+  }
+  return "UNDEFINED";
+}
+
+inline std::string str( const FrontFace& mode )
+{
+  switch( mode )
+  {
+    CASE( FrontFace, COUNTER_CLOCKWISE);
+    CASE( FrontFace, CLOCKWISE);
+  }
+  return "UNDEFINED";
+}
+
+inline std::string str( const BlendFactor& factor )
+{
+  switch( factor )
+  {
+    CASE( BlendFactor, ZERO );
+    CASE( BlendFactor, ONE );
+    CASE( BlendFactor, SRC_COLOR );
+    CASE( BlendFactor, ONE_MINUS_SRC_COLOR );
+    CASE( BlendFactor, DST_COLOR );
+    CASE( BlendFactor, ONE_MINUS_DST_COLOR );
+    CASE( BlendFactor, SRC_ALPHA );
+    CASE( BlendFactor, ONE_MINUS_SRC_ALPHA );
+    CASE( BlendFactor, DST_ALPHA );
+    CASE( BlendFactor, ONE_MINUS_DST_ALPHA );
+    CASE( BlendFactor, CONSTANT_COLOR );
+    CASE( BlendFactor, ONE_MINUS_CONSTANT_COLOR );
+    CASE( BlendFactor, CONSTANT_ALPHA );
+    CASE( BlendFactor, ONE_MINUS_CONSTANT_ALPHA );
+    CASE( BlendFactor, SRC_ALPHA_SATURATE );
+    CASE( BlendFactor, SRC1_COLOR );
+    CASE( BlendFactor, ONE_MINUS_SRC1_COLOR );
+    CASE( BlendFactor, SRC1_ALPHA );
+    CASE( BlendFactor, ONE_MINUS_SRC1_ALPHA );
+  }
+  return "UNDEFINED";
+}
+
+inline std::string str( const BlendOp& op )
+{
+  switch( op )
+  {
+    CASE( BlendOp, ADD );
+    CASE( BlendOp, SUBTRACT );
+    CASE( BlendOp, REVERSE_SUBTRACT );
+    CASE( BlendOp, MIN );
+    CASE( BlendOp, MAX );
+  }
+  return "UNDEFINED";
+}
+
+inline std::string str( const Format& format )
+{
+  switch( format )
+  {
+    CASE( Format, UNDEFINED );
+    CASE( Format, L8 );
+    CASE( Format, L8A8 );
+    CASE( Format, R4G4_UNORM_PACK8 );
+    CASE( Format, R4G4B4A4_UNORM_PACK16 );
+    CASE( Format, B4G4R4A4_UNORM_PACK16 );
+    CASE( Format, R5G6B5_UNORM_PACK16 );
+    CASE( Format, B5G6R5_UNORM_PACK16 );
+    CASE( Format, R5G5B5A1_UNORM_PACK16 );
+    CASE( Format, B5G5R5A1_UNORM_PACK16 );
+    CASE( Format, A1R5G5B5_UNORM_PACK16 );
+    CASE( Format, R8_UNORM );
+    CASE( Format, R8_SNORM );
+    CASE( Format, R8_USCALED );
+    CASE( Format, R8_SSCALED );
+    CASE( Format, R8_UINT );
+    CASE( Format, R8_SINT );
+    CASE( Format, R8_SRGB );
+    CASE( Format, R8G8_UNORM );
+    CASE( Format, R8G8_SNORM );
+    CASE( Format, R8G8_USCALED );
+    CASE( Format, R8G8_SSCALED );
+    CASE( Format, R8G8_UINT );
+    CASE( Format, R8G8_SINT );
+    CASE( Format, R8G8_SRGB );
+    CASE( Format, R8G8B8_UNORM );
+    CASE( Format, R8G8B8_SNORM );
+    CASE( Format, R8G8B8_USCALED );
+    CASE( Format, R8G8B8_SSCALED );
+    CASE( Format, R8G8B8_UINT );
+    CASE( Format, R8G8B8_SINT );
+    CASE( Format, R8G8B8_SRGB );
+    CASE( Format, B8G8R8_UNORM );
+    CASE( Format, B8G8R8_SNORM );
+    CASE( Format, B8G8R8_USCALED );
+    CASE( Format, B8G8R8_SSCALED );
+    CASE( Format, B8G8R8_UINT );
+    CASE( Format, B8G8R8_SINT );
+    CASE( Format, B8G8R8_SRGB );
+    CASE( Format, R8G8B8A8_UNORM );
+    CASE( Format, R8G8B8A8_SNORM );
+    CASE( Format, R8G8B8A8_USCALED );
+    CASE( Format, R8G8B8A8_SSCALED );
+    CASE( Format, R8G8B8A8_UINT );
+    CASE( Format, R8G8B8A8_SINT );
+    CASE( Format, R8G8B8A8_SRGB );
+    CASE( Format, B8G8R8A8_UNORM );
+    CASE( Format, B8G8R8A8_SNORM );
+    CASE( Format, B8G8R8A8_USCALED );
+    CASE( Format, B8G8R8A8_SSCALED );
+    CASE( Format, B8G8R8A8_UINT );
+    CASE( Format, B8G8R8A8_SINT );
+    CASE( Format, B8G8R8A8_SRGB );
+    CASE( Format, A8B8G8R8_UNORM_PACK32 );
+    CASE( Format, A8B8G8R8_SNORM_PACK32 );
+    CASE( Format, A8B8G8R8_USCALED_PACK32 );
+    CASE( Format, A8B8G8R8_SSCALED_PACK32 );
+    CASE( Format, A8B8G8R8_UINT_PACK32 );
+    CASE( Format, A8B8G8R8_SINT_PACK32 );
+    CASE( Format, A8B8G8R8_SRGB_PACK32 );
+    CASE( Format, A2R10G10B10_UNORM_PACK32 );
+    CASE( Format, A2R10G10B10_SNORM_PACK32 );
+    CASE( Format, A2R10G10B10_USCALED_PACK32 );
+    CASE( Format, A2R10G10B10_SSCALED_PACK32 );
+    CASE( Format, A2R10G10B10_UINT_PACK32 );
+    CASE( Format, A2R10G10B10_SINT_PACK32 );
+    CASE( Format, A2B10G10R10_UNORM_PACK32 );
+    CASE( Format, A2B10G10R10_SNORM_PACK32 );
+    CASE( Format, A2B10G10R10_USCALED_PACK32 );
+    CASE( Format, A2B10G10R10_SSCALED_PACK32 );
+    CASE( Format, A2B10G10R10_UINT_PACK32 );
+    CASE( Format, A2B10G10R10_SINT_PACK32 );
+    CASE( Format, R16_UNORM );
+    CASE( Format, R16_SNORM );
+    CASE( Format, R16_USCALED );
+    CASE( Format, R16_SSCALED );
+    CASE( Format, R16_UINT );
+    CASE( Format, R16_SINT );
+    CASE( Format, R16_SFLOAT );
+    CASE( Format, R16G16_UNORM );
+    CASE( Format, R16G16_SNORM );
+    CASE( Format, R16G16_USCALED );
+    CASE( Format, R16G16_SSCALED );
+    CASE( Format, R16G16_UINT );
+    CASE( Format, R16G16_SINT );
+    CASE( Format, R16G16_SFLOAT );
+    CASE( Format, R16G16B16_UNORM );
+    CASE( Format, R16G16B16_SNORM );
+    CASE( Format, R16G16B16_USCALED );
+    CASE( Format, R16G16B16_SSCALED );
+    CASE( Format, R16G16B16_UINT );
+    CASE( Format, R16G16B16_SINT );
+    CASE( Format, R16G16B16_SFLOAT );
+    CASE( Format, R16G16B16A16_UNORM );
+    CASE( Format, R16G16B16A16_SNORM );
+    CASE( Format, R16G16B16A16_USCALED );
+    CASE( Format, R16G16B16A16_SSCALED );
+    CASE( Format, R16G16B16A16_UINT );
+    CASE( Format, R16G16B16A16_SINT );
+    CASE( Format, R16G16B16A16_SFLOAT );
+    CASE( Format, R32_UINT );
+    CASE( Format, R32_SINT );
+    CASE( Format, R32_SFLOAT );
+    CASE( Format, R32G32_UINT );
+    CASE( Format, R32G32_SINT );
+    CASE( Format, R32G32_SFLOAT );
+    CASE( Format, R32G32B32_UINT );
+    CASE( Format, R32G32B32_SINT );
+    CASE( Format, R32G32B32_SFLOAT );
+    CASE( Format, R32G32B32A32_UINT );
+    CASE( Format, R32G32B32A32_SINT );
+    CASE( Format, R32G32B32A32_SFLOAT );
+    CASE( Format, R64_UINT );
+    CASE( Format, R64_SINT );
+    CASE( Format, R64_SFLOAT );
+    CASE( Format, R64G64_UINT );
+    CASE( Format, R64G64_SINT );
+    CASE( Format, R64G64_SFLOAT );
+    CASE( Format, R64G64B64_UINT );
+    CASE( Format, R64G64B64_SINT );
+    CASE( Format, R64G64B64_SFLOAT );
+    CASE( Format, R64G64B64A64_UINT );
+    CASE( Format, R64G64B64A64_SINT );
+    CASE( Format, R64G64B64A64_SFLOAT );
+    CASE( Format, B10G11R11_UFLOAT_PACK32 );
+    CASE( Format, E5B9G9R9_UFLOAT_PACK32 );
+    CASE( Format, D16_UNORM );
+    CASE( Format, X8_D24_UNORM_PACK32 );
+    CASE( Format, D32_SFLOAT );
+    CASE( Format, S8_UINT );
+    CASE( Format, D16_UNORM_S8_UINT );
+    CASE( Format, D24_UNORM_S8_UINT );
+    CASE( Format, D32_SFLOAT_S8_UINT );
+    CASE( Format, BC1_RGB_UNORM_BLOCK );
+    CASE( Format, BC1_RGB_SRGB_BLOCK );
+    CASE( Format, BC1_RGBA_UNORM_BLOCK );
+    CASE( Format, BC1_RGBA_SRGB_BLOCK );
+    CASE( Format, BC2_UNORM_BLOCK );
+    CASE( Format, BC2_SRGB_BLOCK );
+    CASE( Format, BC3_UNORM_BLOCK );
+    CASE( Format, BC3_SRGB_BLOCK );
+    CASE( Format, BC4_UNORM_BLOCK );
+    CASE( Format, BC4_SNORM_BLOCK );
+    CASE( Format, BC5_UNORM_BLOCK );
+    CASE( Format, BC5_SNORM_BLOCK );
+    CASE( Format, BC6H_UFLOAT_BLOCK );
+    CASE( Format, BC6H_SFLOAT_BLOCK );
+    CASE( Format, BC7_UNORM_BLOCK );
+    CASE( Format, BC7_SRGB_BLOCK );
+    CASE( Format, ETC2_R8G8B8_UNORM_BLOCK );
+    CASE( Format, ETC2_R8G8B8_SRGB_BLOCK );
+    CASE( Format, ETC2_R8G8B8A1_UNORM_BLOCK );
+    CASE( Format, ETC2_R8G8B8A1_SRGB_BLOCK );
+    CASE( Format, ETC2_R8G8B8A8_UNORM_BLOCK );
+    CASE( Format, ETC2_R8G8B8A8_SRGB_BLOCK );
+    CASE( Format, EAC_R11_UNORM_BLOCK );
+    CASE( Format, EAC_R11_SNORM_BLOCK );
+    CASE( Format, EAC_R11G11_UNORM_BLOCK );
+    CASE( Format, EAC_R11G11_SNORM_BLOCK );
+    CASE( Format, ASTC_4x4_UNORM_BLOCK );
+    CASE( Format, ASTC_4x4_SRGB_BLOCK );
+    CASE( Format, ASTC_5x4_UNORM_BLOCK );
+    CASE( Format, ASTC_5x4_SRGB_BLOCK );
+    CASE( Format, ASTC_5x5_UNORM_BLOCK );
+    CASE( Format, ASTC_5x5_SRGB_BLOCK );
+    CASE( Format, ASTC_6x5_UNORM_BLOCK );
+    CASE( Format, ASTC_6x5_SRGB_BLOCK );
+    CASE( Format, ASTC_6x6_UNORM_BLOCK );
+    CASE( Format, ASTC_6x6_SRGB_BLOCK );
+    CASE( Format, ASTC_8x5_UNORM_BLOCK );
+    CASE( Format, ASTC_8x5_SRGB_BLOCK );
+    CASE( Format, ASTC_8x6_UNORM_BLOCK );
+    CASE( Format, ASTC_8x6_SRGB_BLOCK );
+    CASE( Format, ASTC_8x8_UNORM_BLOCK );
+    CASE( Format, ASTC_8x8_SRGB_BLOCK );
+    CASE( Format, ASTC_10x5_UNORM_BLOCK );
+    CASE( Format, ASTC_10x5_SRGB_BLOCK );
+    CASE( Format, ASTC_10x6_UNORM_BLOCK );
+    CASE( Format, ASTC_10x6_SRGB_BLOCK );
+    CASE( Format, ASTC_10x8_UNORM_BLOCK );
+    CASE( Format, ASTC_10x8_SRGB_BLOCK );
+    CASE( Format, ASTC_10x10_UNORM_BLOCK );
+    CASE( Format, ASTC_10x10_SRGB_BLOCK );
+    CASE( Format, ASTC_12x10_UNORM_BLOCK );
+    CASE( Format, ASTC_12x10_SRGB_BLOCK );
+    CASE( Format, ASTC_12x12_UNORM_BLOCK );
+    CASE( Format, ASTC_12x12_SRGB_BLOCK );
+    CASE( Format, PVRTC1_2BPP_UNORM_BLOCK_IMG );
+    CASE( Format, PVRTC1_4BPP_UNORM_BLOCK_IMG );
+    CASE( Format, PVRTC2_2BPP_UNORM_BLOCK_IMG );
+    CASE( Format, PVRTC2_4BPP_UNORM_BLOCK_IMG );
+    CASE( Format, PVRTC1_2BPP_SRGB_BLOCK_IMG );
+    CASE( Format, PVRTC1_4BPP_SRGB_BLOCK_IMG );
+    CASE( Format, PVRTC2_2BPP_SRGB_BLOCK_IMG );
+    CASE( Format, PVRTC2_4BPP_SRGB_BLOCK_IMG );
+  }
+  return "UNDEFINED";
+}
+#endif
+
+} // namespace Debug
+} // namespace Graphics
+} // namespace Dali
+
+#endif //DALI_GRAPHICS_API_TYPES_DEBUG_H
index 9d7ee85..d697926 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_API_TYPES_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-#include <dali/graphics-api/graphics-api-utility.h>
 #include <vector>
+#include <string>
 
 namespace Dali
 {
 namespace Graphics
 {
-namespace API
-{
+class Texture;
+class Buffer;
 class Shader;
+class Framebuffer;
 using Extension = void*;
 
 /**
+ *
+ */
+struct Offset2D
+{
+  int32_t x = 0;
+  int32_t y = 0;
+};
+
+struct Extent2D
+{
+  uint32_t width;
+  uint32_t height;
+};
+
+/**
+ *
+ */
+struct Rect2D
+{
+  int32_t x = 0;
+  int32_t y = 0;
+  uint32_t width = 0;
+  uint32_t height = 0;
+};
+
+/**
+ * Structure represents area of viewport
+ */
+struct Viewport
+{
+  float x = 0.0f;
+  float y = 0.0f;
+  float width = 0.0f;
+  float height = 0.0f;
+  float minDepth = 0.0f;
+  float maxDepth = 0.0f;
+};
+
+/**
  * Describes vertex attribute input rate
  */
 enum class VertexInputRate
@@ -174,6 +214,37 @@ enum class PrimitiveTopology
   TRIANGLE_FAN
 };
 
+
+/**
+ * Sampler address ( wrapping ) mode
+ */
+enum class SamplerAddressMode
+{
+  REPEAT,
+  MIRRORED_REPEAT,
+  CLAMP_TO_EDGE,
+  CLAMP_TO_BORDER,
+  MIRROR_CLAMP_TO_EDGE
+};
+
+/**
+ * Filtering
+ */
+enum class SamplerFilter
+{
+  NEAREST,
+  LINEAR
+};
+
+/**
+ * Mipmap mode
+ */
+enum class SamplerMipmapMode
+{
+  NEAREST,
+  LINEAR
+};
+
 /**
  * Describes pipeline's color blend state
  */
@@ -265,17 +336,32 @@ struct ColorBlendState
  */
 struct ShaderState
 {
-  Shader* shaderProgram { nullptr };
+  const Shader* shaderProgram { nullptr };
 
   Extension   extension             { nullptr };
 
-  ShaderState& SetShaderProgram( Shader& value )
+  ShaderState& SetShaderProgram( const Shader& value )
   {
     shaderProgram = &value;
     return *this;
   }
 };
 
+struct FramebufferState
+{
+  const Framebuffer *framebuffer{ nullptr };
+
+  Extension extension{ nullptr };
+
+  FramebufferState& SetFramebuffer( const Framebuffer& value )
+  {
+
+    framebuffer = &value;
+    return *this;
+  }
+};
+
+
 /**
  * Describes pipeline's viewport and scissor state
  */
@@ -300,7 +386,7 @@ struct ViewportState
     return *this;
   }
 
 ViewportState& SetScissorTestEnable( bool value )
+ ViewportState& SetScissorTestEnable( bool value )
   {
     scissorTestEnable = value;
     return *this;
@@ -308,6 +394,62 @@ struct ViewportState
 };
 
 /**
+ * Describes stencil operation state
+ */
+struct StencilOpState
+{
+  StencilOp failOp        {};
+  StencilOp passOp        {};
+  StencilOp depthFailOp   {};
+  CompareOp compareOp     {};
+  uint32_t  compareMask   { 0u };
+  uint32_t  writeMask     { 0u };
+  uint32_t  reference     { 0u };
+
+  StencilOpState& SetFailOp( StencilOp value )
+  {
+    failOp = value;
+    return *this;
+  }
+
+  StencilOpState& SetPassOp( StencilOp value )
+  {
+    failOp = value;
+    return *this;
+  }
+
+  StencilOpState& SetDepthFailOp( StencilOp value )
+  {
+    failOp = value;
+    return *this;
+  }
+
+  StencilOpState& SetCompareOp( CompareOp value )
+  {
+    compareOp = value;
+    return *this;
+  }
+
+  StencilOpState& SetCompareMask( uint32_t value )
+  {
+    compareMask = value;
+    return *this;
+  }
+
+  StencilOpState& SetWriteMask( uint32_t value )
+  {
+    writeMask = value;
+    return *this;
+  }
+
+  StencilOpState& SetReference( uint32_t value )
+  {
+    reference = value;
+    return *this;
+  }
+};
+
+/**
  * Describes pipeline's viewport and scissor state
  */
 struct DepthStencilState
@@ -315,11 +457,10 @@ struct DepthStencilState
   bool      depthTestEnable   { false };
   bool      depthWriteEnable  { false };
   CompareOp depthCompareOp    {};
-  bool      stencilTestEnable { false };
-
-
-  Extension   extension       { nullptr };
 
+  bool      stencilTestEnable { false };
+  StencilOpState front {};
+  StencilOpState back {};
 
   DepthStencilState& SetDepthTestEnable( bool value )
   {
@@ -339,6 +480,23 @@ struct DepthStencilState
     return *this;
   }
 
+  DepthStencilState& SetFront( StencilOpState value)
+  {
+    front = value;
+    return *this;
+  }
+
+  DepthStencilState& SetBack( StencilOpState value)
+  {
+    back = value;
+    return *this;
+  }
+
+  DepthStencilState& SetStencilTestEnable( bool value)
+  {
+    stencilTestEnable = value;
+    return *this;
+  }
 };
 
 /**
@@ -348,7 +506,6 @@ struct RasterizationState
 {
   CullMode              cullMode        {};
   PolygonMode           polygonMode     {};
-  PrimitiveTopology     topology        {};
   FrontFace             frontFace       {};
 
   Extension             extension       { nullptr };
@@ -396,6 +553,26 @@ struct InputAssemblyState
 };
 
 /**
+ * Pipeline dynamic state bits
+ */
+namespace PipelineDynamicStateBits
+{
+const uint32_t VIEWPORT_BIT                   = 1 << 0;
+const uint32_t SCISSOR_BIT                    = 1 << 1;
+const uint32_t LINE_WIDTH_BIT                 = 1 << 2;
+const uint32_t DEPTH_BIAS_BIT                 = 1 << 3;
+const uint32_t BLEND_CONSTANTS_BIT            = 1 << 4;
+const uint32_t DEPTH_BOUNDS_BIT               = 1 << 5;
+const uint32_t STENCIL_COMPARE_MASK_BIT       = 1 << 6;
+const uint32_t STENCIL_WRITE_MASK_BIT         = 1 << 7;
+const uint32_t STENCIL_REFERENCE_BIT          = 1 << 8;
+}
+
+const uint32_t PIPELINE_DYNAMIC_STATE_COUNT( 9u );
+
+using PipelineDynamicStateMask = uint32_t;
+
+/**
  *
  */
 struct VertexInputState
@@ -436,7 +613,307 @@ struct VertexInputState
   Extension   extension                  { nullptr };
 };
 
-} // API
+/**
+ * List of all possible formats
+ * Not all formats may be supported
+ */
+enum class Format
+{
+  UNDEFINED,
+  // GLES compatible, luminance doesn't exist in Vulkan
+  L8,
+  L8A8,
+
+  // Vulkan compatible
+  R4G4_UNORM_PACK8,
+  R4G4B4A4_UNORM_PACK16,
+  B4G4R4A4_UNORM_PACK16,
+  R5G6B5_UNORM_PACK16,
+  B5G6R5_UNORM_PACK16,
+  R5G5B5A1_UNORM_PACK16,
+  B5G5R5A1_UNORM_PACK16,
+  A1R5G5B5_UNORM_PACK16,
+  R8_UNORM,
+  R8_SNORM,
+  R8_USCALED,
+  R8_SSCALED,
+  R8_UINT,
+  R8_SINT,
+  R8_SRGB,
+  R8G8_UNORM,
+  R8G8_SNORM,
+  R8G8_USCALED,
+  R8G8_SSCALED,
+  R8G8_UINT,
+  R8G8_SINT,
+  R8G8_SRGB,
+  R8G8B8_UNORM,
+  R8G8B8_SNORM,
+  R8G8B8_USCALED,
+  R8G8B8_SSCALED,
+  R8G8B8_UINT,
+  R8G8B8_SINT,
+  R8G8B8_SRGB,
+  B8G8R8_UNORM,
+  B8G8R8_SNORM,
+  B8G8R8_USCALED,
+  B8G8R8_SSCALED,
+  B8G8R8_UINT,
+  B8G8R8_SINT,
+  B8G8R8_SRGB,
+  R8G8B8A8_UNORM,
+  R8G8B8A8_SNORM,
+  R8G8B8A8_USCALED,
+  R8G8B8A8_SSCALED,
+  R8G8B8A8_UINT,
+  R8G8B8A8_SINT,
+  R8G8B8A8_SRGB,
+  B8G8R8A8_UNORM,
+  B8G8R8A8_SNORM,
+  B8G8R8A8_USCALED,
+  B8G8R8A8_SSCALED,
+  B8G8R8A8_UINT,
+  B8G8R8A8_SINT,
+  B8G8R8A8_SRGB,
+  A8B8G8R8_UNORM_PACK32,
+  A8B8G8R8_SNORM_PACK32,
+  A8B8G8R8_USCALED_PACK32,
+  A8B8G8R8_SSCALED_PACK32,
+  A8B8G8R8_UINT_PACK32,
+  A8B8G8R8_SINT_PACK32,
+  A8B8G8R8_SRGB_PACK32,
+  A2R10G10B10_UNORM_PACK32,
+  A2R10G10B10_SNORM_PACK32,
+  A2R10G10B10_USCALED_PACK32,
+  A2R10G10B10_SSCALED_PACK32,
+  A2R10G10B10_UINT_PACK32,
+  A2R10G10B10_SINT_PACK32,
+  A2B10G10R10_UNORM_PACK32,
+  A2B10G10R10_SNORM_PACK32,
+  A2B10G10R10_USCALED_PACK32,
+  A2B10G10R10_SSCALED_PACK32,
+  A2B10G10R10_UINT_PACK32,
+  A2B10G10R10_SINT_PACK32,
+  R16_UNORM,
+  R16_SNORM,
+  R16_USCALED,
+  R16_SSCALED,
+  R16_UINT,
+  R16_SINT,
+  R16_SFLOAT,
+  R16G16_UNORM,
+  R16G16_SNORM,
+  R16G16_USCALED,
+  R16G16_SSCALED,
+  R16G16_UINT,
+  R16G16_SINT,
+  R16G16_SFLOAT,
+  R16G16B16_UNORM,
+  R16G16B16_SNORM,
+  R16G16B16_USCALED,
+  R16G16B16_SSCALED,
+  R16G16B16_UINT,
+  R16G16B16_SINT,
+  R16G16B16_SFLOAT,
+  R16G16B16A16_UNORM,
+  R16G16B16A16_SNORM,
+  R16G16B16A16_USCALED,
+  R16G16B16A16_SSCALED,
+  R16G16B16A16_UINT,
+  R16G16B16A16_SINT,
+  R16G16B16A16_SFLOAT,
+  R32_UINT,
+  R32_SINT,
+  R32_SFLOAT,
+  R32G32_UINT,
+  R32G32_SINT,
+  R32G32_SFLOAT,
+  R32G32B32_UINT,
+  R32G32B32_SINT,
+  R32G32B32_SFLOAT,
+  R32G32B32A32_UINT,
+  R32G32B32A32_SINT,
+  R32G32B32A32_SFLOAT,
+  R64_UINT,
+  R64_SINT,
+  R64_SFLOAT,
+  R64G64_UINT,
+  R64G64_SINT,
+  R64G64_SFLOAT,
+  R64G64B64_UINT,
+  R64G64B64_SINT,
+  R64G64B64_SFLOAT,
+  R64G64B64A64_UINT,
+  R64G64B64A64_SINT,
+  R64G64B64A64_SFLOAT,
+  B10G11R11_UFLOAT_PACK32,
+  E5B9G9R9_UFLOAT_PACK32,
+  D16_UNORM,
+  X8_D24_UNORM_PACK32,
+  D32_SFLOAT,
+  S8_UINT,
+  D16_UNORM_S8_UINT,
+  D24_UNORM_S8_UINT,
+  D32_SFLOAT_S8_UINT,
+  BC1_RGB_UNORM_BLOCK,
+  BC1_RGB_SRGB_BLOCK,
+  BC1_RGBA_UNORM_BLOCK,
+  BC1_RGBA_SRGB_BLOCK,
+  BC2_UNORM_BLOCK,
+  BC2_SRGB_BLOCK,
+  BC3_UNORM_BLOCK,
+  BC3_SRGB_BLOCK,
+  BC4_UNORM_BLOCK,
+  BC4_SNORM_BLOCK,
+  BC5_UNORM_BLOCK,
+  BC5_SNORM_BLOCK,
+  BC6H_UFLOAT_BLOCK,
+  BC6H_SFLOAT_BLOCK,
+  BC7_UNORM_BLOCK,
+  BC7_SRGB_BLOCK,
+  ETC2_R8G8B8_UNORM_BLOCK,
+  ETC2_R8G8B8_SRGB_BLOCK,
+  ETC2_R8G8B8A1_UNORM_BLOCK,
+  ETC2_R8G8B8A1_SRGB_BLOCK,
+  ETC2_R8G8B8A8_UNORM_BLOCK,
+  ETC2_R8G8B8A8_SRGB_BLOCK,
+  EAC_R11_UNORM_BLOCK,
+  EAC_R11_SNORM_BLOCK,
+  EAC_R11G11_UNORM_BLOCK,
+  EAC_R11G11_SNORM_BLOCK,
+  ASTC_4x4_UNORM_BLOCK,
+  ASTC_4x4_SRGB_BLOCK,
+  ASTC_5x4_UNORM_BLOCK,
+  ASTC_5x4_SRGB_BLOCK,
+  ASTC_5x5_UNORM_BLOCK,
+  ASTC_5x5_SRGB_BLOCK,
+  ASTC_6x5_UNORM_BLOCK,
+  ASTC_6x5_SRGB_BLOCK,
+  ASTC_6x6_UNORM_BLOCK,
+  ASTC_6x6_SRGB_BLOCK,
+  ASTC_8x5_UNORM_BLOCK,
+  ASTC_8x5_SRGB_BLOCK,
+  ASTC_8x6_UNORM_BLOCK,
+  ASTC_8x6_SRGB_BLOCK,
+  ASTC_8x8_UNORM_BLOCK,
+  ASTC_8x8_SRGB_BLOCK,
+  ASTC_10x5_UNORM_BLOCK,
+  ASTC_10x5_SRGB_BLOCK,
+  ASTC_10x6_UNORM_BLOCK,
+  ASTC_10x6_SRGB_BLOCK,
+  ASTC_10x8_UNORM_BLOCK,
+  ASTC_10x8_SRGB_BLOCK,
+  ASTC_10x10_UNORM_BLOCK,
+  ASTC_10x10_SRGB_BLOCK,
+  ASTC_12x10_UNORM_BLOCK,
+  ASTC_12x10_SRGB_BLOCK,
+  ASTC_12x12_UNORM_BLOCK,
+  ASTC_12x12_SRGB_BLOCK,
+  PVRTC1_2BPP_UNORM_BLOCK_IMG,
+  PVRTC1_4BPP_UNORM_BLOCK_IMG,
+  PVRTC2_2BPP_UNORM_BLOCK_IMG,
+  PVRTC2_4BPP_UNORM_BLOCK_IMG,
+  PVRTC1_2BPP_SRGB_BLOCK_IMG,
+  PVRTC1_4BPP_SRGB_BLOCK_IMG,
+  PVRTC2_2BPP_SRGB_BLOCK_IMG,
+  PVRTC2_4BPP_SRGB_BLOCK_IMG,
+};
+
+enum class BufferUsage
+{
+  TRANSFER_SRC = 1 << 0,
+  TRANSFER_DST = 1 << 1,
+  UNIFORM_TEXEL_BUFFER = 1 << 2,
+  STORAGE_TEXEL_BUFFER = 1 << 3,
+  UNIFORM_BUFFER = 1 << 4,
+  STORAGE_BUFFER = 1 << 5,
+  INDEX_BUFFER = 1 << 6,
+  VERTEX_BUFFER = 1 << 7,
+  INDIRECT_BUFFER = 1 << 8
+};
+
+using BufferUsageFlags = uint32_t;
+
+inline BufferUsageFlags operator|( BufferUsageFlags flags, BufferUsage usage )
+{
+  flags |= static_cast<uint32_t>( usage );
+  return flags;
+}
+
+struct MemoryRequirements
+{
+  size_t size;
+  size_t alignment;
+};
+
+using TextureUpdateFlags = uint32_t;
+enum class TextureUpdateFlagBits
+{
+  KEEP_SOURCE = 1 << 0,
+};
+
+struct TextureUpdateInfo
+{
+  Texture*      dstTexture;
+  Offset2D      dstOffset2D;
+  uint32_t      layer;
+  uint32_t      level;
+
+  uint32_t      srcReference;
+  Extent2D      srcExtent2D;
+  uint32_t      srcOffset;
+  uint32_t      srcSize;
+};
+
+struct TextureUpdateSourceInfo
+{
+  enum class Type
+  {
+    Buffer,
+    Memory,
+    Texture
+  };
+
+  Type sourceType;
+
+  struct BufferSource
+  {
+    Buffer* buffer;
+  } bufferSource;
+
+  struct MemorySource
+  {
+    void* pMemory;
+  } memorySource;
+
+  struct TextureSource
+  {
+    Texture* texture;
+  } textureSource;
+};
+
+struct TextureProperties
+{
+  Format    format;
+  Format    format1;
+  bool      emulated;
+  bool      compressed;
+  bool      packed;
+  Extent2D  extent2D;
+  bool      directWriteAccessEnabled;
+};
+
+/**
+ * Texture tiling that directly refers to the tiling
+ * mode supported by the Vulkan. Other implementations
+ * of the backend may ignore the value.
+ */
+enum class TextureTiling
+{
+  OPTIMAL,
+  LINEAR
+};
+
 } // Graphics
 } // Dali
 
diff --git a/dali/graphics-api/graphics-api-utility.h b/dali/graphics-api/graphics-api-utility.h
deleted file mode 100644 (file)
index b4017e5..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-
-#ifndef DALI_GRAPHICS_API_UTILITY_H
-#define DALI_GRAPHICS_API_UTILITY_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <cstdint>
-#include <cstdlib>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace API
-{
-
-/**
- * Structure that represents a rectangular size
- */
-struct RectSize {
-  size_t width = 0;
-  size_t height = 0;
-};
-
-struct Rect2D {
-  int32_t x = 0;
-  int32_t y = 0;
-  uint32_t width = 0;
-  uint32_t height = 0;
-};
-
-/**
- * Structure represents area of viewport
- */
-struct Viewport
-{
-  float x = 0.0f;
-  float y = 0.0f;
-  float width = 0.0f;
-  float height = 0.0f;
-  float minDepth = 0.0f;
-  float maxDepth = 0.0f;
-};
-
-} // namespace API
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_API_UTILITY_H
diff --git a/dali/graphics-api/utility/graphics-asserts.h b/dali/graphics-api/utility/graphics-asserts.h
deleted file mode 100644 (file)
index 5af6829..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef DALI_GRAPHICS_ASSERTS_H
-#define DALI_GRAPHICS_ASSERTS_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Utility
-{
-
-template< typename T >
-void Assert(bool condition, const T& message)
-{
-  if(!condition)
-  {
-    throw message;
-  }
-}
-
-template< typename T >
-void AssertEqual(const T& lhs, const T& rhs)
-{
-  Assert(lhs == rhs, "Values are not equal.");
-}
-
-template< typename T >
-void AssertLessOrEqual(const T& lhs, const T& rhs)
-{
-  Assert(lhs <= rhs, "Value must be less or equal.");
-}
-
-template< typename T >
-void AssertGraterOrEqual(const T& lhs, const T& rhs)
-{
-  Assert(lhs >= rhs, "Value must be grater or equal.");
-}
-
-} // namespace Utility
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_ASSERTS_H
diff --git a/dali/graphics-api/utility/utility-builder.h b/dali/graphics-api/utility/utility-builder.h
deleted file mode 100644 (file)
index b97bd06..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef DALI_GRAPHICS_UTILITY_BUILDER_H
-#define DALI_GRAPHICS_UTILITY_BUILDER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <cstddef>
-#include <utility>
-#include <tuple>
-
-// INTERNAL INCLUDES
-#include <dali/graphics-api/utility/utility-traits.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Utility
-{
-
-template<typename T, typename... Params>
-class Builder
-{
-public:
-  template<typename... Values>
-  Builder( Values&&... values ) : mParameters{}
-  {
-    SetParameters( values... );
-  }
-
-  template<typename Return>
-  operator Return()
-  {
-    return Build( std::index_sequence_for<Params...>{} );
-  }
-
-  auto Build()
-  {
-    return Build( std::index_sequence_for<Params...>{} );
-  }
-
-  template<typename V>
-  void Set( V&& value )
-  {
-    SetParameters( std::forward<V>( value ) );
-  }
-
-private:
-  void SetParameters() const {};
-
-  template<typename V>
-  void SetParameters( V&& value )
-  {
-    std::get<std::remove_reference_t<V>>( mParameters ) = std::forward<V>( value );
-  }
-
-  template<typename Head, typename... Tail>
-  void SetParameters( Head&& head, Tail&&... tail )
-  {
-    SetParameters( std::forward<Head>( head ) );
-    SetParameters( std::forward<Tail...>( tail... ) );
-  }
-
-  template<size_t... Is>
-  T Build( std::index_sequence<Is...> )
-  {
-    return T(std::move(std::get<Is>( mParameters ) )...);
-  }
-
-private: // data
-  std::tuple<Params...> mParameters;
-};
-
-} // namespace Utility
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_UTILITY_BUILDER_H
diff --git a/dali/graphics-api/utility/utility-memory-pool.h b/dali/graphics-api/utility/utility-memory-pool.h
deleted file mode 100644 (file)
index 2758cbd..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-#ifndef DALI_VULKAN_161117_UTILITY_MEMORY_POOL_H
-#define DALI_VULKAN_161117_UTILITY_MEMORY_POOL_H
-
-#include <cstdint>
-#include <cstdlib>
-#include <vector>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Utility
-{
-class MemoryPool
-{
-public:
-  static const auto ALIGNMENT = 16u;
-
-  MemoryPool( uint32_t capacity, bool isFixed = false )
-  : mPageCapacity( capacity ),
-    mCapacity( 0 ),
-    mMarkedPageIndex( 0 ),
-    mMarkedOffset( 0 ),
-    mMarkedAllocationSize( 0 ),
-    mMarkedAllocationCount( 0 ),
-    mPageOffset( 0 ),
-    mPageIndex( 0 ),
-    mPages(),
-    mTotalPoolCapacity( 0 ),
-    mTotalPoolAllocationsSize( 0 ),
-    mTotalPoolAllocations( 0 ),
-    mIsFixed( isFixed )
-  {
-  }
-
-  ~MemoryPool()
-  {
-    if( !mPages.empty() )
-    {
-      mPages.clear();
-    }
-  }
-
-  void Mark()
-  {
-    mMarkedOffset          = mPageOffset;
-    mMarkedPageIndex       = mPageIndex;
-    mMarkedAllocationCount = mTotalPoolAllocations;
-    mMarkedAllocationSize  = mTotalPoolAllocationsSize;
-  }
-
-  void Rollback()
-  {
-    mPageOffset               = mMarkedOffset;
-    mPageIndex                = mMarkedPageIndex;
-    mTotalPoolAllocationsSize = mMarkedAllocationSize;
-    mTotalPoolAllocations     = mMarkedAllocationCount;
-  }
-
-  void RollbackAll()
-  {
-    mPageOffset               = 0;
-    mPageIndex                = 0;
-    mTotalPoolAllocationsSize = 0;
-    mTotalPoolAllocations     = 0;
-  }
-
-  void* Allocate( uint32_t size, uint32_t aligned = ALIGNMENT )
-  {
-    // if allocated size is more that page capacity, add a page of required size
-    if( size > mPageCapacity )
-    {
-      AddPage( size + ( aligned * 2 ) );
-    }
-    else if( mPageCapacity <= mPageOffset + size + aligned )
-    {
-      AddPage( mPageCapacity );
-    }
-
-    mPageOffset = ( ( mPageOffset + aligned ) / aligned ) * aligned;
-    auto retval = &mPages[mPageIndex].data[mPageOffset];
-    mPageOffset += size + aligned;
-
-    mTotalPoolAllocations++;
-    mTotalPoolAllocationsSize += size;
-
-    return retval;
-  }
-
-  template<class T, class... Args>
-  T* AllocateNew( Args... args )
-  {
-    return new( Allocate( sizeof( T ), ALIGNMENT ) ) T( args... );
-  }
-
-  template<class T>
-  T* Allocate( uint32_t elements )
-  {
-    return new( Allocate( sizeof( T ) * elements ) ) T[elements];
-  }
-
-  /**
-   * Trims unused memory
-   */
-  void Trim()
-  {
-    if( mPageIndex < mPages.size() - 1 )
-    {
-      mPages.resize( mPageIndex + 1 );
-    }
-  }
-
-private:
-  void AddPage( uint32_t pageCapacity )
-  {
-    mPages.emplace_back( pageCapacity );
-    mPageIndex  = uint32_t( mPages.size() - 1u );
-    mPageOffset = 0u;
-    mTotalPoolCapacity += pageCapacity;
-  }
-
-public:
-  //private:
-
-  struct Page
-  {
-    Page() = default;
-    Page( uint32_t _capacity ) : data( nullptr ), capacity( _capacity )
-    {
-    }
-
-    ~Page()
-    {
-      if( data )
-      {
-        free(data);
-      }
-    }
-    char*    data { nullptr };
-    uint32_t capacity { 0u };
-  };
-
-  uint32_t mPageCapacity;
-  uint32_t mCapacity;
-
-  uint32_t mMarkedPageIndex;
-  uint32_t mMarkedOffset;
-  uint32_t mMarkedAllocationSize;
-  uint32_t mMarkedAllocationCount;
-
-  uint32_t mPageOffset;
-  uint32_t mPageIndex;
-
-  std::vector<Page> mPages;
-
-  uint32_t mTotalPoolCapacity;
-  uint32_t mTotalPoolAllocationsSize;
-  uint32_t mTotalPoolAllocations;
-
-  bool mIsFixed;
-};
-} // namespace Utility
-} // namespace Graphics
-} // namespace Dali
-
-#endif //DALI_VULKAN_161117_UTILITY_MEMORY_POOL_H
diff --git a/dali/graphics-api/utility/utility-queue.h b/dali/graphics-api/utility/utility-queue.h
deleted file mode 100644 (file)
index a31f0ed..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-#ifndef DALI_GRAPHICS_UTILITY_QUEUE_H
-#define DALI_GRAPHICS_UTILITY_QUEUE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <vector>
-#include <utility>
-#include <memory>
-#include <type_traits>
-
-#include <dali/graphics/utility/graphics-asserts.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Utility
-{
-
-/**
- * @brief Queue implementation
- */
-template<typename T>
-class Queue
-{
-public:
-  Queue() : Queue(0, nullptr, nullptr, nullptr)
-  {
-  }
-
-  Queue(const Queue&) = delete;
-  Queue& operator=(const Queue&) = delete;
-
-  Queue(Queue&& queue) : Queue()
-  {
-    Swap(queue);
-  }
-
-  Queue& operator=(Queue&& queue)
-  {
-    if(this != &queue)
-    {
-      Queue(queue).Swap(*this);
-    }
-    return *this;
-  }
-
-  virtual ~Queue()
-  {
-    Resize(0);
-  }
-
-  using Iterator = T*;
-
-  constexpr const Iterator Head() const noexcept
-  {
-    return mHead;
-  }
-
-  constexpr const Iterator Tail() const noexcept
-  {
-    return mTail;
-  }
-
-  template< typename U >
-  void Enqueue(U&& element)
-  {
-    EnqueueEmplace(std::forward< U >(element));
-  }
-
-  template< typename... Args >
-  void EnqueueEmplace(Args&&... args)
-  {
-    IncreaseCapacity();
-    new(mTail) T(std::forward< Args >(args)...);
-    mTail = Inc(mTail);
-  }
-
-  /**
-   * @brief Pop element at Head()
-   */
-  T Dequeue()
-  {
-    if(!mBufferSize){
-      throw "Queue is empty!";
-    }
-
-    auto result = std::move(*mHead);
-    mHead->~T();
-    mHead = Inc(mHead);
-
-    DecreaseCapacity();
-
-    return result;
-  }
-
-  constexpr size_t Count() const noexcept
-  {
-    return mHead <= mTail ? mTail - mHead : mBufferSize - (mHead - mTail);
-  }
-
-  constexpr size_t GetCapacity() const noexcept
-  {
-    return mBufferSize ? mBufferSize - 1 : 0;
-  }
-
-  void SetCapacity(size_t capacity)
-  {
-    Resize(capacity ? capacity + 1 : 0);
-  }
-
-private:
-  static constexpr auto MIN_PREFERED_BLOCK_SIZE = size_t{1024};
-  static constexpr auto MIN_BUFFER_SIZE         = MIN_PREFERED_BLOCK_SIZE / sizeof(T);
-
-  /**
-   * @brief Increase a pointer to a queue element, wrapping around at the end
-   */
-  constexpr T* Inc(T* pointer) const noexcept
-  {
-    return ++pointer == mBuffer + mBufferSize ? mBuffer : pointer;
-  }
-
-  size_t MoveData(T* from, T* to, T* destination, size_t max)
-  {
-    auto count = size_t{};
-    while(from < to && count++ < max)
-    {
-      // move the object to the new memory
-      new(destination++) T(std::move(*from));
-      from++->~T();
-    }
-    return count;
-  }
-
-  void CallDeleter(T* from, T* to)
-  {
-    AssertLessOrEqual(from, to);
-    while(from < to)
-    {
-      from++->~T();
-    }
-  }
-
-  void IncreaseCapacity()
-  {
-    // There must always be an empty element
-    // If we are about to reach buffer size duplicate the size of the buffer
-    if(Count() + 1 >= mBufferSize)
-    {
-      Resize(mBufferSize ? mBufferSize * 2 : MIN_BUFFER_SIZE);
-    }
-  }
-
-  void DecreaseCapacity()
-  {
-    auto count = Count();
-
-    // If empty resize to zero
-    if(count == 0)
-    {
-      Resize(0);
-    }
-    else
-    {
-      auto newSize    = Count() + 1;
-      auto doubleSize = newSize * 2;
-
-      // There must always be an empty element
-      // If capacity is double of what it is required resize it
-      if(doubleSize <= mBufferSize && newSize >= MIN_BUFFER_SIZE)
-      {
-        Resize(newSize);
-      }
-    }
-  }
-
-  void Resize(size_t newBufferSize)
-  {
-    if(newBufferSize == mBufferSize)
-    {
-      return;
-    }
-
-    auto oldBufferSize = mBufferSize;
-    auto oldBuffer     = mBuffer;
-
-    mBufferSize = newBufferSize;
-    if(mBufferSize)
-    {
-      mBuffer = (T*)new Storage[mBufferSize];
-    }
-    else
-    {
-      mBuffer = nullptr;
-    }
-
-    if(mBufferSize && mHead != mTail)
-    {
-      auto totalCopied = ptrdiff_t{};
-
-      if(mHead < mTail)
-      {
-        totalCopied = MoveData(mHead, mTail, mBuffer, mBufferSize - 1);
-        CallDeleter(mHead + totalCopied, mTail);
-      }
-      else
-      {
-        auto part1   = oldBufferSize - (oldBuffer - mHead);
-        auto copied1 = MoveData(mHead, mHead + part1, mBuffer, mBufferSize - 1);
-        totalCopied += copied1;
-        if(copied1 == part1)
-        {
-          auto copied2 = MoveData(oldBuffer, mTail, mBuffer + part1, mBufferSize - part1 - 1);
-          CallDeleter(oldBuffer + copied2, mTail);
-          totalCopied += copied2;
-        }
-        else
-        {
-          CallDeleter(mHead + copied1, mHead + part1);
-        }
-      }
-      mHead = mBuffer;
-      mTail = mHead + totalCopied;
-    }
-    else
-    {
-      if(mHead <= mTail)
-      {
-        CallDeleter(mHead, mTail);
-      }
-      else
-      {
-        CallDeleter(oldBuffer, mTail);
-        CallDeleter(mHead, oldBuffer + oldBufferSize);
-      }
-      mTail = mHead = mBuffer;
-    }
-    if(oldBuffer)
-    {
-      delete[] (Storage*)oldBuffer;
-    }
-  }
-
-private:
-  void Swap(Queue& queue)
-  {
-    std::swap(mBufferSize, queue.mBufferSize);
-    std::swap(mBuffer, queue.mBuffer);
-    std::swap(mHead, queue.mHead);
-    std::swap(mTail, queue.mTail);
-  }
-
-  Queue(size_t bufferSize, T* buffer, T* head, T* tail)
-  : mBufferSize(bufferSize), mBuffer(buffer), mHead(head), mTail(tail)
-  {
-  }
-
-  // Correct type to hold the data type without initialising it
-  using Storage = typename std::aligned_storage<sizeof(T), alignof(T)>::type;
-
-  size_t mBufferSize; ///< Size of the buffer allocated
-  T*     mBuffer;     ///< Pointer to the buffer allocated
-  T*     mHead;       ///< Pointer to the Head element in the buffer
-  T*     mTail;       ///< Pointer to the Tail element in the buffer
-};
-
-} // namespace Utility
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_UTILITY_QUEUE_H
diff --git a/dali/graphics-api/utility/utility-strong-type.h b/dali/graphics-api/utility/utility-strong-type.h
deleted file mode 100644 (file)
index 4c74dfe..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef DALI_GRAPHICS_UTILITY_STRONG_TYPE_H
-#define DALI_GRAPHICS_UTILITY_STRONG_TYPE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <utility>
-#include <ostream>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Utility
-{
-
-/**
- * @brief Type wrapper to enforce scemantics in other types
- */
-template<typename T, typename Tag>
-class StrongType final
-{
-public:
-  explicit StrongType( T value ) noexcept : mValue( std::move( value ) )
-  {
-  }
-
-  StrongType() = default;
-
-  const T& Get() const noexcept
-  {
-    return mValue;
-  }
-
-  T& Get() noexcept
-  {
-    return mValue;
-  }
-
-  const T& operator*() const noexcept
-  {
-    return mValue;
-  }
-
-  T& operator*() noexcept
-  {
-    return mValue;
-  }
-
-private:
-  T mValue;
-};
-
-template<typename T, typename Tag>
-std::ostream& operator<<( std::ostream& os, const StrongType<T, Tag>& value )
-{
-  os << value.Get();
-  return os;
-}
-
-} // namespace Utility
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_UTILITY_STRONG_TYPE_H
\ No newline at end of file
diff --git a/dali/graphics-api/utility/utility-synchronized.h b/dali/graphics-api/utility/utility-synchronized.h
deleted file mode 100644 (file)
index b22b03c..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-#ifndef DALI_GRAPHICS_SYNCHRONIZED_H
-#define DALI_GRAPHICS_SYNCHRONIZED_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <memory>
-#include <mutex>
-#include <thread>
-#include <utility>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Utility
-{
-/**
- * @brief Class that encapsulates object for thread-safe access
- */
-template < typename T >
-class Synchronized final
-{
-public:
-  template < typename... Args >
-  Synchronized( Args... args )
-  : mMutex(std::make_unique<std::mutex>()),
-    mObject( std::forward< Args >( args )... )
-  {
-  }
-
-  Synchronized( const Synchronized& ) = delete;
-  Synchronized& operator=( const Synchronized& ) = delete;
-  Synchronized( Synchronized&& ) = default;
-  Synchronized& operator=( Synchronized&& ) = default;
-  virtual ~Synchronized() = default;
-
-  /**
-   * @brief Handle to access the data in the Synchronized object
-   */
-  class Handle final
-  {
-  public:
-    Handle(const Handle&) = delete;
-    Handle& operator=(const Handle&) = delete;
-    Handle(Handle&&) = default;
-    Handle& operator=(Handle&&) = default;
-    ~Handle()
-    {
-      mMutex.unlock();
-    }
-
-    T& operator*()
-    {
-      return mObjectRef;
-    }
-
-    const T& operator*() const
-    {
-      return mObjectRef;
-    }
-
-    T& operator->()
-    {
-      return mObjectRef;
-    }
-
-    const T& operator->() const
-    {
-      return mObjectRef;
-    }
-
-    T* operator&()
-    {
-      return &mObjectRef;
-    }
-
-    const T* operator&() const
-    {
-      return &mObjectRef;
-    }
-
-  private:
-    friend Synchronized; //< Allow Synchronized to create a handle
-    Handle( std::mutex& mutex, T& object )
-    : mMutex( mutex ),
-      mObjectRef( object )
-    {
-      mMutex.lock();
-    }
-
-    std::mutex& mMutex;
-    T& mObjectRef;
-  };
-
-  Handle Lock() {
-    return Handle(*mMutex, mObject);
-  }
-
-private:
-  std::unique_ptr< std::mutex > mMutex; //< Mutex to guard access to the object
-  T mObject;                            //< Memeber object that stores the data
-};
-
-template < typename T, typename... Args >
-Synchronized< T > MakeSynchronized( Args... args )
-{
-  return Synchronized< T >( std::forward< Args >( args )... );
-}
-
-} // namespace Utility
-} // namespace Graphics
-} // namespace Dali
-
-#endif //DALI_GRAPHICS_SYNCHRONIZED_H
\ No newline at end of file
diff --git a/dali/graphics-api/utility/utility-traits.h b/dali/graphics-api/utility/utility-traits.h
deleted file mode 100644 (file)
index 6343a3e..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef DALI_GRAPHICS_UTILITY_TRAITS_H
-#define DALI_GRAPHICS_UTILITY_TRAITS_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <memory>
-#include <type_traits>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Utility
-{
-
-template<typename T>
-struct BasicType
-{
-  using StorageT = T;
-  using AccessT  = T;
-  using ValueT   = T;
-};
-
-template<typename T>
-struct ComplexType
-{
-  using StorageT = T;
-  using AccessT  = const T&;
-  using ValueT   = T;
-};
-
-template<typename T, template<typename...> class Ptr, typename...Ts>
-struct SmartPointerType
-{
-  using StorageT = Ptr<T, Ts...>;
-  using AccessT  = T&;
-  using ValueT   = T;
-};
-
-// Default types
-template<typename T> struct TraitsType : ComplexType<T> {};
-
-// Pointer types
-template<typename T, typename D>
-struct TraitsType<std::unique_ptr<T, D>> : SmartPointerType<T, std::unique_ptr, D>
-{
-};
-template<typename T>
-struct TraitsType<std::shared_ptr<T>> : SmartPointerType<T, std::shared_ptr>
-{
-};
-
-// Basic types
-template<> struct TraitsType<signed char> : BasicType<signed char> { };
-template<> struct TraitsType<unsigned char> : BasicType<unsigned char> { };
-template<> struct TraitsType<signed short> : BasicType<signed short> { };
-template<> struct TraitsType<unsigned short> : BasicType<unsigned short> { };
-template<> struct TraitsType<signed long> : BasicType<signed long> { };
-template<> struct TraitsType<unsigned long> : BasicType<unsigned long> { };
-template<> struct TraitsType<signed long long> : BasicType<signed long long> { };
-template<> struct TraitsType<unsigned long long> : BasicType<unsigned long long> { };
-template<> struct TraitsType<float> : BasicType<float> { };
-template<> struct TraitsType<double> : BasicType<double> { };
-
-// Invalid tyoes
-
-template<typename T> struct TraitsType<T*> {};
-template<typename T> struct TraitsType<const T*> {};
-template<typename T> struct TraitsType<T&> {};
-template<typename T> struct TraitsType<const T&> {};
-
-} // namespace Utility
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_UTILITY_TRAITS_H
\ No newline at end of file
diff --git a/dali/graphics/file.list b/dali/graphics/file.list
deleted file mode 100644 (file)
index 384224c..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# Add graphics source files here
-
-graphics_src_files = \
-    $(graphics_src_dir)/vulkan/vulkan-command-pool.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-surface.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-fence.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-descriptor-set.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-framebuffer.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-queue.cpp \
-    $(graphics_src_dir)/vulkan/gpu-memory/vulkan-gpu-memory-handle.cpp \
-    $(graphics_src_dir)/vulkan/gpu-memory/vulkan-gpu-memory-manager.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-image.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-image-view.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-command-buffer.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-pipeline.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-buffer.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-debug.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-graphics.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-shader.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-swapchain.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-sampler.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-resource-cache.cpp \
-    $(graphics_src_dir)/vulkan/vulkan-graphics-texture.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-controller.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-shader.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-texture.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-buffer.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-buffer-factory.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-texture-factory.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-shader-factory.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-render-command.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-pipeline.cpp \
-    $(graphics_src_dir)/vulkan/api/vulkan-api-pipeline-factory.cpp \
-    $(graphics_src_dir)/vulkan/api/internal/vulkan-ubo-manager.cpp \
-    $(graphics_src_dir)/vulkan/api/internal/vulkan-pipeline-cache.cpp \
-    $(graphics_src_dir)/vulkan/api/internal/vulkan-ubo-pool.cpp \
-    $(graphics_src_dir)/vulkan/api/internal/vulkan-api-pipeline-impl.cpp \
-    $(graphics_src_dir)/vulkan/spirv/vulkan-spirv.cpp
diff --git a/dali/graphics/graphics-object-owner.h b/dali/graphics/graphics-object-owner.h
deleted file mode 100644 (file)
index ed61a89..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef DALI_GRAPHICS_OBJECT_OWNER_H
-#define DALI_GRAPHICS_OBJECT_OWNER_H
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <cassert>
-#include <memory>
-#include <unordered_map>
-#include <utility>
-
-#include <dali/graphics-api/graphics-api-base-object-owner.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-template< typename T >
-class ObjectOwner final : public API::ObjectOwnerBase< T >
-{
-public:
-  using Type   = T;
-  using Handle = size_t;
-
-  constexpr ObjectOwner()
-  : mObjects{},      // Initialise without objects
-    mNextObjecId{0u} // Initialize to zero
-  {
-  }
-
-  Handle CreateObject(const API::BaseFactory< T >& factory)
-  {
-    auto id = mNextObjecId++;
-
-    auto&& object = factory.Create();
-    auto   it     = mObjects.emplace(std::make_pair(id, std::move(object)));
-    assert(it.second);
-
-    return Handle{id};
-  }
-
-  T& operator[](Handle handle)
-  {
-    return *mObjects[handle];
-  }
-
-  const T& operator[](Handle handle) const
-  {
-    return *mObjects[handle];
-  }
-
-  bool Contains(Handle handle) const
-  {
-    return mObjects.end() != mObjects.find(handle);
-  }
-
-  ObjectOwner(const ObjectOwner&) = delete;
-  ObjectOwner& operator=(const ObjectOwner&) = delete;
-
-  ObjectOwner(ObjectOwner&&) = default;
-  ObjectOwner& operator=(ObjectOwner&&) = default;
-
-  virtual ~ObjectOwner() = default;
-
-private:
-  std::unordered_map< size_t, std::unique_ptr< T > > mObjects;
-  size_t mNextObjecId;
-};
-
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_OBJECT_OWNER_H
diff --git a/dali/graphics/graphics-texture.h b/dali/graphics/graphics-texture.h
deleted file mode 100644 (file)
index 920330a..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef DALI_GRAPHICS_TEXTURE_H
-#define DALI_GRAPHICS_TEXTURE_H
-
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics-api/graphics-api-texture.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-
-/**
- * @brief Manager implementation of the graphics API
- */
-class Manager final : public API::Manager
-{
-public:
-  Manager() = default;
-
-  Manager(const Manager&) = delete;
-  Manager& operator=(const Manager&) = delete;
-
-  Manager(Manager&&) = default;
-  Manager& operator=(Manager&&) = default;
-
-  virtual ~Manager() = default;
-
-  /**
-   * Dummy method
-   */
-  int GetNumber() const;
-
-  /**
-   * @brief Creates a new texture
-   */
-  API::Texture CreateTeture();
-};
-
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_TEXTURE_H
diff --git a/dali/graphics/vulkan/api/internal/vulkan-api-pipeline-impl.cpp b/dali/graphics/vulkan/api/internal/vulkan-api-pipeline-impl.cpp
deleted file mode 100644 (file)
index b985d50..0000000
+++ /dev/null
@@ -1,586 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.h>
-#include <dali/graphics/vulkan/api/internal/vulkan-api-pipeline-impl.h>
-#include <dali/graphics/vulkan/api/vulkan-api-pipeline-factory.h>
-#include <dali/graphics/vulkan/api/vulkan-api-pipeline.h>
-#include <dali/graphics/vulkan/api/vulkan-api-controller.h>
-
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-
-#include <dali/graphics/vulkan/api/vulkan-api-shader.h>
-
-#include <array>
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-namespace Internal
-{
-using Vulkan::VkAssert;
-namespace
-{
-constexpr vk::BlendOp ConvertBlendOp( Dali::Graphics::API::BlendOp blendOp )
-{
-  switch( blendOp )
-  {
-    case API::BlendOp::ADD:
-      return vk::BlendOp::eAdd;
-    case API::BlendOp::SUBTRACT:
-      return vk::BlendOp::eSubtract;
-    case API::BlendOp::REVERSE_SUBTRACT:
-      return vk::BlendOp::eReverseSubtract;
-    case API::BlendOp::MIN:
-      return vk::BlendOp::eMin;
-    case API::BlendOp::MAX:
-      return vk::BlendOp::eMax;
-  }
-  return vk::BlendOp{};
-}
-
-constexpr vk::BlendFactor ConvertBlendFactor( Dali::Graphics::API::BlendFactor blendFactor )
-{
-  switch( blendFactor )
-  {
-    case API::BlendFactor::ZERO:
-      return vk::BlendFactor::eZero;
-    case API::BlendFactor::ONE:
-      return vk::BlendFactor::eOne;
-    case API::BlendFactor::SRC_COLOR:
-      return vk::BlendFactor::eSrcColor;
-    case API::BlendFactor::ONE_MINUS_SRC_COLOR:
-      return vk::BlendFactor::eOneMinusSrcAlpha;
-    case API::BlendFactor::DST_COLOR:
-      return vk::BlendFactor::eDstColor;
-    case API::BlendFactor::ONE_MINUS_DST_COLOR:
-      return vk::BlendFactor::eOneMinusDstColor;
-    case API::BlendFactor::SRC_ALPHA:
-      return vk::BlendFactor::eSrcAlpha;
-    case API::BlendFactor::ONE_MINUS_SRC_ALPHA:
-      return vk::BlendFactor::eOneMinusSrcAlpha;
-    case API::BlendFactor::DST_ALPHA:
-      return vk::BlendFactor::eDstAlpha;
-    case API::BlendFactor::ONE_MINUS_DST_ALPHA:
-      return vk::BlendFactor::eOneMinusDstAlpha;
-    case API::BlendFactor::CONSTANT_COLOR:
-      return vk::BlendFactor::eConstantColor;
-    case API::BlendFactor::ONE_MINUS_CONSTANT_COLOR:
-      return vk::BlendFactor::eOneMinusConstantColor;
-    case API::BlendFactor::CONSTANT_ALPHA:
-      return vk::BlendFactor::eConstantAlpha;
-    case API::BlendFactor::ONE_MINUS_CONSTANT_ALPHA:
-      return vk::BlendFactor::eOneMinusConstantAlpha;
-    case API::BlendFactor::SRC_ALPHA_SATURATE:
-      return vk::BlendFactor::eSrcAlphaSaturate;
-    case API::BlendFactor::SRC1_COLOR:
-      return vk::BlendFactor::eSrc1Color;
-    case API::BlendFactor::ONE_MINUS_SRC1_COLOR:
-      return vk::BlendFactor::eOneMinusSrc1Color;
-    case API::BlendFactor::SRC1_ALPHA:
-      return vk::BlendFactor::eSrc1Alpha;
-    case API::BlendFactor::ONE_MINUS_SRC1_ALPHA:
-      return vk::BlendFactor::eOneMinusSrc1Alpha;
-  }
-  return vk::BlendFactor{};
-}
-
-constexpr vk::CompareOp ConvertCompareOp( Dali::Graphics::API::CompareOp compareOp)
-{
-  switch (compareOp)
-  {
-    case API::CompareOp::NEVER:
-      return vk::CompareOp::eNever;
-    case API::CompareOp::LESS:
-      return vk::CompareOp::eLess;
-    case API::CompareOp::EQUAL:
-      return vk::CompareOp::eEqual;
-    case API::CompareOp::LESS_OR_EQUAL:
-      return vk::CompareOp::eLessOrEqual;
-    case API::CompareOp::GREATER:
-      return vk::CompareOp::eGreater;
-    case API::CompareOp::NOT_EQUAL:
-      return vk::CompareOp::eNotEqual;
-    case API::CompareOp::GREATER_OR_EQUAL:
-      return vk::CompareOp::eGreaterOrEqual;
-    case API::CompareOp::ALWAYS:
-      return vk::CompareOp::eAlways;
-  }
-  return vk::CompareOp{};
-}
-
-constexpr vk::PrimitiveTopology ConvertPrimitiveTopology( Dali::Graphics::API::PrimitiveTopology topology)
-{
-  using Dali::Graphics::API::Pipeline;
-  switch (topology)
-  {
-    case API::PrimitiveTopology::POINT_LIST:
-      return vk::PrimitiveTopology::ePointList;
-    case API::PrimitiveTopology::LINE_LIST:
-      return vk::PrimitiveTopology::eLineList;
-    case API::PrimitiveTopology::LINE_STRIP:
-      return vk::PrimitiveTopology::eLineStrip;
-    case API::PrimitiveTopology::TRIANGLE_LIST:
-      return vk::PrimitiveTopology::eTriangleList;
-    case API::PrimitiveTopology::TRIANGLE_STRIP:
-      return vk::PrimitiveTopology::eTriangleStrip;
-    case API::PrimitiveTopology::TRIANGLE_FAN:
-      return vk::PrimitiveTopology::eTriangleFan;
-  }
-  return vk::PrimitiveTopology{};
-}
-
-constexpr vk::CullModeFlagBits ConvertCullMode( Dali::Graphics::API::CullMode cullMode)
-{
-  switch (cullMode)
-  {
-    case API::CullMode::NONE:
-      return vk::CullModeFlagBits::eNone;
-    case API::CullMode::FRONT:
-      return vk::CullModeFlagBits::eFront;
-    case API::CullMode::BACK:
-      return vk::CullModeFlagBits::eBack;
-    case API::CullMode::FRONT_AND_BACK:
-      return vk::CullModeFlagBits::eFrontAndBack;
-  }
-  return vk::CullModeFlagBits{};
-}
-
-constexpr vk::PolygonMode ConvertPolygonMode( Dali::Graphics::API::PolygonMode polygonMode)
-{
-  switch (polygonMode)
-  {
-    case API::PolygonMode::FILL:
-      return vk::PolygonMode::eFill;
-    case API::PolygonMode::LINE:
-      return vk::PolygonMode::eLine;
-    case API::PolygonMode::POINT:
-      return vk::PolygonMode::ePoint;
-  }
-  return vk::PolygonMode{};
-}
-
-constexpr vk::FrontFace ConvertFrontFace( Dali::Graphics::API::FrontFace frontFace)
-{
-  switch (frontFace)
-  {
-    case API::FrontFace::CLOCKWISE:
-      return vk::FrontFace::eClockwise;
-    case API::FrontFace::COUNTER_CLOCKWISE:
-      return vk::FrontFace::eCounterClockwise;
-  }
-  return vk::FrontFace{};
-}
-
-}
-
-struct Pipeline::PipelineCreateInfo
-{
-  PipelineFactory::Info info;
-};
-
-struct Pipeline::VulkanPipelineState
-{
-  VulkanPipelineState() = default;
-  ~VulkanPipelineState() = default;
-
-  vk::PipelineColorBlendStateCreateInfo              colorBlend;
-  std::vector<vk::PipelineColorBlendAttachmentState> colorBlendAttachmentState;
-
-  vk::PipelineDepthStencilStateCreateInfo   depthStencil;
-  vk::PipelineInputAssemblyStateCreateInfo  inputAssembly;
-  vk::PipelineMultisampleStateCreateInfo    multisample;
-  vk::PipelineRasterizationStateCreateInfo  rasterization;
-  vk::PipelineTessellationStateCreateInfo   tesselation;
-  vk::PipelineVertexInputStateCreateInfo    vertexInput;
-
-  struct ViewportState
-  {
-    vk::PipelineViewportStateCreateInfo createInfo;
-    std::vector<vk::Viewport>           viewports;
-    std::vector<vk::Rect2D>             scissors;
-  } viewport;
-
-  Vulkan::RefCountedPipeline pipeline{};
-};
-
-Pipeline::Pipeline( Vulkan::Graphics& graphics, Controller& controller, const PipelineFactory* factory )
-: mGraphics( controller.GetGraphics() ),
-  mController( controller )
-{
-  mHashCode = factory->GetHashCode();
-
-  // copy info
-  mCreateInfo = std::unique_ptr<PipelineCreateInfo>(new PipelineCreateInfo({factory->GetCreateInfo()}));
-
-  mPipelineCache = factory->mPipelineCache;
-
-  Initialise();
-}
-
-Pipeline::~Pipeline()
-{
-  // deleting pipeline
-}
-
-uint32_t GetLocationIndex( const std::vector<Vulkan::SpirV::SPIRVVertexInputAttribute>& attribs, uint32_t location )
-{
-  auto retval = 0u;
-
-  for( auto&& attr : attribs )
-  {
-    if( attr.location == location )
-    {
-      return retval;
-    }
-    retval++;
-  }
-  return -1u;
-}
-
-bool Pipeline::Initialise()
-{
-  mVulkanPipelineState = std::unique_ptr<VulkanPipelineState>( new VulkanPipelineState() );
-
-  // get shaders
-  const auto& shader = static_cast<const VulkanAPI::Shader*>(mCreateInfo->info.shaderState.shaderProgram);
-  auto vertexShader   = shader->GetShader(vk::ShaderStageFlagBits::eVertex);
-  auto fragmentShader = shader->GetShader(vk::ShaderStageFlagBits::eFragment);
-
-  // retrieve input attributes descriptions
-  std::vector<Vulkan::SpirV::SPIRVVertexInputAttribute> attribs{};
-  vertexShader->GetSPIRVReflection()
-              .GetVertexInputAttributes(attribs);
-
-  std::vector<vk::VertexInputAttributeDescription>    attributeDescriptions{};
-  std::vector<vk::VertexInputBindingDescription>      bindingDescriptions{};
-
-  const auto& bufferBindings = mCreateInfo->info.vertexInputState.bufferBindings;
-  const auto& attributes = mCreateInfo->info.vertexInputState.attributes;
-
-  // vertex buffer bindings match order of buffers
-  for( uint32_t bindingIndex = 0u; bindingIndex < bufferBindings.size(); ++bindingIndex )
-  {
-    bindingDescriptions.emplace_back(vk::VertexInputBindingDescription{}
-                                       .setBinding(bindingIndex)
-                                       .setInputRate(
-                                         bufferBindings[bindingIndex].inputRate == API::VertexInputRate::PER_VERTEX
-                                         ? vk::VertexInputRate::eVertex
-                                         : vk::VertexInputRate::eInstance)
-                                       .setStride(bufferBindings[bindingIndex].stride));
-  }
-
-  // create attribute descriptions
-  if( !attribs.empty() && attribs.size() == attribs.size() )
-  {
-    for (auto&& vb : attributes )
-    {
-      attributeDescriptions.emplace_back(vk::VertexInputAttributeDescription{}
-                                           .setBinding(vb.binding)
-                                           .setFormat(attribs[GetLocationIndex( attribs, vb.location)].format)
-                                           .setLocation(vb.location )
-                                           .setOffset(vb.offset));
-    }
-  }
-  else // incompatible pipeline
-  {
-    return false;
-  }
-
-  // prepare vertex input state
-  auto vertexInputState = vk::PipelineVertexInputStateCreateInfo{}
-    .setVertexBindingDescriptionCount(Vulkan::U32(bindingDescriptions.size()))
-    .setPVertexBindingDescriptions(bindingDescriptions.data())
-    .setVertexAttributeDescriptionCount(Vulkan::U32(attributeDescriptions.size()))
-    .setPVertexAttributeDescriptions(attributeDescriptions.data());
-
-  std::vector<vk::PipelineShaderStageCreateInfo> shaderStages =
-                                                   {
-                                                     vk::PipelineShaderStageCreateInfo{}
-                                                       .setModule(vertexShader->GetVkHandle())
-                                                       .setStage(vk::ShaderStageFlagBits::eVertex)
-                                                       .setPName("main"),
-                                                     vk::PipelineShaderStageCreateInfo{}
-                                                       .setModule(fragmentShader->GetVkHandle())
-                                                       .setStage(vk::ShaderStageFlagBits::eFragment)
-                                                       .setPName("main")
-                                                   };
-
-  // @todo use RenderTarget
-  auto swapchain = mGraphics.GetSwapchainForFBID(0);
-  auto fb = swapchain->GetCurrentFramebuffer();
-
-  vk::GraphicsPipelineCreateInfo pipelineInfo;
-  pipelineInfo
-    .setSubpass(0)
-    .setRenderPass(fb->GetRenderPassVkHandle()) // based on render target
-    .setBasePipelineHandle(nullptr)
-    .setBasePipelineIndex(0)
-    .setLayout(PreparePipelineLayout())
-    .setPColorBlendState(PrepareColorBlendStateCreateInfo())
-    .setPDepthStencilState(PrepareDepthStencilStateCreateInfo())
-    .setPDynamicState(nullptr)
-    .setPInputAssemblyState(PrepareInputAssemblyStateCreateInfo())
-    .setPMultisampleState(PrepareMultisampleStateCreateInfo())
-    .setPRasterizationState(PrepareRasterizationStateCreateInfo())
-    .setPTessellationState(PrepareTesselationStateCreateInfo())
-      //.setPVertexInputState(PrepareVertexInputStateCreateInfo())
-    .setPVertexInputState(&vertexInputState)
-    .setPViewportState(PrepareViewportStateCreateInfo())
-    .setPStages(shaderStages.data())
-    .setStageCount(Vulkan::U32(shaderStages.size()));
-
-  auto pipeline = Vulkan::Pipeline::New(mGraphics, pipelineInfo);
-
-  pipeline->Compile();
-
-  mVulkanPipelineState->pipeline = pipeline;
-  return true;
-}
-
-
-
-const vk::PipelineColorBlendStateCreateInfo* Pipeline::PrepareColorBlendStateCreateInfo()
-{
-  const auto& factoryInfo = mCreateInfo->info;
-
-  // blending enabled
-  bool blendEnable = factoryInfo.colorBlendState.blendEnable;
-
-  // color write mask
-  vk::ColorComponentFlags colorWriteMask{};
-  colorWriteMask |= ( factoryInfo.colorBlendState.colorComponentWriteBits & 1 ) ? vk::ColorComponentFlagBits::eR : vk::ColorComponentFlagBits{};
-  colorWriteMask |= ( factoryInfo.colorBlendState.colorComponentWriteBits & 2 ) ? vk::ColorComponentFlagBits::eG : vk::ColorComponentFlagBits{};
-  colorWriteMask |= ( factoryInfo.colorBlendState.colorComponentWriteBits & 4 ) ? vk::ColorComponentFlagBits::eB : vk::ColorComponentFlagBits{};
-  colorWriteMask |= ( factoryInfo.colorBlendState.colorComponentWriteBits & 8 ) ? vk::ColorComponentFlagBits::eA : vk::ColorComponentFlagBits{};
-
-  auto srcColorBlendFactor = ConvertBlendFactor( factoryInfo.colorBlendState.srcColorBlendFactor );
-  auto dstColorBlendFactor = ConvertBlendFactor( factoryInfo.colorBlendState.dstColorBlendFactor );
-  auto srcAlphaBlendFactor = ConvertBlendFactor( factoryInfo.colorBlendState.srcAlphaBlendFactor );
-  auto dstAlphaBlendFactor = ConvertBlendFactor( factoryInfo.colorBlendState.dstAlphaBlendFactor );
-  auto colorBlendOp = ConvertBlendOp( factoryInfo.colorBlendState.colorBlendOp );
-  auto alphaBlendOp = ConvertBlendOp( factoryInfo.colorBlendState.alphaBlendOp );
-
-  auto blendAttachmentState = vk::PipelineColorBlendAttachmentState{}
-    .setBlendEnable( vk::Bool32( blendEnable ) )
-    .setColorWriteMask( colorWriteMask )
-    .setSrcColorBlendFactor( srcColorBlendFactor )
-    .setDstColorBlendFactor( dstColorBlendFactor )
-    .setSrcAlphaBlendFactor( srcAlphaBlendFactor )
-    .setDstAlphaBlendFactor( dstAlphaBlendFactor )
-    .setColorBlendOp( colorBlendOp )
-    .setAlphaBlendOp( alphaBlendOp );
-
-  mVulkanPipelineState->colorBlendAttachmentState.emplace_back( blendAttachmentState );
-
-  mVulkanPipelineState->colorBlend
-                      .setBlendConstants( { factoryInfo.colorBlendState.blendConstants[0],
-                                            factoryInfo.colorBlendState.blendConstants[1],
-                                            factoryInfo.colorBlendState.blendConstants[2],
-                                            factoryInfo.colorBlendState.blendConstants[3] } )
-                      .setAttachmentCount( 1 )
-                      .setPAttachments( mVulkanPipelineState->colorBlendAttachmentState.data() );
-
-  return &mVulkanPipelineState->colorBlend;
-}
-
-const vk::PipelineDepthStencilStateCreateInfo* Pipeline::PrepareDepthStencilStateCreateInfo()
-{
-  const auto& dsInfo = mCreateInfo->info.depthStencilState;
-  return &(mVulkanPipelineState->depthStencil
-                               .setDepthTestEnable( vk::Bool32(dsInfo.depthTestEnable) )
-                               .setDepthWriteEnable( vk::Bool32(dsInfo.depthWriteEnable) )
-                               .setDepthCompareOp( ConvertCompareOp( dsInfo.depthCompareOp ))
-                               .setDepthBoundsTestEnable( false )
-                               .setStencilTestEnable( false )); //@ todo stencil test
-}
-
-const vk::PipelineInputAssemblyStateCreateInfo* Pipeline::PrepareInputAssemblyStateCreateInfo()
-{
-  const auto& iaInfo = mCreateInfo->info.inputAssemblyState;
-  //@todo support topology and restart
-  return &(mVulkanPipelineState->inputAssembly
-                               .setPrimitiveRestartEnable( vk::Bool32( iaInfo.primitiveRestartEnable ) )
-                               .setTopology( ConvertPrimitiveTopology( iaInfo.topology ) ));
-}
-
-const vk::PipelineMultisampleStateCreateInfo* Pipeline::PrepareMultisampleStateCreateInfo()
-{
-  return &(mVulkanPipelineState->multisample
-                               .setSampleShadingEnable( vk::Bool32(false) )
-                               .setRasterizationSamples( vk::SampleCountFlagBits::e1 )
-                               .setAlphaToCoverageEnable( vk::Bool32(false) )
-                               .setMinSampleShading( 1.0f )
-                               .setPSampleMask( nullptr ));
-}
-
-const vk::PipelineRasterizationStateCreateInfo* Pipeline::PrepareRasterizationStateCreateInfo()
-{
-  const auto& rsInfo = mCreateInfo->info.rasterizationState;
-  return &(mVulkanPipelineState->rasterization
-                               .setCullMode( ConvertCullMode( rsInfo.cullMode ) )
-                               .setDepthBiasClamp( 0.0f )
-                               .setDepthBiasEnable( vk::Bool32(false) )
-                               .setDepthClampEnable( vk::Bool32(false) )
-                               .setFrontFace( ConvertFrontFace( rsInfo.frontFace ) )
-                               .setPolygonMode( ConvertPolygonMode( rsInfo.polygonMode ) )
-                               .setRasterizerDiscardEnable( vk::Bool32(false) )
-                               .setLineWidth( 1.0f ));
-}
-
-const vk::PipelineViewportStateCreateInfo* Pipeline::PrepareViewportStateCreateInfo()
-{
-  const auto& vpInfo = mCreateInfo->info.viewportState;
-
-  auto width = vpInfo.viewport.width;
-  auto height = vpInfo.viewport.height;
-
-  if( !uint32_t(width) )
-  {
-    width = float(mGraphics.GetSwapchainForFBID(0)->GetCurrentFramebuffer()->GetWidth());
-    height = float(mGraphics.GetSwapchainForFBID(0)->GetCurrentFramebuffer()->GetHeight());
-  }
-
-  // viewports
-  mVulkanPipelineState->viewport.viewports.emplace_back( vpInfo.viewport.x, vpInfo.viewport.y, width, height );
-  mVulkanPipelineState->viewport.viewports[0].setMinDepth( vpInfo.viewport.minDepth );
-  mVulkanPipelineState->viewport.viewports[0].setMaxDepth( vpInfo.viewport.maxDepth );
-
-  // scissors
-  // todo: add scissor support
-  mVulkanPipelineState->viewport.scissors.emplace_back( vk::Rect2D(
-                        { static_cast<int32_t>(0), static_cast<int32_t>(0) },
-                        { Vulkan::U32(width), Vulkan::U32(height) } )
-                      );
-
-  auto& viewState = mVulkanPipelineState->viewport;
-
-  return &(mVulkanPipelineState->viewport.createInfo.
-                                 setViewportCount( Vulkan::U32(viewState.viewports.size()) ).
-                                 setPViewports( viewState.viewports.data() ).
-                                 setPScissors( viewState.scissors.data() ).
-                                 setScissorCount( Vulkan::U32(viewState.scissors.size())) );
-}
-
-const vk::PipelineTessellationStateCreateInfo* Pipeline::PrepareTesselationStateCreateInfo()
-{
-  return nullptr;
-}
-
-const vk::PipelineLayout Pipeline::PreparePipelineLayout()
-{
-  // descriptor set layout
-  const auto& shader = static_cast<const VulkanAPI::Shader*>(mCreateInfo->info.shaderState.shaderProgram);
-  auto vertexShader   = shader->GetShader(vk::ShaderStageFlagBits::eVertex);
-  auto fragmentShader = shader->GetShader(vk::ShaderStageFlagBits::eFragment);
-
-  auto vshDsLayouts = vertexShader->GetSPIRVReflection()
-                                  .GenerateDescriptorSetLayoutCreateInfo();
-  auto fshDsLayouts = fragmentShader->GetSPIRVReflection()
-                                    .GenerateDescriptorSetLayoutCreateInfo();
-
-  decltype(vshDsLayouts) layouts;
-  layouts.resize(std::max(vshDsLayouts.size(), fshDsLayouts.size()));
-
-  std::vector<vk::DescriptorSetLayout> dsLayouts;
-
-  for (auto i = 0u; i < layouts.size(); ++i)
-  {
-    std::vector<vk::DescriptorSetLayoutBinding> dsBindings;
-
-    // concatenate bindings per set
-    if (vshDsLayouts[i].bindingCount)
-    {
-      dsBindings.insert(
-        dsBindings.end(), vshDsLayouts[i].pBindings, vshDsLayouts[i].pBindings + vshDsLayouts[i].bindingCount);
-    }
-    if (fshDsLayouts[i].bindingCount)
-    {
-      dsBindings.insert(
-        dsBindings.end(), fshDsLayouts[i].pBindings, fshDsLayouts[i].pBindings + fshDsLayouts[i].bindingCount);
-    }
-
-    layouts[i].pBindings    = dsBindings.data();
-    layouts[i].bindingCount = Vulkan::U32(dsBindings.size());
-
-
-    dsLayouts.emplace_back(VkAssert(mGraphics.GetDevice()
-                                             .createDescriptorSetLayout(layouts[i], mGraphics.GetAllocator())));
-
-  }
-
-  mVkDescriptorSetLayouts = dsLayouts;
-
-  // create layout
-  auto pipelineLayoutCreateInfo = vk::PipelineLayoutCreateInfo{}
-    .setSetLayoutCount(Vulkan::U32(dsLayouts.size()))
-    .setPSetLayouts(dsLayouts.data())
-    .setPPushConstantRanges(nullptr)
-    .setPushConstantRangeCount(0);
-
-  return VkAssert(mGraphics.GetDevice().createPipelineLayout(pipelineLayoutCreateInfo, mGraphics.GetAllocator()));
-}
-
-void Pipeline::Reference()
-{
-  ++mRefCounter;
-}
-
-void Pipeline::Dereference()
-{
-  if(mRefCounter)
-  {
-    if (--mRefCounter == 0)
-    {
-      Destroy();
-    }
-  }
-}
-
-void Pipeline::Destroy()
-{
-  if(mPipelineCache)
-  {
-    mPipelineCache->RemovePipeline( this );
-  }
-}
-
-uint32_t Pipeline::GetHashCode() const
-{
-  return mHashCode;
-}
-
-Vulkan::RefCountedPipeline Pipeline::GetVkPipeline() const
-{
-  return mVulkanPipelineState->pipeline;
-}
-
-const std::vector<vk::DescriptorSetLayout>& Pipeline::GetVkDescriptorSetLayouts() const
-{
-  return mVkDescriptorSetLayouts;
-}
-
-} // Internal
-} // VulkanAPI
-} // Graphics
-} // Dal
-
diff --git a/dali/graphics/vulkan/api/internal/vulkan-api-pipeline-impl.h b/dali/graphics/vulkan/api/internal/vulkan-api-pipeline-impl.h
deleted file mode 100644 (file)
index 5b7d07c..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_PIPELINE_IMPL_H
-#define DALI_GRAPHICS_VULKAN_API_PIPELINE_IMPL_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <atomic>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Graphics;
-}
-
-namespace VulkanAPI
-{
-class Pipeline;
-class Controller;
-class PipelineFactory;
-class PipelineCache;
-namespace Internal
-{
-class Pipeline
-{
-public:
-
-  Pipeline( Vulkan::Graphics& graphics, Controller& controller, const PipelineFactory* factory );
-  ~Pipeline();
-
-  uint32_t GetHashCode() const;
-
-  bool Initialise();
-
-  void Reference();
-
-  void Dereference();
-
-  void Destroy();
-
-  Vulkan::RefCountedPipeline GetVkPipeline() const;
-
-  const std::vector<vk::DescriptorSetLayout>& GetVkDescriptorSetLayouts() const;
-
-private:
-
-  const vk::PipelineColorBlendStateCreateInfo*    PrepareColorBlendStateCreateInfo();
-  const vk::PipelineDepthStencilStateCreateInfo*  PrepareDepthStencilStateCreateInfo();
-  const vk::PipelineInputAssemblyStateCreateInfo* PrepareInputAssemblyStateCreateInfo();
-  const vk::PipelineMultisampleStateCreateInfo*   PrepareMultisampleStateCreateInfo();
-  const vk::PipelineRasterizationStateCreateInfo* PrepareRasterizationStateCreateInfo();
-  const vk::PipelineTessellationStateCreateInfo*  PrepareTesselationStateCreateInfo();
-  const vk::PipelineViewportStateCreateInfo*      PrepareViewportStateCreateInfo();
-  const vk::PipelineLayout                        PreparePipelineLayout();
-
-
-  Vulkan::Graphics& mGraphics;
-  Controller& mController;
-  uint32_t mHashCode;
-
-  std::atomic_int mRefCounter{ 0u };
-
-  // wrapper for copy of cSreate data
-  struct PipelineCreateInfo;
-  std::unique_ptr<PipelineCreateInfo> mCreateInfo;
-
-  struct VulkanPipelineState;
-  std::unique_ptr<VulkanPipelineState> mVulkanPipelineState;
-
-  std::vector<vk::DescriptorSetLayout> mVkDescriptorSetLayouts;
-
-  PipelineCache* mPipelineCache;
-};
-
-
-}
-
-}
-}
-}
-
-#endif //DALI_GRAPHICS_VULKAN_API_PIPELINE_IMPL_H
diff --git a/dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.cpp b/dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.cpp
deleted file mode 100644 (file)
index bfff32b..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.h>
-#include <dali/graphics/vulkan/api/internal/vulkan-api-pipeline-impl.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-
-PipelineCache::PipelineCache( Vulkan::Graphics& graphics, Controller& controller )
-{
-
-}
-
-PipelineCache::~PipelineCache() = default;
-
-Internal::Pipeline* PipelineCache::GetPipeline( const VulkanAPI::PipelineFactory& factory ) const
-{
-  auto hashCode = factory.GetHashCode();
-  auto iter = mCacheMap.find( hashCode );
-  if( iter == mCacheMap.end() )
-  {
-    return nullptr;
-  }
-
-  auto& entries = iter->second;
-
-  // return quickly if there's only one entry
-  if( entries.size() == 1 )
-  {
-    return entries[0].pipelineImpl.get();
-  }
-
-  for( auto&& entry : entries )
-  {
-    if( !std::memcmp( &entry.info, &factory.GetCreateInfo(), sizeof(entry.info) ))
-    {
-      return entry.pipelineImpl.get();
-    }
-  }
-
-  return nullptr;
-}
-
-bool PipelineCache::SavePipeline( const VulkanAPI::PipelineFactory& factory, std::unique_ptr<Internal::Pipeline> pipeline )
-{
-  // hash factory
-  auto hashCode = factory.GetHashCode();
-  auto iter = mCacheMap.find( hashCode );
-  std::vector<CacheEntry>* cacheEntries { nullptr };
-
-  if( iter == mCacheMap.end() )
-  {
-    mCacheMap[hashCode] = std::vector<CacheEntry>{};
-    cacheEntries = &mCacheMap[hashCode];
-  }
-  else
-  {
-    cacheEntries = &iter->second;
-  }
-
-  // pass the ownership to the cache
-  CacheEntry entry;
-  entry.pipelineImpl = std::move(pipeline);
-  entry.info = std::unique_ptr<PipelineFactory::Info>( new PipelineFactory::Info(factory.GetCreateInfo()) );
-  cacheEntries->push_back( std::move(entry) );
-  return true;
-}
-
-bool PipelineCache::RemovePipeline( Internal::Pipeline* pipeline )
-{
-  auto hashCode = pipeline->GetHashCode();
-  auto iter = mCacheMap.find( hashCode );
-  if( iter == mCacheMap.end() )
-  {
-    return false;
-  }
-
-  // delete pipeline
-  // todo: for now use brute force, later - safe delete
-  if( iter->second.size() == 1 )
-  {
-    iter->second.clear();
-  }
-  else
-  {
-    uint32_t i = 0;
-    for( auto&& entry : iter->second )
-    {
-      if( entry.pipelineImpl.get() == pipeline )
-      {
-        iter->second.erase( iter->second.begin()+i );
-        break;
-      }
-      ++i;
-    }
-  }
-
-  return true;
-}
-
-} // VulkanAPI
-} // Graphics
-} // Dali
diff --git a/dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.h b/dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.h
deleted file mode 100644 (file)
index cf40806..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_PIPELINE_CACHE_H
-#define DALI_GRAPHICS_VULKAN_API_PIPELINE_CACHE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics-api/graphics-api-pipeline.h>
-#include <dali/graphics/vulkan/api/vulkan-api-pipeline-factory.h>
-
-#include <memory>
-#include <map>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Graphics;
-} // Vulkan
-
-namespace VulkanAPI
-{
-namespace Internal
-{
-class Pipeline;
-} // Internal
-
-class Controller;
-class PipelineFactory;
-
-class PipelineCache
-{
-public:
-
-  PipelineCache( Vulkan::Graphics& graphics, Controller& controller );
-
-  ~PipelineCache();
-
-  /**
-   * Finds a pipeline based on the factory setup
-   * @return pipeline implementation or nullptr if pipeline isn't part of cache
-   */
-  Internal::Pipeline* GetPipeline( const VulkanAPI::PipelineFactory& factory ) const;
-
-  /**
-   * Saves pipeline in the cache
-   * @param pipeline
-   * @return
-   */
-  bool SavePipeline( const VulkanAPI::PipelineFactory& factory, std::unique_ptr<Internal::Pipeline> pipeline );
-
-  /**
-   * Removes unused pipeline
-   */
-  bool RemovePipeline( Internal::Pipeline* pipeline );
-
-
-private:
-
-  struct CacheEntry
-  {
-    std::unique_ptr<Internal::Pipeline>     pipelineImpl;
-    std::unique_ptr<PipelineFactory::Info>  info {}; // to compare if hash collision occurs
-  };
-
-  std::map<uint32_t, std::vector<CacheEntry>> mCacheMap;
-};
-} // VulkanAPI
-} // Graphics
-} // Dali
-
-#endif // DALI_GRAPHICS_VULKAN_API_PIPELINE_CACHE_H
diff --git a/dali/graphics/vulkan/api/internal/vulkan-ubo-manager.cpp b/dali/graphics/vulkan/api/internal/vulkan-ubo-manager.cpp
deleted file mode 100644 (file)
index b3027bc..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/internal/vulkan-ubo-manager.h>
-#include <dali/graphics/vulkan/api/internal/vulkan-ubo-pool.h>
-
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-
-struct UboManager::Impl
-{
-  explicit Impl( UboManager& uboManager, Controller& controller )
-  : mUboManager( uboManager ),
-    mController( controller )
-  {
-    Initialise();
-  }
-
-  ~Impl() = default;
-
-  void Initialise()
-  {
-    // populate pools
-    mPools.emplace( 64, std::make_unique<UboPool>( mController, 64, 64 ) );
-    mPools.emplace( 128, std::make_unique<UboPool>( mController, 128, 64 ) );
-    mPools.emplace( 256, std::make_unique<UboPool>( mController, 256, 64 ) );
-    mPools.emplace( 512, std::make_unique<UboPool>( mController, 512, 64 ) );
-    mPools.emplace( 1024, std::make_unique<UboPool>( mController, 1024, 64 ) );
-  }
-
-  /**
-   * Allocates memory within pool space choosing proper allocation size
-   * @param uboSize
-   * @return
-   */
-  std::unique_ptr<Ubo> Allocate( uint32_t uboSize )
-  {
-    UboPool* uboPool { nullptr };
-    for( auto&& pool : mPools )
-    {
-      if( uboSize < pool.first )
-      {
-        uboPool = &*pool.second;
-        break;
-      }
-    }
-    if(!uboPool)
-    {
-      return nullptr;
-    }
-
-    return uboPool->Allocate( uboSize );
-  }
-
-  /**
-   * Maps all UBO buffers for writing
-   * @note this should happen when frame begins
-   */
-  void MapAllBuffers()
-  {
-    for( auto&& pool : mPools )
-    {
-      pool.second->Map();
-    }
-  }
-
-  /**
-   * Unmaps all buffers and flushes memory
-   * @note this should happen when frame ends
-   */
-  void UnmapAllBuffers()
-  {
-    for( auto&& pool : mPools )
-    {
-      pool.second->Unmap();
-    }
-  }
-
-
-  UboManager& mUboManager;
-  Controller& mController;
-
-  std::unordered_map<uint32_t, std::unique_ptr<UboPool>> mPools;
-};
-
-//
-
-UboManager::UboManager(Controller& controller)
-{
-  mImpl = std::make_unique<Impl>( *this, controller );
-}
-
-UboManager::~UboManager() = default;
-
-std::unique_ptr<Ubo> UboManager::Allocate( uint32_t size )
-{
-  return mImpl->Allocate( size );
-}
-
-void UboManager::MapAllBuffers()
-{
-  mImpl->MapAllBuffers();
-}
-
-void UboManager::UnmapAllBuffers()
-{
-  mImpl->UnmapAllBuffers();
-}
-
-
-}
-}
-}
-
diff --git a/dali/graphics/vulkan/api/internal/vulkan-ubo-manager.h b/dali/graphics/vulkan/api/internal/vulkan-ubo-manager.h
deleted file mode 100644 (file)
index 1856b19..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef DALI_VULKAN_API_VULKAN_UBO_MANAGER_H
-#define DALI_VULKAN_API_VULKAN_UBO_MANAGER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <memory>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-class Controller;
-class Ubo;
-
-class UboManager
-{
-public:
-
-  /**
-   *
-   * @param controller
-   */
-  explicit UboManager( Controller& controller );
-  ~UboManager();
-
-  /** Allocates UBO of specified size
-   *
-   * @param size
-   * @return
-   */
-  std::unique_ptr<Ubo> Allocate( uint32_t size );
-
-  /**
-   * Maps all buffers within all pools
-   */
-  void MapAllBuffers();
-
-  /**
-   * Unmaps all buffers
-   */
-  void UnmapAllBuffers();
-
-private:
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-
-}
-}
-}
-#endif //DALI_VULKAN_API_VULKAN_UBO_MANAGER_H
\ No newline at end of file
diff --git a/dali/graphics/vulkan/api/internal/vulkan-ubo-pool.cpp b/dali/graphics/vulkan/api/internal/vulkan-ubo-pool.cpp
deleted file mode 100644 (file)
index c5ff4c5..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/internal/vulkan-ubo-pool.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-debug.h>
-#include <dali/graphics/vulkan/api/vulkan-api-controller.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-
-#include <deque>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-
-struct UboAllocationInfo
-{
-  uint32_t heapIndex;
-  uint32_t allocationIndex;
-  uint32_t allocationSize;
-  uint32_t allocationOffset;
-  uint32_t requestedSize;
-  uint32_t pageSize;
-};
-
-struct Ubo::Impl
-{
-  Impl( Ubo& ubo,
-        UboPool& pool,
-        UboAllocationInfo& allocationInfo
-  )
-    : mUbo( ubo ),
-      mPool( pool ),
-      mAllocationInfo( allocationInfo )
-  {
-  }
-
-  ~Impl()
-  {
-    mPool.Release(mUbo);
-  }
-
-  uint32_t Write( const void* data, uint32_t offset, uint32_t size )
-  {
-    bool alreadyMapped = mPool.IsMapped( mUbo );
-    void* ptr = mPool.Map( mUbo );
-    memcpy( ptr, reinterpret_cast<const char*>(data)+offset, size );
-
-    // cleanup
-    if( !alreadyMapped )
-    {
-      mPool.Unmap(mUbo);
-    }
-
-    return size;
-  }
-
-  uint32_t WriteKeepMapped( const void* data, uint32_t offset, uint32_t size )
-  {
-    void* ptr = mPool.Map( mUbo );
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General,  "[UBO] Writing " << size << " bytes into: " << ptr );
-    memcpy( ptr, reinterpret_cast<const char*>(data)+offset, size );
-    return size;
-  }
-
-  Vulkan::RefCountedBuffer GetBuffer() const
-  {
-    return mPool.GetBuffer( mUbo );
-  }
-
-  uint32_t GetBindingOffset() const
-  {
-    return mAllocationInfo.allocationOffset;
-  }
-
-  uint32_t GetBindingSize() const
-  {
-    return mAllocationInfo.allocationSize;
-  }
-
-  Ubo&     mUbo;
-  UboPool& mPool;
-  UboAllocationInfo mAllocationInfo;
-
-};
-
-struct UboPool::Impl
-{
-  struct PoolBuffer
-  {
-    explicit PoolBuffer( Vulkan::RefCountedBuffer buf ) :
-    mappedPtr( nullptr ), buffer( buf ) {}
-    ~PoolBuffer() = default;
-
-    void* mappedPtr;
-    Vulkan::RefCountedBuffer buffer;
-  };
-
-  explicit Impl( UboPool& uboPool, Controller& controller, uint32_t blockSize, uint32_t initialCapacity )
-  : mUboPool( uboPool ),
-    mController( controller ),
-    mBlockSize( blockSize ),
-    mInitialCapacity( initialCapacity )
-  {
-
-  }
-
-  ~Impl() = default;
-
-  std::unique_ptr<Ubo> Allocate( uint32_t requestedSize )
-  {
-    if( mAllocationQueue.empty() )
-    {
-      NewUboBuffer();
-    }
-
-    uint32_t allocationIndex = mAllocationQueue.back();
-    mAllocationQueue.pop_back();
-    uint32_t heapIndex = allocationIndex / mInitialCapacity;
-
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General, "[POOL] Allocated block size " << mBlockSize << ", index: " << allocationIndex);
-
-    auto allocationIndexInPage = uint32_t(allocationIndex % mInitialCapacity);
-
-    auto allocationInfo = UboAllocationInfo{};
-    allocationInfo.allocationIndex = allocationIndex;
-    allocationInfo.allocationOffset = allocationIndexInPage*mBlockSize;
-    allocationInfo.allocationSize = requestedSize;
-    allocationInfo.pageSize = mBlockSize;
-    allocationInfo.heapIndex = heapIndex;
-    return std::make_unique<Ubo>( mUboPool, allocationInfo );
-  }
-
-  void Release( Ubo& ubo )
-  {
-    auto& uboImpl = ubo.GetImplementation();
-    if( &uboImpl.mPool != &mUboPool )
-    {
-      return;
-    }
-
-    // return to pool
-    mAllocationQueue.push_back( uboImpl.mAllocationInfo.allocationIndex );
-  }
-
-  void NewUboBuffer()
-  {
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General, "[POOL] Allocating new page of block size " << mBlockSize << ", capacity: " << mInitialCapacity);
-    // add new Vulkan Buffer object
-    auto& graphics = mController.GetGraphics();
-
-    mBuffers.emplace_back( graphics.CreateBuffer(vk::BufferCreateInfo{}
-                                                         .setUsage( vk::BufferUsageFlagBits::eUniformBuffer)
-                                                         .setSharingMode( vk::SharingMode::eExclusive )
-                                                         .setSize( mBlockSize * mInitialCapacity ) ) );
-    mBuffers.back().buffer->BindMemory(
-              graphics
-                      .GetDeviceMemoryManager()
-                      .GetDefaultAllocator()
-                      .Allocate( mBuffers.back().buffer, vk::MemoryPropertyFlagBits::eHostVisible ) );
-
-
-    auto startIndex = ((mBuffers.size()-1)*mInitialCapacity);
-    for( uint32_t i = 0u; i < mInitialCapacity; ++i )
-    {
-      mAllocationQueue.push_back( uint32_t(startIndex + i));
-    }
-  }
-
-  void* Map( Ubo& ubo )
-  {
-    auto& impl = ubo.GetImplementation();
-    auto bufferIndex = uint32_t(impl.mAllocationInfo.allocationIndex / mInitialCapacity);
-    auto allocationIndex = uint32_t(impl.mAllocationInfo.allocationIndex % mInitialCapacity);
-
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General, "[POOL] Mapping UBO = alloc_index = " << impl.mAllocationInfo.allocationIndex);
-
-    return MapBuffer<char>( bufferIndex ) + (allocationIndex*mBlockSize);
-  }
-
-  template<class T>
-  T* MapBuffer( uint32_t bufferIndex )
-  {
-    if( !mBuffers[bufferIndex].mappedPtr )
-    {
-      DALI_LOG_STREAM( gVulkanFilter, Debug::General, "[POOL] Mapping PAGE = " << bufferIndex);
-      mBuffers[bufferIndex].mappedPtr = mBuffers[bufferIndex].buffer->GetMemoryHandle()->Map();
-    }
-
-    return reinterpret_cast<T*>(mBuffers[bufferIndex].mappedPtr);
-  }
-
-  void UnmapBuffer( uint32_t bufferIndex )
-  {
-    if( mBuffers[bufferIndex].mappedPtr )
-    {
-      DALI_LOG_STREAM( gVulkanFilter, Debug::General, "[POOL] Unmapping PAGE = " << bufferIndex);
-      mBuffers[bufferIndex].buffer->GetMemoryHandle()->Unmap();
-      mBuffers[bufferIndex].mappedPtr = nullptr;
-    }
-  }
-
-  void Unmap( Ubo& ubo )
-  {
-    auto& impl = ubo.GetImplementation();
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General, "[POOL] Mapping UBO = alloc[" << impl.mAllocationInfo.allocationIndex);
-    auto bufferIndex = uint32_t(impl.mAllocationInfo.allocationIndex / mInitialCapacity);
-    UnmapBuffer( bufferIndex );
-  }
-
-  bool IsMapped( Ubo& ubo )
-  {
-    auto& impl = ubo.GetImplementation();
-    auto bufferIndex = uint32_t(impl.mAllocationInfo.allocationIndex / mInitialCapacity);
-    return (nullptr != mBuffers[bufferIndex].mappedPtr);
-  }
-
-  Vulkan::RefCountedBuffer GetBuffer( Ubo& ubo ) const
-  {
-    auto& impl = ubo.GetImplementation();
-    auto bufferIndex = uint32_t(impl.mAllocationInfo.allocationIndex / mInitialCapacity);
-    return mBuffers[bufferIndex].buffer;
-  }
-
-  UboPool& mUboPool;
-  Controller& mController;
-  uint32_t mBlockSize;
-  uint32_t mInitialCapacity;
-
-  std::vector<PoolBuffer>         mBuffers;
-  std::deque<uint32_t>            mAllocationQueue;
-
-};
-
-UboPool::UboPool(Controller &controller, uint32_t blockSize, uint32_t initialCapacity )
-{
-  mImpl = std::make_unique<Impl>( *this, controller, blockSize, initialCapacity );
-}
-
-UboPool::~UboPool() = default;
-
-std::unique_ptr<Ubo> UboPool::Allocate( uint32_t requestedSize )
-{
-  return mImpl->Allocate( requestedSize );
-}
-
-void UboPool::Release( Ubo& ubo )
-{
-  mImpl->Release( ubo );
-}
-
-bool UboPool::IsMapped( Ubo& ubo )
-{
-  return mImpl->IsMapped( ubo );
-}
-
-Vulkan::RefCountedBuffer UboPool::GetBuffer( Ubo& ubo ) const
-{
-  return mImpl->GetBuffer( ubo );
-}
-
-void* UboPool::Map( Ubo& ubo )
-{
-  return mImpl->Map( ubo );
-}
-
-void UboPool::Unmap( Ubo& ubo )
-{
-  mImpl->Unmap( ubo );
-}
-
-void* UboPool::MapPage( uint32_t bufferIndex )
-{
-  return mImpl->MapBuffer<char>( bufferIndex );
-}
-
-void UboPool::UnmapPage( uint32_t bufferIndex )
-{
-  mImpl->UnmapBuffer( bufferIndex );
-}
-
-void UboPool::Map()
-{
-  for( auto i = 0u; i < mImpl->mBuffers.size(); ++i )
-  {
-    mImpl->MapBuffer<char>( i );
-  }
-}
-
-void UboPool::Unmap()
-{
-  for( auto i = 0u; i < mImpl->mBuffers.size(); ++i )
-  {
-    mImpl->UnmapBuffer( i );
-  }
-}
-
-Ubo::Ubo( UboPool& pool, UboAllocationInfo& allocationInfo )
-{
-  mImpl = std::make_unique<Impl>( *this, pool, allocationInfo );
-}
-
-Ubo::~Ubo() = default;
-
-uint32_t Ubo::Write( const void* data, uint32_t offset, uint32_t size )
-{
-  return mImpl->Write( data, offset, size );
-}
-
-uint32_t Ubo::WriteKeepMapped( const void* data, uint32_t offset, uint32_t size )
-{
-  return mImpl->WriteKeepMapped( data, offset, size );
-}
-
-Vulkan::RefCountedBuffer Ubo::GetBuffer() const
-{
-  return mImpl->GetBuffer();
-}
-
-uint32_t Ubo::GetBindingOffset() const
-{
-  return mImpl->GetBindingOffset();
-}
-
-uint32_t Ubo::GetBindingSize() const
-{
-  return mImpl->GetBindingSize();
-}
-
-Ubo::Impl& Ubo::GetImplementation()
-{
-  return *mImpl;
-}
-
-}
-}
-}
diff --git a/dali/graphics/vulkan/api/internal/vulkan-ubo-pool.h b/dali/graphics/vulkan/api/internal/vulkan-ubo-pool.h
deleted file mode 100644 (file)
index cd2a8c8..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-#ifndef DALI_VULKAN_INTERNAL_VULKAN_UBO_POOL_H
-#define DALI_VULKAN_INTERNAL_VULKAN_UBO_POOL_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <cstdint>
-#include <memory>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-class Controller;
-class Ubo;
-
-class UboPool
-{
-public:
-
-  explicit UboPool(Controller &controller, uint32_t blockSize, uint32_t initialCapacity );
-
-  ~UboPool();
-
-  /**
-   * Allocates memory within pool space for new UBO
-   * @return unique pointer to the UBO object
-   */
-  std::unique_ptr<Ubo> Allocate( uint32_t requestedSize );
-
-  /**
-   * Releases allocated memory back to the pool
-   * @param ubo
-   */
-  void Release( Ubo& ubo );
-
-  /**
-   * Maps UBO buffer memory into the user space
-   * @param ubo
-   * @return
-   */
-  void* Map( Ubo& ubo );
-
-  /**
-   * Unmaps UBO memory
-   */
-  void Unmap( Ubo& ubo );
-
-  /**
-   * Maps a single page in the pool
-   * @param bufferIndex
-   * @return
-   */
-  void* MapPage( uint32_t bufferIndex );
-
-
-  /**
-   * Unmaps a single page in the pool
-   * @param bufferIndex
-   * @return
-   */
-  void UnmapPage( uint32_t bufferIndex );
-
-  /**
-   * Maps all pages
-   * @param bufferIndex
-   * @return
-   */
-  void Map();
-
-  /**
-   * Unmaps all pages
-   * @param bufferIndex
-   * @return
-   */
-  void Unmap();
-
-  /**
-   *
-   * @param ubo
-   * @return
-   */
-  bool IsMapped( Ubo& ubo );
-
-  /**
-   * Returns Vulkan buffer associated with the UBO
-   * @param ubo
-   * @return
-   */
-  Vulkan::RefCountedBuffer GetBuffer( Ubo& ubo ) const;
-
-private:
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-/**
- * Ubo is an opaque object
- */
-struct Ubo
-{
-  explicit Ubo( UboPool& pool, struct UboAllocationInfo& allocationInfo );
-  ~Ubo();
-
-  /**
-   * Writes into UBO object memory. Maps and unmaps buffer. Not very efficient.
-   * @param data
-   * @param offset
-   * @param size
-   * @return
-   */
-  uint32_t Write( const void* data, uint32_t offset, uint32_t size );
-
-  /**
-   * Writes into the buffer memory, keeps it mapped
-   * @param data
-   * @param offset
-   * @param size
-   * @return
-   */
-  uint32_t WriteKeepMapped( const void* data, uint32_t offset, uint32_t size );
-
-  /**
-   * Returns buffer associated with the UBO
-   * @return
-   */
-  Vulkan::RefCountedBuffer GetBuffer() const;
-
-  /**
-   * Returns binding offset within Vulkan buffer object
-   * @return
-   */
-  uint32_t GetBindingOffset() const;
-
-  /**
-   * Return binding size within Vulkan buffer object
-   * @return
-   */
-  uint32_t GetBindingSize() const;
-
-
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-  Impl& GetImplementation();
-};
-
-
-}
-}
-}
-
-#endif //DALI_VULKAN_INTERNAL_VULKAN_UBO_POOL_H
diff --git a/dali/graphics/vulkan/api/vulkan-api-buffer-factory.cpp b/dali/graphics/vulkan/api/vulkan-api-buffer-factory.cpp
deleted file mode 100644 (file)
index 9bbe138..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/vulkan-api-buffer-factory.h>
-#include <dali/graphics/vulkan/api/vulkan-api-buffer.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/api/vulkan-api-controller.h>
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-BufferFactory::BufferFactory( Controller& controller )
-: mController( controller ), mGraphics(controller.GetGraphics() )
-{
-
-}
-
-BufferFactory& BufferFactory::SetUsage( API::Buffer::UsageHint usage )
-{
-  mUsageHints = usage;
-  switch( usage )
-  {
-    case API::Buffer::UsageHint::ATTRIBUTES:
-    {
-      mUsage = vk::BufferUsageFlagBits::eVertexBuffer;
-      break;
-    }
-    case API::Buffer::UsageHint::FRAME_CONSTANTS:
-    {
-      mUsage = vk::BufferUsageFlagBits::eUniformBuffer;
-      break;
-    }
-    case API::Buffer::UsageHint::INDEX_BUFFER:
-    {
-      mUsage = vk::BufferUsageFlagBits::eIndexBuffer;
-      break;
-    }
-    case API::Buffer::UsageHint::INSTANCE:
-    {
-      mUsage = vk::BufferUsageFlagBits::eVertexBuffer;
-      break;
-    }
-    case API::Buffer::UsageHint::PRIMITIVE_UNIFORMS:
-    {
-      mUsage = vk::BufferUsageFlagBits::eUniformBuffer;
-      break;
-    }
-  }
-  return *this;
-}
-
-BufferFactory& BufferFactory::SetSize( uint32_t size )
-{
-  mSize = size;
-  return *this;
-}
-
-std::unique_ptr<API::Buffer> BufferFactory::Create() const
-{
-  auto retval = std::make_unique<VulkanAPI::Buffer>( mController, mUsage, mUsageHints, mSize );
-  if( retval->Initialise() )
-  {
-    return std::unique_ptr<API::Buffer>{ retval.release() };
-  }
-  return nullptr;
-}
-
-
-
-} // namespace VulkanAPI
-} // namespace Graphics
-} // namespace Dali
\ No newline at end of file
diff --git a/dali/graphics/vulkan/api/vulkan-api-buffer-factory.h b/dali/graphics/vulkan/api/vulkan-api-buffer-factory.h
deleted file mode 100644 (file)
index 7bb8d62..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_BUFFER_FACTORY_H
-#define DALI_GRAPHICS_VULKAN_API_BUFFER_FACTORY_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <dali/graphics-api/graphics-api-buffer-factory.h>
-#include <dali/graphics-api/graphics-api-buffer.h>
-
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Graphics;
-}
-namespace VulkanAPI
-{
-class Controller;
-class BufferFactory : public Dali::Graphics::API::BufferFactory
-{
-public:
-
-  explicit BufferFactory( Controller& controller );
-
-  VulkanAPI::BufferFactory& SetUsage( API::Buffer::UsageHint usage ) override;
-
-  VulkanAPI::BufferFactory& SetSize( uint32_t size ) override;
-
-  PointerType Create() const override;
-
-private:
-
-  Controller&                 mController;
-  Vulkan::Graphics&           mGraphics;
-  vk::BufferUsageFlagBits     mUsage;
-  API::Buffer::UsageHint      mUsageHints;
-  uint32_t                    mSize;
-};
-
-} // namespace VulkanAPI
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_API_BUFFER_FACTORY_H
diff --git a/dali/graphics/vulkan/api/vulkan-api-buffer.cpp b/dali/graphics/vulkan/api/vulkan-api-buffer.cpp
deleted file mode 100644 (file)
index 292df97..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/vulkan-api-buffer.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-#include <dali/graphics/vulkan/api/vulkan-api-controller.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-
-Buffer::Buffer( Controller& controller, vk::BufferUsageFlagBits usage, API::Buffer::UsageHint usageHints, uint32_t size )
-: mController( controller ), mGraphics( controller.GetGraphics() ), mUsage( usage ), mUsageHints( usageHints ), mSize( size )
-{
-
-}
-
-bool Buffer::Initialise()
-{
-  Vulkan::BufferType type;
-  if( mUsage == vk::BufferUsageFlagBits::eUniformBuffer )
-  {
-    type = Vulkan::BufferType::UNIFORM;
-  }
-  else if( mUsage == vk::BufferUsageFlagBits::eIndexBuffer )
-  {
-    type = Vulkan::BufferType::INDEX;
-  }
-  else if( mUsage == vk::BufferUsageFlagBits::eVertexBuffer )
-  {
-    type = Vulkan::BufferType::VERTEX;
-  }
-  else
-  {
-    // unsupported usage
-    return false;
-  }
-
-  // create buffer
-  mBufferRef = mGraphics.CreateBuffer( mSize, type );
-
-  // allocate memory
-  auto memory =
-    mGraphics.GetDeviceMemoryManager().GetDefaultAllocator().Allocate( mBufferRef,
-                      vk::MemoryPropertyFlagBits::eHostVisible ); // todo: host visible should be only for dynamic buffers
-  mBufferRef->BindMemory( memory );
-
-  return true;
-}
-
-void* Buffer::Map()
-{
-  return mBufferRef->GetMemoryHandle()->Map();
-}
-
-void Buffer::Unmap()
-{
-  mBufferRef->GetMemoryHandle()->Unmap();
-}
-
-void Buffer::Write( void* src, uint32_t srcSize, uint32_t dstOffset )
-{
-  // depends whether the buffer is host visible or device local
-  // TODO: implement in-GPU copying, for now all buffers are host-visible
-  auto transfer = std::make_unique<VulkanAPI::BufferMemoryTransfer>();
-  auto tmp = new char[srcSize];
-  memcpy( tmp, src, srcSize );
-  transfer->srcPtr.reset( tmp );
-  transfer->dstBuffer = mBufferRef;
-  transfer->dstOffset = dstOffset;
-  transfer->srcSize = srcSize;
-  mController.ScheduleBufferMemoryTransfer( std::move(transfer) );
-}
-
-Vulkan::RefCountedBuffer Buffer::GetBufferRef() const
-{
-  return mBufferRef;
-}
-
-}
-}
-}
diff --git a/dali/graphics/vulkan/api/vulkan-api-buffer.h b/dali/graphics/vulkan/api/vulkan-api-buffer.h
deleted file mode 100644 (file)
index e4c5124..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_BUFFER_H
-#define DALI_GRAPHICS_VULKAN_API_BUFFER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics-api/graphics-api-buffer.h>
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-#include <memory>
-
-
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-class Controller;
-
-/**
- * Buffer represents a Buffer-type resource
- */
-class Buffer : public Graphics::API::Buffer
-{
-public:
-
-  explicit Buffer( Controller& controller, vk::BufferUsageFlagBits usage, API::Buffer::UsageHint usageHints, uint32_t size );
-
-  bool Initialise();
-
-  /**
-   * Maps buffer only when host visible or nullptr when device local
-   * @return
-   */
-  void* Map() override;
-
-  /**
-   * Unmaps previously accessed buffer
-   */
-  void Unmap() override;
-
-  /**
-   * Writes into the buffer
-   * @param src
-   * @param srcSize
-   * @param dstOffset
-   */
-  void Write( void* src, uint32_t srcSize, uint32_t dstOffset ) override;
-
-  Vulkan::RefCountedBuffer GetBufferRef() const;
-
-private:
-
-  Controller& mController;
-  Vulkan::Graphics& mGraphics;
-  vk::BufferUsageFlagBits mUsage{ vk::BufferUsageFlagBits::eVertexBuffer};
-  API::Buffer::UsageHint mUsageHints;
-  uint32_t mSize;
-
-  Vulkan::RefCountedBuffer mBufferRef;
-};
-}
-} // namespace Graphics
-} // namespace Dali
-#endif // DALI_GRAPHICS_VULKAN_API_BUFFER_H
diff --git a/dali/graphics/vulkan/api/vulkan-api-controller.cpp b/dali/graphics/vulkan/api/vulkan-api-controller.cpp
deleted file mode 100644 (file)
index df6d592..0000000
+++ /dev/null
@@ -1,493 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-descriptor-set.h>
-#include <dali/graphics/vulkan/api/vulkan-api-controller.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-#include <dali/graphics/vulkan/vulkan-surface.h>
-#include <dali/graphics/vulkan/vulkan-sampler.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-graphics-texture.h>
-
-// API
-#include <dali/graphics/vulkan/api/vulkan-api-shader.h>
-#include <dali/graphics/vulkan/api/vulkan-api-texture.h>
-#include <dali/graphics/vulkan/api/vulkan-api-buffer.h>
-#include <dali/graphics/vulkan/api/vulkan-api-texture-factory.h>
-#include <dali/graphics/vulkan/api/vulkan-api-shader-factory.h>
-#include <dali/graphics/vulkan/api/vulkan-api-buffer-factory.h>
-#include <dali/graphics/vulkan/api/vulkan-api-pipeline-factory.h>
-#include <dali/graphics/vulkan/api/vulkan-api-render-command.h>
-#include <dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.h>
-
-#include <dali/graphics/vulkan/api/internal/vulkan-ubo-manager.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-
-struct Controller::Impl
-{
-  struct RenderPassChange
-  {
-    // only move semantics
-    RenderPassChange( vk::RenderPassBeginInfo _beginInfo,
-                      std::vector<vk::ClearValue>&& _clearColorValues,
-                      const Vulkan::RefCountedFramebuffer& _framebuffer,
-                      uint32_t _offset )
-    : beginInfo( std::move(_beginInfo) ),
-      colorValues( std::move(_clearColorValues) ),
-      framebuffer( _framebuffer ),
-      offset( _offset )
-      {
-      }
-
-    // no default constructor!
-    RenderPassChange() = delete;
-
-    vk::RenderPassBeginInfo beginInfo     {};
-    std::vector<vk::ClearValue>           colorValues {};
-    Vulkan::RefCountedFramebuffer         framebuffer {};
-    uint32_t offset { 0 };
-  };
-
-  Impl( Controller& owner, Dali::Graphics::Vulkan::Graphics& graphics )
-  : mGraphics( graphics ),
-    mOwner( owner ),
-    mDefaultAllocator( mGraphics.GetDeviceMemoryManager().GetDefaultAllocator() )
-  {
-  }
-
-  ~Impl()
-  {
-  }
-
-  // TODO: @todo this function initialises basic buffers, shaders and pipeline
-  // for the prototype ONLY
-  bool Initialise()
-  {
-    // Create factories
-    mShaderFactory = std::make_unique<VulkanAPI::ShaderFactory>( mGraphics );
-    mTextureFactory = std::make_unique<VulkanAPI::TextureFactory>( mGraphics );
-    mBufferFactory = std::make_unique<VulkanAPI::BufferFactory>( mOwner );
-    mPipelineFactory = std::make_unique<VulkanAPI::PipelineFactory>( mOwner );
-
-    mUboManager = std::make_unique<VulkanAPI::UboManager>( mOwner );
-
-    mDefaultPipelineCache = std::make_unique<VulkanAPI::PipelineCache>( mGraphics, mOwner );
-
-    return true;
-  }
-
-
-  void BeginFrame()
-  {
-    // for all swapchains acquire new framebuffer
-    auto surface = mGraphics.GetSurface( 0u );
-
-    auto swapchain = mGraphics.GetSwapchainForFBID( 0u );
-
-    swapchain->AcquireNextFramebuffer();
-
-    mCurrentFramebuffer.Reset();
-  }
-
-  void EndFrame()
-  {
-    // swap all swapchains
-    auto swapchain = mGraphics.GetSwapchainForFBID( 0u );
-
-    auto primaryCommandBuffer = swapchain->GetPrimaryCommandBuffer();
-
-    for( auto i = 0u; i < mRenderPasses.size(); ++i )
-    {
-      if( i != 0u )
-      {
-        primaryCommandBuffer->EndRenderPass();
-      }
-
-      const auto& rp = mRenderPasses[i];
-      uint32_t offset = rp.offset;
-      uint32_t count = uint32_t(
-                 (i == mRenderPasses.size()-1) ?
-                 mSecondaryCommandBufferRefs.size() - rp.offset :
-                 mRenderPasses[i+1].offset - rp.offset );
-
-      primaryCommandBuffer->BeginRenderPass( rp.beginInfo, vk::SubpassContents::eSecondaryCommandBuffers );
-      primaryCommandBuffer->ExecuteCommands( mSecondaryCommandBufferRefs, offset, count );
-    }
-
-    primaryCommandBuffer->EndRenderPass();
-
-    swapchain->Present();
-    mSecondaryCommandBufferRefs.clear();
-    mRenderPasses.clear();
-  }
-
-  API::TextureFactory& GetTextureFactory() const
-  {
-    return *(mTextureFactory.get());
-  }
-
-  API::ShaderFactory& GetShaderFactory() const
-  {
-    return *(mShaderFactory.get());
-  }
-
-  API::BufferFactory& GetBufferFactory() const
-  {
-    return *(mBufferFactory.get());
-  }
-
-  /**
-   * NEW IMPLEMENTACIONE
-   */
-
-  std::unique_ptr<API::RenderCommand> AllocateRenderCommand()
-  {
-    return std::make_unique<VulkanAPI::RenderCommand>( mOwner, mGraphics );
-  }
-
-  bool UpdateRenderPass( const API::RenderCommand::RenderTargetBinding& renderTargetBinding )
-  {
-    Vulkan::RefCountedFramebuffer framebuffer{ nullptr };
-    if( renderTargetBinding.framebuffer.Exists() )
-    {
-      // @todo use VulkanAPI::Framebuffer when available
-      //framebuffer = static_cast<VulkanAPI::Framebuffer&>(renderTargetBinding.framebuffer.Get()).GetVkHandle();
-    }
-    else
-    {
-      // use first surface/swapchain as render target
-      auto surface = mGraphics.GetSurface( 0u );
-      auto swapchain = mGraphics.GetSwapchainForFBID( 0u );
-      framebuffer = swapchain->GetCurrentFramebuffer();
-    }
-
-    // If there is no framebuffer the it means DALi tries to use
-    // default framebuffer. For now just substitute with surface/swapchain
-    if( framebuffer != mCurrentFramebuffer )
-    {
-      auto primaryCommandBuffer = mGraphics.GetSwapchainForFBID(0)->GetPrimaryCommandBuffer();
-
-      mCurrentFramebuffer = framebuffer;
-      mCurrentFramebuffer->GetRenderPassVkHandle();
-      auto newColors = mCurrentFramebuffer->GetDefaultClearValues();
-      newColors[0].color.setFloat32( { renderTargetBinding.clearColors[0].r,
-                                       renderTargetBinding.clearColors[0].g,
-                                       renderTargetBinding.clearColors[0].b,
-                                       renderTargetBinding.clearColors[0].a
-                                     } );
-      mRenderPasses.emplace_back(
-                                // render pass
-                                vk::RenderPassBeginInfo{}
-                                    .setRenderPass( mCurrentFramebuffer->GetRenderPassVkHandle() )
-                                    .setFramebuffer( mCurrentFramebuffer->GetVkHandle() )
-                                    .setRenderArea( vk::Rect2D( {0, 0}, {mCurrentFramebuffer->GetWidth(), mCurrentFramebuffer->GetHeight()} ) )
-                                    .setClearValueCount( uint32_t( mCurrentFramebuffer->GetDefaultClearValues().size() ) )
-                                    .setPClearValues( newColors.data() ),
-
-                                // colors
-                                std::move(newColors),
-
-                                // framebuffer
-                                framebuffer,
-
-                                // offset when to begin new render pass
-                                0 );
-      return true;
-    }
-
-    // same render pass
-    return false;
-  }
-
-  /**
-   * Submits number of commands in one go ( simiar to vkCmdExecuteCommands )
-   * @param commands
-   */
-  void SubmitCommands( std::vector<Dali::Graphics::API::RenderCommand*> commands )
-  {
-    // if there are any scheduled writes
-    if(!mBufferTransferRequests.empty())
-    {
-      for(auto&& req : mBufferTransferRequests )
-      {
-        void* dst = req->dstBuffer->GetMemoryHandle()->Map();
-        memcpy( dst, &*req->srcPtr, req->srcSize );
-        req->dstBuffer->GetMemoryHandle()->Unmap();
-      }
-      mBufferTransferRequests.clear();
-    }
-
-    // the list of commands may be empty, but still we may have scheduled memory
-    // transfers
-    if( commands.empty() )
-    {
-      return;
-    }
-
-    std::vector<Vulkan::RefCountedCommandBuffer> cmdBufRefs{};
-
-    // Update uniform buffers
-    for( auto&& command : commands )
-    {
-      // prepare pipelines
-      auto apiCommand = static_cast<VulkanAPI::RenderCommand*>(command);
-      apiCommand->UpdateUniformBuffers();
-    }
-
-    mUboManager->UnmapAllBuffers();
-
-    // bind resources
-    for( auto&& command : commands )
-    {
-      auto apiCommand = static_cast<VulkanAPI::RenderCommand*>(command);
-      apiCommand->PrepareResources();
-    }
-
-    // Begin render pass for render target
-    // clear color obtained from very first command in the batch
-    auto firstCommand = static_cast<VulkanAPI::RenderCommand*>(commands[0]);
-    UpdateRenderPass( firstCommand->GetRenderTargetBinding() );
-
-    // set up writes
-    for( auto&& command : commands )
-    {
-      //const auto& vertexBufferBindings = command->GetVertexBufferBindings();
-      auto apiCommand = static_cast<VulkanAPI::RenderCommand*>(command);
-
-      // skip if there's no valid pipeline
-      if( !apiCommand->GetVulkanPipeline() )
-      {
-        continue;
-      }
-
-      // start new command buffer
-      auto cmdbuf = mGraphics.CreateCommandBuffer( false );//mCommandPool->NewCommandBuffer( false );
-      cmdbuf->Reset();
-      cmdbuf->Begin( vk::CommandBufferUsageFlagBits::eRenderPassContinue );
-      cmdbuf->BindGraphicsPipeline( apiCommand->GetVulkanPipeline() );
-
-      // bind vertex buffers
-      auto binding = 0u;
-      for( auto&& vb : apiCommand->GetVertexBufferBindings() )
-      {
-        cmdbuf->BindVertexBuffer( binding++, static_cast<const VulkanAPI::Buffer&>( vb.Get() ).GetBufferRef(), 0 );
-      }
-
-      // note: starting set = 0
-      cmdbuf->BindDescriptorSets( apiCommand->GetDescriptorSets(), 0 );
-
-      // draw
-      const auto& drawCommand = apiCommand->GetDrawCommand();
-
-      const auto& indexBinding = apiCommand->GetIndexBufferBinding();
-      if( indexBinding.buffer.Exists() )
-      {
-        cmdbuf->BindIndexBuffer( static_cast<const VulkanAPI::Buffer&>(indexBinding.buffer.Get()).GetBufferRef(),
-                                 0, vk::IndexType::eUint16 );
-        cmdbuf->DrawIndexed( drawCommand.indicesCount, drawCommand.instanceCount,
-        drawCommand.firstIndex, 0, drawCommand.firstInstance );
-      }
-      else
-      {
-        cmdbuf->Draw(drawCommand.vertexCount, drawCommand.instanceCount, drawCommand.firstVertex,
-                     drawCommand.firstInstance);
-      }
-      cmdbuf->End();
-      mSecondaryCommandBufferRefs.emplace_back( cmdbuf );
-    }
-
-  }
-
-  // resources
-  std::vector<Vulkan::RefCountedTexture> mTextures;
-  std::vector<Vulkan::RefCountedShader>  mShaders;
-  std::vector<Vulkan::RefCountedBuffer>  mBuffers;
-
-  // owner objects
-  ObjectOwner<API::Texture>   mTexturesOwner;
-  ObjectOwner<API::Shader>    mShadersOwner;
-  ObjectOwner<API::Buffer>    mBuffersOwner;
-
-  std::unique_ptr<PipelineCache> mDefaultPipelineCache;
-
-  Vulkan::Graphics&           mGraphics;
-  Controller&                 mOwner;
-  Vulkan::GpuMemoryAllocator& mDefaultAllocator;
-
-  std::unique_ptr<VulkanAPI::TextureFactory> mTextureFactory;
-  std::unique_ptr<VulkanAPI::ShaderFactory> mShaderFactory;
-  std::unique_ptr<VulkanAPI::BufferFactory> mBufferFactory;
-  std::unique_ptr<VulkanAPI::PipelineFactory> mPipelineFactory;
-
-  std::vector<std::unique_ptr<VulkanAPI::BufferMemoryTransfer>> mBufferTransferRequests;
-
-  std::unique_ptr<VulkanAPI::UboManager> mUboManager;
-
-  // Accumulate all the secondary command buffers of the frame here to avoid them being overwritten
-  // This accumulator vector gets cleared at the end of the frame. The command buffers are returned to the pool
-  // and ready to be used for the next frame.
-  std::vector<Vulkan::RefCountedCommandBuffer> mSecondaryCommandBufferRefs;
-
-  Vulkan::RefCountedFramebuffer mCurrentFramebuffer;
-  std::vector<RenderPassChange> mRenderPasses;
-
-};
-
-// TODO: @todo temporarily ignore missing return type, will be fixed later
-
-API::Accessor<API::Shader> Controller::CreateShader( const API::BaseFactory<API::Shader>& factory )
-{
-  auto handle = mImpl->mShadersOwner.CreateObject( factory );
-  auto& apiShader = static_cast<VulkanAPI::Shader&>(mImpl->mShadersOwner[handle]);
-  auto vertexShaderRef = apiShader.GetShaderRef( vk::ShaderStageFlagBits::eVertex );
-  auto fragmentShaderRef = apiShader.GetShaderRef( vk::ShaderStageFlagBits::eFragment );
-  mImpl->mShaders.push_back( vertexShaderRef );
-  mImpl->mShaders.push_back( fragmentShaderRef );
-  return API::Accessor<API::Shader>( mImpl->mShadersOwner, handle);
-}
-
-API::Accessor<API::Texture> Controller::CreateTexture( const API::BaseFactory<API::Texture>& factory )
-{
-  auto handle = mImpl->mTexturesOwner.CreateObject( factory );
-  auto textureRef = static_cast<VulkanAPI::Texture&>(mImpl->mTexturesOwner[handle]).GetTextureRef();
-  mImpl->mTextures.push_back( textureRef );
-  return API::Accessor<API::Texture>( mImpl->mTexturesOwner, handle);
-}
-
-API::Accessor<API::Buffer> Controller::CreateBuffer( const API::BaseFactory<API::Buffer>& factory )
-{
-  auto handle = mImpl->mBuffersOwner.CreateObject( factory );
-  auto bufferRef = static_cast<VulkanAPI::Buffer&>(mImpl->mBuffersOwner[handle]).GetBufferRef();
-  mImpl->mBuffers.push_back( bufferRef );
-  return API::Accessor<API::Buffer>( mImpl->mBuffersOwner, handle);
-}
-
-API::Accessor<API::Sampler> Controller::CreateSampler( const API::BaseFactory<API::Sampler>& factory )
-{
-  return { nullptr };
-}
-
-std::unique_ptr<API::Pipeline> Controller::CreatePipeline( const API::BaseFactory<API::Pipeline>& factory )
-{
-  auto& pipelineFactory = const_cast<PipelineFactory&>(dynamic_cast<const PipelineFactory&>( factory ));
-
-  // if no custom cache, use default one
-  if(!pipelineFactory.mPipelineCache)
-  {
-    pipelineFactory.mPipelineCache = mImpl->mDefaultPipelineCache.get();
-  }
-
-  return mImpl->mPipelineFactory->Create();
-}
-
-API::Accessor<API::Framebuffer> Controller::CreateFramebuffer( const API::BaseFactory<API::Framebuffer>& factory )
-{
-  return { nullptr };
-}
-
-std::unique_ptr<char> Controller::CreateBuffer( size_t numberOfElements, size_t elementSize )
-{
-  return std::unique_ptr<char>( new char[numberOfElements * elementSize] );
-}
-
-std::unique_ptr<Controller> Controller::New( Vulkan::Graphics& vulkanGraphics )
-{
-  return std::make_unique<Controller>( vulkanGraphics );
-}
-
-Controller::Controller( Vulkan::Graphics& vulkanGraphics ) : mImpl( std::make_unique<Impl>( *this, vulkanGraphics ) )
-{
-  mImpl->Initialise();
-}
-
-Controller::~Controller()       = default;
-Controller::Controller()        = default;
-Controller& Controller::operator=( Controller&& ) noexcept = default;
-
-void Controller::BeginFrame()
-{
-  mImpl->BeginFrame();
-}
-
-void Controller::EndFrame()
-{
-  mImpl->EndFrame();
-}
-
-API::TextureFactory& Controller::GetTextureFactory() const
-{
-  return mImpl->GetTextureFactory();
-}
-
-API::ShaderFactory& Controller::GetShaderFactory() const
-{
-  return mImpl->GetShaderFactory();
-}
-
-API::BufferFactory& Controller::GetBufferFactory() const
-{
-  return mImpl->GetBufferFactory();
-}
-
-API::PipelineFactory& Controller::GetPipelineFactory()
-{
-  mImpl->mPipelineFactory->Reset();
-  return *mImpl->mPipelineFactory;
-}
-
-Vulkan::Graphics& Controller::GetGraphics() const
-{
-  return mImpl->mGraphics;
-}
-
-void Controller::ScheduleBufferMemoryTransfer( std::unique_ptr<VulkanAPI::BufferMemoryTransfer> transferRequest )
-{
-  mImpl->mBufferTransferRequests.emplace_back( std::move(transferRequest) );
-}
-
-VulkanAPI::UboManager& Controller::GetUboManager()
-{
-  return *mImpl->mUboManager;
-}
-
-void Controller::SubmitCommands( std::vector<API::RenderCommand*> commands )
-{
-  mImpl->SubmitCommands( std::move(commands) );
-}
-
-std::unique_ptr<API::RenderCommand> Controller::AllocateRenderCommand()
-{
-  return mImpl->AllocateRenderCommand();
-}
-
-} // namespace VulkanAPI
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/api/vulkan-api-controller.h b/dali/graphics/vulkan/api/vulkan-api-controller.h
deleted file mode 100644 (file)
index 7f53116..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_CONTROLLER_H
-#define DALI_GRAPHICS_VULKAN_API_CONTROLLER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics-api/graphics-api-controller.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-
-namespace Vulkan
-{
-class Graphics;
-}
-
-namespace VulkanAPI
-{
-
-class UboManager;
-
-/**
- * Structure describes deferred memory transfer
- * Source memory is owned by the buffer and will be discarded
- * when transfer is completed
- */
-struct BufferMemoryTransfer
-{
-  BufferMemoryTransfer() = default;
-  ~BufferMemoryTransfer() = default;
-
-  std::unique_ptr<char> srcPtr{ nullptr };
-  uint32_t srcSize{ 0u };
-
-  Vulkan::RefCountedBuffer dstBuffer {};
-  uint32_t          dstOffset { 0u };
-};
-
-
-/**
- * @brief Interface class for Manager types in the graphics API.
- */
-class Controller : public Dali::Graphics::API::Controller
-{
-public:
-
-  explicit Controller( Vulkan::Graphics& vulkanGraphics );
-
-  /**
-   * Must be created from VulkanGraphics
-   * @param vulkanGraphics
-   * @return
-   */
-  static std::unique_ptr<Controller> New( Vulkan::Graphics& vulkanGraphics );
-
-  /**
-   * @brief Create a new object
-   */
-  API::Accessor<API::Shader> CreateShader( const API::BaseFactory<API::Shader>& factory ) override;
-
-  /**
-   * @brief Create a new object
-   */
-  API::Accessor<API::Texture> CreateTexture( const API::BaseFactory<API::Texture>& factory ) override;
-
-  /**
- * @brief Create a new object
- */
-  API::Accessor<API::Buffer> CreateBuffer( const API::BaseFactory<API::Buffer>& factory ) override;
-
-  /**
-   * @brief Create a new object
-   */
-  API::Accessor<API::Sampler> CreateSampler( const API::BaseFactory<API::Sampler>& factory ) override;
-
-  /**
-   * @brief Create a new object
-   */
-  std::unique_ptr<API::Pipeline> CreatePipeline( const API::BaseFactory<API::Pipeline>& factory ) override;
-
-  /**
-   * @brief Create a new object
-   */
-  API::Accessor<API::Framebuffer> CreateFramebuffer( const API::BaseFactory<API::Framebuffer>& factory ) override;
-
-  std::unique_ptr<char> CreateBuffer( size_t numberOfElements, size_t elementSize ) override;
-
-  void SubmitCommands( std::vector<API::RenderCommand*> commands ) override;
-
-  std::unique_ptr<API::RenderCommand> AllocateRenderCommand() override;
-
-  virtual void BeginFrame() override;
-
-  void EndFrame() override;
-
-  // VULKAN only
-
-public:
-
-  Vulkan::Graphics& GetGraphics() const;
-
-  void ScheduleBufferMemoryTransfer( std::unique_ptr<VulkanAPI::BufferMemoryTransfer> transferRequest );
-
-  VulkanAPI::UboManager& GetUboManager();
-
-public:
-
-  API::TextureFactory& GetTextureFactory() const override;
-
-  API::ShaderFactory& GetShaderFactory() const override;
-
-  API::BufferFactory& GetBufferFactory() const override;
-
-  API::PipelineFactory& GetPipelineFactory() override;
-
-public:
-  // not copyable
-  Controller( const Controller& ) = delete;
-  Controller& operator=( const Controller& ) = delete;
-
-  ~Controller() override;
-
-protected:
-  // derived types should not be moved direcly to prevent slicing
-  Controller( Controller&& ) noexcept = default;
-  Controller& operator=( Controller&& ) noexcept;
-
-  /**
-   * Objects of this type should not directly.
-   */
-  Controller();
-
-private:
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-} // namespace VulkanAPI
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_API_CONTROLLER_H
diff --git a/dali/graphics/vulkan/api/vulkan-api-pipeline-factory.cpp b/dali/graphics/vulkan/api/vulkan-api-pipeline-factory.cpp
deleted file mode 100644 (file)
index 075778f..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/vulkan-api-pipeline-factory.h>
-#include <dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.h>
-#include <dali/graphics/vulkan/api/vulkan-api-pipeline.h>
-#include <dali/graphics/vulkan/api/vulkan-api-controller.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-
-namespace
-{
-/**
- * Hashing binary data, it may not be the best algorithm
- * @return
- */
-uint32_t HashBinary(const void *dataObj, uint32_t size)
-{
-  const uint8_t *data = reinterpret_cast<const uint8_t *>(dataObj);
-  uint32_t      hash = 5381u;
-  uint32_t      c;
-  for (uint32_t i    = 0; i < size; ++i)
-  {
-    c    = *data++;
-    hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
-  }
-  return hash;
-}
-
-uint32_t HashPipeline(const VulkanAPI::PipelineFactory::Info &info)
-{
-  uint32_t dsHash = HashBinary( &info.depthStencilState, sizeof(info.depthStencilState) );
-  uint32_t cbHash = HashBinary( &info.colorBlendState, sizeof(info.colorBlendState) );
-  uint32_t shHash = HashBinary( &info.shaderState, sizeof(info.shaderState) );
-  uint32_t vpHash = HashBinary( &info.viewportState, sizeof(info.viewportState) );
-  uint32_t rsHash = HashBinary( &info.rasterizationState, sizeof(info.rasterizationState) );
-  uint32_t iaHash = HashBinary( &info.inputAssemblyState, sizeof(info.inputAssemblyState) );
-
-  // vertex input contains std containers so has to be hashed differently
-  uint32_t viStateBindingsHash = HashBinary( info.vertexInputState.bufferBindings.data(), uint32_t(sizeof( API::VertexInputState::Binding )*info.vertexInputState.bufferBindings.size()) );
-  uint32_t viStateAttributesHash = HashBinary( info.vertexInputState.attributes.data(), uint32_t(sizeof( API::VertexInputState::Attribute )*info.vertexInputState.attributes.size()) );
-
-  // rehash all
-  std::array<uint32_t, 8> allHashes = {
-    dsHash, cbHash, shHash, vpHash, rsHash, iaHash, viStateBindingsHash, viStateAttributesHash
-  };
-
-  return HashBinary( allHashes.data(), uint32_t(allHashes.size() * sizeof(uint32_t)));
-}
-
-}
-
-PipelineFactory::PipelineFactory( Controller& controller )
-: mController( controller ),
-  mGraphics( controller.GetGraphics() ),
-  mHashCode( 0u )
-{
-}
-
-API::PipelineFactory& PipelineFactory::SetPipelineCache(VulkanAPI::PipelineCache& pipelineCache)
-{
-  mPipelineCache = dynamic_cast<VulkanAPI::PipelineCache*>(&pipelineCache);
-  return *this;
-}
-
-
-API::PipelineFactory& PipelineFactory::SetColorBlendState(const API::ColorBlendState& state )
-{
-  mInfo.colorBlendState = state;
-  mHashCode = 0u;
-  return *this;
-}
-
-
-API::PipelineFactory& PipelineFactory::SetShaderState( const API::ShaderState& state )
-{
-  mInfo.shaderState = state;
-  mHashCode = 0u;
-  return *this;
-}
-
-API::PipelineFactory& PipelineFactory::SetViewportState( const API::ViewportState& state )
-{
-  mInfo.viewportState = state;
-  mHashCode = 0u;
-  return *this;
-}
-
-API::PipelineFactory& PipelineFactory::SetBasePipeline(API::Pipeline& pipeline)
-{
-  mBasePipeline = dynamic_cast<VulkanAPI::Pipeline*>(&pipeline);
-  mHashCode = 0u;
-  return *this;
-}
-
-API::PipelineFactory& PipelineFactory::SetDepthStencilState( API::DepthStencilState state )
-{
-  mInfo.depthStencilState = state;
-  mHashCode = 0u;
-  return *this;
-}
-
-API::PipelineFactory& PipelineFactory::SetRasterizationState( const API::RasterizationState& state )
-{
-  mInfo.rasterizationState = state;
-  mHashCode = 0u;
-  return *this;
-}
-
-API::PipelineFactory& PipelineFactory::SetVertexInputState( const API::VertexInputState& state )
-{
-  mInfo.vertexInputState = state;
-  mHashCode = 0u;
-  return *this;
-}
-
-API::PipelineFactory& PipelineFactory::SetInputAssemblyState( const API::InputAssemblyState& state )
-{
-  mInfo.inputAssemblyState = state;
-  mHashCode = 0u;
-  return *this;
-}
-
-std::unique_ptr<API::Pipeline> PipelineFactory::Create() const
-{
-  // todo: validate pipeline
-
-  // check cache
-  if( mPipelineCache )
-  {
-    auto ptr = mPipelineCache->GetPipeline( *this );
-    // if pipeline is already in cache, attach implementation and return unique ptr
-    if( ptr )
-    {
-      return std::unique_ptr<API::Pipeline>( new VulkanAPI::Pipeline( ptr ) );
-    }
-  }
-
-  return std::unique_ptr<API::Pipeline>( new VulkanAPI::Pipeline( mGraphics, mController, this ) );
-}
-
-void PipelineFactory::Reset()
-{
-  mInfo.depthStencilState = {};
-  mInfo.colorBlendState = {};
-  mInfo.shaderState = {};
-  mInfo.viewportState = {};
-  mInfo.rasterizationState = {};
-  mInfo.vertexInputState = {};
-  mInfo.inputAssemblyState = {};
-  mPipelineCache = nullptr;
-  mBasePipeline = nullptr;
-}
-
-uint32_t PipelineFactory::GetHashCode() const
-{
-  if( !mHashCode )
-  {
-    mHashCode = HashPipeline( GetCreateInfo() );
-  }
-  return mHashCode;
-}
-
-}
-}
-}
\ No newline at end of file
diff --git a/dali/graphics/vulkan/api/vulkan-api-pipeline-factory.h b/dali/graphics/vulkan/api/vulkan-api-pipeline-factory.h
deleted file mode 100644 (file)
index 3656281..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_PIPELINE_FACTORY_H
-#define DALI_GRAPHICS_VULKAN_API_PIPELINE_FACTORY_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics-api/graphics-api-pipeline-factory.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-
-namespace Vulkan
-{
-class Graphics;
-}
-
-namespace VulkanAPI
-{
-class Controller;
-class Pipeline;
-class PipelineCache;
-/**
- * @brief Interface class for ShaderFactory types in the graphics API.
- */
-class PipelineFactory : public API::PipelineFactory
-{
-public:
-
-  PipelineFactory( Controller& controller );
-
-  API::PipelineFactory& SetPipelineCache( VulkanAPI::PipelineCache& pipelineCache );
-
-  API::PipelineFactory& SetColorBlendState( const API::ColorBlendState& state ) override;
-
-  API::PipelineFactory& SetShaderState( const API::ShaderState& state ) override;
-
-  API::PipelineFactory& SetViewportState( const API::ViewportState& state ) override;
-
-  API::PipelineFactory& SetBasePipeline( API::Pipeline& pipeline ) override;
-
-  API::PipelineFactory& SetDepthStencilState( API::DepthStencilState state ) override;
-
-  API::PipelineFactory& SetRasterizationState( const API::RasterizationState& state ) override;
-
-  API::PipelineFactory& SetVertexInputState( const API::VertexInputState& state ) override;
-
-  API::PipelineFactory& SetInputAssemblyState( const API::InputAssemblyState& state ) override;
-
-  // To be called when getting new factory
-  void Reset();
-
-  std::unique_ptr<API::Pipeline> Create() const override;
-
-  uint32_t GetHashCode() const;
-
-  struct Info
-  {
-    API::DepthStencilState  depthStencilState;
-    API::ColorBlendState    colorBlendState;
-    API::ShaderState        shaderState;
-    API::ViewportState      viewportState;
-    API::RasterizationState rasterizationState;
-    API::VertexInputState   vertexInputState;
-    API::InputAssemblyState inputAssemblyState;
-  };
-
-  const Info& GetCreateInfo() const
-  {
-    return mInfo;
-  }
-
-public:
-
-  Info                              mInfo;
-  Controller&                       mController;
-  Vulkan::Graphics&                 mGraphics;
-  VulkanAPI::PipelineCache*         mPipelineCache;
-  VulkanAPI::Pipeline*              mBasePipeline;
-  mutable uint32_t                  mHashCode;
-};
-
-} // namespace API
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_API_PIPELINE_FACTORY_H
-
diff --git a/dali/graphics/vulkan/api/vulkan-api-pipeline.cpp b/dali/graphics/vulkan/api/vulkan-api-pipeline.cpp
deleted file mode 100644 (file)
index 9fa9816..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/vulkan-api-pipeline.h>
-#include <dali/graphics/vulkan/api/internal/vulkan-api-pipeline-impl.h>
-#include <dali/graphics/vulkan/api/vulkan-api-pipeline-factory.h>
-#include <dali/graphics/vulkan/api/internal/vulkan-pipeline-cache.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-
-Pipeline::Pipeline( Vulkan::Graphics& graphics, Controller& controller, const PipelineFactory* factory )
-{
-  mPipelineImpl = new Internal::Pipeline( graphics, controller, factory );
-
-  // ownership on the implementation is given away to cache
-  factory->mPipelineCache->SavePipeline( *factory, std::unique_ptr<Internal::Pipeline>( mPipelineImpl ) );
-
-  mPipelineImpl->Reference();
-}
-
-Pipeline::~Pipeline()
-{
-  mPipelineImpl->Dereference();
-}
-
-Pipeline::Pipeline( Internal::Pipeline* impl ) :
-mPipelineImpl( impl )
-{
-  mPipelineImpl->Reference();
-}
-
-Vulkan::RefCountedPipeline Pipeline::GetVkPipeline() const
-{
-  return mPipelineImpl->GetVkPipeline();
-}
-
-const std::vector<vk::DescriptorSetLayout>& Pipeline::GetVkDescriptorSetLayouts() const
-{
-  return mPipelineImpl->GetVkDescriptorSetLayouts();
-}
-
-
-}
-}
-}
diff --git a/dali/graphics/vulkan/api/vulkan-api-pipeline.h b/dali/graphics/vulkan/api/vulkan-api-pipeline.h
deleted file mode 100644 (file)
index 220d0eb..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_PIPELINE_H
-#define DALI_GRAPHICS_VULKAN_API_PIPELINE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics-api/graphics-api-pipeline.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Graphics;
-class PipelineCache;
-}
-
-namespace VulkanAPI
-{
-namespace Internal
-{
-class Pipeline;
-}
-
-class Controller;
-class PipelineFactory;
-/**
- * Pipeline due to its nature ( it's cached, single ownership ) is only an interface
- */
-class Pipeline : public API::Pipeline
-{
-public:
-
-  Pipeline( Vulkan::Graphics& graphics, Controller& controller, const PipelineFactory* factory );
-
-  ~Pipeline() override;
-
-  // non-copyable
-  Pipeline( const Pipeline& ) = delete;
-  Pipeline& operator=( const Pipeline& ) = delete;
-
-  // movable
-  Pipeline( Pipeline&& ) = default;
-  Pipeline& operator=( Pipeline&& ) = default;
-
-  Pipeline( Internal::Pipeline* impl );
-
-  Vulkan::RefCountedPipeline GetVkPipeline() const;
-
-  const std::vector<vk::DescriptorSetLayout>& GetVkDescriptorSetLayouts() const;
-
-private:
-  Internal::Pipeline* mPipelineImpl;
-};
-}
-}
-}
-
-#endif // DALI_GRAPHICS_VULKAN_API_PIPELINE_H
diff --git a/dali/graphics/vulkan/api/vulkan-api-render-command.cpp b/dali/graphics/vulkan/api/vulkan-api-render-command.cpp
deleted file mode 100644 (file)
index 75c4d0a..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics-api/utility/utility-memory-pool.h>
-
-#include <dali/graphics/vulkan/api/vulkan-api-render-command.h>
-
-#include <dali/graphics/vulkan/api/vulkan-api-shader.h>
-#include <dali/graphics/vulkan/api/vulkan-api-texture.h>
-#include <dali/graphics/vulkan/api/vulkan-api-pipeline.h>
-#include <dali/graphics/vulkan/spirv/vulkan-spirv.h>
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics/vulkan/vulkan-sampler.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-image-view.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-#include <dali/graphics/vulkan/vulkan-descriptor-set.h>
-
-#include <dali/graphics/vulkan/vulkan-swapchain.h>
-
-#include <dali/graphics/vulkan/api/internal/vulkan-ubo-manager.h>
-#include <dali/graphics/vulkan/api/internal/vulkan-ubo-pool.h>
-#include <dali/graphics/vulkan/api/vulkan-api-controller.h>
-#include <dali/graphics/vulkan/vulkan-debug.h>
-
-
-namespace Dali
-{
-namespace Graphics
-{
-using Vulkan::VkAssert;
-
-namespace VulkanAPI
-{
-
-RenderCommand::~RenderCommand() = default;
-
-RenderCommand::RenderCommand( VulkanAPI::Controller& controller, Vulkan::Graphics& graphics )
-: mController( controller ), mGraphics( graphics ), mCommandBuffer(), mUpdateFlags( UPDATE_ALL )
-{
-}
-
-///@todo: needs pipeline factory rather than pipeline creation in place!!!
-void RenderCommand::PrepareResources()
-{
-  if( mUpdateFlags )
-  {
-    if( !mVulkanPipeline )
-    {
-      auto pipeline = dynamic_cast<const VulkanAPI::Pipeline*>( mPipeline );
-      if(!pipeline)
-      {
-        return;
-      }
-      mVkDescriptorSetLayouts.clear();
-      mVkDescriptorSetLayouts = pipeline->GetVkDescriptorSetLayouts();
-      mVulkanPipeline = pipeline->GetVkPipeline();
-    }
-
-    // based on pipeline recreate descriptor pool
-    auto poolSizes = std::vector<vk::DescriptorPoolSize>{
-      vk::DescriptorPoolSize{}
-        .setDescriptorCount(10)
-        .setType(vk::DescriptorType::eUniformBuffer),
-      vk::DescriptorPoolSize{}
-        .setDescriptorCount(10)
-        .setType(vk::DescriptorType::eCombinedImageSampler),
-      vk::DescriptorPoolSize{}
-        .setDescriptorCount(10)
-        .setType(vk::DescriptorType::eSampledImage)
-    };
-
-    // create descriptor pool
-    mDescriptorPool = Vulkan::DescriptorPool::New(mGraphics, vk::DescriptorPoolCreateInfo{}
-      .setMaxSets(Vulkan::U32(mVkDescriptorSetLayouts.size() + 1))
-      .setPPoolSizes(poolSizes.data())
-      .setPoolSizeCount(Vulkan::U32(poolSizes.size())));
-
-    // allocate descriptor sets. we need a descriptors for each descriptorset
-    // in the shader
-    // allocate descriptor sets for given pipeline layout
-    mDescriptorSets = mDescriptorPool->AllocateDescriptorSets(
-      vk::DescriptorSetAllocateInfo{}
-        .setPSetLayouts(mVkDescriptorSetLayouts.data())
-        .setDescriptorPool(nullptr)
-        .setDescriptorSetCount(uint32_t(mVkDescriptorSetLayouts.size()))
-    );
-
-    AllocateUniformBufferMemory();
-
-    BindUniformBuffers();
-
-    BindTexturesAndSamplers();
-
-    mUpdateFlags = 0u;
-  }
-}
-
-void RenderCommand::UpdateUniformBuffers()
-{
-  uint32_t uboIndex = 0u;
-  if(!mUboBuffers.empty() && mUboBuffers.size() == mPushConstantsBindings.size())
-  {
-    for (auto &&pc : mPushConstantsBindings)
-    {
-      mUboBuffers[uboIndex++]->WriteKeepMapped(pc.data, 0, pc.size);
-    }
-  }
-}
-
-const Vulkan::RefCountedCommandBuffer& RenderCommand::GetCommandBuffer() const
-{
-  return mCommandBuffer;
-}
-
-void RenderCommand::AllocateUniformBufferMemory()
-{
-  // release any existing buffers
-  mUboBuffers.clear();
-
-  // based on pipeline allocate memory for each push constant and uniform buffer
-  // using given UBOManager
-  for( auto&& pc : mPushConstantsBindings )
-  {
-    mUboBuffers.emplace_back( mController.GetUboManager().Allocate( pc.size ) );
-  }
-
-}
-
-void RenderCommand::BindUniformBuffers()
-{
-  // if uniform buffers for some reason changed, then rewrite
-  // bind PCs
-  for( uint32_t i = 0; i < mPushConstantsBindings.size(); ++i )
-  {
-    auto& ubo = mUboBuffers[i];
-    auto& pc = mPushConstantsBindings[i];
-
-#ifdef DEBUG_ENABLED
-    auto offset = ubo->GetBindingOffset();
-    auto size = ubo->GetBindingSize();
-
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General, "offset: " << offset << ", size: " << size);
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General, "[RenderCommand] BindingUBO: binding = " << pc.binding);
-#endif
-    mDescriptorSets[0]->WriteUniformBuffer( pc.binding, ubo->GetBuffer(), ubo->GetBindingOffset(), ubo->GetBindingSize() );
-  }
-}
-
-void RenderCommand::BindTexturesAndSamplers()
-{
-  // only if textures/samplers changed, rewrite
-  for( auto&& texture : mTextureBindings )
-  {
-    auto& image = static_cast<VulkanAPI::Texture&>( texture.texture.Get() );
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General, "[RenderCommand] BindingTextureSampler: binding = " << texture.binding);
-    mDescriptorSets[0]->WriteCombinedImageSampler( texture.binding, image.GetTextureRef()->GetSampler(), image.GetTextureRef()->GetImageView() );
-  }
-}
-
-const std::vector<Vulkan::RefCountedDescriptorSet>& RenderCommand::GetDescriptorSets() const
-{
-  return mDescriptorSets;
-}
-
-Vulkan::RefCountedPipeline RenderCommand::GetVulkanPipeline() const
-{
-  return mVulkanPipeline;
-}
-
-} // namespace VulkanAPI
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/api/vulkan-api-render-command.h b/dali/graphics/vulkan/api/vulkan-api-render-command.h
deleted file mode 100644 (file)
index df824dd..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_RENDER_COMMAND_H
-#define DALI_GRAPHICS_VULKAN_API_RENDER_COMMAND_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics-api/graphics-api-render-command.h>
-#include <dali/graphics-api/graphics-api-shader-details.h>
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class PipelineCache;
-}
-
-namespace VulkanAPI
-{
-class Controller;
-class Ubo;
-class Pipeline;
-
-/**
- * Render command stores internal command buffer per draw call
- *
- * For Vulkan:
- *
- * - RenderCommand stores all the relevant data
- * - Changing pipeline determines recreating certain resources
- * - Currently each RC has own DescriptorSetPool
- * - Currently each RC has a handle to UBOs
- * - UBOs are assigned upon pipeline creation/assignment
- * - Descriptor sets are allocated upon pipeline creation
- * - Note: need resource "versioning"
- */
-class RenderCommand : public Graphics::API::RenderCommand
-{
-public:
-
-  constexpr static uint32_t UPDATE_ALL = 0xffffffff;
-
-  RenderCommand( VulkanAPI::Controller& controller,
-                 Vulkan::Graphics& graphics );
-
-  ~RenderCommand() override;
-
-  /**
-   * Forces pipeline compilation whenever something changed and
-   * updates cache
-   * @return
-   */
-  void PrepareResources();
-
-  /**
-   * Updates uniform buffers
-   */
-  void UpdateUniformBuffers();
-
-  /**
-   * Writes uniform buffers into descriptor set
-   */
-  void BindUniformBuffers();
-
-  /**
-   * Writes texture/sample combo into descriptor set
-   */
-  void BindTexturesAndSamplers();
-
-  /**
-   * Binds vertex buffers
-   */
-  void BindVertexBuffers();
-
-  /**
-   * Returns an array of updated descriptor sets
-   * @return
-   */
-  const std::vector<Vulkan::RefCountedDescriptorSet>& GetDescriptorSets() const;
-
-  /**
-   * Returns associated Vulkan command buffer
-   * @return
-   */
-  const Vulkan::RefCountedCommandBuffer& GetCommandBuffer() const;
-
-  /**
-   * Returns Vulkan backed pipeline
-   * @return
-   */
-  Vulkan::RefCountedPipeline GetVulkanPipeline() const;
-
-private:
-
-  /**
-   * Allocates UBO memory based on the pipeline. Executed only
-   * once per pipeline
-   */
-  void AllocateUniformBufferMemory();
-
-private:
-
-  VulkanAPI::Controller&                       mController;
-  Vulkan::Graphics&                            mGraphics;
-  Vulkan::RefCountedCommandBuffer              mCommandBuffer;
-  Vulkan::RefCountedPipeline                   mVulkanPipeline;
-  Vulkan::RefCountedDescriptorPool             mDescriptorPool;
-
-  std::vector<vk::DescriptorSetLayout>         mVkDescriptorSetLayouts;
-
-  std::vector<Vulkan::RefCountedDescriptorSet> mDescriptorSets;
-
-  std::vector<std::unique_ptr<Ubo>>            mUboBuffers;
-
-  uint32_t mUpdateFlags;
-};
-
-}
-}
-}
-#endif //DALI_GRAPHICS_VULKAN_API_RENDER_COMMAND_H
diff --git a/dali/graphics/vulkan/api/vulkan-api-shader-factory.cpp b/dali/graphics/vulkan/api/vulkan-api-shader-factory.cpp
deleted file mode 100644 (file)
index ae51b15..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/vulkan-api-shader-factory.h>
-#include <dali/graphics/vulkan/api/vulkan-api-shader.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-shader.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-
-ShaderFactory::ShaderFactory( Vulkan::Graphics& graphics ) :
-mGraphics( graphics )
-{
-}
-
-ShaderFactory::~ShaderFactory() = default;
-
-ShaderFactory& ShaderFactory::SetShaderModule( Graphics::API::ShaderDetails::PipelineStage       pipelineStage,
-                                         Graphics::API::ShaderDetails::Language            language,
-                                         const Graphics::API::ShaderDetails::ShaderSource& source )
-{
-  using PipelineStage = Graphics::API::ShaderDetails::PipelineStage;
-  if( pipelineStage == PipelineStage::VERTEX )
-  {
-    mVertexShader = ShaderModuleInfo( pipelineStage, language, source );
-  }
-  else if( pipelineStage == PipelineStage::FRAGMENT )
-  {
-    mFragmentShader = ShaderModuleInfo( pipelineStage, language, source );
-  }
-  return *this;
-}
-
-std::unique_ptr<Graphics::API::Shader> ShaderFactory::Create() const
-{
-  if( !mVertexShader.source.IsSet() || !mFragmentShader.source.IsSet() )
-  {
-    return nullptr;
-  }
-
-  auto retval = std::make_unique<VulkanAPI::Shader>( mGraphics );
-
-  // add vertex shader
-  retval->AddShaderModule( mVertexShader.pipelineStage, mVertexShader.language, mVertexShader.source );
-
-  // add fragment shader
-  retval->AddShaderModule( mFragmentShader.pipelineStage, mFragmentShader.language, mFragmentShader.source );
-
-  return std::move(retval);
-}
-
-} // namespace VulkanAPI
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/api/vulkan-api-shader-factory.h b/dali/graphics/vulkan/api/vulkan-api-shader-factory.h
deleted file mode 100644 (file)
index fb87fb9..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_SHADER_FACTORY_H
-#define DALI_GRAPHICS_VULKAN_API_SHADER_FACTORY_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include <dali/graphics-api/graphics-api-shader-factory.h>
-#include <dali/graphics-api/graphics-api-shader-details.h>
-#include <dali/graphics-api/graphics-api-shader.h>
-
-#include <vector>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Graphics;
-}
-namespace VulkanAPI
-{
-
-class ShaderFactory : public Dali::Graphics::API::ShaderFactory
-{
-public:
-  explicit ShaderFactory( Vulkan::Graphics& graphics );
-
-  ShaderFactory& SetShaderModule(Graphics::API::ShaderDetails::PipelineStage       pipelineStage,
-                                 Graphics::API::ShaderDetails::Language            language,
-                                 const Graphics::API::ShaderDetails::ShaderSource& source) override;
-
-  PointerType Create() const override;
-
-  ~ShaderFactory() override;
-
-private:
-
-  struct ShaderModuleInfo
-  {
-    using PipelineStage = Graphics::API::ShaderDetails::PipelineStage;
-    using Language = Graphics::API::ShaderDetails::Language;
-    using ShaderSource = Graphics::API::ShaderDetails::ShaderSource;
-
-    PipelineStage pipelineStage;
-    Language language;
-    ShaderSource source;
-
-    ShaderModuleInfo( PipelineStage stage, Language shaderLanguage, const ShaderSource& shaderSource )
-    : pipelineStage( stage ),
-      language( shaderLanguage ),
-      source( shaderSource )
-    {
-    }
-
-    ShaderModuleInfo()
-      : pipelineStage( PipelineStage::VERTEX ),
-        language( Language::SPIRV_1_0 ),
-        source( ShaderSource(std::vector<char>()) )
-    {
-    }
-
-    ShaderModuleInfo( const ShaderModuleInfo& info ) = default;
-
-    ~ShaderModuleInfo() = default;
-  };
-
-  Vulkan::Graphics& mGraphics;
-  ShaderModuleInfo mVertexShader;
-  ShaderModuleInfo mFragmentShader;
-};
-
-
-}
-}
-}
-
-#endif // DALI_GRAPHICS_VULKAN_API_SHADER_FACTORY_H
diff --git a/dali/graphics/vulkan/api/vulkan-api-shader.cpp b/dali/graphics/vulkan/api/vulkan-api-shader.cpp
deleted file mode 100644 (file)
index ae1c821..0000000
+++ /dev/null
@@ -1,356 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/vulkan-api-shader.h>
-#include <dali/graphics-api/graphics-api-shader-details.h>
-#include <dali/graphics/vulkan/vulkan-shader.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-using namespace Dali::Graphics::API;
-using namespace Dali::Graphics::Vulkan;
-
-using ShaderLanguage = Dali::Graphics::API::ShaderDetails::Language;
-using ShaderPipelineStage = Dali::Graphics::API::ShaderDetails::PipelineStage;
-using ShaderSource = Dali::Graphics::API::ShaderDetails::ShaderSource;
-
-Shader::Shader( Vulkan::Graphics& graphics ) :
-mGraphics( graphics )
-{
-
-}
-
-RefCountedShader Shader::GetShader( vk::ShaderStageFlagBits shaderStage ) const
-{
-  switch( shaderStage )
-  {
-    case vk::ShaderStageFlagBits::eVertex:
-    {
-      return mVertexShader;
-    }
-    case vk::ShaderStageFlagBits::eFragment:
-    {
-      return mFragmentShader;
-    }
-    case vk::ShaderStageFlagBits::eTessellationControl:
-    case vk::ShaderStageFlagBits::eTessellationEvaluation:
-    case vk::ShaderStageFlagBits::eGeometry:
-    case vk::ShaderStageFlagBits::eCompute:
-    case vk::ShaderStageFlagBits::eAllGraphics:
-    case vk::ShaderStageFlagBits::eAll:
-    {
-    }
-  }
-  return RefCountedShader();
-}
-
-Shader& Shader::DownCast( Dali::Graphics::API::Shader& shader )
-{
-  return *( dynamic_cast<Shader*>( &shader ) );
-}
-
-Vulkan::RefCountedShader Shader::GetShaderRef( vk::ShaderStageFlagBits shaderStage ) const
-{
-  if(shaderStage == vk::ShaderStageFlagBits::eVertex)
-  {
-    return mVertexShader;
-  }
-  else if(shaderStage == vk::ShaderStageFlagBits::eFragment)
-  {
-    return mFragmentShader;
-  }
-  else
-  {
-    return Vulkan::RefCountedShader( );
-  }
-}
-
-bool Shader::AddShaderModule( Dali::Graphics::API::ShaderDetails::PipelineStage pipelineStage,
-                              Dali::Graphics::API::ShaderDetails::Language language,
-                              Dali::Graphics::API::ShaderDetails::ShaderSource shaderSource )
-
-{
-  // TODO: AB: only supported language is SPIRV for now
-  if( language != ShaderLanguage::SPIRV_1_0 && language != ShaderLanguage::SPIRV_1_1 )
-  {
-    // unsupported language
-    return false;
-  }
-
-  // TODO: AB: only binary shader supported for now
-  if( shaderSource.type != ShaderDetails::ShaderSourceType::BINARY )
-  {
-    return false;
-  }
-
-  auto shaderRef = Vulkan::Shader::New( mGraphics, &shaderSource.code[0], shaderSource.code.size() );
-
-  if(!shaderRef)
-  {
-    return false;
-  }
-
-  if(pipelineStage == ShaderPipelineStage::VERTEX )
-  {
-    mVertexShader = shaderRef;
-    mVertexShader->SetExplicitShaderStage( vk::ShaderStageFlagBits::eVertex );
-    // update input attributes
-    mVertexShader->GetSPIRVReflection().GetVertexInputAttributes( mVertexInputAttributes );
-  }
-  else if(pipelineStage == ShaderPipelineStage::FRAGMENT )
-  {
-    mFragmentShader = shaderRef;
-    mVertexShader->SetExplicitShaderStage( vk::ShaderStageFlagBits::eFragment );
-  }
-
-  mUniformBlocks.clear();
-  mUniformOpaques.clear();
-
-  // recreate reflection
-  if( mVertexShader )
-  {
-    auto& ubo = mVertexShader->GetSPIRVReflection().GetUniformBlocks();
-    mUniformBlocks.insert(mUniformBlocks.end(), ubo.begin(), ubo.end() );
-
-    auto& uniforms = mVertexShader->GetSPIRVReflection().GetOpaqueUniforms();
-    mUniformOpaques.insert(mUniformOpaques.end(), uniforms.begin(), uniforms.end() );
-  }
-  if( mFragmentShader )
-  {
-    auto& ubo = mFragmentShader->GetSPIRVReflection().GetUniformBlocks();
-    mUniformBlocks.insert(mUniformBlocks.end(), ubo.begin(), ubo.end() );
-
-    auto& uniforms = mFragmentShader->GetSPIRVReflection().GetOpaqueUniforms();
-    mUniformOpaques.insert(mUniformOpaques.end(), uniforms.begin(), uniforms.end() );
-  }
-
-  // verify bindings and descriptor sets ( must be no overlaps, or if there are, only one binding will be used )
-  return true;
-}
-
-bool Shader::IsReflectionSupported() const
-{
-  return true;
-}
-
-uint32_t Shader::GetVertexAttributeLocation(const std::string& name) const
-{
-  if( !mVertexShader )
-  {
-    return API::ShaderDetails::ERROR_VERTEX_INPUT_ATTRIBUTE_NOT_FOUND;
-  }
-
-  for( auto&& attr : mVertexInputAttributes )
-  {
-    if( attr.name == name )
-    {
-      return attr.location;
-    }
-  }
-  return API::ShaderDetails::ERROR_VERTEX_INPUT_ATTRIBUTE_NOT_FOUND;
-}
-
-API::ShaderDetails::VertexInputAttributeFormat Shader::GetVertexAttributeFormat( uint32_t location ) const
-{
-  if( !mVertexShader || mVertexInputAttributes.size() <= location )
-  {
-    return API::ShaderDetails::VertexInputAttributeFormat::UNDEFINED;
-  }
-
-  const auto& attr = mVertexInputAttributes[location];
-
-  if( attr.format == vk::Format::eR32Sfloat )
-  {
-    return API::ShaderDetails::VertexInputAttributeFormat::FLOAT;
-  }
-  if( attr.format == vk::Format::eR32Sint )
-  {
-    return API::ShaderDetails::VertexInputAttributeFormat::INTEGER;
-  }
-  if( attr.format == vk::Format::eR32G32Sfloat )
-  {
-    return API::ShaderDetails::VertexInputAttributeFormat::VEC2;
-  }
-  if( attr.format == vk::Format::eR32G32B32Sfloat )
-  {
-    return API::ShaderDetails::VertexInputAttributeFormat::VEC3;
-  }
-  if( attr.format == vk::Format::eR32G32B32A32Sfloat )
-  {
-    return API::ShaderDetails::VertexInputAttributeFormat::VEC4;
-  }
-  return API::ShaderDetails::VertexInputAttributeFormat::UNDEFINED;
-}
-
-std::string Shader::GetVertexAttributeName(uint32_t location) const
-{
-  if( !mVertexShader || mVertexInputAttributes.size() <= location )
-  {
-    return "";
-  }
-
-  return mVertexInputAttributes[location].name;
-}
-
-std::vector<uint32_t> Shader::GetVertexAttributeLocations() const
-{
-  std::vector<uint32_t> locations;
-  for( auto&& attr : mVertexInputAttributes )
-  {
-    if( attr.format != vk::Format::eUndefined )
-    {
-      locations.push_back( attr.location );
-    }
-  }
-
-  return locations;
-}
-
-std::vector<uint32_t> Shader::GetUniformBlockLocations() const
-{
-  std::vector<uint32_t> retval{};
-  for( auto&& ubo : mUniformBlocks )
-  {
-    retval.emplace_back( ubo.binding );
-  }
-  return retval;
-}
-
-std::string Shader::GetUniformBlockName( uint32_t blockIndex ) const
-{
-  return mUniformBlocks[blockIndex].name;
-}
-
-uint32_t Shader::GetUniformBlockMemberCount( uint32_t blockIndex ) const
-{
-  return U32(mUniformBlocks[blockIndex].members.size());
-}
-
-std::string Shader::GetUniformBlockMemberName( uint32_t blockIndex, uint32_t memberLocation ) const
-{
-  return mUniformBlocks[blockIndex].members[memberLocation].name;
-}
-
-uint32_t Shader::GetUniformBlockMemberOffset( uint32_t blockIndex, uint32_t memberLocation ) const
-{
-  return mUniformBlocks[blockIndex].members[memberLocation].offset;
-}
-
-bool Shader::GetNamedUniform( const std::string& name, API::ShaderDetails::UniformInfo& out ) const
-{
-  // check uniform blocks first
-  auto index = 0u;
-  for( auto&& ubo : mUniformBlocks )
-  {
-    for( auto&& member : ubo.members )
-    {
-      if( name == member.name || name == (ubo.name + "." + member.name) )
-      {
-        out.name = name;
-        out.location = member.location;
-        out.binding = ubo.binding;
-        out.bufferIndex = index;
-        out.offset = member.offset;
-        out.uniformClass = ShaderDetails::UniformClass::UNIFORM_BUFFER;
-        return true;
-      }
-    }
-    index++;
-  }
-
-  // check samplers
-  for( auto&& uniform : mUniformOpaques )
-  {
-    if( uniform.name == name )
-    {
-      out.uniformClass = ShaderDetails::UniformClass::COMBINED_IMAGE_SAMPLER;
-      out.binding = uniform.binding;
-      out.name = name;
-      out.offset = 0;
-      out.location = 0;
-      return true;
-    }
-  }
-  return false;
-}
-
-std::vector<API::ShaderDetails::UniformInfo> Shader::GetSamplers() const
-{
-  std::vector<API::ShaderDetails::UniformInfo> retval;
-  for( auto&& uniform : mUniformOpaques )
-  {
-    if(uniform.type == vk::DescriptorType::eCombinedImageSampler )
-    {
-      API::ShaderDetails::UniformInfo info;
-      info.location = 0u;
-      info.binding = uniform.binding;
-      info.offset = 0;
-      info.name = uniform.name;
-      info.uniformClass = API::ShaderDetails::UniformClass::COMBINED_IMAGE_SAMPLER;
-      retval.emplace_back( info );
-    }
-  }
-  std::sort(retval.begin(), retval.end(),
-            []( const API::ShaderDetails::UniformInfo& a, const API::ShaderDetails::UniformInfo& b )
-            {
-              return a.binding < b.binding;
-            } );
-
-  return retval;
-}
-
-uint32_t Shader::GetUniformBlockCount() const
-{
-  return U32(mUniformBlocks.size());
-}
-
-bool Shader::GetUniformBlock( uint32_t index, API::ShaderDetails::UniformBlockInfo& out ) const
-{
-  if( index >= mUniformBlocks.size() )
-  {
-    return false;
-  }
-
-  const auto& block = mUniformBlocks[index];
-
-  out.name = block.name;
-  out.binding = block.binding;
-  out.descriptorSet = block.descriptorSet;
-  auto membersSize = block.members.size();
-  out.members.resize( membersSize );
-  out.size = block.size;
-  for( auto i = 0u; i < out.members.size(); ++i )
-  {
-    const auto& memberUniform = block.members[i];
-    out.members[i].name = memberUniform.name;
-    out.members[i].binding = block.binding;
-    out.members[i].uniformClass = API::ShaderDetails::UniformClass::UNIFORM_BUFFER;
-    out.members[i].offset = memberUniform.offset;
-    out.members[i].location = memberUniform.location;
-  }
-
-  return true;
-}
-
-
-} // namespace VulkanAPI
-} // namespace Graphics
-} // namespace Dali
\ No newline at end of file
diff --git a/dali/graphics/vulkan/api/vulkan-api-shader.h b/dali/graphics/vulkan/api/vulkan-api-shader.h
deleted file mode 100644 (file)
index 8c1b54d..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_SHADER_H
-#define DALI_GRAPHICS_VULKAN_API_SHADER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics-api/graphics-api-shader.h>
-#include <dali/graphics-api/graphics-api-shader-details.h>
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <dali/graphics/vulkan/spirv/vulkan-spirv.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-/**
- * @brief API::Shader represents program conceptually
- */
-class Shader : public Dali::Graphics::API::Shader
-{
-public:
-  // not copyable
-  Shader( const Shader& ) = delete;
-  Shader& operator=( const Shader& ) = delete;
-
-  ~Shader() override = default;
-
-  explicit Shader( Vulkan::Graphics& graphics );
-
-  bool AddShaderModule( Dali::Graphics::API::ShaderDetails::PipelineStage pipelineStage,
-                        Dali::Graphics::API::ShaderDetails::Language language,
-                        Dali::Graphics::API::ShaderDetails::ShaderSource shaderSource );
-
-  Vulkan::RefCountedShader GetShader( vk::ShaderStageFlagBits shaderStage ) const ;
-
-  static Shader& DownCast( Dali::Graphics::API::Shader& shader );
-
-  Vulkan::RefCountedShader GetShaderRef( vk::ShaderStageFlagBits shaderStage ) const;
-
-
-  // REFLECTION
-
-  // Vertex attributes
-  bool IsReflectionSupported() const override;
-
-  uint32_t GetVertexAttributeLocation(const std::string &name) const override;
-
-  API::ShaderDetails::VertexInputAttributeFormat GetVertexAttributeFormat( uint32_t location ) const override;
-
-  std::string GetVertexAttributeName(uint32_t location) const override;
-
-  std::vector<uint32_t> GetVertexAttributeLocations() const override;
-
-  /**
-   * Uniforms
-   */
-
-  std::vector<uint32_t> GetUniformBlockLocations() const;
-
-  std::string GetUniformBlockName( uint32_t blockIndex) const;
-
-  uint32_t GetUniformBlockMemberCount( uint32_t blockIndex ) const;
-
-  std::string GetUniformBlockMemberName( uint32_t blockIndex, uint32_t memberLocation ) const;
-
-  uint32_t GetUniformBlockMemberOffset( uint32_t blockIndex, uint32_t memberLocation ) const;
-
-  bool GetNamedUniform( const std::string& name, API::ShaderDetails::UniformInfo& out ) const override;
-
-  std::vector<API::ShaderDetails::UniformInfo> GetSamplers() const override;
-
-  uint32_t GetUniformBlockCount() const override;
-
-  bool GetUniformBlock( uint32_t index, API::ShaderDetails::UniformBlockInfo& out ) const override;
-
-protected:
-  // derived types should not be moved direcly to prevent slicing
-  Shader( Shader&& ) = default;
-  Shader& operator=( Shader&& ) = default;
-
-  Shader() = default;
-
-private:
-
-  Vulkan::Graphics& mGraphics;
-  Vulkan::RefCountedShader mVertexShader;
-  Vulkan::RefCountedShader mFragmentShader;
-
-  std::vector<Vulkan::SpirV::SPIRVVertexInputAttribute> mVertexInputAttributes;
-  std::vector<Vulkan::SpirV::SPIRVUniformBlock> mUniformBlocks;
-  std::vector<Vulkan::SpirV::SPIRVUniformOpaque> mUniformOpaques;
-};
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-#endif //DALI_GRAPHICS_VULKAN_API_SHADER_H
diff --git a/dali/graphics/vulkan/api/vulkan-api-texture-factory.cpp b/dali/graphics/vulkan/api/vulkan-api-texture-factory.cpp
deleted file mode 100644 (file)
index fa4fb9e..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/vulkan-api-texture-factory.h>
-#include <dali/graphics/vulkan/api/vulkan-api-texture.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-
-struct TextureFactory::Impl
-{
-  Impl( TextureFactory& api, Vulkan::Graphics& graphics )
-  : mApi( api ), mGraphics( graphics )
-  {
-
-  }
-
-  ~Impl() = default;
-
-  std::unique_ptr<Graphics::API::Texture> Create()
-  {
-    auto retval = std::make_unique<VulkanAPI::Texture>( static_cast<Graphics::API::TextureFactory&>(mApi) );
-
-    if(retval->Initialise())
-    {
-      return std::move(retval);
-    }
-
-    return nullptr;
-  }
-
-  TextureFactory& mApi;
-  Vulkan::Graphics& mGraphics;
-
-  API::TextureDetails::Type       mType;
-  API::RectSize                   mSize;
-  API::TextureDetails::Format     mFormat;
-  API::TextureDetails::MipMapFlag mMipmapFlags;
-  void*                           mData;
-  uint32_t                        mDataSizeInBytes;
-
-};
-
-TextureFactory::TextureFactory( Vulkan::Graphics& graphics )
-{
-  mImpl = std::make_unique<Impl>( *this, graphics );
-}
-
-TextureFactory::~TextureFactory() = default;
-
-Graphics::API::TextureFactory& TextureFactory::SetType(API::TextureDetails::Type type)
-{
-  mImpl->mType = type;
-  return *this;
-}
-
-Graphics::API::TextureFactory& TextureFactory::SetSize(const API::RectSize& size)
-{
-  mImpl->mSize = size;
-  return *this;
-}
-
-Graphics::API::TextureFactory& TextureFactory::SetFormat(API::TextureDetails::Format format)
-{
-  mImpl->mFormat = format;
-  return *this;
-}
-
-Graphics::API::TextureFactory& TextureFactory::SetMipMapFlag(API::TextureDetails::MipMapFlag mipMSapFlag)
-{
-  mImpl->mMipmapFlags = mipMSapFlag;
-  return *this;
-}
-
-Graphics::API::TextureFactory& TextureFactory::SetData( void* pData )
-{
-  mImpl->mData = pData;
-  return *this;
-}
-
-Graphics::API::TextureFactory& TextureFactory::SetDataSize( uint32_t dataSizeInBytes )
-{
-  mImpl->mDataSizeInBytes = dataSizeInBytes;
-  return *this;
-}
-
-std::unique_ptr<Graphics::API::Texture> TextureFactory::Create() const
-{
-  return mImpl->Create();
-}
-
-const API::TextureDetails::Type& TextureFactory::GetType() const
-{
-  return mImpl->mType;
-}
-
-const API::RectSize& TextureFactory::GetSize() const
-{
-  return mImpl->mSize;
-}
-
-const API::TextureDetails::Format& TextureFactory::GetFormat() const
-{
-  return mImpl->mFormat;
-}
-
-const API::TextureDetails::MipMapFlag& TextureFactory::GetMipMapFlag() const
-{
-  return mImpl->mMipmapFlags;
-}
-
-const void* TextureFactory::GetData() const
-{
-  return mImpl->mData;
-}
-
-uint32_t TextureFactory::GetDataSize() const
-{
-  return mImpl->mDataSizeInBytes;
-}
-
-Vulkan::Graphics& TextureFactory::GetGraphics() const
-{
-  return mImpl->mGraphics;
-}
-
-
-}
-}
-}
-
diff --git a/dali/graphics/vulkan/api/vulkan-api-texture-factory.h b/dali/graphics/vulkan/api/vulkan-api-texture-factory.h
deleted file mode 100644 (file)
index ca0d926..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_TEXTURE_FACTORY_H
-#define DALI_GRAPHICS_VULKAN_API_TEXTURE_FACTORY_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics-api/graphics-api-texture-factory.h>
-#include <dali/graphics-api/graphics-api-texture-details.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Graphics;
-}
-namespace VulkanAPI
-{
-
-class TextureFactory : public Dali::Graphics::API::TextureFactory
-{
-public:
-
-  explicit TextureFactory( Vulkan::Graphics& graphics );
-
-  Graphics::API::TextureFactory& SetType(API::TextureDetails::Type type) override;
-  Graphics::API::TextureFactory& SetSize(const API::RectSize& size) override;
-  Graphics::API::TextureFactory& SetFormat(API::TextureDetails::Format format) override;
-  Graphics::API::TextureFactory& SetMipMapFlag(API::TextureDetails::MipMapFlag mipMSapFlag) override;
-  Graphics::API::TextureFactory& SetData( void* pData ) override;
-  Graphics::API::TextureFactory& SetDataSize( uint32_t dataSizeInBytes ) override;
-
-  // not copyable
-  TextureFactory(const TextureFactory&) = delete;
-  TextureFactory& operator=(const TextureFactory&) = delete;
-
-  ~TextureFactory() override;
-
-  std::unique_ptr<Graphics::API::Texture> Create() const override;
-
-  /** Internal interface */
-  const API::TextureDetails::Type& GetType() const;
-  const API::RectSize& GetSize() const;
-  const API::TextureDetails::Format& GetFormat() const;
-  const API::TextureDetails::MipMapFlag& GetMipMapFlag() const;
-  const void* GetData() const;
-   uint32_t GetDataSize() const;
-
-  Vulkan::Graphics& GetGraphics() const;
-
-protected:
-  /// @brief default constructor
-  TextureFactory() = default;
-
-  // derived types should not be moved direcly to prevent slicing
-  TextureFactory(TextureFactory&&) = default;
-  TextureFactory& operator=(TextureFactory&&) = default;
-
-private:
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-}
-}
-}
-
-#endif //DALI_GRAPHICS_VULKAN_API_TEXTURE_FACTORY_H
diff --git a/dali/graphics/vulkan/api/vulkan-api-texture.cpp b/dali/graphics/vulkan/api/vulkan-api-texture.cpp
deleted file mode 100644 (file)
index ba29750..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/api/vulkan-api-texture.h>
-
-#include <dali/graphics/vulkan/api/vulkan-api-texture-factory.h>
-#include <dali/graphics-api/graphics-api-texture-details.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-using namespace Dali::Graphics::Vulkan;
-
-struct Texture::Impl
-{
-  Impl( Texture& api, Dali::Graphics::API::TextureFactory& factory )
-  : mTextureFactory( dynamic_cast<VulkanAPI::TextureFactory&>( factory ) ),
-    mGraphics( mTextureFactory.GetGraphics() )
-  {
-  }
-
-  ~Impl() = default;
-
-  bool Initialise()
-  {
-    //return mImpl->CreateTexture( data, sizeInBytes, width, height );
-    // AB: yup, yet another hack
-    auto size = mTextureFactory.GetSize();
-    auto width = size.width;
-    auto height = size.height;
-    auto sizeInBytes = mTextureFactory.GetDataSize();
-    auto data = mTextureFactory.GetData();
-
-    auto format = vk::Format::eR8G8B8A8Unorm;
-
-    if(mTextureFactory.GetFormat() == API::TextureDetails::Format::RGBA8 )
-    {
-      // check bpp, if 24bpp convert
-      if (sizeInBytes == width * height * 3)
-      {
-
-        auto inData  = reinterpret_cast<const uint8_t *>(data);
-        auto outData = new uint8_t[width * height * 4];
-
-        auto      outIdx = 0u;
-        for (auto i      = 0u; i < sizeInBytes; i += 3)
-        {
-          outData[outIdx]     = inData[i];
-          outData[outIdx + 1] = inData[i + 1];
-          outData[outIdx + 2] = inData[i + 2];
-          outData[outIdx + 3] = 0xff;
-          outIdx += 4;
-        }
-
-        data        = outData;
-        sizeInBytes = U32(width * height * 4);
-      }
-
-    }
-    else if(mTextureFactory.GetFormat() == API::TextureDetails::Format::L8 )
-    {
-      format = vk::Format::eR8Unorm;
-    }
-
-    auto textureRef = Dali::Graphics::Vulkan::Texture::New( mGraphics,
-                                                            U32(size.width),
-                                                            U32(size.height),
-                                                            format );
-
-
-    // Upload data immediately. Will stall the queue :(
-    textureRef->UploadData( data, sizeInBytes, TextureUploadMode::eImmediate );
-
-    mTexture = textureRef;
-    return true;
-  }
-
-  Vulkan::RefCountedTexture mTexture;
-  VulkanAPI::TextureFactory& mTextureFactory;
-  Vulkan::Graphics& mGraphics;
-};
-
-Texture::Texture( Dali::Graphics::API::TextureFactory& factory )
-{
-  mImpl = std::make_unique<Impl>( *this, factory );
-}
-
-Texture::~Texture() = default;
-
-Vulkan::RefCountedTexture Texture::GetTextureRef() const
-{
-  return mImpl->mTexture;
-}
-
-bool Texture::Initialise()
-{
-  return mImpl->Initialise();
-}
-
-} // namespace VulkanAPI
-} // namespace Graphics
-} // namespace Dali
\ No newline at end of file
diff --git a/dali/graphics/vulkan/api/vulkan-api-texture.h b/dali/graphics/vulkan/api/vulkan-api-texture.h
deleted file mode 100644 (file)
index 40b161f..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_API_TEXTURE_H
-#define DALI_GRAPHICS_VULKAN_API_TEXTURE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics-api/graphics-api-texture-factory.h>
-#include <dali/graphics-api/graphics-api-texture.h>
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <dali/graphics/vulkan/vulkan-graphics-texture.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace VulkanAPI
-{
-/**
- * This is temporary implementation. It should be using graphics-texture as base
- * interface.
- */
-class Texture : public Dali::Graphics::API::Texture
-{
-public:
-
-  explicit Texture( Dali::Graphics::API::TextureFactory& factory );
-  ~Texture() override;
-
-  bool Initialise();
-
-  Vulkan::RefCountedTexture GetTextureRef() const;
-
-private:
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-} // namespace VulkanAPI
-} // namespace Graphics
-} // namespace Dali
-#endif // DALI_GRAPHICS_VULKAN_API_TEXTURE_H
diff --git a/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h b/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h
deleted file mode 100644 (file)
index 5c25ea4..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_GPU_MEMORY_ALLOCATOR
-#define DALI_GRAPHICS_VULKAN_GPU_MEMORY_ALLOCATOR
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Buffer;
-class Image;
-class GpuMemoryBlock;
-/**
- * Interface to Gpu memory allocation, must be overriden.
- */
-using GpuMemoryAllocationData = void*;
-
-class GpuMemoryAllocator
-{
-public:
-
-  GpuMemoryAllocator() = default;
-
-  /**
-   *
-   */
-  virtual ~GpuMemoryAllocator() = default;
-
-  /**
-   *
-   * @param requirements
-   * @param memoryProperties
-   * @return
-   */
-  virtual RefCountedGpuMemoryBlock Allocate( const vk::MemoryRequirements& requirements, vk::MemoryPropertyFlags memoryProperties ) = 0;
-
-  /**
-   *
-   * @param buffer
-   * @param memoryProperties
-   * @return
-   */
-  virtual RefCountedGpuMemoryBlock Allocate( const RefCountedBuffer& buffer, vk::MemoryPropertyFlags memoryProperties ) = 0;
-
-  /**
-   *
-   * @param buffer
-   * @param memoryProperties
-   * @return
-   */
-  virtual RefCountedGpuMemoryBlock Allocate( const RefCountedImage& buffer, vk::MemoryPropertyFlags memoryProperties ) = 0;
-
-  // refcounting managed via allocator which ownes all the blocks, allocator may
-  // implement this feature any way ( or simply ignore it )
-  /**
-   *
-   * @param allocationId
-   */
-  virtual void Retain( GpuMemoryBlock& allocationId ) {}
-
-  /**
-   *
-   * @param allocationId
-   */
-  virtual void Release( GpuMemoryBlock& allocationId ) {}
-
-  /**
-   *
-   * @param allocationId
-   */
-  virtual uint32_t GetRefCount( GpuMemoryBlock& allocationId )
-  {
-    return 0u;
-  }
-
-  // Garbage collection
-  /**
-   *
-   * @param userdata
-   */
-  virtual void GC( void* userdata ) = 0;
-
-  // Retrieve Vulkan object for this allocation
-  /**
-   *
-   * @return
-   */
-  virtual vk::DeviceMemory GetVkDeviceMemory( GpuMemoryBlock& allocationId ) const = 0;
-
-  /**
-   * Memory mapping
-   * @param allocationId
-   * @param offset
-   * @param size
-   * @return
-   */
-  virtual void* Map( GpuMemoryBlock& allocationId, uint32_t offset, uint32_t size ) = 0;
-
-  /**
-   * Memory mapping
-   * @param allocationId
-   * @param offset
-   * @param size
-   * @return
-   */
-  virtual void Unmap( GpuMemoryBlock& allocationId ) = 0;
-
-  /**
-   *
-   * @param allocationId
-   */
-  virtual void Flush( GpuMemoryBlock& allocationId ) = 0;
-};
-
-} // Namespace Vulkan
-
-} // namespace Graphics
-
-} // Namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_GPU_MEMORY_ALLOCATOR
diff --git a/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.cpp b/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.cpp
deleted file mode 100644 (file)
index fb9e279..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-void GpuMemoryBlock::OnRelease( uint32_t refcount )
-{
-  mAllocator.Release( *this );
-}
-
-void GpuMemoryBlock::OnRetain( uint32_t refcount )
-{
-  mAllocator.Retain( *this );
-}
-
-bool GpuMemoryBlock::OnDestroy()
-{
-  // don't use default delete
-  return true;
-}
-
-GpuMemoryBlock::operator vk::DeviceMemory()
-{
-  return mAllocator.GetVkDeviceMemory( *this );
-}
-
-void* GpuMemoryBlock::Map()
-{
-  return mAllocator.Map( *this, 0, 0 );
-}
-
-void* GpuMemoryBlock::Map( uint32_t offset, uint32_t size )
-{
-  return mAllocator.Map( *this, offset, size );
-}
-
-void GpuMemoryBlock::Unmap()
-{
-  mAllocator.Unmap( *this );
-}
-
-void GpuMemoryBlock::Flush()
-{
-
-}
-
-}
-
-}
-
-}
diff --git a/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h b/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h
deleted file mode 100644 (file)
index 6f8836f..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#ifndef DALI_VULKAN_161117_GPU_MEMORY_HANDLE_H
-#define DALI_VULKAN_161117_GPU_MEMORY_HANDLE_H
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class GpuMemoryAllocator;
-const uint32_t INVALID_ALLOCATION { UINT32_MAX };
-
-struct Any {};
-class GpuMemoryBlock : public VkManaged
-{
-public:
-
-  template <class T>
-  GpuMemoryBlock( GpuMemoryAllocator& allocator, std::unique_ptr<T> data ) :
-  mAllocator(allocator), mAllocationData(reinterpret_cast<Any*>(data.release())){}
-
-  /**
-   *
-   * @return
-   */
-  void* Map();
-
-  /**
-   * Returns mapped memory to specified type
-   * @tparam T
-   * @return
-   */
-  template<class T>
-  T* MapTyped()
-  {
-    return reinterpret_cast<T*>(Map());
-  }
-
-  /**
-   *
-   * @param offset
-   * @param size
-   * @return
-   */
-  void* Map( uint32_t offset, uint32_t size );
-
-  /**
-   *
-   */
-  void Unmap();
-
-  /**
-   *
-   */
-  void Flush();
-
-  /**
-   *
-   * @return
-   */
-  operator vk::DeviceMemory();
-
-  /**
-   *
-   * @tparam T
-   * @return
-   */
-  template <class T>
-  T* GetData() const
-  {
-    return reinterpret_cast<T*>(mAllocationData.get());
-  }
-
-  /**
-   *
-   * @return
-   */
-  GpuMemoryAllocator& GetAllocator() const
-  {
-    return mAllocator;
-  }
-
-public:
-
-  /**
-   *
-   * @param refcount
-   */
-  void OnRelease( uint32_t refcount ) override;
-
-  /**
-   *
-   * @param refcount
-   */
-  void OnRetain( uint32_t refcount ) override;
-
-  /**
-   *
-   */
-  bool OnDestroy() override;
-
-private:
-
-  GpuMemoryAllocator&         mAllocator;
-  std::unique_ptr<Any>        mAllocationData; // may be any POD object pointer, depends on allocator
-};
-
-}
-}
-}
-
-#endif //DALI_VULKAN_161117_GPU_MEMORY_HANDLE_H
diff --git a/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.cpp b/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.cpp
deleted file mode 100644 (file)
index 9b34d72..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <atomic>
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-namespace
-{
-
-const uint32_t INVALID_MEMORY_INDEX = -1u;
-
-/**
- * Helper function which returns GPU heap index that can be used to allocate
- * particular type of resource
- */
-uint32_t GetMemoryIndex(const vk::PhysicalDeviceMemoryProperties &memoryProperties,
-                        uint32_t memoryTypeBits, vk::MemoryPropertyFlags properties)
-{
-  for(uint32_t i = 0; i < memoryProperties.memoryTypeCount; ++i)
-  {
-    if((memoryTypeBits & (1u << i)) &&
-       ((memoryProperties.memoryTypes[i].propertyFlags & properties) == properties))
-    {
-      return i;
-    }
-  }
-  return INVALID_MEMORY_INDEX;
-}
-}
-
-/**
- * Class: GpuMemoryDefaultAllocator
- *
- * Non-thread safe default GPU memory allocator
- * with simple refcounting and garbage collection on demand
- */
-struct GpuMemoryDefaultAllocator : public GpuMemoryAllocator
-{
-  struct MemoryBlock
-  {
-    MemoryBlock() = default;
-    ~MemoryBlock() = default;
-
-    vk::MemoryRequirements  requirements {};
-    vk::DeviceSize          offset { 0u };
-    vk::DeviceSize          size { 0u };
-    vk::DeviceSize          alignment { 0u };
-    vk::DeviceMemory        memory { nullptr };
-  };
-
-  explicit GpuMemoryDefaultAllocator( GpuMemoryManager& manager )
-    : GpuMemoryAllocator(), mGpuManager( manager ),
-      mGraphics(manager.GetGraphics())
-  {
-
-  }
-
-  ~GpuMemoryDefaultAllocator() override = default;
-
-
-  RefCountedGpuMemoryBlock Allocate( const vk::MemoryRequirements& requirements, vk::MemoryPropertyFlags memoryProperties ) override
-  {
-
-    auto memoryTypeIndex = GetMemoryIndex(mGraphics.GetMemoryProperties(), requirements.memoryTypeBits,
-                                          memoryProperties);
-
-    auto memory = VkAssert(
-      mGraphics.GetDevice()
-               .allocateMemory(vk::MemoryAllocateInfo{}
-                                 .setMemoryTypeIndex(memoryTypeIndex)
-                                 .setAllocationSize(requirements.size), mGraphics.GetAllocator()));
-
-    // add allocated memory to the heap of memories as a base handle
-    auto handle = RefCountedGpuMemoryBlock( new GpuMemoryBlock( *this, MakeUnique<MemoryBlock>() ) );
-
-    auto &block = *handle->GetData<MemoryBlock>();
-    block.requirements = requirements;
-    block.offset       = 0u;
-    block.size         = requirements.size;
-    block.alignment    = requirements.alignment;
-    block.memory       = memory;
-
-    mUniqueBlocks.emplace_back( MakeUnique<RefCountedGpuMemoryBlock>(handle) );
-    return handle;
-  }
-
-  /**
-   *
-   * @param buffer
-   * @param memoryProperties
-   * @return
-   */
-  virtual RefCountedGpuMemoryBlock Allocate( const Handle<Buffer>& buffer, vk::MemoryPropertyFlags memoryProperties ) override
-  {
-    vk::Buffer handle = buffer->GetVkHandle();
-    vk::MemoryRequirements memReqs = mGraphics.GetDevice().getBufferMemoryRequirements( handle );
-    return Allocate( memReqs,
-                     memoryProperties );
-  }
-
-  /**
-   *
-   * @param buffer
-   * @param memoryProperties
-   * @return
-   */
-  RefCountedGpuMemoryBlock Allocate( const RefCountedImage& image, vk::MemoryPropertyFlags memoryProperties ) override
-  {
-    return Allocate( mGraphics.GetDevice().getImageMemoryRequirements(image->GetVkHandle() ),
-                               memoryProperties );
-  }
-
-  /**
-   *
-   * Reference counting
-   */
-  void Retain( GpuMemoryBlock& allocationId ) override
-  {
-  }
-
-  void Release( GpuMemoryBlock& block ) override
-  {
-    if( block.GetRefCount() == 1 )
-    {
-      GC(nullptr);
-    }
-  }
-
-  /**
-   *
-   * Garbage collection
-   */
-  void GC( void* userdata ) override
-  {
-    for( auto&& block : mUniqueBlocks )
-    {
-      if( block != nullptr && block->GetRefCount() == 1 )
-      {
-        // collect and make invalid ( maybe freelist or sumtink )
-        mGraphics.GetDevice().freeMemory( (**block.get()), mGraphics.GetAllocator() );
-        block.reset( nullptr );
-      }
-    }
-  }
-
-  vk::DeviceMemory GetVkDeviceMemory( GpuMemoryBlock& block ) const override
-  {
-    return block.GetData<MemoryBlock>()->memory;
-  }
-
-  void* Map( GpuMemoryBlock& block, uint32_t offset, uint32_t size ) override
-  {
-    return VkAssert( mGraphics.GetDevice().mapMemory( block.GetData<MemoryBlock>()->memory,
-                                offset, size == 0u ? VK_WHOLE_SIZE : static_cast<VkDeviceSize>(size)));
-  }
-
-  void Unmap( GpuMemoryBlock& block ) override
-  {
-    mGraphics.GetDevice().unmapMemory( block.GetData<MemoryBlock>()->memory );
-  }
-
-  void Flush( GpuMemoryBlock& allocationId ) override
-  {
-    NotImplemented();
-  }
-
-  GpuMemoryManager& mGpuManager;
-  Graphics& mGraphics;
-
-  std::vector<std::unique_ptr<RefCountedGpuMemoryBlock>> mUniqueBlocks;
-};
-
-struct GpuMemoryManager::Impl
-{
-  Impl( Graphics& graphics, GpuMemoryManager& interface ) :
-    mGraphics( graphics ),
-    mMemoryManager( interface )
-  {
-
-  }
-
-  ~Impl()
-  {
-  }
-
-  bool Initialise()
-  {
-    CreateDefaultAllocator();
-    return true;
-  }
-
-  GpuMemoryAllocator& GetDefaultAllocator() const
-  {
-    return *mDefaultAllocator;
-  }
-
-  void CreateDefaultAllocator()
-  {
-    mDefaultAllocator = MakeUnique<GpuMemoryDefaultAllocator>( mMemoryManager );
-  }
-
-  Graphics& mGraphics;
-  GpuMemoryManager& mMemoryManager; // interface to this implementation
-  std::unique_ptr<GpuMemoryAllocator> mDefaultAllocator; // default allocator, brute force allocation
-};
-
-/**
- * Class: GpuMemoryManager
- */
-
-std::unique_ptr<GpuMemoryManager> GpuMemoryManager::New(Graphics& graphics)
-{
-  auto retval = std::unique_ptr<GpuMemoryManager>(new GpuMemoryManager(graphics));
-  if( retval->mImpl->Initialise() )
-  {
-    return retval;
-  }
-  return nullptr;
-}
-
-GpuMemoryManager::GpuMemoryManager() = default;
-
-GpuMemoryManager::~GpuMemoryManager() = default;
-
-GpuMemoryManager::GpuMemoryManager(Graphics& graphics)
-{
-  mImpl = std::unique_ptr<Impl, std::default_delete<GpuMemoryManager::Impl>>( new Impl(graphics, *this) );
-}
-
-GpuMemoryAllocator& GpuMemoryManager::GetDefaultAllocator() const
-{
-  return mImpl->GetDefaultAllocator();
-}
-
-
-GpuMemoryAllocatorUID GpuMemoryManager::RegisterAllocator( std::unique_ptr<GpuMemoryAllocator> allocator )
-{
-  NotImplemented();
-  return 0;
-}
-
-bool GpuMemoryManager::UnregisterAllocator( GpuMemoryAllocatorUID allocatorHandle )
-{
-  NotImplemented();
-  return false;
-}
-
-Graphics& GpuMemoryManager::GetGraphics() const
-{
-  return mImpl->mGraphics;
-}
-
-}
-
-}
-
-}
diff --git a/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h b/dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h
deleted file mode 100644 (file)
index 4e38a05..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef DALI_VULKAN_161117_GPU_MEMORY_MANAGER_H
-#define DALI_VULKAN_161117_GPU_MEMORY_MANAGER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-using GpuMemoryAllocatorUID = uint32_t;
-class Graphics;
-class GpuMemoryAllocator;
-
-class GpuMemoryManager
-{
-public:
-
-  static std::unique_ptr<GpuMemoryManager> New( Graphics& graphics );
-
-  /**
-   *
-   */
-  ~GpuMemoryManager();
-
-  /**
-   *
-   * @return
-   */
-  GpuMemoryAllocator& GetDefaultAllocator() const;
-
-  /**
-   *
-   * @param allocator
-   * @return
-   */
-  GpuMemoryAllocatorUID RegisterAllocator( std::unique_ptr<GpuMemoryAllocator> allocator );
-
-  /**
-   *
-   * @param allocatorHandle
-   * @return
-   */
-  bool UnregisterAllocator( GpuMemoryAllocatorUID allocatorHandle );
-
-  /**
-   *
-   * @return
-   */
-  Graphics& GetGraphics() const;
-
-private:
-
-  GpuMemoryManager();
-
-  /**
-   *
-   */
-  GpuMemoryManager( Graphics& graphics );
-
-private:
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-}
-
-}
-
-}
-
-#endif //DALI_VULKAN_161117_GPU_MEMORY_MANAGER_H
diff --git a/dali/graphics/vulkan/scripts/glsl2vk-compile.sh b/dali/graphics/vulkan/scripts/glsl2vk-compile.sh
deleted file mode 100755 (executable)
index 7b2615c..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-
-if [ ! -e 'dali-core' ] ; then
-
-    echo "Error: This script must be executed from the top-level directory where dali-core can be found!"
-    exit 0
-
-fi
-
-d=dali-core/dali/graphics/vulkan/shaders
-outdir=dali-core/dali/graphics/vulkan/generated
-
-cd $d
-all_shaders=$(ls -1 *.{vert,frag})
-cd $OLDPWD
-
-for name in $all_shaders ; do
-  echo "Compiling $name..."
-  varname=$(echo "SHADER_$name" | tr [a-z] [A-Z] | sed -e 's/-/_/g;s/\./_/g;')  
-  glslangValidator -V1.0 $d/$name --vn $varname -o /tmp/spv.h
-
-  newname=$(echo ${name} | sed -e 's/\./-/;')".h"
-  echo Writing $newname
-
-  cat /tmp/spv.h | sed -e 's/const uint32_t /std::vector<uint32_t> /g;s/\[\]//g;' | tail -n +3 > $outdir/$newname
-  echo >> $outdir/$newname
-done
-
-echo "Generating cpp file..."
-echo "#include <cstdint>" > $outdir/builtin-shader-gen.cpp
-echo "#include <vector>" >> $outdir/builtin-shader-gen.cpp
-echo "#include <string>" >> $outdir/builtin-shader-gen.cpp
-echo -e "#include <map>\n" >> $outdir/builtin-shader-gen.cpp
-
-varnames=
-for name in $all_shaders ; do
-    varname=$(echo "SHADER_$name" | tr [a-z] [A-Z] | sed -e 's/-/_/g;s/\./_/g;')
-    newname=$(echo ${name} | sed -e 's/\./-/;')".h"
-    varnames="${varnames} $varname"
-    echo "#include \"$newname\"" >> $outdir/builtin-shader-gen.cpp
-done
-
-echo "static std::map<std::string, std::vector<uint32_t>> gGraphicsBuiltinShader = {" >> $outdir/builtin-shader-gen.cpp
-for var in ${varnames} ; do
-    echo "  { \"$var\", $var }," >> $outdir/builtin-shader-gen.cpp
-done
-echo -e "};\n" >> $outdir/builtin-shader-gen.cpp
-
-# generate graphics shader getter function
-cat >> $outdir/builtin-shader-gen.cpp << EOF
-extern "C" {
-
-#define IMPORT_API __attribute__ ((visibility ("default")))
-
-IMPORT_API std::vector<uint32_t> GraphicsGetBuiltinShader( const std::string& tag );
-
-std::vector<uint32_t> GraphicsGetBuiltinShader( const std::string& tag )
-{
-    auto iter = gGraphicsBuiltinShader.find( tag );
-    if( iter != gGraphicsBuiltinShader.end() )
-    {
-        return iter->second;
-    }
-    return {};
-}
-
-}
-EOF
-
-echo "Generating extern header file ( for external use )..."
-echo "#ifndef GRAPHICS_BUILTIN_SHADER_EXTERN_GEN_H" > $outdir/builtin-shader-extern-gen.h
-echo "#define GRAPHICS_BUILTIN_SHADER_EXTERN_GEN_H" >> $outdir/builtin-shader-extern-gen.h
-echo "#include <cstdint>" >> $outdir/builtin-shader-extern-gen.h
-echo "#include <vector>" >> $outdir/builtin-shader-extern-gen.h
-echo "#include <string>" >> $outdir/builtin-shader-extern-gen.h
-echo "" >> $outdir/builtin-shader-extern-gen.h
-
-for name in $all_shaders ; do
-    varname=$(echo "SHADER_$name" | tr [a-z] [A-Z] | sed -e 's/-/_/g;s/\./_/g;')
-    newname=$(echo ${name} | sed -e 's/\./-/;')".h"
-    echo "extern std::vector<uint32_t> $varname;" >> $outdir/builtin-shader-extern-gen.h
-done
-cat >> $outdir/builtin-shader-extern-gen.h << EOF
-extern "C" std::vector<uint32_t> GraphicsGetBuiltinShader( const std::string& tag );
-#define GraphicsGetBuiltinShaderId( x ) GraphicsGetBuiltinShader( #x )
-EOF
-echo "#endif // GRAPHICS_BUILTIN_SHADER_EXTERN_GEN_H" >> $outdir/builtin-shader-extern-gen.h
\ No newline at end of file
diff --git a/dali/graphics/vulkan/spirv/spirv.h b/dali/graphics/vulkan/spirv/spirv.h
deleted file mode 100644 (file)
index d1f5792..0000000
+++ /dev/null
@@ -1,1018 +0,0 @@
-/*
-** Copyright (c) 2014-2018 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a copy
-** of this software and/or associated documentation files (the "Materials"),
-** to deal in the Materials without restriction, including without limitation
-** the rights to use, copy, modify, merge, publish, distribute, sublicense,
-** and/or sell copies of the Materials, and to permit persons to whom the
-** Materials are furnished to do so, subject to the following conditions:
-**
-** The above copyright notice and this permission notice shall be included in
-** all copies or substantial portions of the Materials.
-**
-** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
-** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
-** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
-**
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
-** IN THE MATERIALS.
-*/
-
-/*
-** This header is automatically generated by the same tool that creates
-** the Binary Section of the SPIR-V specification.
-*/
-
-/*
-** Enumeration tokens for SPIR-V, in various styles:
-**   C, C++, C++11, JSON, Lua, Python
-**
-** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
-** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
-** - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
-** - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
-** - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
-**
-** Some tokens act like mask values, which can be OR'd together,
-** while others are mutually exclusive.  The mask-like ones have
-** "Mask" in their name, and a parallel enum that has the shift
-** amount (1 << x) for each corresponding enumerant.
-*/
-
-#ifndef spirv_H
-#define spirv_H
-
-typedef unsigned int SpvId;
-
-#define SPV_VERSION 0x10200
-#define SPV_REVISION 3
-
-static const unsigned int SpvMagicNumber = 0x07230203;
-static const unsigned int SpvVersion = 0x00010200;
-static const unsigned int SpvRevision = 3;
-static const unsigned int SpvOpCodeMask = 0xffff;
-static const unsigned int SpvWordCountShift = 16;
-
-typedef enum SpvSourceLanguage_ {
-  SpvSourceLanguageUnknown = 0,
-  SpvSourceLanguageESSL = 1,
-  SpvSourceLanguageGLSL = 2,
-  SpvSourceLanguageOpenCL_C = 3,
-  SpvSourceLanguageOpenCL_CPP = 4,
-  SpvSourceLanguageHLSL = 5,
-  SpvSourceLanguageMax = 0x7fffffff,
-} SpvSourceLanguage;
-
-typedef enum SpvExecutionModel_ {
-  SpvExecutionModelVertex = 0,
-  SpvExecutionModelTessellationControl = 1,
-  SpvExecutionModelTessellationEvaluation = 2,
-  SpvExecutionModelGeometry = 3,
-  SpvExecutionModelFragment = 4,
-  SpvExecutionModelGLCompute = 5,
-  SpvExecutionModelKernel = 6,
-  SpvExecutionModelMax = 0x7fffffff,
-} SpvExecutionModel;
-
-typedef enum SpvAddressingModel_ {
-  SpvAddressingModelLogical = 0,
-  SpvAddressingModelPhysical32 = 1,
-  SpvAddressingModelPhysical64 = 2,
-  SpvAddressingModelMax = 0x7fffffff,
-} SpvAddressingModel;
-
-typedef enum SpvMemoryModel_ {
-  SpvMemoryModelSimple = 0,
-  SpvMemoryModelGLSL450 = 1,
-  SpvMemoryModelOpenCL = 2,
-  SpvMemoryModelMax = 0x7fffffff,
-} SpvMemoryModel;
-
-typedef enum SpvExecutionMode_ {
-  SpvExecutionModeInvocations = 0,
-  SpvExecutionModeSpacingEqual = 1,
-  SpvExecutionModeSpacingFractionalEven = 2,
-  SpvExecutionModeSpacingFractionalOdd = 3,
-  SpvExecutionModeVertexOrderCw = 4,
-  SpvExecutionModeVertexOrderCcw = 5,
-  SpvExecutionModePixelCenterInteger = 6,
-  SpvExecutionModeOriginUpperLeft = 7,
-  SpvExecutionModeOriginLowerLeft = 8,
-  SpvExecutionModeEarlyFragmentTests = 9,
-  SpvExecutionModePointMode = 10,
-  SpvExecutionModeXfb = 11,
-  SpvExecutionModeDepthReplacing = 12,
-  SpvExecutionModeDepthGreater = 14,
-  SpvExecutionModeDepthLess = 15,
-  SpvExecutionModeDepthUnchanged = 16,
-  SpvExecutionModeLocalSize = 17,
-  SpvExecutionModeLocalSizeHint = 18,
-  SpvExecutionModeInputPoints = 19,
-  SpvExecutionModeInputLines = 20,
-  SpvExecutionModeInputLinesAdjacency = 21,
-  SpvExecutionModeTriangles = 22,
-  SpvExecutionModeInputTrianglesAdjacency = 23,
-  SpvExecutionModeQuads = 24,
-  SpvExecutionModeIsolines = 25,
-  SpvExecutionModeOutputVertices = 26,
-  SpvExecutionModeOutputPoints = 27,
-  SpvExecutionModeOutputLineStrip = 28,
-  SpvExecutionModeOutputTriangleStrip = 29,
-  SpvExecutionModeVecTypeHint = 30,
-  SpvExecutionModeContractionOff = 31,
-  SpvExecutionModeInitializer = 33,
-  SpvExecutionModeFinalizer = 34,
-  SpvExecutionModeSubgroupSize = 35,
-  SpvExecutionModeSubgroupsPerWorkgroup = 36,
-  SpvExecutionModeSubgroupsPerWorkgroupId = 37,
-  SpvExecutionModeLocalSizeId = 38,
-  SpvExecutionModeLocalSizeHintId = 39,
-  SpvExecutionModePostDepthCoverage = 4446,
-  SpvExecutionModeStencilRefReplacingEXT = 5027,
-  SpvExecutionModeMax = 0x7fffffff,
-} SpvExecutionMode;
-
-typedef enum SpvStorageClass_ {
-  SpvStorageClassUniformConstant = 0,
-  SpvStorageClassInput = 1,
-  SpvStorageClassUniform = 2,
-  SpvStorageClassOutput = 3,
-  SpvStorageClassWorkgroup = 4,
-  SpvStorageClassCrossWorkgroup = 5,
-  SpvStorageClassPrivate = 6,
-  SpvStorageClassFunction = 7,
-  SpvStorageClassGeneric = 8,
-  SpvStorageClassPushConstant = 9,
-  SpvStorageClassAtomicCounter = 10,
-  SpvStorageClassImage = 11,
-  SpvStorageClassStorageBuffer = 12,
-  SpvStorageClassMax = 0x7fffffff,
-} SpvStorageClass;
-
-typedef enum SpvDim_ {
-  SpvDim1D = 0,
-  SpvDim2D = 1,
-  SpvDim3D = 2,
-  SpvDimCube = 3,
-  SpvDimRect = 4,
-  SpvDimBuffer = 5,
-  SpvDimSubpassData = 6,
-  SpvDimMax = 0x7fffffff,
-} SpvDim;
-
-typedef enum SpvSamplerAddressingMode_ {
-  SpvSamplerAddressingModeNone = 0,
-  SpvSamplerAddressingModeClampToEdge = 1,
-  SpvSamplerAddressingModeClamp = 2,
-  SpvSamplerAddressingModeRepeat = 3,
-  SpvSamplerAddressingModeRepeatMirrored = 4,
-  SpvSamplerAddressingModeMax = 0x7fffffff,
-} SpvSamplerAddressingMode;
-
-typedef enum SpvSamplerFilterMode_ {
-  SpvSamplerFilterModeNearest = 0,
-  SpvSamplerFilterModeLinear = 1,
-  SpvSamplerFilterModeMax = 0x7fffffff,
-} SpvSamplerFilterMode;
-
-typedef enum SpvImageFormat_ {
-  SpvImageFormatUnknown = 0,
-  SpvImageFormatRgba32f = 1,
-  SpvImageFormatRgba16f = 2,
-  SpvImageFormatR32f = 3,
-  SpvImageFormatRgba8 = 4,
-  SpvImageFormatRgba8Snorm = 5,
-  SpvImageFormatRg32f = 6,
-  SpvImageFormatRg16f = 7,
-  SpvImageFormatR11fG11fB10f = 8,
-  SpvImageFormatR16f = 9,
-  SpvImageFormatRgba16 = 10,
-  SpvImageFormatRgb10A2 = 11,
-  SpvImageFormatRg16 = 12,
-  SpvImageFormatRg8 = 13,
-  SpvImageFormatR16 = 14,
-  SpvImageFormatR8 = 15,
-  SpvImageFormatRgba16Snorm = 16,
-  SpvImageFormatRg16Snorm = 17,
-  SpvImageFormatRg8Snorm = 18,
-  SpvImageFormatR16Snorm = 19,
-  SpvImageFormatR8Snorm = 20,
-  SpvImageFormatRgba32i = 21,
-  SpvImageFormatRgba16i = 22,
-  SpvImageFormatRgba8i = 23,
-  SpvImageFormatR32i = 24,
-  SpvImageFormatRg32i = 25,
-  SpvImageFormatRg16i = 26,
-  SpvImageFormatRg8i = 27,
-  SpvImageFormatR16i = 28,
-  SpvImageFormatR8i = 29,
-  SpvImageFormatRgba32ui = 30,
-  SpvImageFormatRgba16ui = 31,
-  SpvImageFormatRgba8ui = 32,
-  SpvImageFormatR32ui = 33,
-  SpvImageFormatRgb10a2ui = 34,
-  SpvImageFormatRg32ui = 35,
-  SpvImageFormatRg16ui = 36,
-  SpvImageFormatRg8ui = 37,
-  SpvImageFormatR16ui = 38,
-  SpvImageFormatR8ui = 39,
-  SpvImageFormatMax = 0x7fffffff,
-} SpvImageFormat;
-
-typedef enum SpvImageChannelOrder_ {
-  SpvImageChannelOrderR = 0,
-  SpvImageChannelOrderA = 1,
-  SpvImageChannelOrderRG = 2,
-  SpvImageChannelOrderRA = 3,
-  SpvImageChannelOrderRGB = 4,
-  SpvImageChannelOrderRGBA = 5,
-  SpvImageChannelOrderBGRA = 6,
-  SpvImageChannelOrderARGB = 7,
-  SpvImageChannelOrderIntensity = 8,
-  SpvImageChannelOrderLuminance = 9,
-  SpvImageChannelOrderRx = 10,
-  SpvImageChannelOrderRGx = 11,
-  SpvImageChannelOrderRGBx = 12,
-  SpvImageChannelOrderDepth = 13,
-  SpvImageChannelOrderDepthStencil = 14,
-  SpvImageChannelOrdersRGB = 15,
-  SpvImageChannelOrdersRGBx = 16,
-  SpvImageChannelOrdersRGBA = 17,
-  SpvImageChannelOrdersBGRA = 18,
-  SpvImageChannelOrderABGR = 19,
-  SpvImageChannelOrderMax = 0x7fffffff,
-} SpvImageChannelOrder;
-
-typedef enum SpvImageChannelDataType_ {
-  SpvImageChannelDataTypeSnormInt8 = 0,
-  SpvImageChannelDataTypeSnormInt16 = 1,
-  SpvImageChannelDataTypeUnormInt8 = 2,
-  SpvImageChannelDataTypeUnormInt16 = 3,
-  SpvImageChannelDataTypeUnormShort565 = 4,
-  SpvImageChannelDataTypeUnormShort555 = 5,
-  SpvImageChannelDataTypeUnormInt101010 = 6,
-  SpvImageChannelDataTypeSignedInt8 = 7,
-  SpvImageChannelDataTypeSignedInt16 = 8,
-  SpvImageChannelDataTypeSignedInt32 = 9,
-  SpvImageChannelDataTypeUnsignedInt8 = 10,
-  SpvImageChannelDataTypeUnsignedInt16 = 11,
-  SpvImageChannelDataTypeUnsignedInt32 = 12,
-  SpvImageChannelDataTypeHalfFloat = 13,
-  SpvImageChannelDataTypeFloat = 14,
-  SpvImageChannelDataTypeUnormInt24 = 15,
-  SpvImageChannelDataTypeUnormInt101010_2 = 16,
-  SpvImageChannelDataTypeMax = 0x7fffffff,
-} SpvImageChannelDataType;
-
-typedef enum SpvImageOperandsShift_ {
-  SpvImageOperandsBiasShift = 0,
-  SpvImageOperandsLodShift = 1,
-  SpvImageOperandsGradShift = 2,
-  SpvImageOperandsConstOffsetShift = 3,
-  SpvImageOperandsOffsetShift = 4,
-  SpvImageOperandsConstOffsetsShift = 5,
-  SpvImageOperandsSampleShift = 6,
-  SpvImageOperandsMinLodShift = 7,
-  SpvImageOperandsMax = 0x7fffffff,
-} SpvImageOperandsShift;
-
-typedef enum SpvImageOperandsMask_ {
-  SpvImageOperandsMaskNone = 0,
-  SpvImageOperandsBiasMask = 0x00000001,
-  SpvImageOperandsLodMask = 0x00000002,
-  SpvImageOperandsGradMask = 0x00000004,
-  SpvImageOperandsConstOffsetMask = 0x00000008,
-  SpvImageOperandsOffsetMask = 0x00000010,
-  SpvImageOperandsConstOffsetsMask = 0x00000020,
-  SpvImageOperandsSampleMask = 0x00000040,
-  SpvImageOperandsMinLodMask = 0x00000080,
-} SpvImageOperandsMask;
-
-typedef enum SpvFPFastMathModeShift_ {
-  SpvFPFastMathModeNotNaNShift = 0,
-  SpvFPFastMathModeNotInfShift = 1,
-  SpvFPFastMathModeNSZShift = 2,
-  SpvFPFastMathModeAllowRecipShift = 3,
-  SpvFPFastMathModeFastShift = 4,
-  SpvFPFastMathModeMax = 0x7fffffff,
-} SpvFPFastMathModeShift;
-
-typedef enum SpvFPFastMathModeMask_ {
-  SpvFPFastMathModeMaskNone = 0,
-  SpvFPFastMathModeNotNaNMask = 0x00000001,
-  SpvFPFastMathModeNotInfMask = 0x00000002,
-  SpvFPFastMathModeNSZMask = 0x00000004,
-  SpvFPFastMathModeAllowRecipMask = 0x00000008,
-  SpvFPFastMathModeFastMask = 0x00000010,
-} SpvFPFastMathModeMask;
-
-typedef enum SpvFPRoundingMode_ {
-  SpvFPRoundingModeRTE = 0,
-  SpvFPRoundingModeRTZ = 1,
-  SpvFPRoundingModeRTP = 2,
-  SpvFPRoundingModeRTN = 3,
-  SpvFPRoundingModeMax = 0x7fffffff,
-} SpvFPRoundingMode;
-
-typedef enum SpvLinkageType_ {
-  SpvLinkageTypeExport = 0,
-  SpvLinkageTypeImport = 1,
-  SpvLinkageTypeMax = 0x7fffffff,
-} SpvLinkageType;
-
-typedef enum SpvAccessQualifier_ {
-  SpvAccessQualifierReadOnly = 0,
-  SpvAccessQualifierWriteOnly = 1,
-  SpvAccessQualifierReadWrite = 2,
-  SpvAccessQualifierMax = 0x7fffffff,
-} SpvAccessQualifier;
-
-typedef enum SpvFunctionParameterAttribute_ {
-  SpvFunctionParameterAttributeZext = 0,
-  SpvFunctionParameterAttributeSext = 1,
-  SpvFunctionParameterAttributeByVal = 2,
-  SpvFunctionParameterAttributeSret = 3,
-  SpvFunctionParameterAttributeNoAlias = 4,
-  SpvFunctionParameterAttributeNoCapture = 5,
-  SpvFunctionParameterAttributeNoWrite = 6,
-  SpvFunctionParameterAttributeNoReadWrite = 7,
-  SpvFunctionParameterAttributeMax = 0x7fffffff,
-} SpvFunctionParameterAttribute;
-
-typedef enum SpvDecoration_ {
-  SpvDecorationRelaxedPrecision = 0,
-  SpvDecorationSpecId = 1,
-  SpvDecorationBlock = 2,
-  SpvDecorationBufferBlock = 3,
-  SpvDecorationRowMajor = 4,
-  SpvDecorationColMajor = 5,
-  SpvDecorationArrayStride = 6,
-  SpvDecorationMatrixStride = 7,
-  SpvDecorationGLSLShared = 8,
-  SpvDecorationGLSLPacked = 9,
-  SpvDecorationCPacked = 10,
-  SpvDecorationBuiltIn = 11,
-  SpvDecorationNoPerspective = 13,
-  SpvDecorationFlat = 14,
-  SpvDecorationPatch = 15,
-  SpvDecorationCentroid = 16,
-  SpvDecorationSample = 17,
-  SpvDecorationInvariant = 18,
-  SpvDecorationRestrict = 19,
-  SpvDecorationAliased = 20,
-  SpvDecorationVolatile = 21,
-  SpvDecorationConstant = 22,
-  SpvDecorationCoherent = 23,
-  SpvDecorationNonWritable = 24,
-  SpvDecorationNonReadable = 25,
-  SpvDecorationUniform = 26,
-  SpvDecorationSaturatedConversion = 28,
-  SpvDecorationStream = 29,
-  SpvDecorationLocation = 30,
-  SpvDecorationComponent = 31,
-  SpvDecorationIndex = 32,
-  SpvDecorationBinding = 33,
-  SpvDecorationDescriptorSet = 34,
-  SpvDecorationOffset = 35,
-  SpvDecorationXfbBuffer = 36,
-  SpvDecorationXfbStride = 37,
-  SpvDecorationFuncParamAttr = 38,
-  SpvDecorationFPRoundingMode = 39,
-  SpvDecorationFPFastMathMode = 40,
-  SpvDecorationLinkageAttributes = 41,
-  SpvDecorationNoContraction = 42,
-  SpvDecorationInputAttachmentIndex = 43,
-  SpvDecorationAlignment = 44,
-  SpvDecorationMaxByteOffset = 45,
-  SpvDecorationAlignmentId = 46,
-  SpvDecorationMaxByteOffsetId = 47,
-  SpvDecorationExplicitInterpAMD = 4999,
-  SpvDecorationOverrideCoverageNV = 5248,
-  SpvDecorationPassthroughNV = 5250,
-  SpvDecorationViewportRelativeNV = 5252,
-  SpvDecorationSecondaryViewportRelativeNV = 5256,
-  SpvDecorationMax = 0x7fffffff,
-} SpvDecoration;
-
-typedef enum SpvBuiltIn_ {
-  SpvBuiltInPosition = 0,
-  SpvBuiltInPointSize = 1,
-  SpvBuiltInClipDistance = 3,
-  SpvBuiltInCullDistance = 4,
-  SpvBuiltInVertexId = 5,
-  SpvBuiltInInstanceId = 6,
-  SpvBuiltInPrimitiveId = 7,
-  SpvBuiltInInvocationId = 8,
-  SpvBuiltInLayer = 9,
-  SpvBuiltInViewportIndex = 10,
-  SpvBuiltInTessLevelOuter = 11,
-  SpvBuiltInTessLevelInner = 12,
-  SpvBuiltInTessCoord = 13,
-  SpvBuiltInPatchVertices = 14,
-  SpvBuiltInFragCoord = 15,
-  SpvBuiltInPointCoord = 16,
-  SpvBuiltInFrontFacing = 17,
-  SpvBuiltInSampleId = 18,
-  SpvBuiltInSamplePosition = 19,
-  SpvBuiltInSampleMask = 20,
-  SpvBuiltInFragDepth = 22,
-  SpvBuiltInHelperInvocation = 23,
-  SpvBuiltInNumWorkgroups = 24,
-  SpvBuiltInWorkgroupSize = 25,
-  SpvBuiltInWorkgroupId = 26,
-  SpvBuiltInLocalInvocationId = 27,
-  SpvBuiltInGlobalInvocationId = 28,
-  SpvBuiltInLocalInvocationIndex = 29,
-  SpvBuiltInWorkDim = 30,
-  SpvBuiltInGlobalSize = 31,
-  SpvBuiltInEnqueuedWorkgroupSize = 32,
-  SpvBuiltInGlobalOffset = 33,
-  SpvBuiltInGlobalLinearId = 34,
-  SpvBuiltInSubgroupSize = 36,
-  SpvBuiltInSubgroupMaxSize = 37,
-  SpvBuiltInNumSubgroups = 38,
-  SpvBuiltInNumEnqueuedSubgroups = 39,
-  SpvBuiltInSubgroupId = 40,
-  SpvBuiltInSubgroupLocalInvocationId = 41,
-  SpvBuiltInVertexIndex = 42,
-  SpvBuiltInInstanceIndex = 43,
-  SpvBuiltInSubgroupEqMaskKHR = 4416,
-  SpvBuiltInSubgroupGeMaskKHR = 4417,
-  SpvBuiltInSubgroupGtMaskKHR = 4418,
-  SpvBuiltInSubgroupLeMaskKHR = 4419,
-  SpvBuiltInSubgroupLtMaskKHR = 4420,
-  SpvBuiltInBaseVertex = 4424,
-  SpvBuiltInBaseInstance = 4425,
-  SpvBuiltInDrawIndex = 4426,
-  SpvBuiltInDeviceIndex = 4438,
-  SpvBuiltInViewIndex = 4440,
-  SpvBuiltInBaryCoordNoPerspAMD = 4992,
-  SpvBuiltInBaryCoordNoPerspCentroidAMD = 4993,
-  SpvBuiltInBaryCoordNoPerspSampleAMD = 4994,
-  SpvBuiltInBaryCoordSmoothAMD = 4995,
-  SpvBuiltInBaryCoordSmoothCentroidAMD = 4996,
-  SpvBuiltInBaryCoordSmoothSampleAMD = 4997,
-  SpvBuiltInBaryCoordPullModelAMD = 4998,
-  SpvBuiltInFragStencilRefEXT = 5014,
-  SpvBuiltInViewportMaskNV = 5253,
-  SpvBuiltInSecondaryPositionNV = 5257,
-  SpvBuiltInSecondaryViewportMaskNV = 5258,
-  SpvBuiltInPositionPerViewNV = 5261,
-  SpvBuiltInViewportMaskPerViewNV = 5262,
-  SpvBuiltInFullyCoveredEXT = 5264,
-  SpvBuiltInMax = 0x7fffffff,
-} SpvBuiltIn;
-
-typedef enum SpvSelectionControlShift_ {
-  SpvSelectionControlFlattenShift = 0,
-  SpvSelectionControlDontFlattenShift = 1,
-  SpvSelectionControlMax = 0x7fffffff,
-} SpvSelectionControlShift;
-
-typedef enum SpvSelectionControlMask_ {
-  SpvSelectionControlMaskNone = 0,
-  SpvSelectionControlFlattenMask = 0x00000001,
-  SpvSelectionControlDontFlattenMask = 0x00000002,
-} SpvSelectionControlMask;
-
-typedef enum SpvLoopControlShift_ {
-  SpvLoopControlUnrollShift = 0,
-  SpvLoopControlDontUnrollShift = 1,
-  SpvLoopControlDependencyInfiniteShift = 2,
-  SpvLoopControlDependencyLengthShift = 3,
-  SpvLoopControlMax = 0x7fffffff,
-} SpvLoopControlShift;
-
-typedef enum SpvLoopControlMask_ {
-  SpvLoopControlMaskNone = 0,
-  SpvLoopControlUnrollMask = 0x00000001,
-  SpvLoopControlDontUnrollMask = 0x00000002,
-  SpvLoopControlDependencyInfiniteMask = 0x00000004,
-  SpvLoopControlDependencyLengthMask = 0x00000008,
-} SpvLoopControlMask;
-
-typedef enum SpvFunctionControlShift_ {
-  SpvFunctionControlInlineShift = 0,
-  SpvFunctionControlDontInlineShift = 1,
-  SpvFunctionControlPureShift = 2,
-  SpvFunctionControlConstShift = 3,
-  SpvFunctionControlMax = 0x7fffffff,
-} SpvFunctionControlShift;
-
-typedef enum SpvFunctionControlMask_ {
-  SpvFunctionControlMaskNone = 0,
-  SpvFunctionControlInlineMask = 0x00000001,
-  SpvFunctionControlDontInlineMask = 0x00000002,
-  SpvFunctionControlPureMask = 0x00000004,
-  SpvFunctionControlConstMask = 0x00000008,
-} SpvFunctionControlMask;
-
-typedef enum SpvMemorySemanticsShift_ {
-  SpvMemorySemanticsAcquireShift = 1,
-  SpvMemorySemanticsReleaseShift = 2,
-  SpvMemorySemanticsAcquireReleaseShift = 3,
-  SpvMemorySemanticsSequentiallyConsistentShift = 4,
-  SpvMemorySemanticsUniformMemoryShift = 6,
-  SpvMemorySemanticsSubgroupMemoryShift = 7,
-  SpvMemorySemanticsWorkgroupMemoryShift = 8,
-  SpvMemorySemanticsCrossWorkgroupMemoryShift = 9,
-  SpvMemorySemanticsAtomicCounterMemoryShift = 10,
-  SpvMemorySemanticsImageMemoryShift = 11,
-  SpvMemorySemanticsMax = 0x7fffffff,
-} SpvMemorySemanticsShift;
-
-typedef enum SpvMemorySemanticsMask_ {
-  SpvMemorySemanticsMaskNone = 0,
-  SpvMemorySemanticsAcquireMask = 0x00000002,
-  SpvMemorySemanticsReleaseMask = 0x00000004,
-  SpvMemorySemanticsAcquireReleaseMask = 0x00000008,
-  SpvMemorySemanticsSequentiallyConsistentMask = 0x00000010,
-  SpvMemorySemanticsUniformMemoryMask = 0x00000040,
-  SpvMemorySemanticsSubgroupMemoryMask = 0x00000080,
-  SpvMemorySemanticsWorkgroupMemoryMask = 0x00000100,
-  SpvMemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
-  SpvMemorySemanticsAtomicCounterMemoryMask = 0x00000400,
-  SpvMemorySemanticsImageMemoryMask = 0x00000800,
-} SpvMemorySemanticsMask;
-
-typedef enum SpvMemoryAccessShift_ {
-  SpvMemoryAccessVolatileShift = 0,
-  SpvMemoryAccessAlignedShift = 1,
-  SpvMemoryAccessNontemporalShift = 2,
-  SpvMemoryAccessMax = 0x7fffffff,
-} SpvMemoryAccessShift;
-
-typedef enum SpvMemoryAccessMask_ {
-  SpvMemoryAccessMaskNone = 0,
-  SpvMemoryAccessVolatileMask = 0x00000001,
-  SpvMemoryAccessAlignedMask = 0x00000002,
-  SpvMemoryAccessNontemporalMask = 0x00000004,
-} SpvMemoryAccessMask;
-
-typedef enum SpvScope_ {
-  SpvScopeCrossDevice = 0,
-  SpvScopeDevice = 1,
-  SpvScopeWorkgroup = 2,
-  SpvScopeSubgroup = 3,
-  SpvScopeInvocation = 4,
-  SpvScopeMax = 0x7fffffff,
-} SpvScope;
-
-typedef enum SpvGroupOperation_ {
-  SpvGroupOperationReduce = 0,
-  SpvGroupOperationInclusiveScan = 1,
-  SpvGroupOperationExclusiveScan = 2,
-  SpvGroupOperationMax = 0x7fffffff,
-} SpvGroupOperation;
-
-typedef enum SpvKernelEnqueueFlags_ {
-  SpvKernelEnqueueFlagsNoWait = 0,
-  SpvKernelEnqueueFlagsWaitKernel = 1,
-  SpvKernelEnqueueFlagsWaitWorkGroup = 2,
-  SpvKernelEnqueueFlagsMax = 0x7fffffff,
-} SpvKernelEnqueueFlags;
-
-typedef enum SpvKernelProfilingInfoShift_ {
-  SpvKernelProfilingInfoCmdExecTimeShift = 0,
-  SpvKernelProfilingInfoMax = 0x7fffffff,
-} SpvKernelProfilingInfoShift;
-
-typedef enum SpvKernelProfilingInfoMask_ {
-  SpvKernelProfilingInfoMaskNone = 0,
-  SpvKernelProfilingInfoCmdExecTimeMask = 0x00000001,
-} SpvKernelProfilingInfoMask;
-
-typedef enum SpvCapability_ {
-  SpvCapabilityMatrix = 0,
-  SpvCapabilityShader = 1,
-  SpvCapabilityGeometry = 2,
-  SpvCapabilityTessellation = 3,
-  SpvCapabilityAddresses = 4,
-  SpvCapabilityLinkage = 5,
-  SpvCapabilityKernel = 6,
-  SpvCapabilityVector16 = 7,
-  SpvCapabilityFloat16Buffer = 8,
-  SpvCapabilityFloat16 = 9,
-  SpvCapabilityFloat64 = 10,
-  SpvCapabilityInt64 = 11,
-  SpvCapabilityInt64Atomics = 12,
-  SpvCapabilityImageBasic = 13,
-  SpvCapabilityImageReadWrite = 14,
-  SpvCapabilityImageMipmap = 15,
-  SpvCapabilityPipes = 17,
-  SpvCapabilityGroups = 18,
-  SpvCapabilityDeviceEnqueue = 19,
-  SpvCapabilityLiteralSampler = 20,
-  SpvCapabilityAtomicStorage = 21,
-  SpvCapabilityInt16 = 22,
-  SpvCapabilityTessellationPointSize = 23,
-  SpvCapabilityGeometryPointSize = 24,
-  SpvCapabilityImageGatherExtended = 25,
-  SpvCapabilityStorageImageMultisample = 27,
-  SpvCapabilityUniformBufferArrayDynamicIndexing = 28,
-  SpvCapabilitySampledImageArrayDynamicIndexing = 29,
-  SpvCapabilityStorageBufferArrayDynamicIndexing = 30,
-  SpvCapabilityStorageImageArrayDynamicIndexing = 31,
-  SpvCapabilityClipDistance = 32,
-  SpvCapabilityCullDistance = 33,
-  SpvCapabilityImageCubeArray = 34,
-  SpvCapabilitySampleRateShading = 35,
-  SpvCapabilityImageRect = 36,
-  SpvCapabilitySampledRect = 37,
-  SpvCapabilityGenericPointer = 38,
-  SpvCapabilityInt8 = 39,
-  SpvCapabilityInputAttachment = 40,
-  SpvCapabilitySparseResidency = 41,
-  SpvCapabilityMinLod = 42,
-  SpvCapabilitySampled1D = 43,
-  SpvCapabilityImage1D = 44,
-  SpvCapabilitySampledCubeArray = 45,
-  SpvCapabilitySampledBuffer = 46,
-  SpvCapabilityImageBuffer = 47,
-  SpvCapabilityImageMSArray = 48,
-  SpvCapabilityStorageImageExtendedFormats = 49,
-  SpvCapabilityImageQuery = 50,
-  SpvCapabilityDerivativeControl = 51,
-  SpvCapabilityInterpolationFunction = 52,
-  SpvCapabilityTransformFeedback = 53,
-  SpvCapabilityGeometryStreams = 54,
-  SpvCapabilityStorageImageReadWithoutFormat = 55,
-  SpvCapabilityStorageImageWriteWithoutFormat = 56,
-  SpvCapabilityMultiViewport = 57,
-  SpvCapabilitySubgroupDispatch = 58,
-  SpvCapabilityNamedBarrier = 59,
-  SpvCapabilityPipeStorage = 60,
-  SpvCapabilitySubgroupBallotKHR = 4423,
-  SpvCapabilityDrawParameters = 4427,
-  SpvCapabilitySubgroupVoteKHR = 4431,
-  SpvCapabilityStorageBuffer16BitAccess = 4433,
-  SpvCapabilityStorageUniformBufferBlock16 = 4433,
-  SpvCapabilityStorageUniform16 = 4434,
-  SpvCapabilityUniformAndStorageBuffer16BitAccess = 4434,
-  SpvCapabilityStoragePushConstant16 = 4435,
-  SpvCapabilityStorageInputOutput16 = 4436,
-  SpvCapabilityDeviceGroup = 4437,
-  SpvCapabilityMultiView = 4439,
-  SpvCapabilityVariablePointersStorageBuffer = 4441,
-  SpvCapabilityVariablePointers = 4442,
-  SpvCapabilityAtomicStorageOps = 4445,
-  SpvCapabilitySampleMaskPostDepthCoverage = 4447,
-  SpvCapabilityImageGatherBiasLodAMD = 5009,
-  SpvCapabilityFragmentMaskAMD = 5010,
-  SpvCapabilityStencilExportEXT = 5013,
-  SpvCapabilityImageReadWriteLodAMD = 5015,
-  SpvCapabilitySampleMaskOverrideCoverageNV = 5249,
-  SpvCapabilityGeometryShaderPassthroughNV = 5251,
-  SpvCapabilityShaderViewportIndexLayerEXT = 5254,
-  SpvCapabilityShaderViewportIndexLayerNV = 5254,
-  SpvCapabilityShaderViewportMaskNV = 5255,
-  SpvCapabilityShaderStereoViewNV = 5259,
-  SpvCapabilityPerViewAttributesNV = 5260,
-  SpvCapabilityFragmentFullyCoveredEXT = 5265,
-  SpvCapabilitySubgroupShuffleINTEL = 5568,
-  SpvCapabilitySubgroupBufferBlockIOINTEL = 5569,
-  SpvCapabilitySubgroupImageBlockIOINTEL = 5570,
-  SpvCapabilityMax = 0x7fffffff,
-} SpvCapability;
-
-typedef enum SpvOp_ {
-  SpvOpNop = 0,
-  SpvOpUndef = 1,
-  SpvOpSourceContinued = 2,
-  SpvOpSource = 3,
-  SpvOpSourceExtension = 4,
-  SpvOpName = 5,
-  SpvOpMemberName = 6,
-  SpvOpString = 7,
-  SpvOpLine = 8,
-  SpvOpExtension = 10,
-  SpvOpExtInstImport = 11,
-  SpvOpExtInst = 12,
-  SpvOpMemoryModel = 14,
-  SpvOpEntryPoint = 15,
-  SpvOpExecutionMode = 16,
-  SpvOpCapability = 17,
-  SpvOpTypeVoid = 19,
-  SpvOpTypeBool = 20,
-  SpvOpTypeInt = 21,
-  SpvOpTypeFloat = 22,
-  SpvOpTypeVector = 23,
-  SpvOpTypeMatrix = 24,
-  SpvOpTypeImage = 25,
-  SpvOpTypeSampler = 26,
-  SpvOpTypeSampledImage = 27,
-  SpvOpTypeArray = 28,
-  SpvOpTypeRuntimeArray = 29,
-  SpvOpTypeStruct = 30,
-  SpvOpTypeOpaque = 31,
-  SpvOpTypePointer = 32,
-  SpvOpTypeFunction = 33,
-  SpvOpTypeEvent = 34,
-  SpvOpTypeDeviceEvent = 35,
-  SpvOpTypeReserveId = 36,
-  SpvOpTypeQueue = 37,
-  SpvOpTypePipe = 38,
-  SpvOpTypeForwardPointer = 39,
-  SpvOpConstantTrue = 41,
-  SpvOpConstantFalse = 42,
-  SpvOpConstant = 43,
-  SpvOpConstantComposite = 44,
-  SpvOpConstantSampler = 45,
-  SpvOpConstantNull = 46,
-  SpvOpSpecConstantTrue = 48,
-  SpvOpSpecConstantFalse = 49,
-  SpvOpSpecConstant = 50,
-  SpvOpSpecConstantComposite = 51,
-  SpvOpSpecConstantOp = 52,
-  SpvOpFunction = 54,
-  SpvOpFunctionParameter = 55,
-  SpvOpFunctionEnd = 56,
-  SpvOpFunctionCall = 57,
-  SpvOpVariable = 59,
-  SpvOpImageTexelPointer = 60,
-  SpvOpLoad = 61,
-  SpvOpStore = 62,
-  SpvOpCopyMemory = 63,
-  SpvOpCopyMemorySized = 64,
-  SpvOpAccessChain = 65,
-  SpvOpInBoundsAccessChain = 66,
-  SpvOpPtrAccessChain = 67,
-  SpvOpArrayLength = 68,
-  SpvOpGenericPtrMemSemantics = 69,
-  SpvOpInBoundsPtrAccessChain = 70,
-  SpvOpDecorate = 71,
-  SpvOpMemberDecorate = 72,
-  SpvOpDecorationGroup = 73,
-  SpvOpGroupDecorate = 74,
-  SpvOpGroupMemberDecorate = 75,
-  SpvOpVectorExtractDynamic = 77,
-  SpvOpVectorInsertDynamic = 78,
-  SpvOpVectorShuffle = 79,
-  SpvOpCompositeConstruct = 80,
-  SpvOpCompositeExtract = 81,
-  SpvOpCompositeInsert = 82,
-  SpvOpCopyObject = 83,
-  SpvOpTranspose = 84,
-  SpvOpSampledImage = 86,
-  SpvOpImageSampleImplicitLod = 87,
-  SpvOpImageSampleExplicitLod = 88,
-  SpvOpImageSampleDrefImplicitLod = 89,
-  SpvOpImageSampleDrefExplicitLod = 90,
-  SpvOpImageSampleProjImplicitLod = 91,
-  SpvOpImageSampleProjExplicitLod = 92,
-  SpvOpImageSampleProjDrefImplicitLod = 93,
-  SpvOpImageSampleProjDrefExplicitLod = 94,
-  SpvOpImageFetch = 95,
-  SpvOpImageGather = 96,
-  SpvOpImageDrefGather = 97,
-  SpvOpImageRead = 98,
-  SpvOpImageWrite = 99,
-  SpvOpImage = 100,
-  SpvOpImageQueryFormat = 101,
-  SpvOpImageQueryOrder = 102,
-  SpvOpImageQuerySizeLod = 103,
-  SpvOpImageQuerySize = 104,
-  SpvOpImageQueryLod = 105,
-  SpvOpImageQueryLevels = 106,
-  SpvOpImageQuerySamples = 107,
-  SpvOpConvertFToU = 109,
-  SpvOpConvertFToS = 110,
-  SpvOpConvertSToF = 111,
-  SpvOpConvertUToF = 112,
-  SpvOpUConvert = 113,
-  SpvOpSConvert = 114,
-  SpvOpFConvert = 115,
-  SpvOpQuantizeToF16 = 116,
-  SpvOpConvertPtrToU = 117,
-  SpvOpSatConvertSToU = 118,
-  SpvOpSatConvertUToS = 119,
-  SpvOpConvertUToPtr = 120,
-  SpvOpPtrCastToGeneric = 121,
-  SpvOpGenericCastToPtr = 122,
-  SpvOpGenericCastToPtrExplicit = 123,
-  SpvOpBitcast = 124,
-  SpvOpSNegate = 126,
-  SpvOpFNegate = 127,
-  SpvOpIAdd = 128,
-  SpvOpFAdd = 129,
-  SpvOpISub = 130,
-  SpvOpFSub = 131,
-  SpvOpIMul = 132,
-  SpvOpFMul = 133,
-  SpvOpUDiv = 134,
-  SpvOpSDiv = 135,
-  SpvOpFDiv = 136,
-  SpvOpUMod = 137,
-  SpvOpSRem = 138,
-  SpvOpSMod = 139,
-  SpvOpFRem = 140,
-  SpvOpFMod = 141,
-  SpvOpVectorTimesScalar = 142,
-  SpvOpMatrixTimesScalar = 143,
-  SpvOpVectorTimesMatrix = 144,
-  SpvOpMatrixTimesVector = 145,
-  SpvOpMatrixTimesMatrix = 146,
-  SpvOpOuterProduct = 147,
-  SpvOpDot = 148,
-  SpvOpIAddCarry = 149,
-  SpvOpISubBorrow = 150,
-  SpvOpUMulExtended = 151,
-  SpvOpSMulExtended = 152,
-  SpvOpAny = 154,
-  SpvOpAll = 155,
-  SpvOpIsNan = 156,
-  SpvOpIsInf = 157,
-  SpvOpIsFinite = 158,
-  SpvOpIsNormal = 159,
-  SpvOpSignBitSet = 160,
-  SpvOpLessOrGreater = 161,
-  SpvOpOrdered = 162,
-  SpvOpUnordered = 163,
-  SpvOpLogicalEqual = 164,
-  SpvOpLogicalNotEqual = 165,
-  SpvOpLogicalOr = 166,
-  SpvOpLogicalAnd = 167,
-  SpvOpLogicalNot = 168,
-  SpvOpSelect = 169,
-  SpvOpIEqual = 170,
-  SpvOpINotEqual = 171,
-  SpvOpUGreaterThan = 172,
-  SpvOpSGreaterThan = 173,
-  SpvOpUGreaterThanEqual = 174,
-  SpvOpSGreaterThanEqual = 175,
-  SpvOpULessThan = 176,
-  SpvOpSLessThan = 177,
-  SpvOpULessThanEqual = 178,
-  SpvOpSLessThanEqual = 179,
-  SpvOpFOrdEqual = 180,
-  SpvOpFUnordEqual = 181,
-  SpvOpFOrdNotEqual = 182,
-  SpvOpFUnordNotEqual = 183,
-  SpvOpFOrdLessThan = 184,
-  SpvOpFUnordLessThan = 185,
-  SpvOpFOrdGreaterThan = 186,
-  SpvOpFUnordGreaterThan = 187,
-  SpvOpFOrdLessThanEqual = 188,
-  SpvOpFUnordLessThanEqual = 189,
-  SpvOpFOrdGreaterThanEqual = 190,
-  SpvOpFUnordGreaterThanEqual = 191,
-  SpvOpShiftRightLogical = 194,
-  SpvOpShiftRightArithmetic = 195,
-  SpvOpShiftLeftLogical = 196,
-  SpvOpBitwiseOr = 197,
-  SpvOpBitwiseXor = 198,
-  SpvOpBitwiseAnd = 199,
-  SpvOpNot = 200,
-  SpvOpBitFieldInsert = 201,
-  SpvOpBitFieldSExtract = 202,
-  SpvOpBitFieldUExtract = 203,
-  SpvOpBitReverse = 204,
-  SpvOpBitCount = 205,
-  SpvOpDPdx = 207,
-  SpvOpDPdy = 208,
-  SpvOpFwidth = 209,
-  SpvOpDPdxFine = 210,
-  SpvOpDPdyFine = 211,
-  SpvOpFwidthFine = 212,
-  SpvOpDPdxCoarse = 213,
-  SpvOpDPdyCoarse = 214,
-  SpvOpFwidthCoarse = 215,
-  SpvOpEmitVertex = 218,
-  SpvOpEndPrimitive = 219,
-  SpvOpEmitStreamVertex = 220,
-  SpvOpEndStreamPrimitive = 221,
-  SpvOpControlBarrier = 224,
-  SpvOpMemoryBarrier = 225,
-  SpvOpAtomicLoad = 227,
-  SpvOpAtomicStore = 228,
-  SpvOpAtomicExchange = 229,
-  SpvOpAtomicCompareExchange = 230,
-  SpvOpAtomicCompareExchangeWeak = 231,
-  SpvOpAtomicIIncrement = 232,
-  SpvOpAtomicIDecrement = 233,
-  SpvOpAtomicIAdd = 234,
-  SpvOpAtomicISub = 235,
-  SpvOpAtomicSMin = 236,
-  SpvOpAtomicUMin = 237,
-  SpvOpAtomicSMax = 238,
-  SpvOpAtomicUMax = 239,
-  SpvOpAtomicAnd = 240,
-  SpvOpAtomicOr = 241,
-  SpvOpAtomicXor = 242,
-  SpvOpPhi = 245,
-  SpvOpLoopMerge = 246,
-  SpvOpSelectionMerge = 247,
-  SpvOpLabel = 248,
-  SpvOpBranch = 249,
-  SpvOpBranchConditional = 250,
-  SpvOpSwitch = 251,
-  SpvOpKill = 252,
-  SpvOpReturn = 253,
-  SpvOpReturnValue = 254,
-  SpvOpUnreachable = 255,
-  SpvOpLifetimeStart = 256,
-  SpvOpLifetimeStop = 257,
-  SpvOpGroupAsyncCopy = 259,
-  SpvOpGroupWaitEvents = 260,
-  SpvOpGroupAll = 261,
-  SpvOpGroupAny = 262,
-  SpvOpGroupBroadcast = 263,
-  SpvOpGroupIAdd = 264,
-  SpvOpGroupFAdd = 265,
-  SpvOpGroupFMin = 266,
-  SpvOpGroupUMin = 267,
-  SpvOpGroupSMin = 268,
-  SpvOpGroupFMax = 269,
-  SpvOpGroupUMax = 270,
-  SpvOpGroupSMax = 271,
-  SpvOpReadPipe = 274,
-  SpvOpWritePipe = 275,
-  SpvOpReservedReadPipe = 276,
-  SpvOpReservedWritePipe = 277,
-  SpvOpReserveReadPipePackets = 278,
-  SpvOpReserveWritePipePackets = 279,
-  SpvOpCommitReadPipe = 280,
-  SpvOpCommitWritePipe = 281,
-  SpvOpIsValidReserveId = 282,
-  SpvOpGetNumPipePackets = 283,
-  SpvOpGetMaxPipePackets = 284,
-  SpvOpGroupReserveReadPipePackets = 285,
-  SpvOpGroupReserveWritePipePackets = 286,
-  SpvOpGroupCommitReadPipe = 287,
-  SpvOpGroupCommitWritePipe = 288,
-  SpvOpEnqueueMarker = 291,
-  SpvOpEnqueueKernel = 292,
-  SpvOpGetKernelNDrangeSubGroupCount = 293,
-  SpvOpGetKernelNDrangeMaxSubGroupSize = 294,
-  SpvOpGetKernelWorkGroupSize = 295,
-  SpvOpGetKernelPreferredWorkGroupSizeMultiple = 296,
-  SpvOpRetainEvent = 297,
-  SpvOpReleaseEvent = 298,
-  SpvOpCreateUserEvent = 299,
-  SpvOpIsValidEvent = 300,
-  SpvOpSetUserEventStatus = 301,
-  SpvOpCaptureEventProfilingInfo = 302,
-  SpvOpGetDefaultQueue = 303,
-  SpvOpBuildNDRange = 304,
-  SpvOpImageSparseSampleImplicitLod = 305,
-  SpvOpImageSparseSampleExplicitLod = 306,
-  SpvOpImageSparseSampleDrefImplicitLod = 307,
-  SpvOpImageSparseSampleDrefExplicitLod = 308,
-  SpvOpImageSparseSampleProjImplicitLod = 309,
-  SpvOpImageSparseSampleProjExplicitLod = 310,
-  SpvOpImageSparseSampleProjDrefImplicitLod = 311,
-  SpvOpImageSparseSampleProjDrefExplicitLod = 312,
-  SpvOpImageSparseFetch = 313,
-  SpvOpImageSparseGather = 314,
-  SpvOpImageSparseDrefGather = 315,
-  SpvOpImageSparseTexelsResident = 316,
-  SpvOpNoLine = 317,
-  SpvOpAtomicFlagTestAndSet = 318,
-  SpvOpAtomicFlagClear = 319,
-  SpvOpImageSparseRead = 320,
-  SpvOpSizeOf = 321,
-  SpvOpTypePipeStorage = 322,
-  SpvOpConstantPipeStorage = 323,
-  SpvOpCreatePipeFromPipeStorage = 324,
-  SpvOpGetKernelLocalSizeForSubgroupCount = 325,
-  SpvOpGetKernelMaxNumSubgroups = 326,
-  SpvOpTypeNamedBarrier = 327,
-  SpvOpNamedBarrierInitialize = 328,
-  SpvOpMemoryNamedBarrier = 329,
-  SpvOpModuleProcessed = 330,
-  SpvOpExecutionModeId = 331,
-  SpvOpDecorateId = 332,
-  SpvOpSubgroupBallotKHR = 4421,
-  SpvOpSubgroupFirstInvocationKHR = 4422,
-  SpvOpSubgroupAllKHR = 4428,
-  SpvOpSubgroupAnyKHR = 4429,
-  SpvOpSubgroupAllEqualKHR = 4430,
-  SpvOpSubgroupReadInvocationKHR = 4432,
-  SpvOpGroupIAddNonUniformAMD = 5000,
-  SpvOpGroupFAddNonUniformAMD = 5001,
-  SpvOpGroupFMinNonUniformAMD = 5002,
-  SpvOpGroupUMinNonUniformAMD = 5003,
-  SpvOpGroupSMinNonUniformAMD = 5004,
-  SpvOpGroupFMaxNonUniformAMD = 5005,
-  SpvOpGroupUMaxNonUniformAMD = 5006,
-  SpvOpGroupSMaxNonUniformAMD = 5007,
-  SpvOpFragmentMaskFetchAMD = 5011,
-  SpvOpFragmentFetchAMD = 5012,
-  SpvOpSubgroupShuffleINTEL = 5571,
-  SpvOpSubgroupShuffleDownINTEL = 5572,
-  SpvOpSubgroupShuffleUpINTEL = 5573,
-  SpvOpSubgroupShuffleXorINTEL = 5574,
-  SpvOpSubgroupBlockReadINTEL = 5575,
-  SpvOpSubgroupBlockWriteINTEL = 5576,
-  SpvOpSubgroupImageBlockReadINTEL = 5577,
-  SpvOpSubgroupImageBlockWriteINTEL = 5578,
-  SpvOpMax = 0x7fffffff,
-} SpvOp;
-
-#endif  // #ifndef spirv_H
diff --git a/dali/graphics/vulkan/spirv/vulkan-spirv-opcode.h b/dali/graphics/vulkan/spirv/vulkan-spirv-opcode.h
deleted file mode 100644 (file)
index bd7640d..0000000
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef DALI_GRAPHICS_VULKAN_SPIRV_SPIRV_OPCODES_H
-#define DALI_GRAPHICS_VULKAN_SPIRV_SPIRV_OPCODES_H
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-namespace SpirV
-{
-struct SPIRVOpCode
-{
-  std::string name{"OpNull"};
-  uint32_t    code{static_cast<uint32_t>( -1u )};
-  bool        hasResult{false};
-  bool        hasResultType{false};
-  bool        isType{false};
-  bool        isTrivial{false}; // trivial types do not reference to any other result
-
-  /** Defines local data */
-  struct LocalData
-  {
-    uint32_t* start{nullptr};
-    uint32_t  count{0u};
-    uint32_t  resultId{0u};
-    int32_t   resultType{-1};
-  };
-
-  LocalData localData{};
-
-  bool operator!=( const SPIRVOpCode& opcode ) const
-  {
-    return opcode.code != code;
-  }
-
-  bool operator==( const SPIRVOpCode& opcode ) const
-  {
-    return opcode.code == code;
-  }
-
-  bool operator==( SpvOp op ) const
-  {
-    return ( code == static_cast<uint32_t>(op) );
-  }
-
-  template<class T>
-  T GetParameter( uint32_t index ) const
-  {
-    return static_cast<T>( *( localData.start + index + 1 ) );
-  }
-
-  uint32_t GetParameterU32( uint32_t index ) const
-  {
-    return GetParameter<uint32_t>( index );
-  }
-
-  std::string GetParameterAsString( uint32_t index ) const
-  {
-    return reinterpret_cast<const char*>( localData.start + index + 1 );
-  }
-
-  template<class T>
-  T operator[]( uint32_t index ) const
-  {
-    return GetParameter<T>( index );
-  }
-
-  SPIRVOpCode()  = default;
-  ~SPIRVOpCode() = default;
-};
-
-namespace
-{
-
-/**
- * List of all the SPIR-V opcodes
- * OpCodes describing types: 19-39
- */
-static const SPIRVOpCode OP_CODE_ARRAY[] = {{"OpNop", 0, false, false, false},
-                                            {"OpUndef", 1, true, true, false},
-                                            {"OpSourceContinued", 2, false, false, false},
-                                            {"OpSource", 3, false, false, false},
-                                            {"OpSourceExtension", 4, false, false, false},
-                                            {"OpName", 5, false, false, false},
-                                            {"OpMemberName", 6, false, false, false},
-                                            {"OpString", 7, true, false, false},
-                                            {"OpLine", 8, false, false, false},
-                                            {"OpExtension", 10, false, false, false},
-                                            {"OpExtInstImport", 11, true, false, false},
-                                            {"OpExtInst", 12, true, true, false},
-                                            {"OpMemoryModel", 14, false, false, false},
-                                            {"OpEntryPoint", 15, false, false, false},
-                                            {"OpExecutionMode", 16, false, false, false},
-                                            {"OpCapability", 17, false, false, false},
-                                            {"OpTypeVoid", 19, true, false, true, true},
-                                            {"OpTypeBool", 20, true, false, true, true},
-                                            {"OpTypeInt", 21, true, false, true, true},
-                                            {"OpTypeFloat", 22, true, false, true, true},
-                                            {"OpTypeVector", 23, true, false, true},
-                                            {"OpTypeMatrix", 24, true, false, true},
-                                            {"OpTypeImage", 25, true, false, true},
-                                            {"OpTypeSampler", 26, true, false, true},
-                                            {"OpTypeSampledImage", 27, true, false, true},
-                                            {"OpTypeArray", 28, true, false, true},
-                                            {"OpTypeRuntimeArray", 29, true, false, true},
-                                            {"OpTypeStruct", 30, true, false, true},
-                                            {"OpTypeOpaque", 31, true, false, true},
-                                            {"OpTypePointer", 32, true, false, true},
-                                            {"OpTypeFunction", 33, true, false, true},
-                                            {"OpTypeEvent", 34, true, false, true},
-                                            {"OpTypeDeviceEvent", 35, true, false, true},
-                                            {"OpTypeReserveId", 36, true, false, true},
-                                            {"OpTypeQueue", 37, true, false, true},
-                                            {"OpTypePipe", 38, true, false, true},
-                                            {"OpTypeForwardPointer", 39, false, false, true},
-                                            {"OpConstantTrue", 41, true, true, false},
-                                            {"OpConstantFalse", 42, true, true, false},
-                                            {"OpConstant", 43, true, true, false},
-                                            {"OpConstantComposite", 44, true, true, false},
-                                            {"OpConstantSampler", 45, true, true, false},
-                                            {"OpConstantNull", 46, true, true, false},
-                                            {"OpSpecConstantTrue", 48, true, true, false},
-                                            {"OpSpecConstantFalse", 49, true, true, false},
-                                            {"OpSpecConstant", 50, true, true, false},
-                                            {"OpSpecConstantComposite", 51, true, true, false},
-                                            {"OpSpecConstantOp", 52, true, true, false},
-                                            {"OpFunction", 54, true, true, false},
-                                            {"OpFunctionParameter", 55, true, true, false},
-                                            {"OpFunctionEnd", 56, false, false, false},
-                                            {"OpFunctionCall", 57, true, true, false},
-                                            {"OpVariable", 59, true, true, false},
-                                            {"OpImageTexelPointer", 60, true, true, false},
-                                            {"OpLoad", 61, true, true, false},
-                                            {"OpStore", 62, false, false, false},
-                                            {"OpCopyMemory", 63, false, false, false},
-                                            {"OpCopyMemorySized", 64, false, false, false},
-                                            {"OpAccessChain", 65, true, true, false},
-                                            {"OpInBoundsAccessChain", 66, true, true, false},
-                                            {"OpPtrAccessChain", 67, true, true, false},
-                                            {"OpArrayLength", 68, true, true, false},
-                                            {"OpGenericPtrMemSemantics", 69, true, true, false},
-                                            {"OpInBoundsPtrAccessChain", 70, true, true, false},
-                                            {"OpDecorate", 71, false, false, false},
-                                            {"OpMemberDecorate", 72, false, false, false},
-                                            {"OpDecorationGroup", 73, true, false, false},
-                                            {"OpGroupDecorate", 74, false, false, false},
-                                            {"OpGroupMemberDecorate", 75, false, false, false},
-                                            {"OpVectorExtractDynamic", 77, true, true, false},
-                                            {"OpVectorInsertDynamic", 78, true, true, false},
-                                            {"OpVectorShuffle", 79, true, true, false},
-                                            {"OpCompositeConstruct", 80, true, true, false},
-                                            {"OpCompositeExtract", 81, true, true, false},
-                                            {"OpCompositeInsert", 82, true, true, false},
-                                            {"OpCopyObject", 83, true, true, false},
-                                            {"OpTranspose", 84, true, true, false},
-                                            {"OpSampledImage", 86, true, true, false},
-                                            {"OpImageSampleImplicitLod", 87, true, true, false},
-                                            {"OpImageSampleExplicitLod", 88, true, true, false},
-                                            {"OpImageSampleDrefImplicitLod", 89, true, true, false},
-                                            {"OpImageSampleDrefExplicitLod", 90, true, true, false},
-                                            {"OpImageSampleProjImplicitLod", 91, true, true, false},
-                                            {"OpImageSampleProjExplicitLod", 92, true, true, false},
-                                            {"OpImageSampleProjDrefImplicitLod", 93, true, true, false},
-                                            {"OpImageSampleProjDrefExplicitLod", 94, true, true, false},
-                                            {"OpImageFetch", 95, true, true, false},
-                                            {"OpImageGather", 96, true, true, false},
-                                            {"OpImageDrefGather", 97, true, true, false},
-                                            {"OpImageRead", 98, true, true, false},
-                                            {"OpImageWrite", 99, false, false, false},
-                                            {"OpImage", 100, true, true, false},
-                                            {"OpImageQueryFormat", 101, true, true, false},
-                                            {"OpImageQueryOrder", 102, true, true, false},
-                                            {"OpImageQuerySizeLod", 103, true, true, false},
-                                            {"OpImageQuerySize", 104, true, true, false},
-                                            {"OpImageQueryLod", 105, true, true, false},
-                                            {"OpImageQueryLevels", 106, true, true, false},
-                                            {"OpImageQuerySamples", 107, true, true, false},
-                                            {"OpConvertFToU", 109, true, true, false},
-                                            {"OpConvertFToS", 110, true, true, false},
-                                            {"OpConvertSToF", 111, true, true, false},
-                                            {"OpConvertUToF", 112, true, true, false},
-                                            {"OpUConvert", 113, true, true, false},
-                                            {"OpSConvert", 114, true, true, false},
-                                            {"OpFConvert", 115, true, true, false},
-                                            {"OpQuantizeToF16", 116, true, true, false},
-                                            {"OpConvertPtrToU", 117, true, true, false},
-                                            {"OpSatConvertSToU", 118, true, true, false},
-                                            {"OpSatConvertUToS", 119, true, true, false},
-                                            {"OpConvertUToPtr", 120, true, true, false},
-                                            {"OpPtrCastToGeneric", 121, true, true, false},
-                                            {"OpGenericCastToPtr", 122, true, true, false},
-                                            {"OpGenericCastToPtrExplicit", 123, true, true, false},
-                                            {"OpBitcast", 124, true, true, false},
-                                            {"OpSNegate", 126, true, true, false},
-                                            {"OpFNegate", 127, true, true, false},
-                                            {"OpIAdd", 128, true, true, false},
-                                            {"OpFAdd", 129, true, true, false},
-                                            {"OpISub", 130, true, true, false},
-                                            {"OpFSub", 131, true, true, false},
-                                            {"OpIMul", 132, true, true, false},
-                                            {"OpFMul", 133, true, true, false},
-                                            {"OpUDiv", 134, true, true, false},
-                                            {"OpSDiv", 135, true, true, false},
-                                            {"OpFDiv", 136, true, true, false},
-                                            {"OpUMod", 137, true, true, false},
-                                            {"OpSRem", 138, true, true, false},
-                                            {"OpSMod", 139, true, true, false},
-                                            {"OpFRem", 140, true, true, false},
-                                            {"OpFMod", 141, true, true, false},
-                                            {"OpVectorTimesScalar", 142, true, true, false},
-                                            {"OpMatrixTimesScalar", 143, true, true, false},
-                                            {"OpVectorTimesMatrix", 144, true, true, false},
-                                            {"OpMatrixTimesVector", 145, true, true, false},
-                                            {"OpMatrixTimesMatrix", 146, true, true, false},
-                                            {"OpOuterProduct", 147, true, true, false},
-                                            {"OpDot", 148, true, true, false},
-                                            {"OpIAddCarry", 149, true, true, false},
-                                            {"OpISubBorrow", 150, true, true, false},
-                                            {"OpUMulExtended", 151, true, true, false},
-                                            {"OpSMulExtended", 152, true, true, false},
-                                            {"OpAny", 154, true, true, false},
-                                            {"OpAll", 155, true, true, false},
-                                            {"OpIsNan", 156, true, true, false},
-                                            {"OpIsInf", 157, true, true, false},
-                                            {"OpIsFinite", 158, true, true, false},
-                                            {"OpIsNormal", 159, true, true, false},
-                                            {"OpSignBitSet", 160, true, true, false},
-                                            {"OpLessOrGreater", 161, true, true, false},
-                                            {"OpOrdered", 162, true, true, false},
-                                            {"OpUnordered", 163, true, true, false},
-                                            {"OpLogicalEqual", 164, true, true, false},
-                                            {"OpLogicalNotEqual", 165, true, true, false},
-                                            {"OpLogicalOr", 166, true, true, false},
-                                            {"OpLogicalAnd", 167, true, true, false},
-                                            {"OpLogicalNot", 168, true, true, false},
-                                            {"OpSelect", 169, true, true, false},
-                                            {"OpIEqual", 170, true, true, false},
-                                            {"OpINotEqual", 171, true, true, false},
-                                            {"OpUGreaterThan", 172, true, true, false},
-                                            {"OpSGreaterThan", 173, true, true, false},
-                                            {"OpUGreaterThanEqual", 174, true, true, false},
-                                            {"OpSGreaterThanEqual", 175, true, true, false},
-                                            {"OpULessThan", 176, true, true, false},
-                                            {"OpSLessThan", 177, true, true, false},
-                                            {"OpULessThanEqual", 178, true, true, false},
-                                            {"OpSLessThanEqual", 179, true, true, false},
-                                            {"OpFOrdEqual", 180, true, true, false},
-                                            {"OpFUnordEqual", 181, true, true, false},
-                                            {"OpFOrdNotEqual", 182, true, true, false},
-                                            {"OpFUnordNotEqual", 183, true, true, false},
-                                            {"OpFOrdLessThan", 184, true, true, false},
-                                            {"OpFUnordLessThan", 185, true, true, false},
-                                            {"OpFOrdGreaterThan", 186, true, true, false},
-                                            {"OpFUnordGreaterThan", 187, true, true, false},
-                                            {"OpFOrdLessThanEqual", 188, true, true, false},
-                                            {"OpFUnordLessThanEqual", 189, true, true, false},
-                                            {"OpFOrdGreaterThanEqual", 190, true, true, false},
-                                            {"OpFUnordGreaterThanEqual", 191, true, true, false},
-                                            {"OpShiftRightLogical", 194, true, true, false},
-                                            {"OpShiftRightArithmetic", 195, true, true, false},
-                                            {"OpShiftLeftLogical", 196, true, true, false},
-                                            {"OpBitwiseOr", 197, true, true, false},
-                                            {"OpBitwiseXor", 198, true, true, false},
-                                            {"OpBitwiseAnd", 199, true, true, false},
-                                            {"OpNot", 200, true, true, false},
-                                            {"OpBitFieldInsert", 201, true, true, false},
-                                            {"OpBitFieldSExtract", 202, true, true, false},
-                                            {"OpBitFieldUExtract", 203, true, true, false},
-                                            {"OpBitReverse", 204, true, true, false},
-                                            {"OpBitCount", 205, true, true, false},
-                                            {"OpDPdx", 207, true, true, false},
-                                            {"OpDPdy", 208, true, true, false},
-                                            {"OpFwidth", 209, true, true, false},
-                                            {"OpDPdxFine", 210, true, true, false},
-                                            {"OpDPdyFine", 211, true, true, false},
-                                            {"OpFwidthFine", 212, true, true, false},
-                                            {"OpDPdxCoarse", 213, true, true, false},
-                                            {"OpDPdyCoarse", 214, true, true, false},
-                                            {"OpFwidthCoarse", 215, true, true, false},
-                                            {"OpEmitVertex", 218, false, false, false},
-                                            {"OpEndPrimitive", 219, false, false, false},
-                                            {"OpEmitStreamVertex", 220, false, false, false},
-                                            {"OpEndStreamPrimitive", 221, false, false, false},
-                                            {"OpControlBarrier", 224, false, false, false},
-                                            {"OpMemoryBarrier", 225, false, false, false},
-                                            {"OpAtomicLoad", 227, true, true, false},
-                                            {"OpAtomicStore", 228, false, false, false},
-                                            {"OpAtomicExchange", 229, true, true, false},
-                                            {"OpAtomicCompareExchange", 230, true, true, false},
-                                            {"OpAtomicCompareExchangeWeak", 231, true, true, false},
-                                            {"OpAtomicIIncrement", 232, true, true, false},
-                                            {"OpAtomicIDecrement", 233, true, true, false},
-                                            {"OpAtomicIAdd", 234, true, true, false},
-                                            {"OpAtomicISub", 235, true, true, false},
-                                            {"OpAtomicSMin", 236, true, true, false},
-                                            {"OpAtomicUMin", 237, true, true, false},
-                                            {"OpAtomicSMax", 238, true, true, false},
-                                            {"OpAtomicUMax", 239, true, true, false},
-                                            {"OpAtomicAnd", 240, true, true, false},
-                                            {"OpAtomicOr", 241, true, true, false},
-                                            {"OpAtomicXor", 242, true, true, false},
-                                            {"OpPhi", 245, true, true, false},
-                                            {"OpLoopMerge", 246, false, false, false},
-                                            {"OpSelectionMerge", 247, false, false, false},
-                                            {"OpLabel", 248, true, false, false},
-                                            {"OpBranch", 249, false, false, false},
-                                            {"OpBranchConditional", 250, false, false, false},
-                                            {"OpSwitch", 251, false, false, false},
-                                            {"OpKill", 252, false, false, false},
-                                            {"OpReturn", 253, false, false, false},
-                                            {"OpReturnValue", 254, false, false, false},
-                                            {"OpUnreachable", 255, false, false, false},
-                                            {"OpLifetimeStart", 256, false, false, false},
-                                            {"OpLifetimeStop", 257, false, false, false},
-                                            {"OpGroupAsyncCopy", 259, true, true, false},
-                                            {"OpGroupWaitEvents", 260, false, false, false},
-                                            {"OpGroupAll", 261, true, true, false},
-                                            {"OpGroupAny", 262, true, true, false},
-                                            {"OpGroupBroadcast", 263, true, true, false},
-                                            {"OpGroupIAdd", 264, true, true, false},
-                                            {"OpGroupFAdd", 265, true, true, false},
-                                            {"OpGroupFMin", 266, true, true, false},
-                                            {"OpGroupUMin", 267, true, true, false},
-                                            {"OpGroupSMin", 268, true, true, false},
-                                            {"OpGroupFMax", 269, true, true, false},
-                                            {"OpGroupUMax", 270, true, true, false},
-                                            {"OpGroupSMax", 271, true, true, false},
-                                            {"OpReadPipe", 274, true, true, false},
-                                            {"OpWritePipe", 275, true, true, false},
-                                            {"OpReservedReadPipe", 276, true, true, false},
-                                            {"OpReservedWritePipe", 277, true, true, false},
-                                            {"OpReserveReadPipePackets", 278, true, true, false},
-                                            {"OpReserveWritePipePackets", 279, true, true, false},
-                                            {"OpCommitReadPipe", 280, false, false, false},
-                                            {"OpCommitWritePipe", 281, false, false, false},
-                                            {"OpIsValidReserveId", 282, true, true, false},
-                                            {"OpGetNumPipePackets", 283, true, true, false},
-                                            {"OpGetMaxPipePackets", 284, true, true, false},
-                                            {"OpGroupReserveReadPipePackets", 285, true, true, false},
-                                            {"OpGroupReserveWritePipePackets", 286, true, true, false},
-                                            {"OpGroupCommitReadPipe", 287, false, false, false},
-                                            {"OpGroupCommitWritePipe", 288, false, false, false},
-                                            {"OpEnqueueMarker", 291, true, true, false},
-                                            {"OpEnqueueKernel", 292, true, true, false},
-                                            {"OpGetKernelNDrangeSubGroupCount", 293, true, true, false},
-                                            {"OpGetKernelNDrangeMaxSubGroupSize", 294, true, true, false},
-                                            {"OpGetKernelWorkGroupSize", 295, true, true, false},
-                                            {"OpGetKernelPreferredWorkGroupSizeMultiple", 296, true, true, false},
-                                            {"OpRetainEvent", 297, false, false, false},
-                                            {"OpReleaseEvent", 298, false, false, false},
-                                            {"OpCreateUserEvent", 299, true, true, false},
-                                            {"OpIsValidEvent", 300, true, true, false},
-                                            {"OpSetUserEventStatus", 301, false, false, false},
-                                            {"OpCaptureEventProfilingInfo", 302, false, false, false},
-                                            {"OpGetDefaultQueue", 303, true, true, false},
-                                            {"OpBuildNDRange", 304, true, true, false},
-                                            {"OpImageSparseSampleImplicitLod", 305, true, true, false},
-                                            {"OpImageSparseSampleExplicitLod", 306, true, true, false},
-                                            {"OpImageSparseSampleDrefImplicitLod", 307, true, true, false},
-                                            {"OpImageSparseSampleDrefExplicitLod", 308, true, true, false},
-                                            {"OpImageSparseSampleProjImplicitLod", 309, true, true, false},
-                                            {"OpImageSparseSampleProjExplicitLod", 310, true, true, false},
-                                            {"OpImageSparseSampleProjDrefImplicitLod", 311, true, true, false},
-                                            {"OpImageSparseSampleProjDrefExplicitLod", 312, true, true, false},
-                                            {"OpImageSparseFetch", 313, true, true, false},
-                                            {"OpImageSparseGather", 314, true, true, false},
-                                            {"OpImageSparseDrefGather", 315, true, true, false},
-                                            {"OpImageSparseTexelsResident", 316, true, true, false},
-                                            {"OpNoLine", 317, false, false, false},
-                                            {"OpAtomicFlagTestAndSet", 318, true, true, false},
-                                            {"OpAtomicFlagClear", 319, false, false, false},
-                                            {"OpImageSparseRead", 320, true, true, false},
-                                            {"OpSizeOf", 321, true, true, false},
-                                            {"OpTypePipeStorage", 322, true, false, false},
-                                            {"OpConstantPipeStorage", 323, true, true, false},
-                                            {"OpCreatePipeFromPipeStorage", 324, true, true, false},
-                                            {"OpGetKernelLocalSizeForSubgroupCount", 325, true, true, false},
-                                            {"OpGetKernelMaxNumSubgroups", 326, true, true, false},
-                                            {"OpTypeNamedBarrier", 327, true, false, false},
-                                            {"OpNamedBarrierInitialize", 328, true, true, false},
-                                            {"OpMemoryNamedBarrier", 329, false, false, false},
-                                            {"OpModuleProcessed", 330, false, false, false},
-                                            {"OpExecutionModeId", 331, false, false, false},
-                                            {"OpDecorateId", 332, false, false, false},
-                                            {"OpSubgroupBallotKHR", 4421, true, true, false},
-                                            {"OpSubgroupFirstInvocationKHR", 4422, true, true, false},
-                                            {"OpSubgroupReadInvocationKHR", 4432, true, true, false},
-                                            {"OpGroupIAddNonUniformAMD", 5000, true, true, false},
-                                            {"OpGroupFAddNonUniformAMD", 5001, true, true, false},
-                                            {"OpGroupFMinNonUniformAMD", 5002, true, true, false},
-                                            {"OpGroupUMinNonUniformAMD", 5003, true, true, false},
-                                            {"OpGroupSMinNonUniformAMD", 5004, true, true, false},
-                                            {"OpGroupFMaxNonUniformAMD", 5005, true, true, false},
-                                            {"OpGroupUMaxNonUniformAMD", 5006, true, true, false},
-                                            {"OpGroupSMaxNonUniformAMD", 5007, true, true, false}};
-
-static const SPIRVOpCode OP_CODE_NULL{};
-const SPIRVOpCode& FindOpCode( uint32_t code )
-{
-  for( auto&& opcode : OP_CODE_ARRAY )
-  {
-    if( opcode.code == code )
-      return opcode;
-  }
-  return OP_CODE_NULL;
-}
-
-} // namespace
-} // namespace SpirV
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-
-#endif //DALI_GRAPHICS_VULKAN_SPIRV_SPIRV_OPCODES_H
diff --git a/dali/graphics/vulkan/spirv/vulkan-spirv.cpp b/dali/graphics/vulkan/spirv/vulkan-spirv.cpp
deleted file mode 100644 (file)
index 6ba5eba..0000000
+++ /dev/null
@@ -1,1096 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/spirv/vulkan-spirv.h>
-#include <dali/graphics/vulkan/spirv/vulkan-spirv-opcode.h>
-#include <dali/graphics/vulkan/vulkan-debug.h>
-
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-namespace SpirV
-{
-SPIRVShader::Impl& SPIRVShader::GetImplementation() const
-{
-  return *mImpl;
-}
-
-struct SPIRVShader::Impl
-{
-  /**
-   * 32bit word needed to identify SPIRV code
-   */
-  static constexpr uint32_t MAGIC_NUMBER{0x07230203u};
-
-  /**
-   * SPIRV header binary structure
-   */
-  struct Header
-  {
-    uint32_t magicNumber;
-    uint32_t versionNumber; // 0 | major | minor | 0
-    uint32_t generatorMagicNumber;
-    uint32_t bound;
-    uint32_t reserved;
-  };
-
-  /**
-   * Stores descriptorset bindings and createinfo data used by reflection
-   */
-  struct DescriptorSetLayoutAndBindingInfo
-  {
-    std::vector<vk::DescriptorSetLayoutBinding> bindings;
-    vk::DescriptorSetLayoutCreateInfo createInfo;
-  };
-
-  SPIRVOpCode& FindByResultId( uint32_t resultId ) const
-  {
-    return *(opResults[resultId] );
-  }
-
-  SPIRVOpCode* FindByResultId( SPIRVOpCode& opcode ) const
-  {
-    if(!opcode.hasResult)
-    {
-      return nullptr;
-    }
-    return opResults[opcode.localData.resultId];
-  }
-
-  SPIRVOpCode* FindByResultPtrId( uint32_t resultId ) const
-  {
-    if( resultId < opResults.size() )
-    {
-      return opResults[resultId];
-    }
-    return nullptr;
-  }
-
-  /**
-   * Constructor
-   * @param pData
-   * @param size
-   * @param stages
-   */
-  Impl( void* pData, std::size_t size, vk::ShaderStageFlags stages )
-  {
-    data.resize( size );
-    auto begin = reinterpret_cast<uint32_t*>( pData );
-    auto end   = begin + size;
-    std::copy( begin, end, data.begin() );
-  }
-
-  /**
-   * Constructor
-   * @tparam T
-   * @param buffer
-   * @param stages
-   */
-  template<typename T>
-  explicit Impl( std::vector<T> buffer, vk::ShaderStageFlags stages )
-  {
-    data.resize( ( buffer.size() * sizeof( buffer[0] ) ) / sizeof( uint32_t ) );
-    auto begin = reinterpret_cast<uint32_t*>( &*buffer.begin() );
-    auto end   = reinterpret_cast<uint32_t*>( &*buffer.end() );
-    std::copy( begin, end, data.begin() );
-  }
-
-  auto FindDecorationsForId( uint32_t id )
-  {
-    std::vector<SPIRVOpCode*> retval{};
-    for( auto&& op : opCodes )
-    {
-      if( op.code == SpvOpDecorate && op.GetParameterU32( 0 ) == id )
-      {
-        retval.push_back( &op );
-      }
-    }
-    return retval;
-  }
-
-  auto FindMemberDecorationsForId( uint32_t id, uint32_t memberIndex )
-  {
-    std::vector<SPIRVOpCode*> retval{};
-    for( auto&& op : opCodes )
-    {
-      if( op.code == SpvOpMemberDecorate && op.GetParameterU32( 0 ) == id && op.GetParameterU32( 1 ) == memberIndex )
-      {
-        retval.push_back( &op );
-      }
-    }
-    return retval;
-  }
-
-  SPIRVOpCode& GetReferencedOpCode( const SPIRVOpCode& opCode, uint32_t refIndex ) const
-  {
-    return FindByResultId( opCode.GetParameterU32( refIndex ) );
-  }
-
-  auto GetDecorationsOpId( const SPIRVOpCode& resultOp )
-  {
-    std::vector<SPIRVOpCode*> retval;
-    if( resultOp.hasResult )
-    {
-      for( auto&& op : opCodes )
-      {
-        if( op == SpvOpDecorate && op.GetParameterU32( 0 ) == resultOp.localData.resultId )
-        {
-          retval.push_back( &op );
-        }
-      }
-    }
-    return retval;
-  }
-
-  bool CheckDecorationForOpId( const SPIRVOpCode& resultOp, SpvDecoration expectedDecoration )
-  {
-    if( resultOp.hasResult )
-    {
-      for( auto&& op : opCodes )
-      {
-        if( op == SpvOpDecorate && op.GetParameterU32( 0 ) == resultOp.localData.resultId &&
-            op.GetParameter<SpvDecoration>( 1 ) == expectedDecoration )
-        {
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-
-  struct SPIRVReflectionData
-  {
-    SPIRVReflectionData() = default;
-    SPIRVReflectionData( const SPIRVReflectionData& ) = default;
-    SPIRVReflectionData& operator=( const SPIRVReflectionData& ) = default;
-    SPIRVReflectionData( SPIRVReflectionData&& ) = delete;
-    SPIRVReflectionData& operator=( SPIRVReflectionData&& ) = delete;
-
-    std::string                                     name{};
-    SPIRVOpCode*                                    op{nullptr};
-    SpvStorageClass                                 storage{SpvStorageClassMax};
-    vk::DescriptorType                              descriptorType{}; // only valid for uniforms
-    std::unordered_map<SpvDecoration, SPIRVOpCode*> decorations{};
-    std::vector<SPIRVReflectionData>                members{}; // used by structs only
-    uint32_t                                        structSize{0u};
-  };
-
-  template<class M, class K>
-  bool MapContains( const M& map, const K& key ) const
-  {
-    return map.find( key ) != map.end();
-  }
-
-
-  template<class V>
-  struct GetResult
-  {
-    GetResult( bool v, V& value)
-    : success(v), result(&value)
-    {
-    }
-
-    GetResult( bool v )
-      : success(v), result(nullptr)
-    {
-    }
-
-    operator V&()
-    {
-      return *result;
-    }
-
-    operator V*()
-    {
-      return result;
-    }
-
-    GetResult() : success( false ), result(nullptr){}
-    bool  success;
-    V*     result;
-  };
-
-  template<class K, class V>
-  GetResult<V> GetMapItem( std::unordered_map<K,V>& map, const K& key )
-  {
-    auto iter = map.find( key );
-    if( iter == map.end() )
-    {
-      return GetResult<V>( false );
-    }
-
-    return GetResult<V>( true, iter->second );
-  }
-
-  struct SPIRVTypeInfo
-  {
-    vk::Format  vkFormat;
-    uint32_t    sizeInBytes;
-    uint32_t    components;
-    uint32_t    rows;
-    uint32_t    componentSizeInBytes;
-  };
-
-  auto GetTypeInfo( const SPIRVOpCode& typeOpCode ) const
-  {
-    auto retval = SPIRVTypeInfo{};
-
-    const vk::Format VEC[] =
-                       {
-                         vk::Format::eUndefined,
-                         vk::Format::eR32Sfloat,
-                         vk::Format::eR32G32Sfloat,
-                         vk::Format::eR32G32B32Sfloat,
-                         vk::Format::eR32G32B32A32Sfloat,
-                       };
-
-    // note: always assumed:
-    // - not normalized
-    // - float
-    // - signed
-    if( typeOpCode == SpvOpTypeMatrix )
-    {
-      retval.components = typeOpCode.GetParameterU32( 2 );
-      retval.rows = retval.components;
-      retval.componentSizeInBytes = sizeof(float);
-      retval.sizeInBytes = (retval.components*retval.components)*retval.componentSizeInBytes;
-      retval.vkFormat = VEC[retval.components];
-    }
-    else if(typeOpCode == SpvOpTypeVector)
-    {
-      retval.components = typeOpCode.GetParameterU32( 2 );
-      retval.rows = 1;
-      retval.componentSizeInBytes = sizeof(float);
-      retval.sizeInBytes = retval.components*retval.componentSizeInBytes;
-      retval.vkFormat = VEC[retval.components];
-    }
-    else if(typeOpCode == SpvOpTypeFloat)
-    {
-      retval.components = 1;
-      retval.rows = 1;
-      retval.componentSizeInBytes = sizeof(float);
-      retval.sizeInBytes = sizeof(float);
-      retval.vkFormat = vk::Format::eR32Sfloat;
-    }
-    else if(typeOpCode == SpvOpTypeInt)
-    {
-      retval.components = 1;
-      retval.rows = 1;
-      retval.componentSizeInBytes = sizeof(uint32_t);
-      retval.sizeInBytes = sizeof(uint32_t);
-      retval.vkFormat = vk::Format::eR32Sint;
-    }
-    else
-    {
-      retval.components = 0;
-      retval.rows = 0;
-      retval.componentSizeInBytes = 0;
-      retval.sizeInBytes = 0;
-      retval.vkFormat = vk::Format::eUndefined;
-    }
-
-    return retval;
-  }
-
-
-
-  auto BuildReflection()
-  {
-    // collect variables
-    using MemberNameArray = std::vector<SPIRVOpCode*>;
-    auto vars = std::vector<SPIRVOpCode*>{};
-    auto opNames = std::unordered_map<uint32_t, SPIRVOpCode*>{};
-
-    // member names, key: struct id, value: ordered vector of OpMemberName ops
-    auto opMemberNames = std::unordered_map<uint32_t, MemberNameArray>{};
-    for( auto&& op : opCodes )
-    {
-      auto id = op.GetParameterU32(0);
-      if( op == SpvOpVariable )
-      {
-        vars.push_back( &op );
-      }
-      else if( op == SpvOpName )
-      {
-        opNames.emplace( id, &op );
-      }
-      else if( op == SpvOpMemberName )
-      {
-        GetResult<MemberNameArray> result{};
-        MemberNameArray* memberNames{ nullptr };
-        if( !(result = GetMapItem( opMemberNames, id )).success )
-        {
-          opMemberNames.emplace(id, MemberNameArray{} );
-          memberNames = &opMemberNames[id];
-        }
-        else
-        {
-          memberNames = result.result;
-        }
-
-        if(memberNames->size() <= op.GetParameterU32(1))
-          memberNames->resize( op.GetParameterU32(1)+1 );
-        (*memberNames)[op.GetParameterU32(1)] = &op;
-      }
-    }
-
-    // find uniforms and inputs
-    auto decorationVariables = std::unordered_map<uint32_t, SPIRVReflectionData>{};
-    auto uniformVariables = std::vector<SPIRVOpCode*>{};
-    auto inputVariables   = std::vector<SPIRVOpCode*>{};
-    auto outputVariables  = std::vector<SPIRVOpCode*>{};
-    for( auto&& op : vars )
-    {
-      auto storage = op->GetParameter<SpvStorageClass>( 2 );
-      bool varFound{false};
-      if( storage == SpvStorageClassUniform || storage == SpvStorageClassUniformConstant )
-      {
-        uniformVariables.emplace_back( op );
-        varFound = true;
-      }
-      else if( storage == SpvStorageClassInput )
-      {
-        inputVariables.emplace_back( op );
-        varFound = true;
-      }
-      else if( storage == SpvStorageClassOutput )
-      {
-        outputVariables.emplace_back( op );
-        varFound = true;
-      }
-
-      // find decorations if variable
-      if( varFound )
-      {
-        auto id = op->localData.resultId;
-        auto decorations = FindDecorationsForId( id );
-        SPIRVReflectionData decorationInfo;
-        decorationInfo.op = op;
-        decorationInfo.storage = storage;
-
-        // update descriptor type if viable
-        decorationInfo.descriptorType = FindDescriptorTypeForVariable( *op );
-
-        for( auto&& decoration : decorations )
-        {
-          auto decorationQualifier = decoration->GetParameter<SpvDecoration>( 1 );
-          decorationInfo.decorations.emplace( decorationQualifier, decoration );
-          DALI_LOG_STREAM( gVulkanFilter, Debug::General, decorationQualifier);
-        }
-        decorationVariables.emplace( id, decorationInfo );
-
-        // store name if element is named
-        GetResult<SPIRVOpCode*> name{};
-
-        bool foundName = false;
-        if( (name = GetMapItem( opNames, id )).success )
-        {
-
-          // variable may not be named ( global scope of the shader )
-          if( !(*name.result)->GetParameterAsString( 1 ).empty() )
-          {
-            DALI_LOG_STREAM( gVulkanFilter, Debug::General, "Found name");
-            decorationVariables[id].name = (*name.result)->GetParameterAsString( 1 );
-            foundName = true;
-          }
-        }
-
-        // continue if name hasn't been found, this means the variable is an uniform
-        // in the global scope
-        if( !foundName )
-        {
-          auto pointerId = op->GetParameterU32(0);
-          auto pointer = FindByResultId( pointerId );
-          auto pointerToType = FindByResultId( pointer.GetParameterU32(2) );
-
-          // find name of the structure
-          GetResult<SPIRVOpCode*> retval{};
-          if( (retval = GetMapItem( opNames, pointerToType.localData.resultId )).success )
-          {
-            DALI_LOG_STREAM( gVulkanFilter, Debug::General, "Found: " << (*retval.result)->GetParameterAsString(1));
-            decorationVariables[id].name = (*retval.result)->GetParameterAsString(1);
-          }
-
-          // depending on the type, we may need to extract members, member types as well
-          // as other relevant data
-          if( pointerToType == SpvOpTypeStruct )
-          {
-
-            auto memberCount = pointerToType.localData.count-2;
-            DALI_LOG_STREAM( gVulkanFilter, Debug::General,
-                               "Found struct, look for member names and member decorations: "
-                               "member count: " << memberCount);
-
-            // for each member resolve type and compute size of the structure
-            auto memberNames = opMemberNames[ pointerToType.localData.resultId ];
-            for( auto i = 0u; i < memberCount; ++i )
-            {
-              auto& memberName = memberNames[i];
-              SPIRVReflectionData memberOpInfo;
-              memberOpInfo.name = memberName->GetParameterAsString(2);
-              auto memberResultId = pointerToType.GetParameterU32( i+1 );
-              memberOpInfo.op = FindByResultPtrId( memberResultId );
-
-              // look for decoration for each member ( needed in order to build data structures )
-              auto memberDecorationOps = FindMemberDecorationsForId( pointerToType.localData.resultId, i );
-              for( auto&& mop : memberDecorationOps )
-              {
-                memberOpInfo.decorations.emplace( mop->GetParameter<SpvDecoration>( 2 ), mop );
-              }
-              decorationVariables[id].members.emplace_back(memberOpInfo);
-              DALI_LOG_STREAM( gVulkanFilter, Debug::General,  "memberName: " << memberName->GetParameterAsString(2) );
-            }
-
-            uint32_t structSize = 0u;
-
-            // for last member update size of the data structure ( for blocks only )
-            if(memberCount)
-            {
-              if( memberCount > 0 )
-              {
-                auto& lastMember = decorationVariables[id].members.back();
-
-                if( MapContains( lastMember.decorations, SpvDecorationOffset ) )
-                {
-                  structSize = lastMember.decorations[SpvDecorationOffset]->GetParameterU32(3);
-                }
-                auto typeInfo = GetTypeInfo( *lastMember.op );
-                structSize += typeInfo.sizeInBytes;
-              }
-              decorationVariables[id].structSize = structSize;
-            }
-            DALI_LOG_STREAM( gVulkanFilter, Debug::General, "struct size: " << structSize);
-          }
-        }
-      }
-    }
-
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General,  "Found " << uniformVariables.size() << " variables" );
-
-    return decorationVariables;
-  }
-
-  auto LoadOpCodes( const std::vector<SPIRVWord>& _data )
-  {
-    auto retval = std::vector<SPIRVOpCode>{};
-
-    // test if we have valid SPIRV header
-    auto iter = data.begin();
-    if( !CheckHeader() )
-    {
-      DALI_LOG_STREAM( gVulkanFilter, Debug::General,  "Not SPIRV!" );
-      return retval;
-    }
-
-    DALI_LOG_STREAM( gVulkanFilter, Debug::General,  "SPIR-V detected" );
-    std::advance( iter, 5u ); // skip header
-
-    while( iter != data.end() )
-    {
-      auto opword    = *iter;
-      auto wordCount = ( ( opword >> 16 ) & 0xFFFF );
-      auto opCode    = ( (opword)&0xFFFF );
-
-      auto& op = FindOpCode( opCode );
-
-      if( op != OP_CODE_NULL )
-      {
-        uint32_t resultIndex{0};
-        int      resultIndexOffset = 1;
-        int32_t  resultType{0u};
-
-        // make a copy
-        retval.emplace_back( op );
-        auto& opcode           = retval.back();
-        opcode.localData.start = &*iter;
-        opcode.localData.count = wordCount;
-
-        // update result type and index for non-void opcodes
-        if( op.hasResultType )
-        {
-          resultIndexOffset++;
-        }
-        if( op.hasResult )
-        {
-          if( op.hasResultType )
-          {
-            resultType = static_cast<int32_t>( *( iter + 1 ) );
-          }
-          resultIndex                 = *( iter + resultIndexOffset );
-          opcode.localData.resultId   = resultIndex;
-          opcode.localData.resultType = resultType;
-        }
-      }
-
-      // next instruction
-      std::advance( iter, wordCount );
-    }
-
-    return retval;
-  }
-
-  auto CreateOpResults( std::vector<SPIRVOpCode>& _opcodes )
-  {
-    auto retval = std::vector<SPIRVOpCode*>{};
-    for( auto i = 0u; i < _opcodes.size(); ++i )
-    {
-      const auto& op = _opcodes[i];
-      if( op.hasResult )
-      {
-        if( retval.size() <= op.localData.resultId )
-        {
-          retval.resize( op.localData.resultId + 1 );
-        }
-        retval[op.localData.resultId] = &_opcodes[i];
-      }
-    }
-    return retval;
-  }
-
-  vk::DescriptorType FindDescriptorTypeForVariable( SPIRVOpCode& opVariable )
-  {
-    vk::DescriptorType descriptorType{};
-
-    auto storageClass = opVariable.GetParameter<SpvStorageClass>(2);
-
-    // we need to detect storage by call into function
-    if (storageClass == SpvStorageClassUniformConstant)
-    {
-      auto& resource = opVariable;
-      if (TestStorageImageDescriptor(resource))
-      {
-        descriptorType = vk::DescriptorType::eStorageImage;
-      }
-      else if(TestSamplerDescriptor(resource))
-      {
-        descriptorType = vk::DescriptorType::eSampler;
-      }
-      else if(TestSampledImageDescriptor(resource))
-      {
-        descriptorType = vk::DescriptorType::eSampledImage;
-      }
-      else if(TestCombinedImageSamplerDescriptor(resource))
-      {
-        descriptorType = vk::DescriptorType::eCombinedImageSampler;
-      }
-      else if(TestUniformTexelBufferDescriptor(resource))
-      {
-        descriptorType = vk::DescriptorType::eUniformTexelBuffer;
-      }
-      else if(TestStorageTexelBufferDescriptor(resource))
-      {
-        descriptorType = vk::DescriptorType::eStorageTexelBuffer;
-      }
-      else
-      {
-        // @todo check the shader, something hasn't been recognized
-        descriptorType = vk::DescriptorType{};
-      }
-
-      if(descriptorType != vk::DescriptorType{})
-      {
-        //uniformResources.push_back( &resource );
-      }
-    }
-    else if(storageClass == SpvStorageClassUniform)
-    {
-      descriptorType = vk::DescriptorType::eUniformBuffer;
-    }
-    return descriptorType;
-  }
-
-  auto GenerateVulkanDescriptorSetLayouts()
-  {
-    // key: descriptor set, value: ds layout create info and binding
-    auto vkDescriptorSetLayoutCreateInfos = std::unordered_map<uint32_t, DescriptorSetLayoutAndBindingInfo>{};
-
-    for(auto&& symbol : reflectionData)
-    {
-      auto storage = symbol.second.storage;
-      auto& symbolData = symbol.second;
-      if( storage == SpvStorageClassUniform || storage == SpvStorageClassUniformConstant )
-      {
-        auto binding = MapContains( symbolData.decorations, SpvDecorationBinding ) ? symbolData.decorations[SpvDecorationBinding]->GetParameterU32(2) : 0u;
-        auto descriptorSet = MapContains( symbolData.decorations, SpvDecorationDescriptorSet ) ? symbolData.decorations[SpvDecorationDescriptorSet]->GetParameterU32(2) : 0u;
-        DALI_LOG_STREAM( gVulkanFilter, Debug::General, "found layout: binding: " << binding << " ds: " << descriptorSet << ", type: " << U32(symbolData.descriptorType) );
-
-        auto& ds = (MapContains( vkDescriptorSetLayoutCreateInfos, descriptorSet ) ?
-                    vkDescriptorSetLayoutCreateInfos[descriptorSet] :
-                    (*vkDescriptorSetLayoutCreateInfos.emplace( descriptorSet, DescriptorSetLayoutAndBindingInfo{} ).first).second);
-
-
-        ds.bindings.emplace_back( vk::DescriptorSetLayoutBinding{}.setBinding( binding )
-                                                                  .setDescriptorCount( 1 )
-                                                                  .setDescriptorType( symbolData.descriptorType )
-                                                                  .setStageFlags( vk::ShaderStageFlagBits::eVertex | vk::ShaderStageFlagBits::eFragment ) );
-      }
-    }
-
-    // sort bindings and complete create info structures
-    for( auto&& ds : vkDescriptorSetLayoutCreateInfos )
-    {
-      std::sort(ds.second.bindings.begin(), ds.second.bindings.end(), []( auto& a, auto& b ){ return a.binding < b.binding; });
-      ds.second.createInfo.setBindingCount( U32(ds.second.bindings.size()) );
-      ds.second.createInfo.pBindings = ds.second.bindings.data();
-    }
-
-    return vkDescriptorSetLayoutCreateInfos;
-  }
-
-  bool Initialise()
-  {
-    // load opcodes
-    opCodes = std::move(LoadOpCodes(data));
-
-    // create results lookup array
-    opResults = std::move(CreateOpResults(opCodes));
-
-    // build reflection map
-    reflectionData = std::move(BuildReflection());
-
-    // build vulkan descriptor set layout infos
-    descriptorSetLayoutCreateInfoMap = std::move(GenerateVulkanDescriptorSetLayouts());
-
-    // generate additional reflection structures
-    uint32_t blockIndex = 0u;
-    for( auto&& symbol : reflectionData )
-    {
-      auto& symbolData = symbol.second;
-      auto binding = MapContains( symbolData.decorations, SpvDecorationBinding ) ? symbolData.decorations[SpvDecorationBinding]->GetParameterU32(2) : 0u;
-      auto descriptorSet = MapContains( symbolData.decorations, SpvDecorationDescriptorSet ) ? symbolData.decorations[SpvDecorationDescriptorSet]->GetParameterU32(2) : 0u;
-
-      if( symbolData.storage == SpvStorageClassUniform )
-      {
-        auto block = SPIRVUniformBlock{};
-        block.name = symbolData.name;
-        block.size = symbolData.structSize;
-        block.binding = binding;
-        block.descriptorSet = descriptorSet;
-
-        uint32_t location{ 0u };
-        for( auto&& member : symbolData.members )
-        {
-          auto blockMember = SPIRVUniformBlockMember{};
-          blockMember.name = member.name;
-          blockMember.location = location++;
-          blockMember.offset = MapContains( member.decorations, SpvDecorationOffset ) ? member.decorations[SpvDecorationOffset]->GetParameterU32(3) : 0u;
-          blockMember.blockIndex = blockIndex;
-          block.members.emplace_back( blockMember );
-        }
-        blockIndex++;
-        uniformBlockReflection.emplace_back( block );
-
-      }
-      else if( symbolData.storage == SpvStorageClassUniformConstant )
-      {
-        auto opaque = SPIRVUniformOpaque{};
-        opaque.name = symbolData.name;
-        opaque.binding = binding;
-        opaque.descriptorSet = descriptorSet;
-        opaque.type =  symbolData.descriptorType;
-        uniformOpaqueReflection.emplace_back( opaque );
-      }
-    }
-
-    return true;
-  }
-
-  /**
-   * Recognizes descriptor type VkDescriptorTypeStorageImage
-   * GLSL:
-   *      layout (set=m, binding=n, r32f) uniform image2D myStorageImage;
-   *
-   * SPIR-V:
-   *      %7 = OpTypeImage %6 2D 0 0 0 2 R32f
-   *      %8 = OpTypePointer UniformConstant %7
-   *      %9 = OpVariable %8 UniformConstant
-   * @param resource
-   * @return
-   */
-  bool TestStorageImageDescriptor( SPIRVOpCode& opcode )
-  {
-    auto opPointer = &FindByResultId( opcode.GetParameterU32(0) );
-    if( (opPointer && *opPointer == SpvOpTypePointer) )
-    {
-      auto& opTypeImage = GetReferencedOpCode( *opPointer, 2 );
-      if( opTypeImage == SpvOpTypeImage && opTypeImage.GetParameterU32( 6 ) == 2 )
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Recognizes descriptor type VkDescriptorTypeSampler
-   * GLSL:
-          layout (set=m, binding=n) uniform sampler mySampler;
-   *
-   * SPIR-V:
-          %3 = OpTypeFunction %2
-          %6 = OpTypeSampler
-          %7 = OpTypePointer UniformConstant %6
-          %8 = OpVariable %7 UniformConstant
-
-   * @param resource
-   * @return
-   */
-  bool TestSamplerDescriptor( SPIRVOpCode& opcode )
-  {
-    auto opPointer = &FindByResultId( opcode.GetParameterU32(0) );
-    if( (opPointer && *opPointer == SpvOpTypePointer) )
-    {
-      auto& opTypeSampler = GetReferencedOpCode( *opPointer, 2 );
-      if( opTypeSampler == SpvOpTypeSampler )
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Recognizes descriptor type VkDescriptorTypeSampledImage
-   * GLSL:
-   *      layout (set=m, binding=n) uniform texture2D mySampledImage;
-   * SPIR_V:
-          %6 = OpTypeFloat 32
-          %7 = OpTypeImage %6 2D 0 0 0 1 Unknown
-          %8 = OpTypePointer UniformConstant %7
-          %9 = OpVariable %8 UniformConstant
-   *
-   * @param resource
-   * @return
-   */
-  bool TestSampledImageDescriptor( SPIRVOpCode& opcode)
-  {
-    auto opPointer = &FindByResultId( opcode.GetParameterU32(0) );
-    if( (opPointer && *opPointer == SpvOpTypePointer) )
-    {
-      auto& opTypeImage = GetReferencedOpCode( *opPointer, 2 );
-      if( opTypeImage == SpvOpTypeImage && opTypeImage.GetParameterU32( 6 ) == 1 )
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Recognizes descriptor type VkDescriptorTypeCombinedImageSampler
-   * GLSL:
-   *      layout (set=m, binding=n) uniform sampler2D myCombinedImageSampler;
-   * SPIR-V:
-          %7 = OpTypeImage %6 2D 0 0 0 1 Unknown
-          %8 = OpTypeSampledImage %7
-          %9 = OpTypePointer UniformConstant %8
-         %10 = OpVariable %9 UniformConstant
-   * @param resource
-   * @return
-   */
-  bool TestCombinedImageSamplerDescriptor( SPIRVOpCode& opcode )
-  {
-    auto opPointer = &FindByResultId( opcode.GetParameterU32(0) );
-    if( (opPointer && *opPointer == SpvOpTypePointer) )
-    {
-      auto& opCode = GetReferencedOpCode( *opPointer, 2 );
-      if( opCode == SpvOpTypeSampledImage )
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Recognizes descriptor type VkDescriptorTypeUniformTexelBuffer
-   * GLSL:
-   *      layout (set=m, binding=n) uniform samplerBuffer myUniformTexelBuffer;
-   * SPIR-V:
-            %6 = OpTypeFloat 32
-            %7 = OpTypeImage %6 Buffer 0 0 0 1 Unknown
-            %8 = OpTypePointer UniformConstant %7
-            %9 = OpVariable %8 UniformConstant
-   * @param resource
-   * @return
-   */
-  bool TestUniformTexelBufferDescriptor( SPIRVOpCode& opcode  )
-  {
-    auto opPointer = &FindByResultId( opcode.GetParameterU32(0) );
-    if( (opPointer && *opPointer == SpvOpTypePointer) )
-    {
-      auto& opCode = GetReferencedOpCode( *opPointer, 2 );
-      if( opCode == SpvOpTypeImage && opCode.GetParameter<SpvDim>( 2 ) == SpvDimBuffer &&
-          opCode.GetParameterU32( 6 ) == 1 )
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Recognizes descriptor type VkDescriptorTypeStorageTexelBuffer
-   * GLSL:
-   *      layout (set=m, binding=n, r32f) uniform imageBuffer myStorageTexelBuffer;
-   * SPIR-V:
-          %7 = OpTypeImage %6 Buffer 0 0 0 2 R32f
-          %8 = OpTypePointer UniformConstant %7
-          %9 = OpVariable %8 UniformConstant
-   * @param resource
-   * @return
-   */
-  bool TestStorageTexelBufferDescriptor( SPIRVOpCode& opcode )
-  {
-    auto opPointer = &FindByResultId( opcode.GetParameterU32(0) );
-    if( (opPointer && *opPointer == SpvOpTypePointer) )
-    {
-      auto& opCode = GetReferencedOpCode( *opPointer, 2 );
-      if( opCode == SpvOpTypeImage && opCode.GetParameter<SpvDim>( 2 ) == SpvDimBuffer &&
-          opCode.GetParameterU32( 6 ) == 2 )
-      {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Recognizes descriptor type VkDescriptorTypeUniformBuffer
-   * GLSL:
-          layout (set=m, binding=n) uniform myUniformBuffer
-          {
-              vec4 myElement[32];
-          };
-   * SPIR-V:
-         %11 = OpTypeStruct %10
-         %12 = OpTypePointer Uniform %11
-         %13 = OpVariable %12 Uniform
-   * @todo pull data out of OpDecorate ( Block )
-   * @param resource
-   * @return
-   */
-  bool TestUniformBufferDescriptor( SPIRVOpCode& opcode )
-  {
-    auto opPointer = &FindByResultId( opcode.GetParameterU32(0) );
-    if( (opPointer && *opPointer == SpvOpTypePointer) && opPointer->GetParameter<SpvStorageClass>( 1 ) == SpvStorageClassUniform )
-    {
-      auto& opTypeStruct = GetReferencedOpCode( *opPointer, 2 );
-      if( opTypeStruct == SpvOpTypeStruct )
-      {
-        return CheckDecorationForOpId( opTypeStruct, SpvDecorationBlock );
-      }
-    }
-    return false;
-  }
-
-  bool TestStorageBufferDescriptor( SPIRVOpCode& opcode )
-  {
-    auto opPointer = FindByResultId( opcode );
-    if( (opPointer && *opPointer == SpvOpTypePointer) && opPointer->GetParameter<SpvStorageClass>( 1 ) == SpvStorageClassUniform )
-    {
-      auto& opTypeStruct = GetReferencedOpCode( *opPointer, 2 );
-      if( opTypeStruct == SpvOpTypeStruct )
-      {
-        return CheckDecorationForOpId( opTypeStruct, SpvDecorationBufferBlock );
-      }
-    }
-    return false;
-  }
-
-  std::vector<vk::DescriptorSetLayoutCreateInfo> GenerateDescriptorSetLayoutCreateInfo() const
-  {
-    auto retval = std::vector<vk::DescriptorSetLayoutCreateInfo>{};
-    for( auto& layout : descriptorSetLayoutCreateInfoMap )
-    {
-      retval.emplace_back( layout.second.createInfo );
-    }
-
-    return retval;
-  }
-
-  bool GetVertexInputAttributes( std::vector<SPIRVVertexInputAttribute>& out, bool canOverlap = false )
-  {
-    for( auto&& i : reflectionData )
-    {
-      if( i.second.storage == SpvStorageClassInput )
-      {
-        auto attr =  SPIRVVertexInputAttribute{};
-        attr.name = i.second.name;
-        attr.location = MapContains( i.second.decorations, SpvDecorationLocation ) ?
-                        i.second.decorations[SpvDecorationLocation]->GetParameterU32(2) : 0u;
-        attr.format = GetTypeInfo(
-          GetReferencedOpCode( GetReferencedOpCode( *i.second.op, 0 ), 2)
-        ).vkFormat;
-        out.emplace_back( attr );
-      }
-    }
-
-    return true;
-  }
-
-  /**
-   * Tests if the header is valid for SPIR-V
-   * @return
-   */
-  bool CheckHeader()
-  {
-    header = *reinterpret_cast<Header*>( data.data() );
-    return MAGIC_NUMBER == header.magicNumber;
-  }
-
-public:
-  std::vector<SPIRVOpCode>  opCodes;   // contains all opcodes
-  std::vector<SPIRVOpCode*> opResults; // links to the resulting opcode or nullptr if opcode doesn't return
-
-  std::unordered_map<uint32_t, SPIRVReflectionData> reflectionData;
-  std::unordered_map<uint32_t, DescriptorSetLayoutAndBindingInfo>      descriptorSetLayoutCreateInfoMap;
-
-  std::vector<SPIRVWord>    data;
-
-
-  std::vector<SPIRVUniformBlock>                                       uniformBlockReflection;
-  std::vector<SPIRVUniformOpaque>                                      uniformOpaqueReflection;
-  Header                                                               header;
-
-};
-
-/**************************************************************************************
- * SPIRVShader
- */
-
-SPIRVShader::SPIRVShader() = default;
-
-SPIRVShader::~SPIRVShader() = default;
-
-SPIRVShader::SPIRVShader( SPIRVShader&& shader ) noexcept = default;
-
-SPIRVShader::SPIRVShader( Impl& impl )
-{
-  mImpl.reset( &impl );
-}
-
-SPIRVShader::SPIRVShader( std::vector<SPIRVWord> code, vk::ShaderStageFlags stages )
-{
-  mImpl = std::make_unique<Impl>( code, stages );
-}
-
-std::vector<vk::DescriptorSetLayoutCreateInfo> SPIRVShader::GenerateDescriptorSetLayoutCreateInfo() const
-{
-  return mImpl->GenerateDescriptorSetLayoutCreateInfo();
-}
-
-uint32_t SPIRVShader::GetOpCodeCount() const
-{
-  return static_cast<uint32_t>( mImpl->opCodes.size() );
-}
-
-const SPIRVOpCode* SPIRVShader::GetOpCodeAt( uint32_t index ) const
-{
-  return &mImpl->opCodes[index];
-}
-
-const SPIRVOpCode* SPIRVShader::GetOpCodeForResultId( uint32_t resultId ) const
-{
-  return mImpl->opResults[resultId];
-}
-
-SPIRVWord SPIRVShader::GetOpCodeParameterWord( const SPIRVOpCode& opCode, uint32_t index ) const
-{
-  return GetOpCodeParameter<SPIRVWord>( opCode, index );
-}
-
-SpvOp SPIRVShader::GetOpCodeType( SPIRVOpCode& opCode )
-{
-  return SpvOpMax;
-}
-
-const uint32_t* SPIRVShader::GetOpCodeParameterPtr( const SPIRVOpCode& opCode, uint32_t index ) const
-{
-  return ( opCode.localData.start + index + 1 );
-}
-
-void SPIRVShader::GetVertexInputAttributes( std::vector<SPIRVVertexInputAttribute>& out ) const
-{
-  mImpl->GetVertexInputAttributes( out );
-}
-
-const std::vector<SPIRVUniformBlock>& SPIRVShader::GetUniformBlocks() const
-{
-  return mImpl->uniformBlockReflection;
-}
-
-const std::vector<SPIRVUniformOpaque>& SPIRVShader::GetOpaqueUniforms() const
-{
-  return mImpl->uniformOpaqueReflection;
-}
-
-bool SPIRVShader::FindUniformMemberByName( const std::string& uniformName, SPIRVUniformBlockMember& out ) const
-{
-  for( auto&& ubo : mImpl->uniformBlockReflection )
-  {
-    for( auto&& member : ubo.members )
-    {
-      if( member.name == uniformName )
-      {
-        out = member;
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-/**************************************************************************************
- * SPIRVUtils
- */
-
-/**
- * SPIRVUtils
- * @param data
- * @return
- */
-std::unique_ptr<SPIRVShader> SPIRVUtils::Parse( std::vector<SPIRVWord> data, vk::ShaderStageFlags stages )
-{
-  auto shader = std::unique_ptr<SPIRVShader>( new SPIRVShader( data, stages ) );
-  if( !shader->GetImplementation().Initialise() )
-  {
-    return nullptr;
-  }
-  return shader;
-}
-
-std::unique_ptr<SPIRVShader> SPIRVUtils::Parse( const SPIRVWord* data, size_t sizeInBytes, vk::ShaderStageFlags stages )
-{
-  std::vector<SPIRVWord> spirvCode{};
-  auto                   wordSize = sizeInBytes / sizeof( SPIRVWord );
-  spirvCode.resize( wordSize );
-  std::copy( data, data + wordSize, spirvCode.begin() );
-  return Parse( spirvCode, stages );
-}
-
-} // namespace SpirV
-
-} // namespace Vulkan
-
-} // namespace Graphics
-
-} // namespace Dali
diff --git a/dali/graphics/vulkan/spirv/vulkan-spirv.h b/dali/graphics/vulkan/spirv/vulkan-spirv.h
deleted file mode 100644 (file)
index 974e3b4..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef DALI_GRAPHICS_VULKAN_SPIRV_SPIRV_H
-#define DALI_GRAPHICS_VULKAN_SPIRV_SPIRV_H
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <cstdint>
-#include <vector>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-namespace SpirV
-{
-
-// include C header
-#include "spirv.h"
-
-using SPIRVWord = uint32_t;
-
-/**
- * Opcode storage, doesn't expose direct interface, must be used within
- * SPIRVShader context
- */
-struct SPIRVOpCode;
-
-struct SPIRVVertexInputAttribute
-{
-  uint32_t     location;
-  std::string  name;
-  vk::Format   format;
-};
-
-/**
- * Describes a member of a buffer/uniform block
- */
-struct SPIRVUniformBlockMember
-{
-  std::string               name;
-  uint32_t                  offset;
-  uint32_t                  location;
-  uint32_t                  blockIndex;
-};
-
-/**
- * Describes single uniform block
- */
-struct SPIRVUniformBlock
-{
-  std::string name;
-  uint32_t    descriptorSet;
-  uint32_t    binding;
-  uint32_t    size;
-  std::vector<SPIRVUniformBlockMember> members;
-};
-
-/**
- * Describes non-buffer opaque types
- */
-struct SPIRVUniformOpaque
-{
-  std::string         name;
-  uint32_t            descriptorSet;
-  uint32_t            binding;
-  vk::DescriptorType  type;
-};
-
-/**
- * Defines SPIRVShader program
- */
-class SPIRVShader
-{
-  friend class SPIRVUtils;
-
-public:
-
-  SPIRVShader( SPIRVShader&& shader ) noexcept;
-  SPIRVShader( const SPIRVShader& shader ) = delete;
-  ~SPIRVShader();
-
-  /**
-   * Generates descriptor set layout info from the supplied shader
-   * @note This function does not create the layout itself!
-   * @return create info structure
-   */
-  std::vector<vk::DescriptorSetLayoutCreateInfo> GenerateDescriptorSetLayoutCreateInfo() const;
-
-  /**
-   * Retrieves vertex input attributes ( names and locations ) from the shader
-   * @return fills the given vector of attributes
-   */
-  void GetVertexInputAttributes( std::vector<SPIRVVertexInputAttribute>& out ) const;
-
-  /**
-   * Retrieves all uniform block data
-   */
-  const std::vector<SPIRVUniformBlock>& GetUniformBlocks() const;
-
-  /**
-   *
-   * @return
-   */
-  const std::vector<SPIRVUniformOpaque>& GetOpaqueUniforms() const;
-
-  /**
-   * Looks for uniform by name and retrieves location within
-   * uniform buffer
-   * @note Uniform member name must be unique, otherwise first found is returned
-   * @param uniformName
-   * @return
-   */
-  bool FindUniformMemberByName( const std::string& uniformName, SPIRVUniformBlockMember& out ) const;
-
-  /**
-   * Returns total number of OpCodes
-   * @return
-   */
-  uint32_t GetOpCodeCount() const;
-
-  /**
-   * Returns OpCode at specified index
-   * @param index
-   * @return
-   */
-  const SPIRVOpCode* GetOpCodeAt( uint32_t index ) const;
-
-  /**
-   * Returns OpCode associated with specified result id
-   * @param resultId
-   * @return
-   */
-  const SPIRVOpCode* GetOpCodeForResultId( uint32_t resultId ) const;
-
-  /**
-   * SPIRVOpCode API
-   */
-
-  /**
-   * Helper function that allows to convert SPIRVWords into requested type
-   * @tparam T
-   * @param index
-   * @return
-   */
-  template<class T>
-  T GetOpCodeParameter( const SPIRVOpCode& opCode, uint32_t index ) const
-  {
-    return *reinterpret_cast<const T*>( GetOpCodeParameterPtr( opCode, index ) );
-  }
-
-  /**
-   * Returns SPIRV parameter as 32bit SPIRVWord
-   * @param index
-   * @return
-   */
-  SPIRVWord GetOpCodeParameterWord( const SPIRVOpCode& opCode,uint32_t index ) const;
-
-  /**
-   *
-   * @param opCode
-   * @return
-   */
-  SpvOp GetOpCodeType( SPIRVOpCode& opCode );
-
-private:
-
-  /**
-   * Accesses parameter via pointer
-   * @param index
-   * @return
-   */
-  const uint32_t* GetOpCodeParameterPtr( const SPIRVOpCode& opCode, uint32_t index ) const;
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-
-  explicit SPIRVShader( Impl& impl );
-
-  SPIRVShader();
-
-  /**
-   * Constructor that should be called only from SPIRVUtils
-   * @param code
-   */
-  explicit SPIRVShader( std::vector<SPIRVWord> code, vk::ShaderStageFlags stages );
-
-public:
-  /**
-   * Accessor to the implementation object
-   * @return
-   */
-  Impl& GetImplementation() const;
-};
-
-
-
-/**
- * Simple set
- */
-class SPIRVUtils
-{
-public:
-
-  /**
-   * Creates SPIRVShader instance
-   * @param data
-   * @return
-   */
-  static std::unique_ptr<SPIRVShader> Parse( std::vector<SPIRVWord> data, vk::ShaderStageFlags stages );
-
-  static std::unique_ptr<SPIRVShader> Parse( const SPIRVWord* data, size_t sizeInBytes, vk::ShaderStageFlags stages );
-
-private:
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-}
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_SPIRV_SPIRV_H
diff --git a/dali/graphics/vulkan/tests/texture-test.cpp b/dali/graphics/vulkan/tests/texture-test.cpp
deleted file mode 100644 (file)
index 23dbfce..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-#include <string>
-#include <vector>
-#include <vulkan/vulkan.hpp>
-
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-fence.h>
-#include <dali/graphics/vulkan/vulkan-queue.h>
-
-#include <dali/graphics/vulkan/vulkan-graphics-texture.h>
-
-
-namespace VulkanTest
-{
-using namespace Dali::Graphics::Vulkan;
-
-struct Pixel
-{
-  Pixel() = default;
-
-  explicit Pixel( uint32_t _color )
-    : color(_color)
-  {}
-
-  explicit Pixel( uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a)
-  {
-    r = _r;
-    g = _g;
-    b = _b;
-    a = _a;
-  }
-
-  union
-  {
-    uint32_t color;
-    struct
-    {
-      uint8_t r, g, b, a;
-    };
-  };
-};
-
-struct Pixmap
-{
-  explicit Pixmap( std::vector<Pixel> _data, uint32_t _width, uint32_t _height ) :
-  data(_data), width(_width), height(_height), bytesPerPixel(4), pixelFormat( vk::Format::eR8G8B8A8Unorm )
-  {
-  }
-  std::vector<Pixel> data;
-  uint32_t          width;
-  uint32_t          height;
-  uint32_t          bytesPerPixel;
-  vk::Format        pixelFormat;
-};
-
-struct Texture
-{
-  Texture( Graphics& graphics, Pixmap pixmap ) : mGraphics( graphics ), mPixmap( pixmap )
-  {
-  }
-
-  bool Initialise()
-  {
-    // create image
-    auto imageCreateInfo = vk::ImageCreateInfo{}
-            .setFormat( mPixmap.pixelFormat )
-            .setInitialLayout( vk::ImageLayout::ePreinitialized )
-            .setSamples( vk::SampleCountFlagBits::e1 )
-            .setSharingMode( vk::SharingMode::eExclusive )
-            .setUsage( vk::ImageUsageFlagBits::eSampled | vk::ImageUsageFlagBits::eTransferDst )
-            .setExtent( {mPixmap.width, mPixmap.height, 1} )
-            .setArrayLayers( 1 )
-            .setImageType( vk::ImageType::e2D )
-            .setTiling( vk::ImageTiling::eOptimal )
-            .setMipLevels( 1 );
-
-    mImage = mGraphics.CreateImage( imageCreateInfo );
-
-    auto& allocator = mGraphics
-            .GetDeviceMemoryManager()
-            .GetDefaultAllocator();
-
-    mGraphics.BindImageMemory( mImage, allocator.Allocate( mImage, vk::MemoryPropertyFlagBits::eDeviceLocal ), 0 );
-
-    // create transient buffer to copy data
-    auto size = mPixmap.data.size()*sizeof(mPixmap.data[0]);
-    auto buffer = Buffer::New( mGraphics,
-                               vk::BufferCreateInfo{}
-                                 .setUsage( vk::BufferUsageFlagBits::eTransferSrc )
-                                 .setSharingMode( vk::SharingMode::eExclusive )
-                                 .setSize( size ) );
-
-    buffer->BindMemory( allocator.Allocate( buffer, vk::MemoryPropertyFlagBits::eHostVisible ) );
-
-    // copy pixels to the buffer
-    auto ptr = buffer->GetMemoryHandle()->MapTyped<Pixel>();
-    std::copy( mPixmap.data.begin(), mPixmap.data.end(), ptr );
-    buffer->GetMemoryHandle()->Unmap();
-
-    // record copy and layout change
-    auto copy = vk::BufferImageCopy{}.setImageExtent( { mPixmap.width, mPixmap.height, 1 } )
-                         .setBufferImageHeight( mPixmap.height )
-                         .setBufferOffset( 0 )
-                         .setBufferRowLength( mPixmap.width )
-                         .setImageOffset( { 0, 0, 0 } )
-                         .setImageSubresource(
-                           vk::ImageSubresourceLayers{}
-                           .setMipLevel( 0 )
-                           .setAspectMask( vk::ImageAspectFlagBits::eColor )
-                           .setLayerCount( 1 )
-                           .setBaseArrayLayer( 0 )
-                         );
-    mCommandPool = CommandPool::New( mGraphics );
-    mCommandBuffer = mCommandPool->NewCommandBuffer( true );
-    mCommandBuffer->Begin( vk::CommandBufferUsageFlagBits::eOneTimeSubmit);
-
-    // change layout
-    auto barrier = std::vector<vk::ImageMemoryBarrier>{
-      mCommandBuffer->ImageLayoutTransitionBarrier( mImage, vk::ImageLayout::ePreinitialized, vk::ImageLayout::eTransferDstOptimal, vk::ImageAspectFlagBits::eColor )
-    };
-
-    // change layout to prepare image to transfer data
-    mCommandBuffer->PipelineBarrier( vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eTransfer,
-                                     {}, {}, {}, { barrier } );
-
-    // copy image
-    mCommandBuffer->CopyBufferToImage( buffer, mImage, vk::ImageLayout::eTransferDstOptimal, { copy } );
-
-    // change layout to shader read-only optimal
-    mCommandBuffer->PipelineBarrier( vk::PipelineStageFlagBits::eVertexShader, vk::PipelineStageFlagBits::eVertexShader,
-                                     {}, {}, {}, {
-                                       mCommandBuffer->ImageLayoutTransitionBarrier( mImage, vk::ImageLayout::eTransferDstOptimal, vk::ImageLayout::eShaderReadOnlyOptimal, vk::ImageAspectFlagBits::eColor )
-                                     } );
-
-    mCommandBuffer->End();
-
-    // submit and wait till image is uploaded so temporary buffer can be destroyed safely
-    auto fence = mGraphics.CreateFence({});
-    mGraphics.GetGraphicsQueue(0u).Submit( mCommandBuffer, fence );
-    mGraphics.WaitForFence(fence);
-
-  }
-
-  Graphics&        mGraphics;
-  RefCountedImage         mImage;
-  RefCountedImageView     mImageView;
-
-  RefCountedCommandPool    mCommandPool;
-  RefCountedCommandBuffer  mCommandBuffer; // primary buffer, executed independent
-
-  // layouts
-  vk::ImageLayout mOldLayout;
-  vk::ImageLayout mNewLayout;
-
-  // Command pool
-
-
-  Pixmap mPixmap;
-};
-
-/**
- * Generates a random pixmap
- * @param width
- * @param height
- * @return
- */
-Pixmap GenerateTexture32BPPRGBA( uint32_t width, uint32_t height )
-{
-  std::vector<Pixel> data;
-  data.resize( width * height );
-
-  const Pixel WHITE     { 0xffffffff };
-  const Pixel BLACK     { 0x000000ff };
-  const Pixel RED       { 0xff0000ff };
-  const Pixel GREEN     { 0x00ff00ff };
-  const Pixel BLUE      { 0x0000ffff };
-
-  const Pixel COLORS[] = { WHITE, BLACK, RED, GREEN, BLUE };
-  const auto COLORS_COUNT = 5u;
-
-  for( auto y = 0u; y < height; ++y )
-  {
-    for( auto x = 0u; x < width; ++x )
-    {
-      data[ x + width * y ] = COLORS[ ((x*x)+(y*y)) % COLORS_COUNT];
-    }
-  }
-
-  return Pixmap{ data, width, height };
-}
-
-Pixmap LoadResourceImage( void* data, uint32_t width, uint32_t height, uint32_t bytesPerPixel )
-{
-  // todo: create Pixmap object
-}
-
-Texture CreateTexture( Graphics& graphics, Pixmap pixmap )
-{
-  return Texture( graphics, pixmap );
-}
-
-int TextureTestMain( Dali::Graphics::Vulkan::Graphics& graphics )
-{
-  auto pixmap = GenerateTexture32BPPRGBA( 1024, 1024 );
-  auto texture = Dali::Graphics::Vulkan::Texture::New( graphics, 1024, 1024, vk::Format::eR8G8B8A8Unorm);
-
-  return 0;
-}
-
-} // namespace VulkanTest
\ No newline at end of file
diff --git a/dali/graphics/vulkan/vulkan-buffer.cpp b/dali/graphics/vulkan/vulkan-buffer.cpp
deleted file mode 100644 (file)
index acb1d9b..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-#include <utility>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-RefCountedBuffer Buffer::New( Graphics& graphics, vk::BufferCreateInfo info )
-{
-  return RefCountedBuffer(new Buffer(graphics, info));
-}
-
-const Buffer& Buffer::ConstRef()
-{
-  return *this;
-}
-
-Buffer& Buffer::Ref()
-{
-  return *this;
-}
-
-Buffer::Buffer( Graphics& graphics, const vk::BufferCreateInfo& createInfo )
-        : VkManaged(),
-          mGraphics(&graphics),
-          mDeviceMemory(nullptr),
-          mInfo(createInfo)
-{
-}
-
-Buffer::~Buffer() = default;
-
-vk::BufferUsageFlags Buffer::GetUsage() const
-{
-  return mInfo.usage;
-}
-
-const RefCountedGpuMemoryBlock& Buffer::GetMemoryHandle() const
-{
-  return mDeviceMemory;
-}
-
-uint32_t Buffer::GetSize() const
-{
-  return static_cast<uint32_t>(mInfo.size);
-}
-
-vk::Buffer Buffer::GetVkHandle() const
-{
-  return mBuffer;
-}
-
-void Buffer::BindMemory( const RefCountedGpuMemoryBlock& handle )
-{
-  assert(mBuffer && "Buffer not initialised!");
-  VkAssert(mGraphics->GetDevice().bindBufferMemory(mBuffer, (*handle), 0));
-  mDeviceMemory = handle;
-}
-
-bool Buffer::OnDestroy()
-{
-  if( !mGraphics->IsShuttingDown() )
-  {
-    mGraphics->RemoveBuffer( *this );
-  }
-
-  auto device = mGraphics->GetDevice();
-  auto buffer = mBuffer;
-  auto allocator = &mGraphics->GetAllocator();
-
-  mGraphics->DiscardResource( [device, buffer, allocator]() {
-#ifndef NDEBUG
-    printf("Invoking BUFFER deleter function\n");
-#endif
-    device.destroyBuffer(buffer, allocator);
-  } );
-
-  return false;
-}
-
-Buffer::operator vk::Buffer*()
-{
-  return &mBuffer;
-}
-
-
-}
-
-}
-
-}
\ No newline at end of file
diff --git a/dali/graphics/vulkan/vulkan-buffer.h b/dali/graphics/vulkan/vulkan-buffer.h
deleted file mode 100644 (file)
index 0ba6ed7..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_BUFFER_H
-#define DALI_GRAPHICS_VULKAN_BUFFER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Graphics;
-class GpuMemoryBlock;
-
-class Buffer : public VkManaged
-{
-public:
-
-  /**
-   * Destructor
-   */
-  ~Buffer() override;
-
-  /**
-   *
-   * @param graphics
-   * @param info
-   * @return
-   */
-  static RefCountedBuffer New( Graphics& graphics, vk::BufferCreateInfo info );
-
-  const Buffer& ConstRef();
-
-  Buffer& Ref();
-
-  /**
-   * Returns buffer usage flags
-   * @return
-   */
-  vk::BufferUsageFlags GetUsage() const;
-
-  /**
-   * Returns buffer size in bytes
-   * @return
-   */
-  uint32_t GetSize() const;
-
-  /**
-   * Returns Vulkan VkBuffer object associated with this buffer
-   * @return
-   */
-  vk::Buffer GetVkHandle() const;
-
-  /**
-   * Returns handle to the allocated memory
-   * @return
-   */
-  const RefCountedGpuMemoryBlock& GetMemoryHandle() const;
-
-  /**
-   * Binds buffer memory
-   * @param handle
-   */
-  void BindMemory( const RefCountedGpuMemoryBlock& handle );
-
-  /**
-   *
-   * @return
-   */
-  bool OnDestroy() override;
-
-  Buffer( const Buffer& ) = delete;
-  Buffer& operator =( const Buffer& ) = delete;
-
-  operator vk::Buffer*();
-
-private:
-
-  /**
-   * Creates new VkBuffer with given specification, it doesn't
-   * bind the memory.
-   * @param graphics
-   * @param createInfo
-   */
-  Buffer( Graphics& graphics, const vk::BufferCreateInfo& createInfo );
-
-private:
-  Graphics*                             mGraphics;
-  RefCountedGpuMemoryBlock              mDeviceMemory;
-  vk::BufferCreateInfo                  mInfo;
-  vk::Buffer                            mBuffer;
-};
-
-
-}
-}
-}
-
-#endif //VULKAN_PROJECT_BUFFER_H
diff --git a/dali/graphics/vulkan/vulkan-command-buffer.cpp b/dali/graphics/vulkan/vulkan-command-buffer.cpp
deleted file mode 100644 (file)
index 1c41026..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-descriptor-set.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-fence.h>
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics/vulkan/vulkan-surface.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-/**
- *
- * Class: CommandBuffer
- *
- */
-
-CommandBuffer::CommandBuffer( CommandPool& commandPool,
-                              uint32_t poolIndex,
-                              const vk::CommandBufferAllocateInfo& allocateInfo,
-                              vk::CommandBuffer vulkanHandle )
-        : mOwnerCommandPool( &commandPool ),
-          mGraphics( &mOwnerCommandPool->GetGraphics()),
-          mPoolAllocationIndex( poolIndex ),
-          mAllocateInfo( allocateInfo ),
-          mCommandBuffer( vulkanHandle )
-{
-}
-
-CommandBuffer::~CommandBuffer() = default;
-
-/** Begin recording */
-void CommandBuffer::Begin( vk::CommandBufferUsageFlags usageFlags,
-                           vk::CommandBufferInheritanceInfo* inheritanceInfo )
-{
-  assert( !mRecording && "CommandBuffer already is in the recording state" );
-  auto info = vk::CommandBufferBeginInfo{};
-  info.setPInheritanceInfo( inheritanceInfo );
-  info.setFlags( usageFlags );
-
-  // set the inheritance option
-  auto inheritance = vk::CommandBufferInheritanceInfo{}.setSubpass( 0 );
-
-  if( mAllocateInfo.level == vk::CommandBufferLevel::eSecondary )
-  {
-    // Render pass is obtained from the default framebuffer
-    // it's a legacy but little nicer
-    auto swapchain = mGraphics->GetSwapchainForFBID( 0u );
-    inheritance.setRenderPass( swapchain->GetCurrentFramebuffer()->GetRenderPassVkHandle());
-    info.setPInheritanceInfo( &inheritance );
-  }
-
-  VkAssert( mCommandBuffer.begin( info ));
-
-  mRecording = true;
-}
-
-/** Finish recording */
-void CommandBuffer::End()
-{
-  assert( mRecording && "CommandBuffer is not in the recording state!" );
-  VkAssert( mCommandBuffer.end());
-  mRecording = false;
-}
-
-/** Reset command buffer */
-void CommandBuffer::Reset()
-{
-  assert( !mRecording && "Can't reset command buffer during recording!" );
-  assert( mCommandBuffer && "Invalid command buffer!" );
-  mCommandBuffer.reset( vk::CommandBufferResetFlagBits::eReleaseResources );
-}
-
-/** Free command buffer */
-void CommandBuffer::Free()
-{
-  assert( mCommandBuffer && "Invalid command buffer!" );
-  mGraphics->GetDevice().freeCommandBuffers( mOwnerCommandPool->GetVkHandle(), mCommandBuffer );
-}
-
-vk::CommandBuffer CommandBuffer::GetVkHandle() const
-{
-  return mCommandBuffer;
-}
-
-bool CommandBuffer::IsPrimary() const
-{
-  return mAllocateInfo.level == vk::CommandBufferLevel::ePrimary;
-}
-
-void CommandBuffer::BindVertexBuffers( uint32_t firstBinding,
-                                       uint32_t bindingCount,
-                                       std::vector< Handle< Buffer>> buffers,
-                                       const vk::DeviceSize* pOffsets )
-{
-  // update list of used resources and create an array of VkBuffers
-  std::vector< vk::Buffer > vkBuffers;
-  vkBuffers.reserve( buffers.size());
-  for( auto&& buffer : buffers )
-  {
-    vkBuffers.emplace_back( buffer->GetVkHandle());
-  }
-
-  mCommandBuffer.bindVertexBuffers( firstBinding, bindingCount, vkBuffers.data(), pOffsets );
-}
-
-void CommandBuffer::BindIndexBuffer( RefCountedBuffer buffer, uint32_t offset, vk::IndexType indexType )
-{
-  // validate
-  assert(( buffer->GetUsage() & vk::BufferUsageFlagBits::eIndexBuffer ) &&
-         "The buffer used as index buffer has wrong usage flags!" );
-
-  mCommandBuffer.bindIndexBuffer( buffer->GetVkHandle(), offset, indexType );
-}
-
-void CommandBuffer::BindVertexBuffer( uint32_t binding,
-                                      const RefCountedBuffer& buffer,
-                                      vk::DeviceSize offset )
-{
-  BindVertexBuffers( binding, 1, std::vector< Handle< Buffer>>( { buffer } ), &offset );
-}
-
-void CommandBuffer::BindGraphicsPipeline( Handle< Pipeline > pipeline )
-{
-  mCurrentPipeline = pipeline;
-  mCommandBuffer.bindPipeline( vk::PipelineBindPoint::eGraphics, pipeline->GetVkHandle());
-}
-
-void CommandBuffer::BindDescriptorSets( std::vector< RefCountedDescriptorSet > descriptorSets,
-                                        RefCountedPipeline pipeline,
-                                        uint32_t firstSet,
-                                        uint32_t descriptorSetCount )
-{
-  // update resources
-  std::vector< vk::DescriptorSet > vkSets;
-  vkSets.reserve( descriptorSets.size());
-  for( auto&& set : descriptorSets )
-  {
-    vkSets.emplace_back( set->GetVkDescriptorSet());
-  }
-
-  // TODO: support dynamic offsets
-  mCommandBuffer.bindDescriptorSets( vk::PipelineBindPoint::eGraphics,
-                                     pipeline->GetVkPipelineLayout(),
-                                     firstSet,
-                                     descriptorSetCount,
-                                     vkSets.data(),
-                                     0,
-                                     nullptr );
-}
-
-//TODO: Fix this. It looks wrong.
-void CommandBuffer::BindDescriptorSets( std::vector< RefCountedDescriptorSet > descriptorSets,
-                                        uint32_t firstSet )
-{
-  BindDescriptorSets(
-          descriptorSets, mCurrentPipeline, 0, static_cast<uint32_t>( descriptorSets.size()));
-}
-
-void CommandBuffer::Draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance )
-{
-  mCommandBuffer.draw( vertexCount, instanceCount, firstVertex, firstInstance );
-}
-
-void CommandBuffer::DrawIndexed( uint32_t indexCount,
-                                 uint32_t instanceCount,
-                                 uint32_t firstIndex,
-                                 uint32_t vertexOffset,
-                                 uint32_t firstInstance )
-{
-  mCommandBuffer.drawIndexed( indexCount,
-                              instanceCount,
-                              firstIndex,
-                              static_cast<int32_t>( vertexOffset ),
-                              firstInstance );
-}
-
-void CommandBuffer::BeginRenderPass( FBID framebufferId, uint32_t bufferIndex )
-{
-  auto swapchain = mGraphics->GetSwapchainForFBID( 0u );
-  auto surface = mGraphics->GetSurface( 0u );
-  auto frameBuffer = swapchain->GetCurrentFramebuffer();
-  auto renderPass = frameBuffer->GetRenderPassVkHandle();
-  auto clearValues = frameBuffer->GetDefaultClearValues();
-
-  auto info = vk::RenderPassBeginInfo{};
-  info.setFramebuffer( frameBuffer->GetVkHandle());
-  info.setRenderPass( renderPass );
-  info.setClearValueCount( U32( clearValues.size()));
-  info.setPClearValues( clearValues.data());
-  info.setRenderArea( vk::Rect2D( { 0, 0 }, surface->GetSize()));
-
-  mCurrentRenderPass = renderPass;
-  mCommandBuffer.beginRenderPass( info, vk::SubpassContents::eInline );
-}
-
-void CommandBuffer::BeginRenderPass( vk::RenderPassBeginInfo renderPassBeginInfo, vk::SubpassContents subpassContents )
-{
-  mCurrentRenderPass = renderPassBeginInfo.renderPass;
-  mCommandBuffer.beginRenderPass( renderPassBeginInfo, subpassContents );
-}
-
-void CommandBuffer::EndRenderPass()
-{
-  mCurrentRenderPass = nullptr;
-  mCommandBuffer.endRenderPass();
-}
-
-void CommandBuffer::ExecuteCommands( const std::vector<Dali::Graphics::Vulkan::Handle<CommandBuffer>>& commandBuffers, uint32_t offset, uint32_t count )
-{
-  assert( mAllocateInfo.level == vk::CommandBufferLevel::ePrimary
-          && "Cannot record command: ExecuteCommands\tReason: The command buffer recording this command is not primary" );
-
-  auto vkBuffers = std::vector< vk::CommandBuffer >{};
-  vkBuffers.reserve( commandBuffers.size());
-
-  auto iter = commandBuffers.begin();
-  std::advance(iter, offset);
-
-  for( uint32_t i = 0; i < count; ++i )
-  {
-    const auto& buf = *iter;
-    assert(buf->mAllocateInfo.level == vk::CommandBufferLevel::eSecondary &&
-           "Cannot record command: Execute Commands\tReason: A command buffer provided for execution is not secondary" );
-
-    vkBuffers.emplace_back( buf->GetVkHandle());
-    ++iter;
-  }
-
-  mCommandBuffer.executeCommands( vkBuffers );
-}
-
-void CommandBuffer::ExecuteCommands( const std::vector< Dali::Graphics::Vulkan::Handle< CommandBuffer>>& commandBuffers )
-{
-  ExecuteCommands( commandBuffers, 0, uint32_t(commandBuffers.size()) );
-}
-
-void CommandBuffer::PipelineBarrier( vk::PipelineStageFlags srcStageMask,
-                                     vk::PipelineStageFlags dstStageMask,
-                                     vk::DependencyFlags dependencyFlags,
-                                     std::vector< vk::MemoryBarrier > memoryBarriers,
-                                     std::vector< vk::BufferMemoryBarrier > bufferBarriers,
-                                     std::vector< vk::ImageMemoryBarrier > imageBarriers )
-{
-  mCommandBuffer.pipelineBarrier( srcStageMask,
-                                  dstStageMask,
-                                  dependencyFlags,
-                                  memoryBarriers,
-                                  bufferBarriers,
-                                  imageBarriers );
-}
-
-void CommandBuffer::CopyBufferToImage( RefCountedBuffer srcBuffer,
-                                       RefCountedImage dstImage,
-                                       vk::ImageLayout dstLayout,
-                                       std::vector< vk::BufferImageCopy > regions )
-{
-  mCommandBuffer.copyBufferToImage( srcBuffer->GetVkHandle(),
-                                    dstImage->GetVkHandle(),
-                                    dstLayout,
-                                    regions );
-}
-
-vk::ImageMemoryBarrier CommandBuffer::ImageLayoutTransitionBarrier( RefCountedImage image,
-                                                                    vk::AccessFlags srcAccessMask,
-                                                                    vk::AccessFlags dstAccessMask,
-                                                                    vk::ImageLayout oldLayout,
-                                                                    vk::ImageLayout newLayout,
-                                                                    vk::ImageAspectFlags aspectMask ) const
-{
-  return vk::ImageMemoryBarrier{}
-          .setNewLayout( newLayout )
-          .setImage( image->GetVkHandle())
-          .setOldLayout( oldLayout )
-          .setSrcAccessMask( srcAccessMask )
-          .setDstAccessMask( dstAccessMask )
-          .setSubresourceRange( vk::ImageSubresourceRange{ aspectMask,
-                                                           0,
-                                                           image->GetMipLevelCount(),
-                                                           0,
-                                                           image->GetLayerCount() } );
-
-}
-
-vk::ImageMemoryBarrier CommandBuffer::ImageLayoutTransitionBarrier( RefCountedImage image,
-                                                                    vk::ImageLayout oldLayout,
-                                                                    vk::ImageLayout newLayout,
-                                                                    vk::ImageAspectFlags aspectMask ) const
-{
-
-  vk::AccessFlags srcAccessMask, dstAccessMask;
-  vk::PipelineStageFlags srcStageMask, dstStageMask;
-
-  switch( oldLayout )
-  {
-    case vk::ImageLayout::ePreinitialized:
-    case vk::ImageLayout::eUndefined:
-    {
-      srcAccessMask = {};
-      srcStageMask = vk::PipelineStageFlagBits::eTopOfPipe;
-      break;
-    }
-    case vk::ImageLayout::ePresentSrcKHR:
-    {
-      srcAccessMask = vk::AccessFlagBits::eColorAttachmentRead;
-      srcStageMask = vk::PipelineStageFlagBits::eColorAttachmentOutput;
-      break;
-    }
-    case vk::ImageLayout::eTransferSrcOptimal:
-    {
-      srcAccessMask = vk::AccessFlagBits::eMemoryRead;
-      srcStageMask = vk::PipelineStageFlagBits::eTransfer;
-      break;
-    }
-    case vk::ImageLayout::eTransferDstOptimal:
-    {
-      srcAccessMask = vk::AccessFlagBits::eMemoryWrite;
-      srcStageMask = vk::PipelineStageFlagBits::eTransfer;
-      break;
-    }
-    case vk::ImageLayout::eGeneral:
-    case vk::ImageLayout::eColorAttachmentOptimal:
-    case vk::ImageLayout::eDepthStencilAttachmentOptimal:
-    case vk::ImageLayout::eDepthStencilReadOnlyOptimal:
-    case vk::ImageLayout::eShaderReadOnlyOptimal:
-    case vk::ImageLayout::eSharedPresentKHR:
-    {
-      break;
-    }
-  }
-
-  switch( newLayout )
-  {
-    case vk::ImageLayout::ePresentSrcKHR:
-    {
-      dstAccessMask = vk::AccessFlagBits::eColorAttachmentWrite;
-      dstStageMask = vk::PipelineStageFlagBits::eBottomOfPipe;
-      break;
-    }
-    case vk::ImageLayout::eTransferSrcOptimal:
-    {
-      dstAccessMask = vk::AccessFlagBits::eMemoryRead;
-      dstStageMask = vk::PipelineStageFlagBits::eTransfer;
-      break;
-    }
-    case vk::ImageLayout::eTransferDstOptimal:
-    {
-      dstAccessMask = vk::AccessFlagBits::eMemoryWrite;
-      dstStageMask = vk::PipelineStageFlagBits::eTransfer;
-      break;
-    }
-    case vk::ImageLayout::eShaderReadOnlyOptimal:
-    {
-      dstAccessMask = vk::AccessFlagBits::eMemoryRead;
-      dstStageMask = vk::PipelineStageFlagBits::eVertexShader;
-      break;
-    }
-    case vk::ImageLayout::eUndefined:
-    case vk::ImageLayout::eGeneral:
-    case vk::ImageLayout::eColorAttachmentOptimal:
-    case vk::ImageLayout::eDepthStencilAttachmentOptimal:
-    case vk::ImageLayout::eDepthStencilReadOnlyOptimal:
-    case vk::ImageLayout::ePreinitialized:
-    case vk::ImageLayout::eSharedPresentKHR:
-    {
-      break;
-    }
-  }
-
-  return vk::ImageMemoryBarrier{}
-          .setNewLayout( newLayout )
-          .setImage( image->GetVkHandle())
-          .setOldLayout( oldLayout )
-          .setSrcAccessMask( srcAccessMask )
-          .setDstAccessMask( dstAccessMask )
-          .setSubresourceRange( vk::ImageSubresourceRange{ aspectMask,
-                                                           0,
-                                                           image->GetMipLevelCount(),
-                                                           0,
-                                                           image->GetLayerCount() } );
-}
-
-uint32_t CommandBuffer::GetPoolAllocationIndex() const
-{
-  return mPoolAllocationIndex;
-}
-
-bool CommandBuffer::OnDestroy()
-{
-  mOwnerCommandPool->ReleaseCommandBuffer( *this );
-  return true;
-}
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-command-buffer.h b/dali/graphics/vulkan/vulkan-command-buffer.h
deleted file mode 100644 (file)
index e7554cf..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_COMMAND_BUFFER_H
-#define DALI_GRAPHICS_VULKAN_COMMAND_BUFFER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-class Image;
-class Graphics;
-class Buffer;
-class Pipeline;
-class DescriptorSet;
-
-class CommandBuffer : public VkManaged
-{
-  friend class CommandPool;
-  friend struct CommandBufferPool;
-
-public:
-
-  CommandBuffer() = delete;
-
-  ~CommandBuffer() override;
-
-  /** Begin recording */
-  void Begin(vk::CommandBufferUsageFlags       usageFlags      = vk::CommandBufferUsageFlags{},
-             vk::CommandBufferInheritanceInfo* inheritanceInfo = nullptr);
-
-  /** Finish recording */
-  void End();
-
-  /** Reset command buffer */
-  void Reset();
-
-  /** Free command buffer */
-  void Free();
-
-  /** Returns Vulkan object associated with the buffer */
-  vk::CommandBuffer GetVkHandle() const;
-
-  /**
-   * Tests if the command buffer is primary
-   * @return Returns true if the command buffer is primary
-   */
-  bool IsPrimary() const;
-
-  /**
-   * Binds an array of vertex buffers
-   * @param firstBinding
-   * @param bindingCount
-   * @param buffers
-   * @param pOffsets
-   */
-  void BindVertexBuffers(uint32_t firstBinding, uint32_t bindingCount,
-                         std::vector<Dali::Graphics::Vulkan::Handle<Buffer>> buffers,
-                         const vk::DeviceSize *pOffsets);
-
-  /**
-   * Binds an index buffer
-   * @param buffer
-   * @param offset
-   * @param indexType
-   */
-  void BindIndexBuffer( RefCountedBuffer buffer, uint32_t offset, vk::IndexType indexType);
-
-  /**
-   * Binds single vertex buffer
-   * @param binding
-   * @param buffer
-   * @param offset
-   */
-  void BindVertexBuffer(uint32_t binding, const Dali::Graphics::Vulkan::Handle<Buffer>& buffer, vk::DeviceSize offset );
-
-  /**
-   * Binds graphics pipeline
-   * @param pipeline
-   */
-  void BindGraphicsPipeline( Handle<Pipeline> pipeline );
-
-  /**
-   *
-   * @param descriptorSets
-   * @param pipeline
-   * @param firstSet
-   * @param descriptorSetCount
-   */
-  void BindDescriptorSets( std::vector<Dali::Graphics::Vulkan::Handle<DescriptorSet>> descriptorSets,
-                           Handle<Pipeline> pipeline, uint32_t firstSet, uint32_t descriptorSetCount );
-
-  /**
-   * Binds descriptor sets to the most recently bound Pipeline
-   * @param descriptorSets
-   * @param firstSet
-   */
-  void BindDescriptorSets( std::vector<Dali::Graphics::Vulkan::Handle<DescriptorSet>> descriptorSets, uint32_t firstSet );
-
-  /**
-   * Issues draw command
-   * @param vertexCount
-   * @param instanceCount
-   * @param firstVertex
-   * @param firstInstance
-   */
-  void Draw( uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance );
-
-  /**
-   * Issues draw indexed primiteve command
-   * @param indexCount
-   * @param instanceCount
-   * @param firstIndex
-   * @param vertexOffset
-   * @param firstInstance
-   */
-  void DrawIndexed( uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, uint32_t vertexOffset, uint32_t firstInstance );
-
-  /**
-   * Begins render pass using VkRenderPass and VkFramebuffer associated with FBID
-   * @todo should be replaced with proper implementation and use the framebuffer
-   * @param framebufferId
-   * @param bufferIndex
-   */
-  void BeginRenderPass( FBID framebufferId, uint32_t bufferIndex );
-
-  /**
-   * Allows to issue custom VkRenderPassBeginInfo structure
-   * @param renderPassBeginInfo
-   * @param subpassContents
-   */
-  void BeginRenderPass( vk::RenderPassBeginInfo renderPassBeginInfo, vk::SubpassContents subpassContents );
-
-  /**
-   * Ends current render pass
-   */
-  void EndRenderPass();
-
-  /**
-   * Records pipeline barrier
-   * @param srcStageMask
-   * @param dstStageMask
-   * @param dependencyFlags
-   * @param memoryBarriers
-   * @param bufferBarriers
-   * @param imageBarriers
-   */
-  void PipelineBarrier( vk::PipelineStageFlags srcStageMask,
-                        vk::PipelineStageFlags dstStageMask,
-                        vk::DependencyFlags dependencyFlags,
-                        std::vector<vk::MemoryBarrier> memoryBarriers,
-                        std::vector<vk::BufferMemoryBarrier> bufferBarriers,
-                        std::vector<vk::ImageMemoryBarrier> imageBarriers );
-
-  /**
-   * Executes secondary command buffers within primary command buffer
-   * @param commandBuffers
-   */
-  void ExecuteCommands( const std::vector<Dali::Graphics::Vulkan::Handle<CommandBuffer>>& commandBuffers );
-
-  /**
-   * Executes secondary command buffers within primary command buffer
-   * @param commandBuffers
-   */
-  void ExecuteCommands( const std::vector<Dali::Graphics::Vulkan::Handle<CommandBuffer>>& commandBuffers, uint32_t offset, uint32_t count );
-
-  /**
-   * Copies buffer into the specified image
-   * @param srcBuffer
-   * @param dstImage
-   * @param dtsLayout
-   * @param regions
-   */
-  void CopyBufferToImage( RefCountedBuffer srcBuffer, RefCountedImage dstImage, vk::ImageLayout dstLayout,
-                          std::vector<vk::BufferImageCopy> regions );
-
-  /**
-   * Creates layout transition barrier
-   * @return
-   */
-  vk::ImageMemoryBarrier ImageLayoutTransitionBarrier( RefCountedImage image,
-                                                  vk::AccessFlags        srcAccessMask,
-                                                  vk::AccessFlags        dstAccessMask,
-                                                  vk::ImageLayout        oldLayout,
-                                                  vk::ImageLayout        newLayout,
-                                                  vk::ImageAspectFlags   aspectMask
-  ) const;
-
-  /**
-   * Simplified version of memory barrier generation based on data stored inside the Image
-   * @param image
-   * @param newLayout
-   * @param aspectMask
-   * @return
-   */
-  vk::ImageMemoryBarrier ImageLayoutTransitionBarrier( RefCountedImage image,
-                                                       vk::ImageLayout        olsLayout,
-                                                       vk::ImageLayout        newLayout,
-                                                       vk::ImageAspectFlags   aspectMask
-  ) const;
-
-  /**
-   * Implements VkManaged::OnDestroy
-   * @return
-   */
-  bool OnDestroy() override;
-
-private:
-
-  /**
-   * Returns allocation index
-   * @return
-   */
-  uint32_t GetPoolAllocationIndex() const;
-
-private:
-
-  // Constructor called by the CommandPool only
-  CommandBuffer( CommandPool& commandPool,
-                 uint32_t poolIndex,
-                 const vk::CommandBufferAllocateInfo& allocateInfo,
-                 vk::CommandBuffer vulkanHandle );
-
-private:
-
-  CommandPool*                  mOwnerCommandPool;
-  Graphics*                     mGraphics;
-  uint32_t                      mPoolAllocationIndex;
-  vk::CommandBufferAllocateInfo mAllocateInfo{};
-
-  vk::CommandBuffer mCommandBuffer{};
-
-  RefCountedPipeline mCurrentPipeline;
-
-  vk::RenderPass mCurrentRenderPass;
-
-  bool mRecording{ false };
-};
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_COMMAND_BUFFER_H
diff --git a/dali/graphics/vulkan/vulkan-command-pool.cpp b/dali/graphics/vulkan/vulkan-command-pool.cpp
deleted file mode 100644 (file)
index cd943ef..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-/**
- *
- * Struct: InternalPool
- */
-CommandPool::InternalPool::Node::Node( uint32_t _nextFreeIndex, CommandBuffer* _commandBuffer )
-  : nextFreeIndex( _nextFreeIndex ),
-    commandBuffer( _commandBuffer )
-{
-}
-
-CommandPool::InternalPool::InternalPool( CommandPool& owner, Dali::Graphics::Vulkan::Graphics* graphics,
-                                         uint32_t initialCapacity, bool isPrimary )
-        : mOwner( owner ),
-          mGraphics( graphics ),
-          mPoolData{},
-          mFirstFree(INVALID_NODE_INDEX),
-          mCapacity( initialCapacity ),
-          mAllocationCount( 0u ),
-          mIsPrimary( isPrimary )
-{
-  // don't allocate anything if initial capacity is 0
-  if(initialCapacity)
-  {
-    Resize(initialCapacity);
-  }
-}
-
-CommandPool::InternalPool::~InternalPool()
-{
-  // free all buffers here
-  for( auto&& cmd : mPoolData )
-  {
-    delete cmd.commandBuffer;
-  }
-}
-
-std::vector< vk::CommandBuffer >
-        CommandPool::InternalPool::AllocateVkCommandBuffers( vk::CommandBufferAllocateInfo allocateInfo )
-{
-  return VkAssert( mGraphics->GetDevice().allocateCommandBuffers( allocateInfo ) );
-}
-
-void CommandPool::InternalPool::Resize( uint32_t newCapacity )
-{
-  if( newCapacity <= mPoolData.size() )
-  {
-    return;
-  }
-
-  auto diff = newCapacity - mPoolData.size();
-
-  auto allocateInfo = vk::CommandBufferAllocateInfo{}
-          .setCommandBufferCount( U32(diff) )
-          .setCommandPool(mOwner.GetVkHandle() )
-          .setLevel( mIsPrimary ? vk::CommandBufferLevel::ePrimary : vk::CommandBufferLevel::eSecondary );
-  auto newBuffers = AllocateVkCommandBuffers( allocateInfo );
-
-  uint32_t i = U32(mPoolData.size() + 1);
-
-  mFirstFree = U32(mPoolData.size());
-  if(!mPoolData.empty())
-  {
-    mPoolData.back()
-             .nextFreeIndex = U32(mPoolData.size());
-  }
-  for( auto&& cmdbuf : newBuffers )
-  {
-    auto commandBuffer = new CommandBuffer( mOwner, i-1, allocateInfo, cmdbuf);
-    mPoolData.emplace_back( i, commandBuffer );
-    ++i;
-  }
-  mPoolData.back().nextFreeIndex = INVALID_NODE_INDEX;
-  mCapacity = U32(mPoolData.size());
-}
-
-RefCountedCommandBuffer CommandPool::InternalPool::AllocateCommandBuffer( bool reset )
-{
-  // resize if no more nodes
-  if( mFirstFree == INVALID_NODE_INDEX )
-  {
-    auto newSize = static_cast<uint32_t>(mPoolData.empty() ? 1 : 2 * mPoolData.size());
-    Resize( U32( newSize ) );
-  }
-
-  auto& node = mPoolData[mFirstFree];
-  mFirstFree = node.nextFreeIndex;
-
-  if( reset )
-  {
-    node.commandBuffer->Reset();
-  }
-
-  ++mAllocationCount;
-  return RefCountedCommandBuffer( node.commandBuffer );
-}
-
-void CommandPool::InternalPool::ReleaseCommandBuffer( CommandBuffer& buffer, bool reset )
-{
-  auto indexInPool = buffer.GetPoolAllocationIndex();
-  mPoolData[indexInPool].nextFreeIndex = mFirstFree;
-  mFirstFree = indexInPool;
-
-  if( reset )
-  {
-    buffer.Reset();
-  }
-  --mAllocationCount;
-}
-
-uint32_t CommandPool::InternalPool::GetCapacity() const
-{
-  return mCapacity;
-}
-
-uint32_t CommandPool::InternalPool::GetAllocationCount() const
-{
-  return mAllocationCount;
-}
-
-/**
- *
- * Class: CommandPool
- */
-RefCountedCommandPool CommandPool::New( Graphics& graphics, const vk::CommandPoolCreateInfo& createInfo )
-{
-  auto retval = Handle<CommandPool>( new CommandPool(graphics, createInfo) );
-
-  if(retval && retval->Initialize())
-  {
-    graphics.AddCommandPool( retval );
-  }
-
-  return retval;
-}
-
-RefCountedCommandPool CommandPool::New( Graphics& graphics )
-{
-  return New( graphics, vk::CommandPoolCreateInfo{});
-}
-
-bool CommandPool::Initialize()
-{
-  mCreateInfo.setFlags( vk::CommandPoolCreateFlagBits::eResetCommandBuffer );
-  mCommandPool = VkAssert(mGraphics->GetDevice().createCommandPool(mCreateInfo, mGraphics->GetAllocator()));
-  mInternalPoolPrimary = std::make_unique<InternalPool>( *this, mGraphics, 0, true );
-  mInternalPoolSecondary = std::make_unique<InternalPool>( *this, mGraphics, 0, false );
-  return true;
-}
-
-CommandPool::CommandPool() = default;
-
-CommandPool::CommandPool(Graphics& graphics, const vk::CommandPoolCreateInfo& createInfo)
-        : mGraphics(&graphics),
-          mCreateInfo(createInfo)
-{
-}
-
-CommandPool::~CommandPool() = default;
-
-vk::CommandPool CommandPool::GetVkHandle() const
-{
-  return mCommandPool;
-}
-
-Graphics& CommandPool::GetGraphics() const
-{
-  return *mGraphics;
-}
-
-RefCountedCommandBuffer CommandPool::NewCommandBuffer( const vk::CommandBufferAllocateInfo& allocateInfo )
-{
-  return NewCommandBuffer( allocateInfo.level == vk::CommandBufferLevel::ePrimary );
-}
-
-RefCountedCommandBuffer CommandPool::NewCommandBuffer( bool isPrimary )
-{
-  auto& usedPool = isPrimary ? *mInternalPoolPrimary : *mInternalPoolSecondary;
-  return usedPool.AllocateCommandBuffer( false );
-}
-
-void CommandPool::Reset( bool releaseResources )
-{
-  mGraphics->GetDevice()
-           .resetCommandPool( mCommandPool,
-                              releaseResources ? vk::CommandPoolResetFlagBits::eReleaseResources
-                                               : vk::CommandPoolResetFlags{} );
-}
-
-bool CommandPool::ReleaseCommandBuffer( CommandBuffer& buffer )
-{
-  if(buffer.IsPrimary())
-  {
-    mInternalPoolPrimary->ReleaseCommandBuffer( buffer );
-  }
-  else
-  {
-    mInternalPoolSecondary->ReleaseCommandBuffer( buffer );
-  }
-  return false;
-}
-
-uint32_t CommandPool::GetCapacity() const
-{
-  return mInternalPoolPrimary->GetCapacity()+
-         mInternalPoolSecondary->GetCapacity();
-}
-
-uint32_t CommandPool::GetAllocationCount() const
-{
-  return mInternalPoolPrimary->GetAllocationCount()+
-         mInternalPoolSecondary->GetAllocationCount();
-}
-
-uint32_t CommandPool::GetAllocationCount( vk::CommandBufferLevel level ) const
-{
-  return level == vk::CommandBufferLevel::ePrimary ?
-         mInternalPoolPrimary->GetAllocationCount() :
-         mInternalPoolSecondary->GetAllocationCount();
-}
-
-bool CommandPool::OnDestroy()
-{
-  if( !mGraphics->IsShuttingDown() )
-  {
-    mGraphics->RemoveCommandPool( *this );
-  }
-
-  auto device = mGraphics->GetDevice();
-  auto commandPool = mCommandPool;
-  auto allocator = &mGraphics->GetAllocator();
-
-  mGraphics->DiscardResource( [device, commandPool, allocator]() {
-#ifndef NDEBUG
-    printf("Invoking COMMAND POOL deleter function\n");
-#endif
-    device.destroyCommandPool( commandPool, allocator );
-  } );
-
-  return false;
-}
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-
diff --git a/dali/graphics/vulkan/vulkan-command-pool.h b/dali/graphics/vulkan/vulkan-command-pool.h
deleted file mode 100644 (file)
index 1e8db00..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_COMMANDPOOL
-#define DALI_GRAPHICS_VULKAN_COMMANDPOOL
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-class Graphics;
-class CommandBuffer;
-
-
-class CommandPool : public VkManaged
-{
-
-  friend class Graphics;
-
-public:
-
-  ~CommandPool() override;
-
-  /**
-   *
-   * @return
-   */
-  vk::CommandPool GetVkHandle() const;
-
-  /**
-   *
-   * @return
-   */
-  Graphics& GetGraphics() const;
-
-  /**
-   * Resets command pool
-   */
-  void Reset( bool releaseResources );
-
-  /**
-   *
-   * @param allocateInfo
-   * @return
-   */
-  RefCountedCommandBuffer NewCommandBuffer( const vk::CommandBufferAllocateInfo& allocateInfo );
-
-  /**
-   *
-   * @param isPrimary
-   * @return
-   */
-  RefCountedCommandBuffer NewCommandBuffer( bool isPrimary = true );
-
-  /**
-   * Releases command buffer
-   * @param buffer
-   * @return
-   */
-  bool ReleaseCommandBuffer( CommandBuffer& buffer );
-
-  /**
-   * Returns current pool capacity ( 0 if nothing allocated )
-   * @return
-   */
-  uint32_t GetCapacity() const;
-
-  /**
-   * Returns number of allocated command buffers
-   * @return
-   */
-  uint32_t GetAllocationCount() const;
-
-  /**
-   * Returns number of allocated command buffers by level
-   * @param level
-   * @return
-   */
-  uint32_t GetAllocationCount( vk::CommandBufferLevel level ) const;
-
-  bool OnDestroy() override; //TODO: Queue deleter for destruction
-
-private: //Private methods
-
-  CommandPool();
-
-  CommandPool( Graphics& graphics, const vk::CommandPoolCreateInfo& createInfo );
-
-  /**
- *
- * @param graphics
- * @param createInfo
- * @return
- */
-  static RefCountedCommandPool New( Graphics& graphics, const vk::CommandPoolCreateInfo& createInfo );
-
-  /**
-   *
-   * @param graphics
-   * @return
-   */
-  static RefCountedCommandPool New( Graphics& graphics );
-
-  bool Initialize();
-
-private: //Internal structs
-  /**
- * CommandBufferPool contains preallocated command buffers that are
- * reusable.
- */
-  struct InternalPool
-  {
-    static constexpr uint32_t INVALID_NODE_INDEX{ 0xffffffffu };
-    struct Node
-    {
-      Node( uint32_t _nextFreeIndex, CommandBuffer* _commandBuffer );
-
-      uint32_t          nextFreeIndex;
-      CommandBuffer*    commandBuffer;
-    };
-
-    InternalPool( CommandPool& owner, Graphics* graphics, uint32_t initialCapacity, bool isPrimary );
-
-    ~InternalPool();
-
-    /**
-     * Creates new batch of command buffers
-     * @param allocateInfo
-     * @return
-     */
-    std::vector<vk::CommandBuffer> AllocateVkCommandBuffers( vk::CommandBufferAllocateInfo allocateInfo );
-
-    /**
-     * Resizes command pool to the new capacity. Pool may only grow
-     * @param newCapacity
-     */
-    void Resize( uint32_t newCapacity );
-
-    /**
-     * Allocates new command buffer
-     * @return
-     */
-    RefCountedCommandBuffer AllocateCommandBuffer( bool reset );
-
-    /**
-     * Releases command buffer back to the pool
-     * @param reset if true, Resets command buffer
-     * @param ref
-     */
-    void ReleaseCommandBuffer( CommandBuffer& buffer, bool reset = false );
-
-    uint32_t GetCapacity() const;
-
-    uint32_t GetAllocationCount() const;
-
-    CommandPool&                  mOwner;
-    Graphics*                     mGraphics;
-    std::vector<Node>             mPoolData;
-    uint32_t                      mFirstFree;
-    uint32_t                      mCapacity;
-    uint32_t                      mAllocationCount;
-    bool                          mIsPrimary;
-  };
-
-private: // Data members
-  Graphics* mGraphics;
-  vk::CommandPoolCreateInfo mCreateInfo;
-  vk::CommandPool mCommandPool;
-
-  // Pools are lazily allocated, depends on the requested command buffers
-  std::unique_ptr<InternalPool> mInternalPoolPrimary;
-  std::unique_ptr<InternalPool> mInternalPoolSecondary;
-
-};
-
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_COMMANDPOOL
diff --git a/dali/graphics/vulkan/vulkan-descriptor-set.cpp b/dali/graphics/vulkan/vulkan-descriptor-set.cpp
deleted file mode 100644 (file)
index 55c645d..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-descriptor-set.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-image-view.h>
-#include <dali/graphics/vulkan/vulkan-sampler.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-/**
- * Class DescriptorPool
- */
-
-Handle<DescriptorPool> DescriptorPool::New( Graphics& graphics, const vk::DescriptorPoolCreateInfo& createInfo )
-{
-  auto pool = Handle<DescriptorPool>( new DescriptorPool( graphics, createInfo ) );
-  if(pool->Initialise())
-  {
-    graphics.AddDescriptorPool(pool);
-  }
-  return pool;
-}
-
-DescriptorPool::~DescriptorPool() = default;
-
-bool DescriptorPool::Initialise()
-{
-  mDescriptorPool = VkAssert( mGraphics->GetDevice().createDescriptorPool( mCreateInfo, mGraphics->GetAllocator() ) );
-  return true;
-}
-
-DescriptorPool::DescriptorPool( Graphics& graphics, const vk::DescriptorPoolCreateInfo& createInfo )
-        : mGraphics(&graphics),
-          mCreateInfo(createInfo)
-{
-}
-
-vk::DescriptorPool DescriptorPool::GetVkHandle() const
-{
-  return mDescriptorPool;
-}
-
-std::vector< RefCountedDescriptorSet > DescriptorPool::AllocateDescriptorSets( vk::DescriptorSetAllocateInfo allocateInfo )
-{
-  // all other fields must be set correct
-  allocateInfo.setDescriptorPool( mDescriptorPool );
-  auto result = VkAssert( mGraphics->GetDevice().allocateDescriptorSets( allocateInfo ) );
-
-  std::vector< RefCountedDescriptorSet > retval;
-  retval.reserve( result.size() );
-  for( auto&& item : result )
-  {
-    Handle<DescriptorSet> handle( new DescriptorSet(*mGraphics, *this, item, allocateInfo) );
-    retval.emplace_back( handle );
-    mDescriptorSetCache.emplace_back( handle );
-  }
-
-  return retval;
-}
-
-void DescriptorPool::Reset()
-{
-  mGraphics->GetDevice().resetDescriptorPool( mDescriptorPool );
-  mDescriptorSetCache.clear();
-}
-
-bool DescriptorPool::OnDestroy()
-{
-  if( !mGraphics->IsShuttingDown() )
-  {
-    mGraphics->RemoveDescriptorPool( *this );
-  }
-
-  auto device = mGraphics->GetDevice();
-  auto descriptorPool = mDescriptorPool;
-  auto allocator = &mGraphics->GetAllocator();
-
-  mGraphics->DiscardResource( [device, descriptorPool, allocator] () {
-#ifndef NDEBUG
-    printf("Invoking DESCRIPTOR POOL deleter function\n");
-#endif
-    device.destroyDescriptorPool( descriptorPool, allocator );
-  } );
-
-  return false;
-}
-
-/**
- * Class DescriptorSet
- */
-
-//Called by DescriptorPool only!
-DescriptorSet::DescriptorSet( Graphics& graphics,
-                              DescriptorPool& pool,
-                              vk::DescriptorSet descriptorSet,
-                              vk::DescriptorSetAllocateInfo allocateInfo )
-        : mGraphics( &graphics ),
-          mPool( &pool ),
-          mAllocateInfo( allocateInfo ),
-          mDescriptorSet( descriptorSet )
-{
-}
-
-DescriptorSet::~DescriptorSet() = default;
-
-void DescriptorSet::WriteUniformBuffer( uint32_t binding, Handle<Buffer> buffer, uint32_t offset, uint32_t size )
-{
-  // add resource to the list
-  mResources.emplace_back( buffer.StaticCast<VkManaged>() );
-
-  auto bufferInfo = vk::DescriptorBufferInfo{}
-          .setOffset( U32(offset) )
-          .setRange( U32(size) )
-          .setBuffer(buffer->GetVkHandle() );
-
-  auto write = vk::WriteDescriptorSet{}.setPBufferInfo( &bufferInfo )
-                                       .setDescriptorType( vk::DescriptorType::eUniformBuffer )
-                                       .setDescriptorCount( 1 )
-                                       .setDstSet( mDescriptorSet )
-                                       .setDstBinding( binding )
-                                       .setDstArrayElement( 0 );
-
-  // write descriptor set
-  mGraphics->GetDevice().updateDescriptorSets( 1, &write, 0, nullptr  );
-}
-
-vk::DescriptorSet DescriptorSet::GetVkDescriptorSet() const
-{
-  return mDescriptorSet;
-}
-
-void DescriptorSet::WriteCombinedImageSampler( uint32_t binding, RefCountedSampler sampler, RefCountedImageView imageView )
-{
-  // add resource to the list
-  mResources.emplace_back( sampler.StaticCast<VkManaged>() );
-  mResources.emplace_back( imageView.StaticCast<VkManaged>() );
-
-  auto imageViewInfo = vk::DescriptorImageInfo{}
-          .setImageLayout( vk::ImageLayout::eShaderReadOnlyOptimal )
-          .setImageView( imageView->GetVkHandle() )
-          .setSampler(sampler->GetVkHandle() );
-
-  auto write = vk::WriteDescriptorSet{}.setPImageInfo( &imageViewInfo )
-                                       .setDescriptorType( vk::DescriptorType::eCombinedImageSampler )
-                                       .setDescriptorCount( 1 )
-                                       .setDstSet( mDescriptorSet )
-                                       .setDstBinding( binding )
-                                       .setDstArrayElement( 0 );
-
-  // write descriptor set
-  mGraphics->GetDevice().updateDescriptorSets( 1, &write, 0, nullptr  );
-}
-
-void DescriptorSet::WriteStorageBuffer( RefCountedBuffer buffer, uint32_t offset, uint32_t size )
-{
-  NotImplemented()
-}
-
-void DescriptorSet::WriteImage( Handle< Image > )
-{
-  NotImplemented()
-}
-
-void DescriptorSet::Write( vk::WriteDescriptorSet writeDescriptorSet )
-{
-  NotImplemented()
-}
-
-#if 0
-struct DescriptorSetLayout::Impl
-{
-  Impl( Graphics& graphics, const vk::DescriptorSetLayoutCreateInfo& createInfo ) :
-    mGraphics( graphics ),
-    mCreateInfo( createInfo )
-  {
-  }
-
-  ~Impl()
-  {
-    if(mLayout)
-    {
-      mGraphics.GetDevice().destroyDescriptorSetLayout( mLayout, mGraphics.GetAllocator() );
-    }
-  }
-
-  bool Initialise()
-  {
-    mLayout = VkAssert( mGraphics.GetDevice().createDescriptorSetLayout( mCreateInfo, mGraphics.GetAllocator() ));
-    if(mLayout)
-    {
-      return true;
-    }
-    return false;
-  }
-
-  Graphics&                         mGraphics;
-  vk::DescriptorSetLayout           mLayout;
-  vk::DescriptorSetLayoutCreateInfo mCreateInfo;
-};
-
-/**
- * Class: DescriptorSetLayout
- */
-
-std::unique_ptr<DescriptorSetLayout> DescriptorSetLayout::New( Graphics& graphics, const vk::DescriptorSetLayoutCreateInfo& createInfo )
-{
-  auto retval = std::unique_ptr<DescriptorSetLayout>( new DescriptorSetLayout(graphics, createInfo ) );
-  if( retval->mImpl->Initialise() )
-  {
-    return retval;
-  }
-  return nullptr;
-}
-
-DescriptorSetLayout::DescriptorSetLayout( Graphics& graphics, const vk::DescriptorSetLayoutCreateInfo& createInfo )
-{
-  mImpl = MakeUnique<DescriptorSetLayout::Impl>( graphics, createInfo );
-}
-#endif
-} // Namespace Vulkan
-
-} // Namespace Graphics
-
-} // Namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-descriptor-set.h b/dali/graphics/vulkan/vulkan-descriptor-set.h
deleted file mode 100644 (file)
index 70e97ae..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_DESCRIPTOR_SET
-#define DALI_GRAPHICS_VULKAN_DESCRIPTOR_SET
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Graphics;
-class Buffer;
-class Image;
-class DescriptorPool;
-
-class DescriptorSet : public VkManaged
-{
-  friend class DescriptorPool;
-
-public:
-
-  ~DescriptorSet() override;
-
-  /**
-   *
-   * @param buffer
-   * @param offset
-   * @param size
-   */
-  void WriteUniformBuffer( uint32_t binding, Handle<Buffer> buffer, uint32_t offset, uint32_t size );
-
-  /**
-   *
-   * @param binding
-   * @param sampler
-   * @param imageView
-   */
-  void WriteCombinedImageSampler( uint32_t binding, RefCountedSampler sampler, RefCountedImageView imageView );
-  /**
-   *
-   * @param buffer
-   * @param offset
-   * @param size
-   */
-  void WriteStorageBuffer( RefCountedBuffer buffer, uint32_t offset, uint32_t size );
-
-  /**
-   *
-   */
-  void WriteImage( Handle<Image> );
-
-  /**
-   *
-   * @param writeDescriptorSet
-   */
-  void Write( vk::WriteDescriptorSet writeDescriptorSet );
-
-  /**
-   * Returns VkDescriptorSet associated with this object
-   * @return Descriptor set
-   */
-  vk::DescriptorSet GetVkDescriptorSet() const;
-
-private:
-
-  DescriptorSet( Graphics& graphics, DescriptorPool& pool, vk::DescriptorSet descriptorSet, vk::DescriptorSetAllocateInfo allocateInfo );
-
-  Graphics* mGraphics;
-  DescriptorPool* mPool;
-  vk::DescriptorSetAllocateInfo mAllocateInfo;
-  vk::DescriptorSet             mDescriptorSet;
-
-  // attached resources
-  std::vector<Handle<VkManaged>> mResources;
-};
-
-class DescriptorPool : public VkManaged
-{
-public:
-
-  static RefCountedDescriptorPool New( Graphics& graphics, const vk::DescriptorPoolCreateInfo& createInfo );
-
-  ~DescriptorPool() override;
-
-  bool Initialise();
-
-  vk::DescriptorPool GetVkHandle() const;
-
-  std::vector< RefCountedDescriptorSet > AllocateDescriptorSets( vk::DescriptorSetAllocateInfo allocateInfo );
-
-  /**
-   * Resets descriptor pool
-   */
-  void Reset();
-
-  bool OnDestroy() override;
-
-private:
-
-  DescriptorPool( Graphics& graphics, const vk::DescriptorPoolCreateInfo& createInfo );
-
-  Graphics* mGraphics;
-  vk::DescriptorPoolCreateInfo mCreateInfo;
-
-  vk::DescriptorPool mDescriptorPool;
-
-  // cache
-  std::vector<Handle<DescriptorSet>> mDescriptorSetCache;
-};
-
-#if 0
-class DescriptorSetLayout
-{
-public:
-
-  static std::unique_ptr<DescriptorSetLayout> New( Graphics& graphics, const vk::DescriptorSetLayoutCreateInfo& createInfo );
-
-private:
-
-  DescriptorSetLayout( Graphics& graphics, const vk::DescriptorSetLayoutCreateInfo& createInfo );
-
-private:
-
-  class Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-#endif
-} // Namespace Vulkan
-
-} // Namespace Graphics
-
-} // Namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_DESCRIPTOR_SET
diff --git a/dali/graphics/vulkan/vulkan-fence.cpp b/dali/graphics/vulkan/vulkan-fence.cpp
deleted file mode 100644 (file)
index c5fbb0f..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-fence.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-/**
- * Class: Fence
- *
- */
-RefCountedFence Fence::New( Graphics& graphics )
-{
-  return Handle<Fence>( new Fence(graphics) );
-}
-
-Fence::Fence( Graphics& graphics ) : mGraphics(&graphics)
-{
-}
-
-const Fence& Fence::ConstRef() const
-{
-  return *this;
-}
-
-Fence& Fence::Ref()
-{
-  return *this;
-}
-
-Fence::~Fence() = default;
-
-vk::Fence Fence::GetVkHandle() const
-{
-  return mFence;
-}
-
-Fence::operator vk::Fence*()
-{
-  return &mFence;
-}
-
-bool Fence::OnDestroy()
-{
-  // Copy the Vulkan handles and pointers here.
-  // Cannot capture the "this" pointer in the lambda.
-  // When the lambda is invoked "this" is already destroyed.
-  // This method is only deferring execution to the end of the frame.
-  auto device = mGraphics->GetDevice();
-  auto fence = mFence;
-  auto allocator = &mGraphics->GetAllocator();
-
-  // capture copies of the pointers and handles
-  mGraphics->DiscardResource( [device, fence, allocator]() {
-#ifndef NDEBUG
-    printf("Invoking FENCE deleter function\n");
-#endif
-    device.destroyFence( fence, allocator );
-  } );
-
-  return false;
-}
-
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-framebuffer.cpp b/dali/graphics/vulkan/vulkan-framebuffer.cpp
deleted file mode 100644 (file)
index c70748e..0000000
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-image-view.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-struct Framebuffer::Impl
-{
-  Impl( Framebuffer& owner, Graphics& graphics, uint32_t width, uint32_t height )
-  : mInterface( owner ), mGraphics( graphics ), mColorImageViewAttachments{}, mDepthStencilImageViewAttachment()
-  {
-    mWidth = width;
-    mHeight = height;
-  }
-
-  // creating render pass may happen either as deferred or
-  // when framebuffer is initialised into immutable state
-  bool Initialise()
-  {
-    mAttachmentReference.clear();
-    mAttachmentDescription.clear();
-    mDefaultClearValues.clear();
-    /*
-     * COLOR ATTACHMENTS
-     */
-    auto attachments         = std::vector<vk::ImageView>{};
-    auto colorAttachmentSize = 0u;
-    for( auto&& colorAttachment : mColorImageViewAttachments )
-    {
-      auto attRef = vk::AttachmentReference{};
-      attRef.setLayout( vk::ImageLayout::eColorAttachmentOptimal );
-      attRef.setAttachment( colorAttachmentSize++ );
-      mAttachmentReference.emplace_back( attRef );
-      attachments.emplace_back( colorAttachment->GetVkHandle() );
-
-      vk::AttachmentDescription attDesc{};
-      attDesc.setSamples( vk::SampleCountFlagBits::e1 )
-        .setInitialLayout( vk::ImageLayout::eUndefined )
-        .setFormat( colorAttachment->GetImage()->GetFormat() )
-        .setStencilStoreOp( vk::AttachmentStoreOp::eDontCare )
-        .setStencilLoadOp( vk::AttachmentLoadOp::eDontCare )
-        .setLoadOp( vk::AttachmentLoadOp::eClear )
-        .setStoreOp( vk::AttachmentStoreOp::eStore )
-        .setFinalLayout( vk::ImageLayout::ePresentSrcKHR );
-
-      mAttachmentDescription.emplace_back( attDesc );
-
-      // update clear color values
-      vk::ClearColorValue clear;
-      clear.setFloat32( {0.0f, 0.0f, 0.0f, 1.0f} );
-      mDefaultClearValues.emplace_back( clear );
-    }
-
-    /*
-     * DEPTH-STENCIL ATTACHMENT
-     */
-    if( mDepthStencilImageViewAttachment )
-    {
-      auto attRef = vk::AttachmentReference{};
-      attRef.setLayout( vk::ImageLayout::eDepthStencilAttachmentOptimal );
-      attRef.setAttachment( colorAttachmentSize );
-      mAttachmentReference.emplace_back( attRef );
-      attachments.emplace_back( mDepthStencilImageViewAttachment->GetVkHandle() );
-
-      vk::AttachmentDescription attDesc{};
-      attDesc.setSamples( vk::SampleCountFlagBits::e1 )
-             .setInitialLayout( vk::ImageLayout::eUndefined )
-             .setFormat( mDepthStencilImageViewAttachment->GetImage()->GetFormat() )
-             .setStencilStoreOp( vk::AttachmentStoreOp::eDontCare )
-             .setStencilLoadOp( vk::AttachmentLoadOp::eDontCare )
-             .setLoadOp( vk::AttachmentLoadOp::eClear )
-             .setStoreOp( vk::AttachmentStoreOp::eDontCare )
-             .setFinalLayout( vk::ImageLayout::eDepthStencilAttachmentOptimal );
-      mAttachmentDescription.emplace_back( attDesc );
-
-      // update clear depth/stencil values
-      vk::ClearDepthStencilValue clear;
-      clear.setDepth( 0.0f ).setStencil( 1.0f );
-      mDefaultClearValues.emplace_back( clear );
-    }
-
-    /*
-     * SUBPASS
-     */
-    // creating single subpass per framebuffer
-    auto subpassDesc = vk::SubpassDescription{};
-    subpassDesc.setPipelineBindPoint( vk::PipelineBindPoint::eGraphics );
-    subpassDesc.setColorAttachmentCount( colorAttachmentSize );
-    if( mDepthStencilImageViewAttachment )
-    {
-      subpassDesc.setPDepthStencilAttachment( &mAttachmentReference[colorAttachmentSize] );
-    }
-    subpassDesc.setPColorAttachments( &mAttachmentReference[0] );
-
-    /*
-     * RENDERPASS
-     */
-    // create compatible render pass
-    auto rpInfo = vk::RenderPassCreateInfo{};
-    rpInfo.setAttachmentCount( U32(mAttachmentDescription.size()) );
-    rpInfo.setPAttachments( mAttachmentDescription.data() );
-    rpInfo.setPSubpasses( &subpassDesc );
-    rpInfo.setSubpassCount( 1 );
-    mVkRenderPass = VkAssert( mGraphics.GetDevice().createRenderPass( rpInfo, mGraphics.GetAllocator() ));
-
-    /*
-     * FRAMEBUFFER
-     */
-    vk::FramebufferCreateInfo info;
-    info.setRenderPass( mVkRenderPass )
-        .setPAttachments( attachments.data() )
-        .setLayers( 1 )
-        .setWidth( mWidth )
-        .setHeight( mHeight )
-        .setAttachmentCount( U32(attachments.size()) );
-
-    mVkFramebuffer = VkAssert( mGraphics.GetDevice().createFramebuffer( info, mGraphics.GetAllocator() ) );
-
-    return true;
-  }
-
-  /**
-   * Creates immutable framebuffer object
-   */
-  bool Commit()
-  {
-    if(!mInitialised)
-    {
-      mInitialised = Initialise();
-      return mInitialised;
-    }
-    return false;
-  }
-
-  void SetAttachment( RefCountedImageView imageViewRef, Framebuffer::AttachmentType type, uint32_t index )
-  {
-    // TODO: all array-type atyachments
-    if( type == AttachmentType::COLOR )
-    {
-      auto& attachments = mColorImageViewAttachments;
-      if( attachments.size() <= index )
-      {
-        attachments.resize( index + 1 );
-      }
-      attachments[index] = imageViewRef;
-    }
-    else if( type == AttachmentType::DEPTH_STENCIL )
-    {
-      mDepthStencilImageViewAttachment = imageViewRef;
-    }
-  }
-
-  RefCountedImageView GetAttachment( AttachmentType type, uint32_t index ) const
-  {
-    switch( type )
-    {
-      case AttachmentType::COLOR:
-      {
-        return mColorImageViewAttachments[index];
-      }
-      case AttachmentType::DEPTH_STENCIL:
-      {
-        return mDepthStencilImageViewAttachment;
-      }
-      case AttachmentType::DEPTH:
-      case AttachmentType::INPUT:
-      case AttachmentType::RESOLVE:
-      case AttachmentType::PRESERVE:
-      {
-        return RefCountedImageView();
-      }
-    }
-    return RefCountedImageView();
-  }
-
-  std::vector<RefCountedImageView> GetAttachments( AttachmentType type ) const
-  {
-    std::vector<RefCountedImageView> retval{};
-    switch( type )
-    {
-      case AttachmentType::COLOR:
-      {
-        retval.insert( retval.end(), mColorImageViewAttachments.begin(), mColorImageViewAttachments.end() );
-        return retval;
-      }
-      case AttachmentType::DEPTH_STENCIL:
-      {
-        retval.push_back( mDepthStencilImageViewAttachment );
-        return retval;
-      }
-      case AttachmentType::DEPTH:
-      case AttachmentType::INPUT:
-      case AttachmentType::RESOLVE:
-      case AttachmentType::PRESERVE:
-      {
-        return retval;
-      }
-    }
-    return retval;
-  }
-
-  uint32_t GetAttachmentCount( AttachmentType type ) const
-  {
-    switch( type )
-    {
-      case AttachmentType::COLOR:
-      {
-        return U32(mColorImageViewAttachments.size());
-      }
-      case AttachmentType::DEPTH_STENCIL:
-      {
-        return mDepthStencilImageViewAttachment ? 1u : 0u;
-      }
-      case AttachmentType::DEPTH:
-      case AttachmentType::INPUT:
-      case AttachmentType::RESOLVE:
-      case AttachmentType::PRESERVE:
-      {
-        return 0u;
-      }
-    }
-    return 0u;
-  }
-
-  const std::vector<vk::ClearValue>& GetDefaultClearValues() const
-  {
-    return mDefaultClearValues;
-  }
-
-  ~Impl() = default;
-
-  vk::RenderPass GetVkRenderPass() const
-  {
-    return mVkRenderPass;
-  }
-
-  vk::Framebuffer GetVkFramebuffer() const
-  {
-    return mVkFramebuffer;
-  }
-
-  Framebuffer& mInterface;
-  Graphics&    mGraphics;
-
-  uint32_t mWidth;
-  uint32_t mHeight;
-
-  std::vector<RefCountedImageView> mColorImageViewAttachments;
-  RefCountedImageView              mDepthStencilImageViewAttachment;
-  vk::Framebuffer           mVkFramebuffer;
-  vk::RenderPass            mVkRenderPass;
-
-  // attachment references for the main subpass
-  std::vector<vk::AttachmentReference>   mAttachmentReference;
-  std::vector<vk::AttachmentDescription> mAttachmentDescription;
-
-  std::vector<vk::ClearValue> mDefaultClearValues;
-  bool mInitialised{false};
-};
-
-RefCountedFramebuffer Framebuffer::New( Graphics& graphics, uint32_t width, uint32_t height )
-{
-  RefCountedFramebuffer ref( new Framebuffer( graphics, width, height ) );
-  return ref;
-}
-
-Framebuffer::Framebuffer( Graphics& graphics, uint32_t width, uint32_t height )
-{
-  mImpl = std::make_unique<Impl>( *this, graphics, width, height );
-}
-
-void Framebuffer::SetAttachment( RefCountedImageView imageViewRef, Framebuffer::AttachmentType type, uint32_t index )
-{
-  mImpl->SetAttachment( imageViewRef, type, index );
-}
-
-uint32_t Framebuffer::GetWidth() const
-{
-  return mImpl->mWidth;
-}
-
-uint32_t Framebuffer::GetHeight() const
-{
-  return mImpl->mHeight;
-}
-
-RefCountedImageView Framebuffer::GetAttachment( AttachmentType type, uint32_t index ) const
-{
-  return mImpl->GetAttachment( type, index );
-}
-
-std::vector<RefCountedImageView> Framebuffer::GetAttachments( AttachmentType type ) const
-{
-  return mImpl->GetAttachments( type );
-}
-
-uint32_t Framebuffer::GetAttachmentCount( AttachmentType type ) const
-{
-  return mImpl->GetAttachmentCount( type );
-}
-
-void Framebuffer::Commit()
-{
-  mImpl->Commit();
-}
-
-vk::RenderPass Framebuffer::GetRenderPassVkHandle() const
-{
-  return mImpl->mVkRenderPass;
-}
-
-vk::Framebuffer Framebuffer::GetVkHandle() const
-{
-  return mImpl->mVkFramebuffer;
-}
-
-const std::vector<vk::ClearValue>& Framebuffer::GetDefaultClearValues() const
-{
-  return mImpl->GetDefaultClearValues();
-}
-
-} // Namespace Vulkan
-
-} // Namespace Graphics
-
-} // Namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-framebuffer.h b/dali/graphics/vulkan/vulkan-framebuffer.h
deleted file mode 100644 (file)
index 176adb9..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_FRAMEBUFFER
-#define DALI_GRAPHICS_VULKAN_FRAMEBUFFER
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-class Image;
-
-/**
- * Framebuffer encapsulates following objects:
- * - Images ( attachments )
- * - Framebuffer
- * - ImageViews
- */
-class Framebuffer : public VkManaged
-{
-public:
-
-  enum class AttachmentType
-  {
-    COLOR,
-    DEPTH_STENCIL,
-    DEPTH,
-    INPUT,
-    RESOLVE,
-    PRESERVE
-  };
-
-  static RefCountedFramebuffer New( Graphics& graphics, uint32_t width, uint32_t height );
-
-  uint32_t GetWidth() const;
-
-  uint32_t GetHeight() const;
-
-  RefCountedImageView GetAttachment( AttachmentType type, uint32_t index ) const;
-
-  std::vector<RefCountedImageView> GetAttachments( AttachmentType type ) const;
-
-  uint32_t GetAttachmentCount( AttachmentType type ) const;
-
-  void SetAttachment( RefCountedImageView imageViewRef, Framebuffer::AttachmentType type, uint32_t index );
-
-  void Commit();
-
-  vk::RenderPass GetRenderPassVkHandle() const;
-
-  vk::Framebuffer GetVkHandle() const;
-
-  const std::vector<vk::ClearValue>& GetDefaultClearValues() const;
-
-private:
-
-  Framebuffer( Graphics& graphics, uint32_t width, uint32_t height );
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-
-};
-
-
-} // Namespace Vulkan
-
-} // Namespace Graphics
-
-} // Namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_FRAMEBUFFER
diff --git a/dali/graphics/vulkan/vulkan-graphics-texture.cpp b/dali/graphics/vulkan/vulkan-graphics-texture.cpp
deleted file mode 100644 (file)
index 765d73e..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-graphics-texture.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-image-view.h>
-#include <dali/graphics/vulkan/vulkan-fence.h>
-#include <dali/graphics/vulkan/vulkan-queue.h>
-#include <dali/graphics/vulkan/vulkan-sampler.h>
-#include <thread>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-using namespace Dali::Graphics::Vulkan;
-
-struct Pixmap
-{
-  explicit Pixmap( uint32_t _width, uint32_t _height, vk::Format format  )
-    : width( _width ), height( _height ), bytesPerPixel(1), pixelFormat( format )
-  {
-    totalSizeInBytes = width * height * bytesPerPixel;
-    data.resize(totalSizeInBytes);
-  }
-
-  explicit Pixmap( uint32_t _width, uint32_t _height )
-  : width( _width ), height( _height ), bytesPerPixel( 4 ), pixelFormat( vk::Format::eR8G8B8A8Unorm )
-  {
-    data.resize( _width * _height );
-  }
-
-  std::vector<uint8_t>  data;
-  uint32_t              width;
-  uint32_t              height;
-  uint32_t              bytesPerPixel;
-  uint32_t              totalSizeInBytes;
-  vk::Format            pixelFormat;
-};
-
-/**
- * Texture::Impl
- * Responsible for creating an image, basic image view, allocating texture memory,
- * transfering the data into into the texture
- *
- */
-struct Texture::Impl
-{
-  Impl( Texture& owner,
-        Graphics& graphics,
-        uint32_t width,
-        uint32_t height,
-        vk::Format format ) : mGraphics( graphics ),
-        mPixmap( width, height, format )
-  {
-    mWidth = width;
-    mHeight = height;
-    mFormat = format;
-  }
-
-  bool UploadData( const void* data, uint32_t offsetInBytes, uint32_t sizeInBytes )
-  {
-    // create buffer
-    auto& allocator = mGraphics.GetDeviceMemoryManager().GetDefaultAllocator();
-    auto size   = sizeInBytes;
-    auto buffer = mGraphics.CreateBuffer(vk::BufferCreateInfo{}
-                                                 .setUsage( vk::BufferUsageFlagBits::eTransferSrc )
-                                                 .setSharingMode( vk::SharingMode::eExclusive )
-                                                 .setSize( size ));
-
-    buffer->BindMemory( allocator.Allocate( buffer, vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent ) );
-
-    // copy pixels to the buffer
-    auto ptr = buffer->GetMemoryHandle()->MapTyped<char>();
-    std::copy( reinterpret_cast<const char*>(data),
-               reinterpret_cast<const char*>(data) + sizeInBytes,
-               ptr );
-
-    buffer->GetMemoryHandle()->Unmap();
-
-    // record copy and layout change
-    auto copy = vk::BufferImageCopy{}
-      .setImageExtent( { mWidth, mHeight, 1} )
-      .setBufferImageHeight( mHeight )
-      .setBufferOffset( 0 )
-      .setBufferRowLength( mWidth )
-      .setImageOffset( {0, 0, 0} )
-      .setImageSubresource( vk::ImageSubresourceLayers{}
-                              .setMipLevel( 0 )
-                              .setAspectMask( vk::ImageAspectFlagBits::eColor )
-                              .setLayerCount( 1 )
-                              .setBaseArrayLayer( 0 ) );
-
-    auto commandBuffer = mGraphics.CreateCommandBuffer( true );
-
-    commandBuffer->Begin(vk::CommandBufferUsageFlagBits::eOneTimeSubmit);
-
-    // change layout
-    auto barrier = std::vector<vk::ImageMemoryBarrier>{commandBuffer->ImageLayoutTransitionBarrier(
-      mImage, vk::ImageLayout::ePreinitialized, vk::ImageLayout::eTransferDstOptimal, vk::ImageAspectFlagBits::eColor )};
-
-    // change layout to prepare image to transfer data
-    commandBuffer->PipelineBarrier(
-      vk::PipelineStageFlagBits::eTopOfPipe, vk::PipelineStageFlagBits::eTransfer, {}, {}, {}, {barrier} );
-
-    // copy image
-    commandBuffer->CopyBufferToImage( buffer, mImage, vk::ImageLayout::eTransferDstOptimal, {copy} );
-
-    // change layout to shader read-only optimal
-    commandBuffer->PipelineBarrier(
-      vk::PipelineStageFlagBits::eVertexShader,
-      vk::PipelineStageFlagBits::eVertexShader,
-      {},
-      {},
-      {},
-      {commandBuffer->ImageLayoutTransitionBarrier(
-        mImage, vk::ImageLayout::eTransferDstOptimal, vk::ImageLayout::eShaderReadOnlyOptimal, vk::ImageAspectFlagBits::eColor )} );
-
-    commandBuffer->End();
-
-    // submit and wait till image is uploaded so temporary buffer can be destroyed safely
-    auto fence = mGraphics.CreateFence({});
-    VkAssert(mGraphics.Submit( mGraphics.GetGraphicsQueue( 0u ), { SubmissionData{}.SetCommandBuffers( { commandBuffer } ) }, fence ));
-    VkAssert(mGraphics.WaitForFence(fence, std::numeric_limits<uint32_t>::max()));
-    return true;
-  }
-
-  // creates image with pre-allocated memory and default sampler, no data
-  // uploaded at this point
-  bool Initialise()
-  {
-    // create image
-    auto imageCreateInfo = vk::ImageCreateInfo{}
-            .setFormat( mPixmap.pixelFormat )
-            .setInitialLayout( vk::ImageLayout::ePreinitialized )
-            .setSamples( vk::SampleCountFlagBits::e1 )
-            .setSharingMode( vk::SharingMode::eExclusive )
-            .setUsage( vk::ImageUsageFlagBits::eSampled | vk::ImageUsageFlagBits::eTransferDst )
-            .setExtent( {mPixmap.width, mPixmap.height, 1} )
-            .setArrayLayers( 1 )
-            .setImageType( vk::ImageType::e2D )
-            .setTiling( vk::ImageTiling::eOptimal )
-            .setMipLevels( 1 );
-
-    // Create the image handle
-    mImage = mGraphics.CreateImage( imageCreateInfo );
-
-    // allocate memory for the image
-    auto memory = mGraphics.GetDeviceMemoryManager()
-            .GetDefaultAllocator()
-            .Allocate(mImage, vk::MemoryPropertyFlagBits::eDeviceLocal );
-
-    // bind the allocated memory to the image
-    mGraphics.BindImageMemory( mImage, memory, 0 );
-
-    // create default image view
-    mImageView = mGraphics.CreateImageView(mImage);
-
-    // create basic sampler
-    CreateSampler();
-
-    return true;
-  }
-
-  void CreateSampler()
-  {
-    auto samplerCreateInfo = vk::SamplerCreateInfo()
-            .setAddressModeU( vk::SamplerAddressMode::eClampToEdge )
-            .setAddressModeV( vk::SamplerAddressMode::eClampToEdge )
-            .setAddressModeW( vk::SamplerAddressMode::eClampToEdge )
-            .setBorderColor( vk::BorderColor::eFloatOpaqueBlack )
-            .setCompareOp( vk::CompareOp::eNever )
-            .setMinFilter( vk::Filter::eLinear )
-            .setMagFilter( vk::Filter::eLinear )
-            .setMipmapMode( vk::SamplerMipmapMode::eLinear );
-
-    mSampler = mGraphics.CreateSampler( samplerCreateInfo );
-  }
-
-  RefCountedSampler GetSampler() const
-  {
-    return mSampler;
-  }
-
-  Graphics&    mGraphics;
-  RefCountedImage     mImage;
-  RefCountedImageView mImageView;
-  RefCountedSampler   mSampler;
-
-  // layouts
-  vk::ImageLayout mOldLayout;
-  vk::ImageLayout mNewLayout;
-
-  uint32_t mWidth { 0u }, mHeight { 0u };
-  vk::Format mFormat {};
-  // Command pool
-  Pixmap mPixmap;
-};
-
-/**
- * Texture
- *
- */
-
-RefCountedTexture Texture::New( Graphics& graphics, uint32_t width, uint32_t height, vk::Format format )
-{
-  auto result = RefCountedTexture( new Texture( graphics, width, height, format ));
-  if( !result->mImpl->Initialise() )
-  {
-    result.Reset();
-  }
-  return result;
-}
-
-Texture::Texture( Graphics& graphics, uint32_t width, uint32_t height, vk::Format format )
-{
-  mImpl.reset( new Impl( *this, graphics, width, height, format ) );
-}
-
-
-/**
- * Schedules data upload from CPU
- * @param data
- * @param size
- * @param mode
- */
-void Texture::UploadData( const void* data, size_t size, TextureUploadMode mode )
-{
-  mImpl->UploadData( data, 0, U32(size) );
-}
-
-/**
- *
- * @param buffer
- * @param mode
- */
-void Texture::UploadFromBuffer( RefCountedBuffer buffer, TextureUploadMode mode )
-{
-
-}
-
-RefCountedImage Texture::GetImage() const
-{
-  return mImpl->mImage;
-}
-
-RefCountedImageView Texture::GetImageView() const
-{
-  return mImpl->mImageView;
-}
-
-RefCountedSampler Texture::GetSampler() const
-{
-  return mImpl->mSampler;
-}
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-graphics-texture.h b/dali/graphics/vulkan/vulkan-graphics-texture.h
deleted file mode 100644 (file)
index 6b1631f..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_GRAPHICS_TEXTURE_H
-#define DALI_GRAPHICS_VULKAN_GRAPHICS_TEXTURE_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-/**
- *
- */
-enum class TextureUploadMode
-{
-  eLazy,
-  eImmediate
-};
-
-/**
- * This is temporary implementation. It should be using graphics-texture as base
- * interface.
- */
-class Texture : public VkManaged
-{
-public:
-
-  /**
-   * Creates new texture
-   * @param width
-   * @param height
-   * @param format
-   * @return
-   */
-  static Handle<Texture> New( Graphics& graphics, uint32_t width, uint32_t height, vk::Format format );
-
-  /**
-   * Schedules data upload from CPU
-   * @param data
-   * @param size
-   * @param mode
-   */
-  void UploadData( const void* data, size_t size, TextureUploadMode mode );
-
-  /**
-   *
-   * @param buffer
-   * @param mode
-   */
-  void UploadFromBuffer( RefCountedBuffer buffer, TextureUploadMode mode );
-
-  /**
-   * Returns Image object
-   * @return
-   */
-  RefCountedImage GetImage() const;
-
-  /**
-   * Returns image view
-   * @return
-   */
-  RefCountedImageView GetImageView() const;
-
-  /**
-   * Returns sampler
-   * @return
-   */
-  RefCountedSampler GetSampler() const;
-
-private:
-
-  explicit Texture( Graphics& graphics, uint32_t width, uint32_t height, vk::Format format );
-
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-}
-} // namespace Graphics
-} // namespace Dali
-#endif // DALI_GRAPHICS_VULKAN_GRAPHICS_TEXTURE_H
diff --git a/dali/graphics/vulkan/vulkan-graphics.cpp b/dali/graphics/vulkan/vulkan-graphics.cpp
deleted file mode 100644 (file)
index b28e3c5..0000000
+++ /dev/null
@@ -1,1035 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-#include <dali/graphics/vulkan/vulkan-queue.h>
-#include <dali/graphics/vulkan/vulkan-surface.h>
-#include <dali/integration-api/graphics/vulkan/vk-surface-factory.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-image-view.h>
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics/vulkan/vulkan-shader.h>
-#include <dali/graphics/vulkan/vulkan-descriptor-set.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-#include <dali/graphics/vulkan/api/vulkan-api-controller.h>
-#include <dali/graphics/vulkan/vulkan-sampler.h>
-#include <dali/graphics/vulkan/vulkan-resource-cache.h>
-#include <dali/graphics/vulkan/vulkan-debug.h>
-#include <dali/graphics/vulkan/vulkan-fence.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-
-#include <dali/graphics-api/graphics-api-controller.h>
-
-#ifndef VK_KHR_XLIB_SURFACE_EXTENSION_NAME
-#define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface"
-#endif
-
-#ifndef VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME
-#define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface"
-#endif
-
-#ifndef VK_KHR_XCB_SURFACE_EXTENSION_NAME
-#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"
-#endif
-
-#include <iostream>
-#include <utility>
-
-namespace Dali
-{
-namespace Graphics
-{
-using VkSurfaceFactory = Dali::Integration::Graphics::Vulkan::VkSurfaceFactory;
-namespace Vulkan
-{
-
-const auto VALIDATION_LAYERS = std::vector< const char* >{
-
-  //"VK_LAYER_LUNARG_screenshot",           // screenshot
-  //"VK_LAYER_RENDERDOC_Capture",
-  "VK_LAYER_LUNARG_parameter_validation", // parameter
-  //"VK_LAYER_LUNARG_vktrace",              // vktrace ( requires vktrace connection )
-  //"VK_LAYER_LUNARG_monitor",             // monitor
-  "VK_LAYER_LUNARG_swapchain",           // swapchain
-  "VK_LAYER_GOOGLE_threading",           // threading
-  //"VK_LAYER_LUNARG_api_dump",            // api
-  "VK_LAYER_LUNARG_object_tracker",      // objects
-  "VK_LAYER_LUNARG_core_validation",     // core
-  "VK_LAYER_GOOGLE_unique_objects",      // unique objects
-  "VK_LAYER_LUNARG_standard_validation", // standard
-};
-
-Graphics::Graphics() = default;
-
-Graphics::~Graphics()
-{
-  // Wait for everything to finish on the GPU
-  DeviceWaitIdle();
-
-  // We are shutting down. This flag is used to avoid cache manipulation by Handles' OnDestroy function calls.
-  // The cache will do its own house keeping on teardown
-  mShuttingDown = true;
-
-  // Manually resetting unique pointer here because we need to control the order of destruction.
-  // This defeats the purpose of unique pointers and we might as well use raw pointers. But a unique ptr
-  // communicates ownership more clearly (e.g by not allowing copies).
-  mGfxController.reset(nullptr);
-  mSurfaceFBIDMap.clear();
-
-#ifndef NDEBUG
-  printf("DESTROYING GRAPHICS CONTEXT--------------------------------\n");
-  size_t totalObjCount = 0;
-  mResourceCache->PrintReferenceCountReport( &totalObjCount );
-#endif
-
-  // Clear the last references of resources in the cache.
-  // This should ensure that all resources have been queued for garbage collection
-  // This call assumes that the cash only holds the last reference of every resource in the program. (As it should)
-  mResourceCache->Clear();
-
-  mDeviceMemoryManager.reset(nullptr);
-
-  // Collect the garbage! And shut down gracefully...
-  CollectGarbage();
-
-  // We are done with all resources (technically... . If not we will get a ton of validation layer errors)
-  // Kill the Vulkan logical device
-  mDevice.destroy(mAllocator.get());
-
-  // Kill the Vulkan instance
-  mInstance.destroy(mAllocator.get());
-
-}
-
-// Create methods -----------------------------------------------------------------------------------------------
-void Graphics::Create()
-{
-
-  auto extensions = PrepareDefaultInstanceExtensions();
-
-  auto layers = vk::enumerateInstanceLayerProperties();
-  std::vector< const char* > validationLayers;
-  for( auto&& reqLayer : VALIDATION_LAYERS )
-  {
-    for( auto&& prop : layers.value )
-    {
-      DALI_LOG_STREAM( gVulkanFilter, Debug::General, prop.layerName );
-      if( std::string(prop.layerName) == reqLayer )
-      {
-        validationLayers.push_back( reqLayer );
-      }
-    }
-  }
-
-  CreateInstance( extensions, validationLayers );
-  PreparePhysicalDevice();
-}
-
-void Graphics::CreateDevice()
-{
-  auto queueInfos = GetQueueCreateInfos();
-  {
-    auto maxQueueCountPerFamily = 0u;
-    for( auto&& info : queueInfos )
-    {
-      maxQueueCountPerFamily = std::max( info.queueCount, maxQueueCountPerFamily );
-    }
-
-    auto priorities = std::vector< float >( maxQueueCountPerFamily );
-    std::fill( priorities.begin(), priorities.end(), 1.0f );
-
-    for( auto& info : queueInfos )
-    {
-      info.setPQueuePriorities( priorities.data());
-    }
-
-    std::vector< const char* > extensions{ VK_KHR_SWAPCHAIN_EXTENSION_NAME };
-
-    auto info = vk::DeviceCreateInfo{};
-    info.setEnabledExtensionCount( U32( extensions.size()))
-        .setPpEnabledExtensionNames( extensions.data())
-        .setPEnabledFeatures( &( *mPhysicalDeviceFeatures ))
-        .setPQueueCreateInfos( queueInfos.data())
-        .setQueueCreateInfoCount( U32( queueInfos.size()));
-
-    mDevice = VkAssert( mPhysicalDevice.createDevice( info, *mAllocator ));
-  }
-
-  // create Queue objects
-  for( auto& queueInfo : queueInfos )
-  {
-    for( auto i = 0u; i < queueInfo.queueCount; ++i )
-    {
-      auto queue = mDevice.getQueue( queueInfo.queueFamilyIndex, i );
-
-      // based on family push queue instance into right array
-      auto flags = mQueueFamilyProperties[queueInfo.queueFamilyIndex].queueFlags;
-      if( flags & vk::QueueFlagBits::eGraphics )
-      {
-        mGraphicsQueues.emplace_back(
-                MakeUnique< Queue >( *this, queue, queueInfo.queueFamilyIndex, i, flags ));
-      }
-      if( flags & vk::QueueFlagBits::eTransfer )
-      {
-        mTransferQueues.emplace_back(
-                MakeUnique< Queue >( *this, queue, queueInfo.queueFamilyIndex, i, flags ));
-      }
-      if( flags & vk::QueueFlagBits::eCompute )
-      {
-        mComputeQueues.emplace_back(
-                MakeUnique< Queue >( *this, queue, queueInfo.queueFamilyIndex, i, flags ));
-      }
-
-      // todo: present queue
-    }
-  }
-
-  mResourceCache = MakeUnique< ResourceCache >();
-}
-
-FBID Graphics::CreateSurface( std::unique_ptr< SurfaceFactory > surfaceFactory )
-{
-  // create surface from the factory
-  auto surfaceRef = Surface::New( *this, std::move( surfaceFactory ));
-
-  if( surfaceRef->Create())
-  {
-
-    // map surface to FBID
-    auto fbid = ++mBaseFBID;
-    mSurfaceFBIDMap[fbid] = SwapchainSurfacePair{ RefCountedSwapchain{}, surfaceRef };
-    return fbid;
-  }
-  return -1;
-}
-
-RefCountedSwapchain Graphics::CreateSwapchainForSurface( RefCountedSurface surface )
-{
-  auto swapchain = Swapchain::New( *this,
-                                   GetGraphicsQueue( 0u ),
-                                   surface, 4, 0 );
-
-  // store swapchain in the correct pair
-  for( auto&& val : mSurfaceFBIDMap )
-  {
-    if( val.second
-           .surface == surface )
-    {
-      val.second
-         .swapchain = swapchain;
-      break;
-    }
-  }
-
-  return swapchain;
-}
-
-RefCountedShader Graphics::CreateShader()
-{
-  NotImplemented()
-}
-
-RefCountedPipeline Graphics::CreatePipeline()
-{
-  NotImplemented()
-}
-
-RefCountedFence Graphics::CreateFence( const vk::FenceCreateInfo& fenceCreateInfo )
-{
-  auto refCountedFence = Fence::New( *this );
-
-  VkAssert( mDevice.createFence( &fenceCreateInfo, mAllocator.get(), refCountedFence->Ref()));
-
-  return refCountedFence;
-}
-
-RefCountedBuffer Graphics::CreateBuffer( size_t size, BufferType type )
-{
-  auto usageFlags = vk::BufferUsageFlags{};
-
-  switch( type )
-  {
-    case BufferType::VERTEX:
-    {
-      usageFlags |= vk::BufferUsageFlagBits::eVertexBuffer;
-      break;
-    };
-    case BufferType::INDEX:
-    {
-      usageFlags |= vk::BufferUsageFlagBits::eIndexBuffer;
-      break;
-    };
-    case BufferType::UNIFORM:
-    {
-      usageFlags |= vk::BufferUsageFlagBits::eUniformBuffer;
-      break;
-    };
-    case BufferType::SHADER_STORAGE:
-    {
-      usageFlags |= vk::BufferUsageFlagBits::eStorageBuffer;
-      break;
-    };
-  }
-
-  auto info = vk::BufferCreateInfo{};
-  info.setSharingMode( vk::SharingMode::eExclusive );
-  info.setSize( size );
-  info.setUsage( usageFlags | vk::BufferUsageFlagBits::eTransferDst );
-
-  auto refCountedBuffer = Buffer::New( *this, info );
-
-  VkAssert( mDevice.createBuffer( &info, mAllocator.get(), refCountedBuffer->Ref()));
-
-  AddBuffer( refCountedBuffer );
-
-  return refCountedBuffer;
-}
-
-RefCountedBuffer Graphics::CreateBuffer( const vk::BufferCreateInfo& bufferCreateInfo )
-{
-  auto refCountedBuffer = Buffer::New( *this, bufferCreateInfo );
-
-  VkAssert( mDevice.createBuffer( &bufferCreateInfo, mAllocator.get(), refCountedBuffer->Ref()));
-
-  AddBuffer( refCountedBuffer );
-
-  return refCountedBuffer;
-}
-
-RefCountedFramebuffer Graphics::CreateFramebuffer()
-{
-  NotImplemented()
-}
-
-RefCountedImage Graphics::CreateImage( const vk::ImageCreateInfo& imageCreateInfo )
-{
-  auto refCountedImage = Image::New(*this, imageCreateInfo);
-
-  VkAssert( mDevice.createImage( &imageCreateInfo, mAllocator.get(), refCountedImage->Ref() ) );
-
-  AddImage( refCountedImage );
-
-  return refCountedImage;
-}
-
-RefCountedImageView Graphics::CreateImageView( const vk::ImageViewCreateFlags& flags,
-                                               const RefCountedImage& image,
-                                               vk::ImageViewType viewType,
-                                               vk::Format format,
-                                               vk::ComponentMapping components,
-                                               vk::ImageSubresourceRange subresourceRange )
-{
-  auto imageViewCreateInfo = vk::ImageViewCreateInfo{}
-          .setFlags( flags )
-          .setImage( image->GetVkHandle())
-          .setViewType( viewType )
-          .setFormat( format )
-          .setComponents( components )
-          .setSubresourceRange( std::move( subresourceRange ));
-
-  auto refCountedImageView = ImageView::New( *this, image, imageViewCreateInfo );
-
-  VkAssert( mDevice.createImageView( &imageViewCreateInfo, nullptr, refCountedImageView->Ref()));
-
-  AddImageView( refCountedImageView );
-
-  return refCountedImageView;
-}
-
-RefCountedImageView Graphics::CreateImageView( RefCountedImage image )
-{
-  vk::ComponentMapping componentsMapping = { vk::ComponentSwizzle::eR, vk::ComponentSwizzle::eG,
-                                             vk::ComponentSwizzle::eB, vk::ComponentSwizzle::eA };
-  vk::ImageAspectFlags aspectFlags{};
-  if( image->GetUsageFlags() & vk::ImageUsageFlagBits::eColorAttachment )
-  {
-    aspectFlags |= vk::ImageAspectFlagBits::eColor;
-  }
-  if( image->GetUsageFlags() & vk::ImageUsageFlagBits::eDepthStencilAttachment )
-  {
-    aspectFlags |= ( vk::ImageAspectFlagBits::eDepth | vk::ImageAspectFlagBits::eStencil );
-  }
-  if( image->GetUsageFlags() & vk::ImageUsageFlagBits::eSampled )
-  {
-    aspectFlags |= vk::ImageAspectFlagBits::eColor;
-  }
-
-  auto subresourceRange = vk::ImageSubresourceRange{}
-          .setAspectMask( aspectFlags )
-          .setBaseArrayLayer( 0 )
-          .setBaseMipLevel( 0 )
-          .setLevelCount( image->GetMipLevelCount())
-          .setLayerCount( image->GetLayerCount());
-
-  auto refCountedImageView = CreateImageView( {},
-                                              image,
-                                              vk::ImageViewType::e2D,
-                                              image->GetFormat(),
-                                              componentsMapping,
-                                              subresourceRange );
-
-  AddImageView( refCountedImageView );
-
-  return refCountedImageView;
-}
-
-RefCountedDescriptorPool Graphics::CreateDescriptorPool()
-{
-  NotImplemented()
-}
-
-RefCountedGpuMemoryBlock Graphics::CreateGpuMemoryBlock()
-{
-  NotImplemented()
-}
-
-RefCountedDescriptorSet Graphics::CreateDescriptorSet()
-{
-  NotImplemented()
-}
-
-RefCountedSampler Graphics::CreateSampler( const vk::SamplerCreateInfo& samplerCreateInfo )
-{
-  auto refCountedSampler = Sampler::New( *this, samplerCreateInfo );
-
-  VkAssert( mDevice.createSampler( &samplerCreateInfo, mAllocator.get(), refCountedSampler->Ref() ) );
-
-  AddSampler( refCountedSampler );
-
-  return refCountedSampler;
-
-}
-
-RefCountedCommandBuffer Graphics::CreateCommandBuffer( bool primary )
-{
-  auto commandPool = GetCommandPool( std::this_thread::get_id());
-
-  return commandPool->NewCommandBuffer( primary );
-}
-// --------------------------------------------------------------------------------------------------------------
-
-// Actions ------------------------------------------------------------------------------------------------------
-vk::Result Graphics::WaitForFence( RefCountedFence fence, uint32_t timeout )
-{
-  return mDevice.waitForFences( 1, *fence, VK_TRUE, timeout );
-}
-
-vk::Result Graphics::WaitForFences( const std::vector< RefCountedFence >& fences, bool waitAll, uint32_t timeout )
-{
-  std::vector< vk::Fence > vkFenceHandles{};
-  std::transform( fences.begin(),
-                  fences.end(),
-                  std::back_inserter( vkFenceHandles ),
-                  []( RefCountedFence entry ) { return entry->GetVkHandle(); } );
-
-
-  return mDevice.waitForFences( vkFenceHandles, vk::Bool32( waitAll ), timeout );
-}
-
-vk::Result Graphics::ResetFence( RefCountedFence fence )
-{
-  return mDevice.resetFences( 1, *fence );
-}
-
-vk::Result Graphics::ResetFences( const std::vector< RefCountedFence >& fences )
-{
-  std::vector< vk::Fence > vkFenceHandles{};
-  std::transform( fences.begin(),
-                  fences.end(),
-                  std::back_inserter( vkFenceHandles ),
-                  []( RefCountedFence entry ) { return entry->GetVkHandle(); } );
-
-  return mDevice.resetFences( vkFenceHandles );
-}
-
-vk::Result Graphics::BindImageMemory( RefCountedImage image, RefCountedGpuMemoryBlock memory, uint32_t offset )
-{
-  auto result = VkAssert( mDevice.bindImageMemory( image->GetVkHandle(), *memory, offset ) );
-  image->AssignMemory(memory);
-  return result;
-}
-
-vk::Result Graphics::Submit( Queue& queue, const std::vector< SubmissionData >& submissionData, RefCountedFence fence )
-{
-  std::vector< vk::SubmitInfo > submitInfos;
-  std::vector< vk::CommandBuffer > commandBufferHandles;
-
-  // Transform SubmissionData to vk::SubmitInfo
-  std::transform(submissionData.begin(),
-                 submissionData.end(),
-                 std::back_inserter( submitInfos ),
-                 [&]( SubmissionData subData )
-                 {
-
-
-                   //Extract the command buffer handles
-                   std::transform(subData.commandBuffers.begin(),
-                                  subData.commandBuffers.end(),
-                                  std::back_inserter(commandBufferHandles),
-                                  [&]( RefCountedCommandBuffer& entry )
-                                  {
-                                    return entry->GetVkHandle();
-                                  });
-
-                   return vk::SubmitInfo().setWaitSemaphoreCount( U32( subData.waitSemaphores.size() ) )
-                                          .setPWaitSemaphores( subData.waitSemaphores.data() )
-                                          .setPWaitDstStageMask( &subData.waitDestinationStageMask )
-                                          .setCommandBufferCount( U32( subData.commandBuffers.size() )  )
-                                          .setPCommandBuffers( commandBufferHandles.data() )
-                                          .setSignalSemaphoreCount( U32( subData.signalSemaphores.size() ) )
-                                          .setPSignalSemaphores( subData.signalSemaphores.data() );
-                 });
-
-  return VkAssert( queue.GetVkHandle().submit( submitInfos, fence ? fence->GetVkHandle() : nullptr ) );
-}
-
-vk::Result Graphics::Present( Queue& queue, vk::PresentInfoKHR presentInfo )
-{
-  return queue.GetVkHandle().presentKHR(presentInfo);
-}
-
-vk::Result Graphics::QueueWaitIdle( Queue& queue )
-{
-  return queue.GetVkHandle().waitIdle();
-}
-
-vk::Result Graphics::DeviceWaitIdle()
-{
-  return mDevice.waitIdle();
-}
-// --------------------------------------------------------------------------------------------------------------
-
-// Getters ------------------------------------------------------------------------------------------------------
-RefCountedSurface Graphics::GetSurface( FBID surfaceId )
-{
-  // TODO: FBID == 0 means default framebuffer, but there should be no
-  // such thing as default framebuffer.
-  if( surfaceId == 0 )
-  {
-    return mSurfaceFBIDMap.begin()
-                          ->second
-                          .surface;
-  }
-  return mSurfaceFBIDMap[surfaceId].surface;
-}
-
-RefCountedSwapchain Graphics::GetSwapchainForSurface( RefCountedSurface surface )
-{
-  for( auto&& val : mSurfaceFBIDMap )
-  {
-    if( val.second
-           .surface == surface )
-    {
-      return val.second
-                .swapchain;
-    }
-  }
-  return RefCountedSwapchain();
-}
-
-RefCountedSwapchain Graphics::GetSwapchainForFBID( FBID surfaceId )
-{
-  if( surfaceId == 0 )
-  {
-    return mSurfaceFBIDMap.begin()
-                          ->second
-                          .swapchain;
-  }
-  return mSurfaceFBIDMap[surfaceId].swapchain;
-}
-
-vk::Device Graphics::GetDevice() const
-{
-  return mDevice;
-}
-
-vk::PhysicalDevice Graphics::GetPhysicalDevice() const
-{
-  return mPhysicalDevice;
-}
-
-vk::Instance Graphics::GetInstance() const
-{
-  return mInstance;
-}
-
-const vk::AllocationCallbacks& Graphics::GetAllocator() const
-{
-  return *mAllocator;
-}
-
-GpuMemoryManager& Graphics::GetDeviceMemoryManager() const
-{
-  return *mDeviceMemoryManager;
-}
-
-const vk::PhysicalDeviceMemoryProperties& Graphics::GetMemoryProperties() const
-{
-  return *mPhysicalDeviceMemoryProperties;
-}
-
-Queue& Graphics::GetGraphicsQueue( uint32_t index ) const
-{
-  // todo: at the moment each type of queue may use only one, indices greater than 0 are invalid
-  // this will change in the future
-  assert( index == 0u && "Each type of queue may use only one, indices greater than 0 are invalid!" );
-
-  return *mGraphicsQueues[0]; // will be mGraphicsQueues[index]
-}
-
-Queue& Graphics::GetTransferQueue( uint32_t index ) const
-{
-  // todo: at the moment each type of queue may use only one, indices greater than 0 are invalid
-  // this will change in the future
-  assert( index == 0u && "Each type of queue may use only one, indices greater than 0 are invalid!" );
-
-  return *mTransferQueues[0]; // will be mGraphicsQueues[index]
-}
-
-Queue& Graphics::GetComputeQueue( uint32_t index ) const
-{
-  // todo: at the moment each type of queue may use only one, indices greater than 0 are invalid
-  // this will change in the future
-  assert( index == 0u && "Each type of queue may use only one, indices greater than 0 are invalid!" );
-
-  return *mComputeQueues[0]; // will be mGraphicsQueues[index]
-}
-
-Queue& Graphics::GetPresentQueue() const
-{
-  // fixme: should be a dedicated presentation queue
-  return GetGraphicsQueue( 0 );
-}
-
-Platform Graphics::GetDefaultPlatform() const
-{
-#ifdef VK_USE_PLATFORM_WAYLAND_KHR
-  mPlatform = Platform::WAYLAND;
-#elif VK_USE_PLATFORM_XCB_KHR
-  mPlatform = Platform::XCB;
-#elif VK_USE_PLATFORM_XLIB_KHR
-  mPlatform =  Platform::XLIB;
-#else
-  return mPlatform;
-#endif
-}
-
-Dali::Graphics::API::Controller& Graphics::GetController()
-{
-  if( !mGfxController )
-  {
-    mGfxController = Dali::Graphics::VulkanAPI::Controller::New( *this );
-  }
-
-  return *mGfxController;
-}
-
-bool Graphics::IsShuttingDown()
-{
-  return mShuttingDown;
-}
-
-// --------------------------------------------------------------------------------------------------------------
-
-// Cache manipulation methods -----------------------------------------------------------------------------------
-void Graphics::AddBuffer( Handle< Buffer > buffer )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->AddBuffer( std::move( buffer ));
-}
-
-void Graphics::AddImage( Handle< Image > image )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->AddImage( std::move( image ));
-}
-
-void Graphics::AddImageView( RefCountedImageView imageView )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->AddImageView( std::move( imageView ));
-}
-
-void Graphics::AddShader( Handle< Shader > shader )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->AddShader( std::move( shader ));
-}
-
-void Graphics::AddCommandPool( Handle< CommandPool > pool )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->AddCommandPool( std::this_thread::get_id(), std::move( pool ));
-}
-
-void Graphics::AddDescriptorPool( Handle< DescriptorPool > pool )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->AddDescriptorPool( std::move( pool ));
-}
-
-void Graphics::AddFramebuffer( Handle< Framebuffer > framebuffer )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->AddFramebuffer( std::move( framebuffer ));
-}
-
-void Graphics::AddSampler( RefCountedSampler sampler )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->AddSampler( std::move( sampler ) );
-}
-
-RefCountedShader Graphics::FindShader( vk::ShaderModule shaderModule )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  return mResourceCache->FindShader( shaderModule );
-}
-
-RefCountedImage Graphics::FindImage( vk::Image image )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  return mResourceCache->FindImage( image );
-}
-
-void Graphics::RemoveBuffer( Buffer& buffer )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->RemoveBuffer( buffer );
-}
-
-void Graphics::RemoveImage( Image& image )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->RemoveImage( image );
-}
-
-void Graphics::RemoveImageView( ImageView& imageView )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->RemoveImageView( imageView );
-}
-
-void Graphics::RemoveShader( Shader& shader )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->RemoveShader( shader );
-}
-
-void Graphics::RemoveCommandPool( CommandPool& commandPool )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->RemoveCommandPool( commandPool );
-}
-
-void Graphics::RemoveDescriptorPool( DescriptorPool& pool )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->RemoveDescriptorPool( pool );
-}
-
-void Graphics::RemoveFramebuffer( Framebuffer& framebuffer )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->RemoveFramebuffer( framebuffer );
-}
-
-void Graphics::RemoveSampler( Sampler& sampler )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->RemoveSampler( sampler );
-}
-
-void Graphics::CollectGarbage()
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->CollectGarbage();
-}
-
-void Graphics::DiscardResource( std::function< void() > deleter )
-{
-  std::lock_guard< std::mutex > lock{ mMutex };
-  mResourceCache->EnqueueDiscardOperation( std::move( deleter ));
-}
-// --------------------------------------------------------------------------------------------------------------
-
-
-void
-Graphics::CreateInstance( const std::vector< const char* >& extensions,
-                          const std::vector< const char* >& validationLayers )
-{
-  auto info = vk::InstanceCreateInfo{};
-
-  info.setEnabledExtensionCount(U32(extensions.size()))
-      .setPpEnabledExtensionNames(extensions.data())
-      .setEnabledLayerCount(U32(validationLayers.size()))
-      .setPpEnabledLayerNames(validationLayers.data());
-
-#if defined(DEBUG_ENABLED)
-  if( ! getenv("LOG_VULKAN") )
-  {
-    info.setEnabledLayerCount(0);
-  }
-#else
-  info.setEnabledLayerCount(0);
-#endif
-
-  mInstance = VkAssert(vk::createInstance(info, *mAllocator));
-}
-
-void Graphics::DestroyInstance()
-{
-  if( mInstance )
-  {
-    mInstance.destroy( *mAllocator );
-    mInstance = nullptr;
-  }
-}
-
-
-void Graphics::PreparePhysicalDevice()
-{
-  auto devices = VkAssert( mInstance.enumeratePhysicalDevices());
-  assert( !devices.empty() && "No Vulkan supported device found!" );
-
-  // if only one, pick first
-  mPhysicalDevice = nullptr;
-  if( devices.size() == 1 )
-  {
-    mPhysicalDevice = devices[0];
-  }else // otherwise look for one which is a graphics device
-  {
-    for( auto& device : devices )
-    {
-      auto properties = device.getProperties();
-      if( properties.deviceType == vk::PhysicalDeviceType::eDiscreteGpu ||
-          properties.deviceType == vk::PhysicalDeviceType::eIntegratedGpu )
-      {
-        mPhysicalDevice = device;
-        break;
-      }
-    }
-  }
-
-  assert( mPhysicalDevice && "No suitable Physical Device found!" );
-
-  GetPhysicalDeviceProperties();
-
-  GetQueueFamilyProperties();
-
-  mDeviceMemoryManager = GpuMemoryManager::New( *this );
-}
-
-void Graphics::GetPhysicalDeviceProperties()
-{
-  // store data on heap to keep object smaller
-  mPhysicalDeviceProperties =
-          MakeUnique< vk::PhysicalDeviceProperties >( mPhysicalDevice.getProperties());
-  mPhysicalDeviceMemoryProperties =
-          MakeUnique< vk::PhysicalDeviceMemoryProperties >( mPhysicalDevice.getMemoryProperties());
-  mPhysicalDeviceFeatures =
-          MakeUnique< vk::PhysicalDeviceFeatures >( mPhysicalDevice.getFeatures());
-}
-
-void Graphics::GetQueueFamilyProperties()
-{
-  mQueueFamilyProperties = mPhysicalDevice.getQueueFamilyProperties();
-}
-
-std::vector< vk::DeviceQueueCreateInfo > Graphics::GetQueueCreateInfos()
-{
-  // surface is needed in order to find a family that supports presentation to this surface
-  // fixme: assuming all surfaces will be compatible with the queue family
-  assert( !mSurfaceFBIDMap.empty() &&
-          "At least one surface has to be created before creating VkDevice!" );
-
-  std::vector< vk::DeviceQueueCreateInfo > queueInfos{};
-
-  constexpr uint8_t MAX_QUEUE_TYPES = 3;
-  // find suitable family for each type of queue
-  uint32_t familyIndexType[MAX_QUEUE_TYPES];
-  std::fill( &familyIndexType[0], &familyIndexType[MAX_QUEUE_TYPES], -1u );
-
-  // Graphics
-  auto& graphicsFamily = familyIndexType[0];
-
-  // Transfer
-  auto& transferFamily = familyIndexType[1];
-
-  // Transfer
-  auto& presentFamily = familyIndexType[2];
-
-  auto queueFamilyIndex = 0u;
-  for( auto& prop : mQueueFamilyProperties )
-  {
-    if(( prop.queueFlags & vk::QueueFlagBits::eGraphics ) && graphicsFamily == -1u )
-    {
-      graphicsFamily = queueFamilyIndex;
-    }
-    if(( prop.queueFlags & vk::QueueFlagBits::eTransfer ) && transferFamily == -1u )
-    {
-      transferFamily = queueFamilyIndex;
-    }
-    if( mPhysicalDevice.getSurfaceSupportKHR( queueFamilyIndex, mSurfaceFBIDMap.begin()->second.
-            surface->GetSurfaceKHR()).value && presentFamily == -1u )
-    {
-      presentFamily = queueFamilyIndex;
-    }
-    ++queueFamilyIndex;
-  }
-
-  assert( graphicsFamily != -1u && "No queue family that supports graphics operations!" );
-  assert( transferFamily != -1u && "No queue family that supports transfer operations!" );
-  assert( presentFamily != -1u && "No queue family that supports present operations!" );
-
-  // todo: we may require that the family must be same for all types of operations, it makes
-  // easier to handle synchronisation related issues.
-
-  // sort queues
-  std::sort( &familyIndexType[0], &familyIndexType[MAX_QUEUE_TYPES] );
-
-  // allocate all queues from graphics family
-  uint32_t prevQueueFamilyIndex = -1u;
-
-  for( auto i = 0u; i < MAX_QUEUE_TYPES; ++i )
-  {
-    auto& familyIndex = familyIndexType[i];
-    if( prevQueueFamilyIndex == familyIndex )
-    {
-      continue;
-    }
-
-    auto& queueCount = mQueueFamilyProperties[familyIndex].queueCount;
-
-    // fill queue create info for the family.
-    // note the priorities are not being set as local pointer will out of scope, this
-    // will be fixed by the caller function
-    auto info = vk::DeviceQueueCreateInfo{}
-            .setPQueuePriorities( nullptr )
-            .setQueueCount( queueCount )
-            .setQueueFamilyIndex( familyIndex );
-    queueInfos.push_back( info );
-    prevQueueFamilyIndex = familyIndex;
-  }
-
-  return queueInfos;
-}
-
-std::vector< const char* > Graphics::PrepareDefaultInstanceExtensions()
-{
-  auto extensions = vk::enumerateInstanceExtensionProperties();
-
-  std::string extensionName;
-
-  bool xlibAvailable{ false };
-  bool xcbAvailable{ false };
-  bool waylandAvailable{ false };
-
-  for( auto&& ext : extensions.value )
-  {
-    extensionName = ext.extensionName;
-    if( extensionName == VK_KHR_XCB_SURFACE_EXTENSION_NAME )
-    {
-      xcbAvailable = true;
-    }
-    else if( extensionName == VK_KHR_XLIB_SURFACE_EXTENSION_NAME )
-    {
-      xlibAvailable = true;
-    }
-    else if( extensionName == VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME )
-    {
-      waylandAvailable = true;
-    }
-  }
-
-  std::vector< const char* > retval{};
-
-  // depending on the platform validate extensions
-  auto platform = GetDefaultPlatform();
-
-  if( platform != Platform::UNDEFINED )
-  {
-    if (platform == Platform::XCB && xcbAvailable)
-    {
-      retval.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME);
-    }
-    else if (platform == Platform::XLIB && xlibAvailable)
-    {
-      retval.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
-    }
-    else if (platform == Platform::WAYLAND && waylandAvailable)
-    {
-      retval.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
-    }
-  }
-  else // try to determine the platform based on available extensions
-  {
-    if (xcbAvailable)
-    {
-      mPlatform = Platform::XCB;
-      retval.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME);
-    }
-    else if (xlibAvailable)
-    {
-      mPlatform = Platform::XLIB;
-      retval.push_back(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
-    }
-    else if (waylandAvailable)
-    {
-      mPlatform = Platform::WAYLAND;
-      retval.push_back(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
-    }
-    else
-    {
-      // can't determine the platform!
-      mPlatform = Platform::UNDEFINED;
-    }
-  }
-
-  // other essential extensions
-  retval.push_back( VK_KHR_SURFACE_EXTENSION_NAME );
-  retval.push_back( VK_EXT_DEBUG_REPORT_EXTENSION_NAME );
-
-  return retval;
-}
-
-RefCountedCommandPool Graphics::GetCommandPool( std::thread::id )
-{
-  RefCountedCommandPool commandPool;
-  {
-    std::lock_guard< std::mutex > lock{ mMutex };
-    commandPool = mResourceCache->FindCommandPool( std::this_thread::get_id() );
-  }
-
-  if( !commandPool )
-  {
-    auto&& createInfo = vk::CommandPoolCreateInfo{}.setFlags( vk::CommandPoolCreateFlagBits::eResetCommandBuffer );
-    commandPool = CommandPool::New( *this,  createInfo);
-  }
-
-  return commandPool;
-}
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-graphics.h b/dali/graphics/vulkan/vulkan-graphics.h
deleted file mode 100644 (file)
index 699e7f5..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_GRAPHICS
-#define DALI_GRAPHICS_VULKAN_GRAPHICS
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef VULKAN_HPP_NO_EXCEPTIONS
-#define VULKAN_HPP_NO_EXCEPTIONS
-#endif
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/graphics/surface-factory.h>
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <dali/graphics/vulkan/vulkan-queue.h>
-#include <dali/graphics/vulkan/vulkan-swapchain.h>
-
-#include <thread>
-#include <mutex>
-#include <map>
-#include <functional>
-
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace API
-{
-class Controller;
-}
-namespace VulkanAPI
-{
-class Controller;
-}
-
-namespace Vulkan
-{
-
-class Buffer;
-
-class Image;
-
-class Pipeline;
-
-class Shader;
-
-class Framebuffer;
-
-class Surface;
-
-class CommandPool;
-
-class DescriptorPool;
-
-class GpuMemoryManager;
-class ResourceCache;
-
-using SurfaceFactory = Dali::Integration::Graphics::SurfaceFactory;
-
-struct SwapchainSurfacePair
-{
-  RefCountedSwapchain swapchain;
-  RefCountedSurface surface;
-};
-
-class Graphics
-{
-
-public:
-  Graphics();
-
-  Graphics( const Graphics& ) = delete;
-
-  Graphics& operator=( const Graphics& ) = delete;
-
-  ~Graphics();
-
-public: // Create methods
-
-  void Create();
-
-  void CreateDevice();
-
-  FBID CreateSurface( std::unique_ptr< SurfaceFactory > surfaceFactory );
-
-  RefCountedSwapchain CreateSwapchainForSurface( RefCountedSurface surface );
-
-  RefCountedShader CreateShader(); //will see if this will work
-
-  RefCountedPipeline CreatePipeline();
-
-  RefCountedFence CreateFence( const vk::FenceCreateInfo& fenceCreateInfo );
-
-  RefCountedBuffer CreateBuffer( size_t size, BufferType type );
-
-  RefCountedBuffer CreateBuffer( const vk::BufferCreateInfo& bufferCreateInfo );
-
-  RefCountedFramebuffer CreateFramebuffer();
-
-  RefCountedImage CreateImage( const vk::ImageCreateInfo& imageCreateInfo );
-
-  RefCountedImageView CreateImageView( const vk::ImageViewCreateFlags& flags,
-                                       const RefCountedImage& image,
-                                       vk::ImageViewType viewType,
-                                       vk::Format format,
-                                       vk::ComponentMapping components,
-                                       vk::ImageSubresourceRange subresourceRange );
-
-  RefCountedImageView CreateImageView( RefCountedImage image );
-
-  RefCountedDescriptorPool CreateDescriptorPool();
-
-  RefCountedGpuMemoryBlock CreateGpuMemoryBlock();
-
-  RefCountedDescriptorSet CreateDescriptorSet();
-
-  RefCountedSampler CreateSampler( const vk::SamplerCreateInfo& samplerCreateInfo );
-
-  RefCountedCommandBuffer CreateCommandBuffer( bool primary );
-
-public: // Actions
-  vk::Result WaitForFence( RefCountedFence fence, uint32_t timeout = std::numeric_limits< uint32_t >::max() );
-
-  vk::Result WaitForFences( const std::vector< RefCountedFence >& fences,
-                            bool waitAll = true,
-                            uint32_t timeout = std::numeric_limits< uint32_t >::max());
-
-  vk::Result ResetFence( RefCountedFence fence );
-
-  vk::Result ResetFences( const std::vector< RefCountedFence >& fences );
-
-  vk::Result BindImageMemory( RefCountedImage image, RefCountedGpuMemoryBlock memory, uint32_t offset);
-
-  vk::Result Submit( Queue& queue, const std::vector< SubmissionData >& submissionData, RefCountedFence fence );
-
-  vk::Result Present( Queue& queue, vk::PresentInfoKHR presentInfo );
-
-  vk::Result QueueWaitIdle( Queue& queue );
-
-  vk::Result DeviceWaitIdle();
-
-public: // Getters
-  RefCountedSurface GetSurface( FBID surfaceId );
-
-  RefCountedSwapchain GetSwapchainForSurface( RefCountedSurface surface );
-
-  RefCountedSwapchain GetSwapchainForFBID( FBID surfaceId );
-
-  vk::Device GetDevice() const;
-
-  vk::PhysicalDevice GetPhysicalDevice() const;
-
-  vk::Instance GetInstance() const;
-
-  const vk::AllocationCallbacks& GetAllocator() const;
-
-  GpuMemoryManager& GetDeviceMemoryManager() const;
-
-  const vk::PhysicalDeviceMemoryProperties& GetMemoryProperties() const;
-
-  Queue& GetGraphicsQueue( uint32_t index = 0u ) const;
-
-  Queue& GetTransferQueue( uint32_t index = 0u ) const;
-
-  Queue& GetComputeQueue( uint32_t index = 0u ) const;
-
-  Queue& GetPresentQueue() const;
-
-  Platform GetDefaultPlatform() const;
-
-  Dali::Graphics::API::Controller& GetController();
-
-  bool IsShuttingDown();
-
-public: //Cache management methods
-
-  void AddBuffer( RefCountedBuffer buffer );
-
-  void AddImage( RefCountedImage image );
-
-  void AddImageView( RefCountedImageView imageView );
-
-  void AddShader( RefCountedShader shader );
-
-  void AddCommandPool( RefCountedCommandPool pool );
-
-  void AddDescriptorPool( RefCountedDescriptorPool pool );
-
-  void AddFramebuffer( RefCountedFramebuffer framebuffer );
-
-  void AddSampler( RefCountedSampler sampler );
-
-  RefCountedShader FindShader( vk::ShaderModule shaderModule );
-
-  RefCountedImage FindImage( vk::Image image );
-
-  void RemoveBuffer( Buffer& buffer );
-
-  void RemoveImage( Image& image );
-
-  void RemoveImageView( ImageView& imageView );
-
-  void RemoveShader( Shader& shader );
-
-  void RemoveCommandPool( CommandPool& commandPool );
-
-  void RemoveDescriptorPool( DescriptorPool& pool );
-
-  void RemoveFramebuffer( Framebuffer& framebuffer );
-
-  void RemoveSampler( Sampler& sampler );
-
-  void CollectGarbage();
-
-  void DiscardResource( std::function< void() > deleter );
-
-
-private: // Methods
-
-  void CreateInstance( const std::vector< const char* >& extensions,
-                       const std::vector< const char* >& validationLayers );
-
-  void DestroyInstance();
-
-  void PreparePhysicalDevice();
-
-  void GetPhysicalDeviceProperties();
-
-  void GetQueueFamilyProperties();
-
-  std::vector< vk::DeviceQueueCreateInfo > GetQueueCreateInfos();
-
-  std::vector< const char* > PrepareDefaultInstanceExtensions();
-
-  RefCountedCommandPool GetCommandPool( std::thread::id );
-
-private: // Members
-
-  // physical device
-  vk::PhysicalDevice mPhysicalDevice;
-
-  // logical device
-  vk::Device mDevice;
-
-  vk::Instance mInstance;
-
-  // physical device properties
-  std::unique_ptr< vk::PhysicalDeviceProperties > mPhysicalDeviceProperties;
-  std::unique_ptr< vk::PhysicalDeviceMemoryProperties > mPhysicalDeviceMemoryProperties;
-  std::unique_ptr< vk::PhysicalDeviceFeatures > mPhysicalDeviceFeatures;
-
-  std::unique_ptr< vk::AllocationCallbacks > mAllocator{ nullptr };
-
-  // queue family properties
-  std::vector< vk::QueueFamilyProperties > mQueueFamilyProperties;
-
-  // Sets of queues
-  std::vector< std::unique_ptr< Queue > > mGraphicsQueues;
-  std::vector< std::unique_ptr< Queue > > mTransferQueues;
-  std::vector< std::unique_ptr< Queue > > mComputeQueues;
-  //std::unique_ptr< Queue > mPresentQueue;
-
-  std::unique_ptr< ResourceCache > mResourceCache;
-
-  std::unordered_map< FBID, SwapchainSurfacePair > mSurfaceFBIDMap;
-  FBID mBaseFBID{ 0u };
-
-  std::unique_ptr< GpuMemoryManager > mDeviceMemoryManager;
-
-  Platform mPlatform{ Platform::UNDEFINED };
-
-  std::mutex mMutex;
-
-  std::unique_ptr< Dali::Graphics::VulkanAPI::Controller > mGfxController;
-
-  bool mShuttingDown = false;
-
-};
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_GRAPHICS
diff --git a/dali/graphics/vulkan/vulkan-image-view.cpp b/dali/graphics/vulkan/vulkan-image-view.cpp
deleted file mode 100644 (file)
index e6d96b5..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-image-view.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <utility>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-ImageView::ImageView( Graphics& graphics, RefCountedImage image, vk::ImageViewCreateInfo createInfo )
-        : mGraphics(&graphics),
-          mImage(std::move(image)),
-          mCreateInfo(std::move(createInfo)),
-          mImageView(nullptr)
-{
-}
-
-ImageView::~ImageView() = default;
-
-RefCountedImageView ImageView::New( Graphics& graphics,
-                                           const RefCountedImage& image,
-                                           const vk::ImageViewCreateInfo& createInfo )
-{
-  return RefCountedImageView( new ImageView(graphics, image, createInfo) );
-}
-
-vk::ImageView ImageView::GetVkHandle() const
-{
-  return mImageView;
-}
-
-RefCountedImage ImageView::GetImage() const
-{
-  return mImage;
-}
-
-uint32_t ImageView::GetLayerCount() const
-{
-  return mImage->GetLayerCount();
-}
-
-uint32_t ImageView::GetMipLevelCount() const
-{
-  return mImage->GetMipLevelCount();
-}
-
-vk::ImageAspectFlags ImageView::GetImageAspectMask() const
-{
-  return vk::ImageAspectFlags();
-}
-
-const ImageView& ImageView::ConstRef()
-{
-  return *this;
-}
-
-ImageView& ImageView::Ref()
-{
-  return *this;
-}
-
-ImageView::operator vk::ImageView*()
-{
-  return &mImageView;
-}
-
-bool ImageView::OnDestroy()
-{
-  if( !mGraphics->IsShuttingDown() )
-  {
-    mGraphics->RemoveImageView( *this );
-  }
-
-  auto device = mGraphics->GetDevice();
-  auto imageView = mImageView;
-  auto allocator = &mGraphics->GetAllocator();
-
-  mGraphics->DiscardResource( [device, imageView, allocator]() {
-#ifndef NDEBUG
-    printf("Invoking IMAGE VIEW deleter function\n");
-#endif
-    device.destroyImageView(imageView, allocator);
-  } );
-
-  return VkManaged::OnDestroy();
-}
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-
diff --git a/dali/graphics/vulkan/vulkan-image-view.h b/dali/graphics/vulkan/vulkan-image-view.h
deleted file mode 100644 (file)
index 1c45715..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_IMAGE_VIEW
-#define DALI_GRAPHICS_VULKAN_IMAGE_VIEW
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-/*
- * ImageView
- */
-class ImageView : public VkManaged
-{
-public:
-
-  /**
-   * Creates ImageView according to the given spec
-   * @param graphics
-   * @param image
-   * @param info
-   * @return
-   */
-  static RefCountedImageView New( Graphics& graphics, const RefCountedImage& image, const vk::ImageViewCreateInfo& createInfo);
-
-
-  ~ImageView() override;
-
-  /**
-   *
-   * @return
-   */
-  vk::ImageView GetVkHandle() const;
-
-  /**
-   * Returns bound ImageRef
-   * @return
-   */
-  RefCountedImage GetImage() const;
-
-  /**
-   *
-   * @return
-   */
-  uint32_t GetLayerCount() const;
-
-  /**
-   *
-   * @return
-   */
-  uint32_t GetMipLevelCount() const;
-
-  /**
-   *
-   * @return
-   */
-  vk::ImageAspectFlags GetImageAspectMask() const;
-
-  const ImageView& ConstRef();
-
-  ImageView& Ref();
-
-  operator vk::ImageView*();
-
-  bool OnDestroy() override;
-
-private:
-  ImageView( Graphics& graphics,
-             RefCountedImage image,
-             vk::ImageViewCreateInfo createInfo );
-
-private:
-  Graphics*                      mGraphics;
-  RefCountedImage                mImage;
-  vk::ImageViewCreateInfo        mCreateInfo;
-  vk::ImageView                  mImageView;
-};
-
-} //namespace Vulkan
-} //namespace Graphics
-} //namespace Dali
-
-#endif //DALI_GRAPHICS_VULKAN_IMAGE_VIEW
diff --git a/dali/graphics/vulkan/vulkan-image.cpp b/dali/graphics/vulkan/vulkan-image.cpp
deleted file mode 100644 (file)
index 0c91036..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-Image::~Image() = default;
-
-RefCountedImage Image::New( Graphics& graphics, vk::ImageCreateInfo createInfo )
-{
-  return RefCountedImage( new Image( graphics, createInfo, nullptr ) );
-}
-
-RefCountedImage Image::NewFromExternal( Graphics& graphics, vk::ImageCreateInfo createInfo, vk::Image externalImage )
-{
-  return RefCountedImage( new Image( graphics, createInfo, externalImage ) );
-}
-
-Image::Image( Graphics& graphics, const vk::ImageCreateInfo& createInfo, vk::Image externalImage )
-        : mGraphics(&graphics),
-          mCreateInfo(createInfo),
-          mImage(externalImage),
-          mImageLayout(mCreateInfo.initialLayout),
-          mIsExternal( static_cast<bool>(externalImage))
-{
-}
-
-vk::Image Image::GetVkHandle() const
-{
-  return mImage;
-}
-
-vk::ImageLayout Image::GetImageLayout() const
-{
-  return mImageLayout;
-}
-
-uint32_t Image::GetWidth() const
-{
-  return mCreateInfo.extent.width;
-}
-
-uint32_t Image::GetHeight() const
-{
-  return mCreateInfo.extent.height;
-}
-
-uint32_t Image::GetLayerCount() const
-{
-  return mCreateInfo.arrayLayers;
-}
-
-uint32_t Image::GetMipLevelCount() const
-{
-  return mCreateInfo.mipLevels;
-}
-
-vk::Format Image::GetFormat() const
-{
-  return mCreateInfo.format;
-}
-
-vk::ImageType Image::GetImageType() const
-{
-  return mCreateInfo.imageType;
-}
-
-vk::ImageTiling Image::GetImageTiling() const
-{
-  return mCreateInfo.tiling;
-}
-
-void Image::AssignMemory( RefCountedGpuMemoryBlock memory )
-{
-  mDeviceMemory = memory;
-}
-
-const Image& Image::ConstRef()
-{
-  return *this;
-}
-
-Image& Image::Ref()
-{
-  return *this;
-}
-
-Image::operator vk::Image*()
-{
-  return &mImage;
-}
-
-vk::ImageUsageFlags Image::GetUsageFlags() const
-{
-  return mCreateInfo.usage;
-}
-
-bool Image::OnDestroy()
-{
-  if( !mIsExternal )
-  {
-    if( !mGraphics->IsShuttingDown() )
-    {
-      mGraphics->RemoveImage(*this);
-    }
-
-    auto device = mGraphics->GetDevice();
-    auto image = mImage;
-    auto allocator = &mGraphics->GetAllocator();
-
-    mGraphics->DiscardResource([device, image, allocator]() {
-#ifndef NDEBUG
-      printf("Invoking IMAGE deleter function\n");
-#endif
-      device.destroyImage(image, allocator);
-    });
-  }
-
-  return false;
-}
-
-} // namespace Vulkan
-
-} // namespace Graphics
-
-} // namespace Dali
\ No newline at end of file
diff --git a/dali/graphics/vulkan/vulkan-image.h b/dali/graphics/vulkan/vulkan-image.h
deleted file mode 100644 (file)
index 90e5647..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_IMAGE
-#define DALI_GRAPHICS_VULKAN_IMAGE
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-class Image : public VkManaged
-{
-public:
-  /**
-   * Creates new managed Image object
-   * @param graphics
-   * @param createInfo
-   * @return
-   */
-  static RefCountedImage New( Graphics& graphics, vk::ImageCreateInfo createInfo );
-
-  /**
-   * Creates new managed object from external image, lifecycle must be managed
-   * explicitly, as well as any data
-   * @param graphics
-   * @param createInfo
-   * @param image
-   * @return
-   */
-  static RefCountedImage NewFromExternal( Graphics& graphics, vk::ImageCreateInfo createInfo, vk::Image externalImage );
-
-  /**
-   * Destructor
-   */
-  ~Image() override;
-
-  /**
-   * Returns underlying Vulkan object
-   * @return
-   */
-  vk::Image GetVkHandle() const;
-
-  /**
-   * Returns VkImageLayout associated with the image
-   * @return
-   */
-  vk::ImageLayout GetImageLayout() const;
-
-  /**
-   * Returns width in pixels
-   * @return
-   */
-  uint32_t GetWidth() const;
-
-  /**
-   * Returns height in pixels
-   * @return
-   */
-  uint32_t GetHeight() const;
-
-  /**
-   * Returns number of layers
-   * @return
-   */
-  uint32_t GetLayerCount() const;
-
-  /**
-   * Returns number of mipmap levels
-   * @return
-   */
-  uint32_t GetMipLevelCount() const;
-
-  /**
-   * Returns pixel format
-   * @return
-   */
-  vk::Format GetFormat() const;
-
-  /**
-   * returns image type ( VkImageType)
-   * @return
-   */
-  vk::ImageType GetImageType() const;
-
-  /**
-   * Returns used image tiling mode
-   * @return
-   */
-  vk::ImageTiling GetImageTiling() const;
-
-  /**
-   *
-   * @return
-   */
-  vk::ImageUsageFlags  GetUsageFlags() const;
-
-  /**
-   * Assigns the specified image memory to the image
-   * @warning This method does NOT bind the memory. Use Graphics::BindImageMemory instead
-   * @param memory The device memory to be assigned to the image
-   */
-  void AssignMemory( RefCountedGpuMemoryBlock memory );
-
-  const Image& ConstRef();
-
-  Image& Ref();
-
-  operator vk::Image*();
-
-  bool OnDestroy() override;
-
-private:
-
-  /**
-   * Creates new VkImage with given specification, it doesn't
-   * bind the memory.
-   * @param graphics
-   * @param createInfo
-   */
-  Image( Graphics& graphics, const vk::ImageCreateInfo& createInfo, vk::Image externalImage = nullptr );
-
-private:
-  Graphics*           mGraphics;
-  vk::ImageCreateInfo mCreateInfo;
-  vk::Image           mImage;
-  vk::ImageLayout     mImageLayout;
-
-  RefCountedGpuMemoryBlock   mDeviceMemory;
-  bool mIsExternal;
-};
-
-} // namespace Vulkan
-
-} // namespace Graphics
-
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_IMAGE
diff --git a/dali/graphics/vulkan/vulkan-pipeline.cpp b/dali/graphics/vulkan/vulkan-pipeline.cpp
deleted file mode 100644 (file)
index bcc8099..0000000
+++ /dev/null
@@ -1,538 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-surface.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-#include <dali/graphics/vulkan/vulkan-descriptor-set.h>
-#include <dali/graphics/vulkan/spirv/vulkan-spirv.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-namespace
-{
-static const vk::ShaderStageFlags DEFAULT_SHADER_STAGES{ vk::ShaderStageFlagBits::eVertex|vk::ShaderStageFlagBits::eFragment };
-}
-
-/**
- * Class Pipeline::Impl
- * Internal implementation of the pipeline
- */
-struct Pipeline::Impl
-{
-
-
-  Impl( Vulkan::Graphics& graphics, vk::GraphicsPipelineCreateInfo info ) :
-    mInfo( std::move(info) ),
-    mGraphics( graphics )
-  {
-  };
-
-  Impl() = default;
-  ~Impl()
-  {
-    if(mPipelineLayout)
-    {
-      mGraphics.GetDevice().destroyPipelineLayout( mPipelineLayout, mGraphics.GetAllocator() );
-    }
-    if(mPipeline)
-    {
-      mGraphics.GetDevice().destroyPipeline( mPipeline, mGraphics.GetAllocator() );
-    }
-  }
-
-  /**
-   *
-   * @return
-   */
-  vk::Pipeline GetVkHandle() const
-  {
-    return mPipeline;
-  }
-
-  vk::Result Initialise()
-  {
-    if( !ValidateShaderModules() )
-    {
-      return vk::Result::eErrorInitializationFailed;
-    }
-
-    if(!mInfo.layout)
-    {
-      CreatePipelineLayout();
-    }
-    else
-    {
-      mPipelineLayout = mInfo.layout;
-    }
-
-    // use default render pass for default framebuffer
-    // TODO: swapchain/surface should use vulkan-framebuffer object
-    // in place of swapchain structures!
-    if( !mInfo.renderPass )
-    {
-      SetRenderPass(mGraphics.GetSwapchainForFBID(0u)->
-              GetCurrentFramebuffer()->GetRenderPassVkHandle());
-    }
-
-    if(!mInfo.pRasterizationState)
-    {
-      SetRasterizationState();
-    }
-    else
-    {
-      mRasterizationState = *mInfo.pRasterizationState;
-    }
-
-    if(!mInfo.pDepthStencilState)
-    {
-      SetDepthStencilState();
-    }
-
-    if(!mInfo.pMultisampleState)
-    {
-      SetMultisampleState();
-    }
-
-    if(!mInfo.pColorBlendState)
-    {
-      SetColorBlendState();
-    }
-
-    mInfo.setFlags( vk::PipelineCreateFlagBits::eAllowDerivatives );
-
-    // create pipeline
-    mPipeline = VkAssert( mGraphics.GetDevice().createGraphicsPipeline( nullptr, mInfo, mGraphics.GetAllocator() ) );
-    if(mPipeline)
-    {
-      return vk::Result::eSuccess;
-    }
-    return vk::Result::eErrorInitializationFailed;
-  }
-
-  void SetRenderPass( vk::RenderPass renderpass )
-  {
-    mInfo.setRenderPass( renderpass );
-  }
-
-  void SetDepthStencilState()
-  {
-    mDepthStencilState = vk::PipelineDepthStencilStateCreateInfo{};
-    mDepthStencilState.setDepthBoundsTestEnable( false );
-    mDepthStencilState.setStencilTestEnable( false );
-    mInfo.setPDepthStencilState( & mDepthStencilState );
-  }
-
-  void SetMultisampleState()
-  {
-    mMultisampleState = vk::PipelineMultisampleStateCreateInfo{};
-    mMultisampleState.setSampleShadingEnable( false );
-    mMultisampleState.setRasterizationSamples( vk::SampleCountFlagBits::e1);
-    mMultisampleState.setAlphaToCoverageEnable( false );
-    mMultisampleState.setMinSampleShading( 1.0f );
-    mMultisampleState.setPSampleMask( nullptr );
-    mInfo.setPMultisampleState( &mMultisampleState );
-  }
-
-  void SetVertexInputState(
-    std::vector<vk::VertexInputAttributeDescription> attrDesc,
-    std::vector<vk::VertexInputBindingDescription> bindingDesc)
-  {
-    mBindingDesc.clear();
-    mAttrDesc.clear();
-    mVertexInputState = vk::PipelineVertexInputStateCreateInfo{};
-    mVertexInputState.setPVertexAttributeDescriptions( (mAttrDesc = attrDesc).data() );
-    mVertexInputState.setPVertexBindingDescriptions( (mBindingDesc = bindingDesc).data() );
-    mVertexInputState.setVertexAttributeDescriptionCount( U32(mAttrDesc.size()) );
-    mVertexInputState.setVertexBindingDescriptionCount( U32(mBindingDesc.size()) );
-    mInfo.setPVertexInputState( &mVertexInputState );
-  }
-
-  /**
-   * Sets the viewport on uncompiled pipeline
-   * @return
-   */
-  void SetViewport( float x, float y, float width, float height )
-  {
-    assert( !mPipeline && "Pipeline cannot be changed anymore!");
-
-    // AB: add scissor, read data from graphics for fullscreen viewport
-    // simplified mode for the demo purposes
-    mViewports.emplace_back( x, y, width, height );
-    mViewports[0].setMinDepth( 0.0f );
-    mViewports[0].setMaxDepth( 1.0f );
-    mScissors = vk::Rect2D( { static_cast<int32_t>(x), static_cast<int32_t>(y) },
-                            { U32(width), U32(height) });
-    mViewportState = vk::PipelineViewportStateCreateInfo{}.
-           setViewportCount( U32(mViewports.size()) ).
-           setPViewports( mViewports.data() ).
-           setPScissors( &mScissors ).
-           setScissorCount( 1 );
-
-    // replace viewport state
-    mInfo.setPViewportState( &mViewportState );
-  }
-
-  /**
-   *
-   * @param topology
-   * @param restartEnable
-   */
-  void SetInputAssemblyState( vk::PrimitiveTopology topology, bool restartEnable )
-  {
-    mInputAssemblyState = vk::PipelineInputAssemblyStateCreateInfo{};
-    mInputAssemblyState.setPrimitiveRestartEnable( restartEnable );
-    mInputAssemblyState.setTopology( topology );
-    mInfo.setPInputAssemblyState( &mInputAssemblyState );
-  }
-
-  void SetRasterizationState()
-  {
-    mRasterizationState = vk::PipelineRasterizationStateCreateInfo{};
-    mRasterizationState.setCullMode( vk::CullModeFlagBits::eNone );
-    mRasterizationState.setDepthBiasClamp( 0.0f );
-    mRasterizationState.setDepthBiasEnable( false );
-    mRasterizationState.setDepthClampEnable( false );
-    mRasterizationState.setFrontFace( vk::FrontFace::eCounterClockwise );
-    mRasterizationState.setPolygonMode( vk::PolygonMode::eFill );
-    mRasterizationState.setRasterizerDiscardEnable( false );
-    mRasterizationState.setLineWidth( 1.0f );
-    mInfo.setPRasterizationState( & mRasterizationState );
-  }
-
-  void SetColorBlendState()
-  {
-    mAttachementNoBlendState = vk::PipelineColorBlendAttachmentState{};
-    mAttachementNoBlendState.setBlendEnable( true );
-    mAttachementNoBlendState.setColorWriteMask( vk::ColorComponentFlagBits::eR |
-                                                  vk::ColorComponentFlagBits::eG |
-                                                  vk::ColorComponentFlagBits::eB |
-                                                  vk::ColorComponentFlagBits::eA );
-    mAttachementNoBlendState.setSrcColorBlendFactor( vk::BlendFactor::eSrcAlpha );
-    mAttachementNoBlendState.setDstColorBlendFactor( vk::BlendFactor::eOneMinusSrc1Alpha );
-    mAttachementNoBlendState.setSrcAlphaBlendFactor( vk::BlendFactor::eOne );
-    mAttachementNoBlendState.setDstAlphaBlendFactor( vk::BlendFactor::eOneMinusSrc1Alpha );
-    mAttachementNoBlendState.setColorBlendOp( vk::BlendOp::eAdd );
-    mAttachementNoBlendState.setAlphaBlendOp( vk::BlendOp::eAdd );
-
-    mColorBlendState.setBlendConstants( { 1.0f, 1.0f, 1.0f, 1.0f });
-    mColorBlendState = vk::PipelineColorBlendStateCreateInfo{};
-    mColorBlendState.setAttachmentCount( 1 );
-    mColorBlendState.setPAttachments( &mAttachementNoBlendState );
-    mInfo.setPColorBlendState(&mColorBlendState);
-  }
-
-  /**
-   * Sets the shader. Must be set before compiling the pipeline, compiled pipeline
-   * becomes immutable.
-   * @param shader
-   * @param stage
-   * @return
-   */
-  bool SetShader( RefCountedShader shader, Shader::Type stage )
-  {
-    assert( !mPipeline && "Pipeline cannot be changed anymore!");
-
-    // check if shader isn't orphaned for some reason
-    if( !mGraphics.FindShader( *shader ) )
-    {
-      return false;
-    }
-
-    auto info = vk::PipelineShaderStageCreateInfo{}.
-                                                     setModule( *shader ).
-                                                     setStage( static_cast<vk::ShaderStageFlagBits>( stage ) ).
-                                                     setPName( "main" );
-    mShaderStageCreateInfo.push_back( info );
-    mShaderResources.push_back( shader );
-
-    mInfo.setPStages( mShaderStageCreateInfo.data() );
-    mInfo.setStageCount( static_cast<uint32_t>(mShaderStageCreateInfo.size()) );
-
-    return false;
-  }
-
-  /**
-   * Creates deferred pipeline layout. Since not all the shader modules
-   * are supplied in one go the layout creation first must instantiate
-   * correct descriptor set layouts.
-   *
-   * @todo: Store SPIRV data of shader modules in the cache rather than
-   * parsing every time
-   */
-  void CreatePipelineLayout()
-  {
-
-    // pull desciptor set layouts from shaders
-    auto layoutInfo = vk::PipelineLayoutCreateInfo{};
-
-    using DSLayoutBindingArray = std::vector<vk::DescriptorSetLayoutBinding>;
-
-    std::vector<DSLayoutBindingArray> allDescriptorSetLayouts;
-
-    // concatenate all bindings
-    // TODO: @todo validate if there are weird overlaps!
-    for( auto&& shader : mShaderResources )
-    {
-      const auto& reflection = shader->GetSPIRVReflection();
-      auto layouts = reflection.GenerateDescriptorSetLayoutCreateInfo();
-
-      if(allDescriptorSetLayouts.size() < layouts.size())
-      {
-        allDescriptorSetLayouts.resize(layouts.size());
-      }
-
-      for( auto i = 0u; i < layouts.size(); ++i )
-      {
-        auto currIndex = allDescriptorSetLayouts[i].size();
-        allDescriptorSetLayouts[i].insert( allDescriptorSetLayouts[i].end(),
-        layouts[i].pBindings, layouts[i].pBindings + layouts[i].bindingCount );
-        for( auto j = 0u; j < layouts[i].bindingCount; ++j )
-        {
-          allDescriptorSetLayouts[i][j+currIndex].setStageFlags( GetShaderStage( shader ) );
-        }
-      }
-    }
-
-    // create descriptor set layouts for the pipeline
-    std::vector<vk::DescriptorSetLayout> dsLayouts{};
-    dsLayouts.resize( allDescriptorSetLayouts.size() );
-    mDSCreateInfoArray.clear();
-    for( auto i = 0u; i < allDescriptorSetLayouts.size(); ++i )
-    {
-      auto info = vk::DescriptorSetLayoutCreateInfo{}.
-                    setBindingCount( static_cast<uint32_t>(allDescriptorSetLayouts[i].size()) ).
-                    setPBindings( allDescriptorSetLayouts[i].data() );
-
-      mDSCreateInfoArray.push_back( info );
-      dsLayouts[i] = VkAssert( mGraphics.GetDevice().createDescriptorSetLayout( info, mGraphics.GetAllocator() ) );
-    }
-
-    // create pipeline layout
-    layoutInfo.setPSetLayouts( dsLayouts.data() );
-    layoutInfo.setSetLayoutCount( static_cast<uint32_t>(dsLayouts.size()) );
-
-    mPipelineLayout = VkAssert( mGraphics.GetDevice().createPipelineLayout( layoutInfo, mGraphics.GetAllocator() ) );
-
-    mDSLayoutArray = dsLayouts;
-    mInfo.setLayout( mPipelineLayout );
-  }
-
-  vk::ShaderStageFlagBits GetShaderStage( RefCountedShader shader )
-  {
-    for( auto&& stage : mShaderStageCreateInfo )
-    {
-      if( stage.module == *shader )
-      {
-        return stage.stage;
-      }
-    }
-    return vk::ShaderStageFlagBits{};
-  }
-
-  bool Compile()
-  {
-    return Initialise() == vk::Result::eSuccess;
-  }
-
-  bool ValidateShaderModules()
-  {
-    for( auto i = 0u; i < mInfo.stageCount; ++i )
-    {
-      const auto& stage = mInfo.pStages[i];
-      auto shaderHandle = mGraphics.FindShader( stage.module );
-      if( shaderHandle )
-      {
-        bool tracked { false };
-        for(auto&& sh : mShaderResources )
-        {
-          if( sh == shaderHandle )
-          {
-            tracked = true;
-          }
-        }
-        if(!tracked)
-        {
-          mShaderResources.push_back(shaderHandle);
-        }
-      }
-      else
-      {
-        return false; // invalid shader! Can't track it
-      }
-    }
-    return true;
-  }
-
-
-  vk::GraphicsPipelineCreateInfo  mInfo           {    };
-  vk::Pipeline                    mPipeline       { nullptr };
-  uint32_t                        mModified       { 0u };
-  Graphics&                       mGraphics;
-
-  // resources
-  std::vector<RefCountedShader>     mShaderResources;
-
-  vk::PipelineViewportStateCreateInfo mViewportState {};
-  std::vector<vk::Viewport> mViewports {};
-  vk::Rect2D mScissors {};
-
-  std::vector<vk::PipelineShaderStageCreateInfo> mShaderStageCreateInfo;
-  vk::PipelineLayout mPipelineLayout{};
-  std::vector<vk::DescriptorSetLayoutCreateInfo>    mDSCreateInfoArray{};
-  std::vector<vk::DescriptorSetLayout>              mDSLayoutArray{};
-
-  // vertex input state
-  vk::PipelineVertexInputStateCreateInfo            mVertexInputState {};
-  std::vector<vk::VertexInputAttributeDescription>  mAttrDesc;
-  std::vector<vk::VertexInputBindingDescription>    mBindingDesc;
-
-  // vertex input assembly state
-  vk::PipelineInputAssemblyStateCreateInfo          mInputAssemblyState {};
-
-  // rasterization state
-  vk::PipelineRasterizationStateCreateInfo          mRasterizationState {};
-
-  // Dpeth/stencil state
-  vk::PipelineDepthStencilStateCreateInfo           mDepthStencilState {};
-
-  // Multisample state
-  vk::PipelineMultisampleStateCreateInfo            mMultisampleState {};
-
-  // Color blend
-  vk::PipelineColorBlendStateCreateInfo             mColorBlendState {};
-  vk::PipelineColorBlendAttachmentState             mAttachementNoBlendState {};
-
-
-};
-
-/*********************************************************************
- * Class Pipeline
- *
- */
-
-RefCountedPipeline Pipeline::New( Graphics& graphics, const vk::GraphicsPipelineCreateInfo& info )
-{
-  auto pipeline = Handle<Pipeline>( new Pipeline(graphics, info) );
-  //graphics.AddPipeline(pipeline); //TODO: Use the pipeline cache class here?
-  return pipeline;
-}
-
-Pipeline::~Pipeline() = default;
-
-Pipeline::Pipeline( Graphics& graphics, const vk::GraphicsPipelineCreateInfo& info )
-{
-  mImpl = MakeUnique<Pipeline::Impl>( graphics, info );
-}
-
-vk::Pipeline Pipeline::GetVkHandle() const
-{
-  return mImpl->GetVkHandle();
-}
-
-bool Pipeline::OnDestroy()
-{
-  return false;
-}
-
-void Pipeline::SetViewport( float x, float y, float width, float height )
-{
-  mImpl->SetViewport( x, y, width, height );
-}
-
-bool Pipeline::SetShader( RefCountedShader shader, Shader::Type stage )
-{
-  return mImpl->SetShader( shader, stage );
-}
-
-void Pipeline::SetVertexInputState(std::vector<vk::VertexInputAttributeDescription> attrDesc,
-                         std::vector<vk::VertexInputBindingDescription> bindingDesc)
-{
-  mImpl->SetVertexInputState( attrDesc, bindingDesc );
-}
-
-void Pipeline::SetInputAssemblyState( vk::PrimitiveTopology topology, bool restartEnable )
-{
-  mImpl->SetInputAssemblyState( topology, restartEnable );
-}
-
-bool Pipeline::Compile()
-{
-  return mImpl->Compile();
-}
-
-vk::PipelineLayout Pipeline::GetVkPipelineLayout() const
-{
-  return mImpl->mPipelineLayout;
-}
-
-const std::vector<vk::DescriptorSetLayoutCreateInfo>& Pipeline::GetVkDescriptorSetLayoutCreateInfo() const
-{
-  return mImpl->mDSCreateInfoArray;
-}
-
-const std::vector<vk::DescriptorSetLayout>& Pipeline::GetVkDescriptorSetLayouts() const
-{
-  return mImpl->mDSLayoutArray;
-}
-
-const vk::PipelineInputAssemblyStateCreateInfo& Pipeline::GetInputAssemblyState() const
-{
-  return mImpl->mInputAssemblyState;
-}
-
-const vk::PipelineVertexInputStateCreateInfo& Pipeline::GetVertexInputState() const
-{
-  return mImpl->mVertexInputState;
-}
-
-const vk::PipelineViewportStateCreateInfo& Pipeline::GetViewportState() const
-{
-  return mImpl->mViewportState;
-}
-
-const vk::PipelineRasterizationStateCreateInfo& Pipeline::GetRasterizationState() const
-{
-  return mImpl->mRasterizationState;
-}
-
-const vk::PipelineMultisampleStateCreateInfo& Pipeline::GetMultisamplingState() const
-{
-  return mImpl->mMultisampleState;
-}
-
-const vk::PipelineDepthStencilStateCreateInfo& Pipeline::GetDepthStencilState() const
-{
-  return mImpl->mDepthStencilState;
-}
-
-const vk::PipelineColorBlendStateCreateInfo& Pipeline::GetColorBlendState() const
-{
-  return mImpl->mColorBlendState;
-}
-
-} // namespace Vulkan
-
-} // namespace Graphics
-
-} // namespace Dali
\ No newline at end of file
diff --git a/dali/graphics/vulkan/vulkan-pipeline.h b/dali/graphics/vulkan/vulkan-pipeline.h
deleted file mode 100644 (file)
index 40b36e4..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_PIPELINE
-#define DALI_GRAPHICS_VULKAN_PIPELINE
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <dali/graphics/vulkan/vulkan-shader.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Graphics;
-class Pipeline : public VkManaged
-{
-public:
-
-  /**
-   * Creates immutable Pipeline object ( verified resources for tracking )
-   * @param graphics
-   * @param info
-   * @return
-   */
-  static RefCountedPipeline New( Graphics& graphics, const vk::GraphicsPipelineCreateInfo& info = vk::GraphicsPipelineCreateInfo{} );
-
-  /**
-   * Destructor
-   */
-  ~Pipeline() override;
-
-  /**
-   * Sets the viewport
-   * @param x
-   * @param y
-   * @param width
-   * @param height
-   */
-  void SetViewport( float x, float y, float width, float height );
-
-  /**
-   * Attaches A shader module to the particular stage of pipeline
-   * @param shader
-   * @param stage
-   * @return
-   */
-  bool SetShader( RefCountedShader shader, Shader::Type stage );
-
-  /**
-   *
-   * @param attrDesc
-   * @param bindingDesc
-   */
-  void SetVertexInputState(std::vector<vk::VertexInputAttributeDescription> attrDesc,
-                           std::vector<vk::VertexInputBindingDescription> bindingDesc);
-
-  /**
-   *
-   * @param topology
-   * @param restartEnable
-   */
-  void SetInputAssemblyState( vk::PrimitiveTopology topology, bool restartEnable );
-
-  /**
-   *
-   * @return
-   */
-  bool Compile();
-
-  /**
-   *
-   * @return
-   */
-  const std::vector<vk::DescriptorSetLayoutCreateInfo>& GetVkDescriptorSetLayoutCreateInfo() const;
-
-  /**
-   *
-   * @return
-   */
-  const std::vector<vk::DescriptorSetLayout>& GetVkDescriptorSetLayouts() const;
-
-  /**
-   * State getters from the pipeline
-   */
-
-  const vk::PipelineInputAssemblyStateCreateInfo& GetInputAssemblyState() const;
-
-  const vk::PipelineVertexInputStateCreateInfo& GetVertexInputState() const;
-
-  const vk::PipelineViewportStateCreateInfo& GetViewportState() const;
-
-  const vk::PipelineRasterizationStateCreateInfo& GetRasterizationState() const;
-
-  const vk::PipelineMultisampleStateCreateInfo& GetMultisamplingState() const;
-
-  const vk::PipelineDepthStencilStateCreateInfo& GetDepthStencilState() const;
-
-  const vk::PipelineColorBlendStateCreateInfo& GetColorBlendState() const;
-
-private:
-
-  Pipeline( Graphics& graphics, const vk::GraphicsPipelineCreateInfo& info );
-
-public:
-
-  /**
-   * Returns Vulkan VkPipeline object associated with Pipeline
-   * @return
-   */
-  vk::Pipeline GetVkHandle() const;
-
-  /**
-   * Returns Vulkan VkPipelineLayout object associated with Pipeline
-   * @return
-   */
-  vk::PipelineLayout GetVkPipelineLayout() const;
-
-  bool OnDestroy() override;
-
-private:
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-using RefCountedPipeline = Handle<Pipeline>;
-
-} // Namespace Vulkan
-
-} // Namespace Graphics
-
-} // Namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_PIPELINE
diff --git a/dali/graphics/vulkan/vulkan-queue.cpp b/dali/graphics/vulkan/vulkan-queue.cpp
deleted file mode 100644 (file)
index 9fdd20d..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-#include <dali/graphics/vulkan/vulkan-fence.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-queue.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-// submission
-SubmissionData::SubmissionData( const std::vector< vk::Semaphore >& waitSemaphores_,
-                                vk::PipelineStageFlags waitDestinationStageMask_,
-                                const std::vector< RefCountedCommandBuffer >& commandBuffers_,
-                                const std::vector< vk::Semaphore >& signalSemaphores_ )
-        : waitSemaphores( waitSemaphores_ ),
-          waitDestinationStageMask( waitDestinationStageMask_ ),
-          commandBuffers( commandBuffers_ ),
-          signalSemaphores( signalSemaphores_ )
-{
-}
-
-SubmissionData& SubmissionData::SetWaitSemaphores( const std::vector< vk::Semaphore >& semaphores )
-{
-  waitSemaphores = semaphores;
-  return *this;
-}
-
-SubmissionData& SubmissionData::SetWaitDestinationStageMask( vk::PipelineStageFlags dstStageMask )
-{
-  waitDestinationStageMask = dstStageMask;
-  return *this;
-}
-
-SubmissionData& SubmissionData::SetCommandBuffers( const std::vector< RefCountedCommandBuffer >& cmdBuffers )
-{
-  commandBuffers = cmdBuffers;
-  return *this;
-}
-
-SubmissionData& SubmissionData::SetSignalSemaphores( const std::vector< vk::Semaphore >& semaphores )
-{
-  signalSemaphores = semaphores;
-  return *this;
-}
-
-// queue
-Queue::Queue(Graphics& graphics,
-             vk::Queue queue,
-             uint32_t queueFamilyIndex,
-             uint32_t queueIndex,
-             vk::QueueFlags queueFlags)
-        : mGraphics(graphics),
-          mQueue(queue),
-          mFlags(queueFlags),
-          mQueueFamilyIndex(queueFamilyIndex),
-          mQueueIndex(queueIndex)
-{
-}
-
-Queue::~Queue() = default; // queues are non-destructible
-
-vk::Queue Queue::GetVkHandle()
-{
-  return mQueue;
-}
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-queue.h b/dali/graphics/vulkan/vulkan-queue.h
deleted file mode 100644 (file)
index 5ea22eb..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_QUEUE
-#define DALI_GRAPHICS_VULKAN_QUEUE
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-class Fence;
-
-struct SubmissionData
-{
-  SubmissionData() = default;
-
-  explicit SubmissionData( const std::vector< vk::Semaphore >& waitSemaphores_,
-                           vk::PipelineStageFlags waitDestinationStageMask_,
-                           const std::vector< RefCountedCommandBuffer >& commandBuffers_,
-                           const std::vector< vk::Semaphore >& signalSemaphores_ );
-
-  SubmissionData& SetWaitSemaphores( const std::vector< vk::Semaphore >& semaphores );
-
-  SubmissionData& SetWaitDestinationStageMask( vk::PipelineStageFlags dstStageMask );
-
-  SubmissionData& SetCommandBuffers( const std::vector< RefCountedCommandBuffer >& cmdBuffers );
-
-  SubmissionData& SetSignalSemaphores( const std::vector< vk::Semaphore >& semaphores );
-
-  std::vector< vk::Semaphore > waitSemaphores;
-  vk::PipelineStageFlags waitDestinationStageMask;
-  std::vector< RefCountedCommandBuffer > commandBuffers;
-  std::vector< vk::Semaphore > signalSemaphores;
-};
-
-class Queue
-{
-public:
-  Queue() = delete;
-  Queue(Graphics& graphics, vk::Queue queue, uint32_t queueFamilyIndex, uint32_t queueIndex,
-        vk::QueueFlags queueFlags);
-  ~Queue(); // queues are non-destructible
-
-  vk::Queue GetVkHandle();
-
-private:
-  Graphics&                  mGraphics;
-  vk::Queue                  mQueue;
-  vk::QueueFlags             mFlags;
-  uint32_t                   mQueueFamilyIndex;
-  uint32_t                   mQueueIndex;
-};
-
-} // namespace Vulkan
-
-} // namespace Graphics
-
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_QUEUE
diff --git a/dali/graphics/vulkan/vulkan-resource-cache.cpp b/dali/graphics/vulkan/vulkan-resource-cache.cpp
deleted file mode 100644 (file)
index 3265905..0000000
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-resource-cache.h>
-
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-image-view.h>
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics/vulkan/vulkan-shader.h>
-#include <dali/graphics/vulkan/vulkan-descriptor-set.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-sampler.h>
-#include <dali/graphics/vulkan/vulkan-fence.h>
-
-#include <algorithm>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-ResourceCache& ResourceCache::AddBuffer( RefCountedBuffer buffer )
-{
-  mBuffers.push_back( buffer );
-  return *this;
-}
-
-ResourceCache& ResourceCache::AddImage( RefCountedImage image )
-{
-  mImages.push_back( image );
-  return *this;
-}
-
-ResourceCache& ResourceCache::AddImageView( RefCountedImageView imageView )
-{
-  mImageViews.push_back( imageView );
-  return *this;
-}
-
-ResourceCache& ResourceCache::AddShader( RefCountedShader shader )
-{
-  mShaders.push_back( shader );
-  return *this;
-}
-
-ResourceCache& ResourceCache::AddCommandPool( std::thread::id currentThreadId, RefCountedCommandPool pool )
-{
-  mCommandPools[currentThreadId] = pool;
-  return *this;
-}
-
-ResourceCache& ResourceCache::AddDescriptorPool( RefCountedDescriptorPool pool )
-{
-  mDescriptorPools.push_back( pool );
-  return *this;
-}
-
-ResourceCache& ResourceCache::AddFramebuffer( RefCountedFramebuffer framebuffer )
-{
-  mFramebuffers.push_back( framebuffer );
-  return *this;
-}
-
-ResourceCache& ResourceCache::AddSampler( RefCountedSampler sampler )
-{
-  mSamplers.push_back( sampler );
-  return *this;
-}
-
-RefCountedShader ResourceCache::FindShader( vk::ShaderModule shaderModule )
-{
-  auto iterator = std::find_if(mShaders.begin(),
-                               mShaders.end(),
-                               [&](const RefCountedShader entry) { return entry->GetVkHandle() == shaderModule; });
-
-  return iterator == mShaders.end() ? RefCountedShader() : RefCountedShader(&**iterator);
-}
-
-RefCountedCommandPool ResourceCache::FindCommandPool( std::thread::id currentThreadId )
-{
-  return mCommandPools.find( currentThreadId ) == mCommandPools.end() ? RefCountedCommandPool() : mCommandPools[ currentThreadId ];
-}
-
-RefCountedDescriptorPool ResourceCache::FindDescriptorPool( vk::DescriptorPool descriptorPool )
-{
-  auto iterator = std::find_if(mDescriptorPools.begin(),
-                               mDescriptorPools.end(),
-                               [&](const RefCountedDescriptorPool entry) { return entry->GetVkHandle() == descriptorPool; });
-
-  return iterator == mDescriptorPools.end() ? RefCountedDescriptorPool() : RefCountedDescriptorPool(&**iterator);
-}
-
-RefCountedFramebuffer ResourceCache::FindFramebuffer( vk::Framebuffer framebuffer )
-{
-  auto iterator = std::find_if(mFramebuffers.begin(),
-                               mFramebuffers.end(),
-                               [&](const RefCountedFramebuffer entry) { return entry->GetVkHandle() == framebuffer; });
-
-  return iterator == mFramebuffers.end() ? RefCountedFramebuffer() : RefCountedFramebuffer(&**iterator);
-}
-
-RefCountedSampler ResourceCache::FindSampler( vk::Sampler sampler )
-{
-  auto iterator = std::find_if(mSamplers.begin(),
-                               mSamplers.end(),
-                               [&](const RefCountedSampler entry) { return entry->GetVkHandle() == sampler; });
-
-  return iterator == mSamplers.end() ? RefCountedSampler() : RefCountedSampler(&**iterator);
-}
-
-RefCountedBuffer ResourceCache::FindBuffer( vk::Buffer buffer )
-{
-  auto iterator = std::find_if(mBuffers.begin(),
-                               mBuffers.end(),
-                               [&](const RefCountedBuffer entry) { return entry->GetVkHandle() == buffer; });
-
-  return iterator == mBuffers.end() ? RefCountedBuffer() : RefCountedBuffer(&**iterator);
-}
-
-RefCountedImage ResourceCache::FindImage( vk::Image image )
-{
-  auto iterator = std::find_if(mImages.begin(),
-                               mImages.end(),
-                               [&](const RefCountedImage entry) { return entry->GetVkHandle() == image; });
-
-  return iterator == mImages.end() ? RefCountedImage() : RefCountedImage(&**iterator);
-}
-
-RefCountedImageView ResourceCache::FindImageView( vk::ImageView imageView )
-{
-  auto iterator = std::find_if(mImageViews.begin(),
-                               mImageViews.end(),
-                               [&](const RefCountedImageView entry) { return entry->GetVkHandle() == imageView; });
-
-  return iterator == mImageViews.end() ? RefCountedImageView() : RefCountedImageView(&**iterator);
-}
-
-ResourceCache& ResourceCache::RemoveBuffer( Buffer& buffer )
-{
-  if( !mBuffers.empty() )
-  {
-    auto found = std::find_if(mBuffers.begin(),
-                              mBuffers.end(),
-                              [&](const RefCountedBuffer& entry)
-                              {
-                                return entry->GetVkHandle() == buffer.GetVkHandle();
-                              });
-
-    std::iter_swap(found, std::prev(mBuffers.end()));
-    mBuffers.back().Reset();
-    mBuffers.pop_back();
-  }
-  return *this;
-}
-
-ResourceCache& ResourceCache::RemoveImage( Image& image )
-{
-  if( !mImages.empty() )
-  {
-    auto found = std::find_if(mImages.begin(),
-                              mImages.end(),
-                              [&](const RefCountedImage& entry)
-                              {
-                                return entry->GetVkHandle() == image.GetVkHandle();
-                              });
-
-    std::iter_swap(found, std::prev(mImages.end()));
-    mImages.back().Reset();
-    mImages.pop_back();
-  }
-  return *this;
-}
-
-ResourceCache& ResourceCache::RemoveImageView( ImageView& imageView )
-{
-  if( !mImageViews.empty() )
-  {
-    auto found = std::find_if(mImageViews.begin(),
-                              mImageViews.end(),
-                              [&](const RefCountedImageView& entry)
-                              {
-                                return entry->GetVkHandle() == imageView.GetVkHandle();
-                              });
-
-    std::iter_swap(found, std::prev(mImageViews.end()));
-    mImageViews.back().Reset();
-    mImageViews.pop_back();
-  }
-  return *this;
-}
-
-ResourceCache& ResourceCache::RemoveShader( Shader& shader )
-{
-  if( !mShaders.empty() )
-  {
-    auto iterator = std::find_if(mShaders.begin(),
-                                 mShaders.end(),
-                                 [&](const RefCountedShader& entry)
-                                 {
-                                   return &*entry == &shader;
-                                 });
-
-    std::iter_swap(iterator, std::prev(mShaders.end()));
-    mShaders.back().Reset();
-    mShaders.pop_back();
-  }
-  return *this;
-}
-
-ResourceCache& ResourceCache::RemoveCommandPool( CommandPool& commandPool )
-{
-  if( !mCommandPools.empty() )
-  {
-
-    auto found = mCommandPools.end();
-
-    auto it = mCommandPools.begin();
-    while ( it != mCommandPools.end() )
-    {
-      auto& refcounted = (*it).second;
-      if ( refcounted->GetVkHandle() == commandPool.GetVkHandle() )
-      {
-        found = it;
-        break;
-      }
-
-      ++it;
-    }
-
-    mCommandPools.erase( found );
-  }
-  return *this;
-}
-
-ResourceCache& ResourceCache::RemoveDescriptorPool( DescriptorPool& descriptorPool )
-{
-  if( !mDescriptorPools.empty() )
-  {
-    auto iterator = std::find_if(mDescriptorPools.begin(),
-                                 mDescriptorPools.end(),
-                                 [&](const RefCountedDescriptorPool& entry)
-                                 {
-                                   return entry->GetVkHandle() == descriptorPool.GetVkHandle();
-                                 });
-
-    std::iter_swap(iterator, std::prev(mDescriptorPools.end()));
-    mDescriptorPools.back().Reset();
-    mDescriptorPools.pop_back();
-  }
-  return *this;
-}
-
-ResourceCache& ResourceCache::RemoveFramebuffer( Framebuffer &framebuffer )
-{
-  if( !mFramebuffers.empty() )
-  {
-    auto iterator = std::find_if(mFramebuffers.begin(),
-                                 mFramebuffers.end(),
-                                 [&](const RefCountedFramebuffer& entry)
-                                 {
-                                   return entry->GetVkHandle() == framebuffer.GetVkHandle();
-                                 });
-
-    std::iter_swap(iterator, std::prev(mFramebuffers.end()));
-    mFramebuffers.back().Reset();
-    mFramebuffers.pop_back();
-  }
-  return *this;
-}
-
-ResourceCache& ResourceCache::RemoveSampler( Sampler &sampler )
-{
-  if( !mSamplers.empty() )
-  {
-    auto iterator = std::find_if(mSamplers.begin(),
-                                 mSamplers.end(),
-                                 [&](const RefCountedSampler& entry)
-                                 {
-                                   return entry->GetVkHandle() == sampler.GetVkHandle();
-                                 });
-
-    std::iter_swap(iterator, std::prev(mSamplers.end()));
-    mSamplers.back().Reset();
-    mSamplers.pop_back();
-  }
-  return *this;
-}
-
-void ResourceCache::CollectGarbage()
-{
-  for( const auto& deleter : mDiscardQueue )
-  {
-    deleter();
-  }
-
-  mDiscardQueue.clear();
-}
-
-void ResourceCache::EnqueueDiscardOperation( std::function<void()> deleter )
-{
-  mDiscardQueue.push_back(std::move(deleter));
-#ifndef NDEBUG
-  printf("DISCARD QUEUE SIZE: %ld\n", mDiscardQueue.size());
-#endif
-}
-
-// Called only by the Graphics class destructor
-void ResourceCache::Clear()
-{
-  //This call assumes that all possible render threads have been joined by this point.
-  //This function is called by the Graphics class destructor. At this point the caches
-  //should contain the last reference of all created objects.
-  //Clearing the cache here will enqueue all resources to the discard queue ready to be garbage collected.
-  mBuffers.clear();
-  mImages.clear();
-  mImageViews.clear();
-  mDescriptorPools.clear();
-  mShaders.clear();
-  mSamplers.clear();
-  mFramebuffers.clear();
-  mCommandPools.clear();
-}
-
-void ResourceCache::PrintReferenceCountReport( size_t* outObjectCount )
-{
-  auto totalObjectCount = mBuffers.size() +
-                          mImages.size() +
-                          mImageViews.size() +
-                          mShaders.size() +
-                          mDescriptorPools.size() +
-                          mFramebuffers.size() +
-                          mSamplers.size();
-
-  if( outObjectCount )
-  {
-    *outObjectCount = totalObjectCount;
-  }
-
-  uint32_t totalRefCount = 0;
-  printf("TOTAL OBJECT COUNT: %ld\n", totalObjectCount);
-  printf("BUFFER REFERENCES:\n");
-  for (auto& buffer : mBuffers)
-  {
-    auto refCount = buffer->GetRefCount();
-    printf("\tbuffer->%p : %d\n", static_cast< void* >(buffer->GetVkHandle()), refCount);
-    totalRefCount += refCount;
-  }
-  printf("\tTotal reference count: %d\n", totalRefCount);
-  printf("\tTotal object count: %ld\n\n", mBuffers.size());
-  totalRefCount = 0;
-
-  printf("IMAGE REFERENCES:\n");
-  for( auto& image : mImages )
-  {
-    auto refCount = image->GetRefCount();
-    printf("\timage->%p : %d\n", static_cast< void* >(image->GetVkHandle()), refCount);
-    totalRefCount += refCount;
-  }
-  printf("\tTotal reference count: %d\n", totalRefCount);
-  printf("\tTotal object count: %ld\n\n", mImages.size());
-  totalRefCount = 0;
-
-  printf("IMAGE VIEW REFERENCES:\n");
-  for( auto& imageView : mImageViews )
-  {
-    auto refCount = imageView->GetRefCount();
-    printf("\timage view->%p : %d\n", static_cast< void* >(imageView->GetVkHandle()), refCount);
-    totalRefCount += refCount;
-  }
-  printf("\tTotal reference count: %d\n", totalRefCount);
-  printf("\tTotal object count: %ld\n\n", mImageViews.size());
-  totalRefCount = 0;
-
-  printf("SHADER MODULE REFERENCES:\n");
-  for( auto& shader : mShaders )
-  {
-    auto refCount = shader->GetRefCount();
-    printf("\tshader module->%p : %d\n", static_cast< void* >(shader->GetVkHandle()), refCount);
-    totalRefCount += refCount;
-  }
-  printf("\tTotal reference count: %d\n", totalRefCount);
-  printf("\tTotal object count: %ld\n\n", mShaders.size());
-  totalRefCount = 0;
-
-  printf("DESCRIPTOR POOL REFERENCES:\n");
-  for( auto& descPool : mDescriptorPools )
-  {
-    auto refCount = descPool->GetRefCount();
-    printf("\tdescriptor pool->%p : %d\n", static_cast< void* >(descPool->GetVkHandle()), refCount);
-    totalRefCount += refCount;
-  }
-  printf("\tTotal reference count: %d\n", totalRefCount);
-  printf("\tTotal object count: %ld\n\n", mDescriptorPools.size());
-  totalRefCount = 0;
-
-  printf("FRAMEBUFFER REFERENCES:\n");
-  for( auto& framebuffer : mFramebuffers )
-  {
-    auto refCount = framebuffer->GetRefCount();
-    printf("\tframebuffer->%p : %d\n", static_cast< void* >(framebuffer->GetVkHandle()), refCount);
-    totalRefCount += refCount;
-  }
-  printf("\tTotal reference count: %d\n", totalRefCount);
-  printf("\tTotal object count: %ld\n\n", mFramebuffers.size());
-  totalRefCount = 0;
-
-  printf("SAMPLER REFERENCES:\n");
-  for( auto& sampler : mSamplers )
-  {
-    auto refCount = sampler->GetRefCount();
-    printf("\tsampler->%p : %d\n", static_cast< void* >(sampler->GetVkHandle()), refCount);
-    totalRefCount += refCount;
-  }
-  printf("\tTotal reference count: %d\n", totalRefCount);
-  printf("\tTotal object count: %ld\n\n", mSamplers.size());
-}
-
-} //namespace Vulkan
-} //namespace Graphics
-} //namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-resource-cache.h b/dali/graphics/vulkan/vulkan-resource-cache.h
deleted file mode 100644 (file)
index f5a2193..0000000
+++ /dev/null
@@ -1,255 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_RESOURCE_CACHE
-#define DALI_GRAPHICS_VULKAN_RESOURCE_CACHE
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef VULKAN_HPP_NO_EXCEPTIONS
-#define VULKAN_HPP_NO_EXCEPTIONS
-#endif
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <functional>
-#include <thread>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-using CommandPoolMap = std::unordered_map< std::thread::id, RefCountedCommandPool >;
-using DiscardQueue = std::vector< std::function< void() > >;
-
-/**
- * Stores and manages Vulkan resources
- */
-class ResourceCache final
-{
-public:
-  /**
-   * Adds the provided buffer object to the buffer cache
-   * @param buffer The buffer object to be added to the cache
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& AddBuffer( RefCountedBuffer buffer );
-
-  /**
-   * Adds the provided image object to the image cache
-   * @param image The image object to be added to the cache
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& AddImage( RefCountedImage image );
-
-  /**
-   * Adds the provided image view object to the image view cache
-   * @param imageView The image view object to be added to the cache
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& AddImageView( RefCountedImageView imageView );
-
-  /**
-   * Adds the provided shader object to the pipeline cache
-   * @param shader The shader object to be added to the cache
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& AddShader( RefCountedShader shader );
-
-  /**
-   * Adds the provided command pool object to the command pool cache
-   * @param pool The command pool object to be added to the cache
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& AddCommandPool( std::thread::id currentThreadId, RefCountedCommandPool pool );
-
-  /**
-   * Adds the provided descriptor pool object to the descriptor pool cache
-   * @param pool The descriptor pool object to be added to the cache
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& AddDescriptorPool( RefCountedDescriptorPool pool );
-
-  /**
-   * Adds the provided framebuffer object to the framebuffer cache
-   * @param framebuffer The framebuffer object to be added to the cache
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& AddFramebuffer( RefCountedFramebuffer framebuffer );
-
-  /**
-   * Adds the provided sampler object to the sampler cache
-   * @param sampler The sampler object to be added to the cache
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& AddSampler( RefCountedSampler sampler );
-
-  /**
-   * Finds the buffer object using the specified Vulkan handle in the cache
-   * @param buffer The Vulkan handle of the buffer object to be found
-   * @return A Handle to the buffer object if found. An empty Handle otherwise
-   */
-  RefCountedBuffer FindBuffer( vk::Buffer buffer );
-
-  /**
-   * Finds the image object using the specified Vulkan handle in the cache
-   * @param image The Vulkan handle of the image object to be found
-   * @return A handle to the Image object if found. An empty Handle otherwise
-   */
-  RefCountedImage FindImage( vk::Image image);
-
-  /**
-   * Finds the image view object using the specified Vulkan handle
-   * @param imageView The Vulkan handle of the image view object to be found
-   * @return A handle to the ImageView object if found. An empty Handle otherwise
-   */
-  RefCountedImageView FindImageView( vk::ImageView imageView );
-
-  /**
-   * Finds the shader module using the specified Vulkan handle
-   * @param shaderModule The Vulkan handle of the shader module to be found
-   * @return A Handle to the Shader module if found. An empty Handle otherwise
-   */
-  RefCountedShader FindShader( vk::ShaderModule shaderModule );
-
-  /**
-   * Finds the CommandPool object using the specified Vulkan handle
-   * @param currentThreadId The Vulkan handle of the CommandPool object to be found
-   * @return A Handle to the CommandPool object if found. An empty Handle otherwise
-   */
-  RefCountedCommandPool FindCommandPool( std::thread::id currentThreadId );
-
-  /**
-   * Finds the DescriptorPool object using the specified Vulkan handle
-   * @param descriptorPool The Vulkan handle of the DescriptorPool object to be found
-   * @return A Handle to the DescriptorPool object if found. An empty Handle otherwise
-   */
-  RefCountedDescriptorPool FindDescriptorPool( vk::DescriptorPool descriptorPool );
-
-  /**
-   * Finds the Framebuffer object using the specified Vulkan handle
-   * @param framebuffer The Vulkan handle of the Framebuffer object to be found
-   * @return A Handle to the Framebuffer object if found. An empty Handle otherwise
-   */
-  RefCountedFramebuffer FindFramebuffer( vk::Framebuffer framebuffer );
-
-  /**
-   * Finds the Sampler object using the specified Vulkan handle
-   * @param sampler The Vulkan handle of the Sampler object to be found
-   * @return A Handle to the Sampler object if found. An empty Handle otherwise
-   */
-  RefCountedSampler FindSampler( vk::Sampler sampler );
-
-  /**
-   * Removes the specified Buffer from the cache
-   * @param buffer The Buffer to be removed
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& RemoveBuffer( Buffer& buffer );
-
-  /**
-   * Removes the specified Image from the cache
-   * @param image The Image to be removed
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& RemoveImage( Image& image );
-
-  /**
-   * Removes the specified ImageView from the cache
-   * @param imageView The ImageView to be removed
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& RemoveImageView( ImageView& imageView );
-
-  /**
-   * Removes the specified Shader from the cache
-   * @param shader The Shader to be removed
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& RemoveShader( Shader& shader );
-
-  /**
-   * Removes the specified CommandPool from the cache
-   * @param commandPool The CommandPool to be removed
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& RemoveCommandPool( CommandPool& commandPool );
-
-  /**
-   * Removes the specified DescriptorPool from the cache
-   * @param descriptorPool The DescriptorPool to be removed
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& RemoveDescriptorPool( DescriptorPool& descriptorPool );
-
-  /**
-   * Removes the specified Framebuffer from the cache
-   * @param framebuffer The DescriptorPool to be removed
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& RemoveFramebuffer( Framebuffer& framebuffer );
-
-  /**
-   * Removes the specified Sampler from the cache
-   * @param sampler The Sampler to be removed
-   * @return A reference to the ResourceCache
-   */
-  ResourceCache& RemoveSampler( Sampler& sampler );
-
-  void CollectGarbage();
-
-  void EnqueueDiscardOperation( std::function<void()> deleter );
-
-  void Clear();
-
-#ifndef NDEBUG
-  void PrintReferenceCountReport( size_t* outObjectCount = nullptr );
-#endif
-
-  ResourceCache() = default;
-
-  // The cache should not be copyable
-  ResourceCache( const ResourceCache& other ) = delete;
-
-  ResourceCache& operator=( const ResourceCache& other ) = delete;
-
-  // The cache should not be movable
-  ResourceCache( ResourceCache&& other ) = delete;
-
-  ResourceCache&& operator=( ResourceCache&& other ) = delete;
-
-private:
-  std::vector< RefCountedBuffer >         mBuffers;
-  std::vector< RefCountedImage >          mImages;
-  std::vector< RefCountedImageView >      mImageViews;
-  std::vector< RefCountedShader >         mShaders;
-  std::vector< RefCountedDescriptorPool > mDescriptorPools;
-  std::vector< RefCountedFramebuffer >    mFramebuffers;
-  std::vector< RefCountedSampler >        mSamplers;
-
-  // Command pool map using thread IDs as keys
-  CommandPoolMap                          mCommandPools;
-
-  DiscardQueue                            mDiscardQueue;
-};
-
-} //namespace Vulkan
-} //namespace Graphics
-} //namespace Dali
-
-#endif //DALI_GRAPHICS_VULKAN_RESOURCE_CACHE
diff --git a/dali/graphics/vulkan/vulkan-sampler.cpp b/dali/graphics/vulkan/vulkan-sampler.cpp
deleted file mode 100644 (file)
index 366b703..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-sampler.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-/**
- * Sampler
- */
-
-/**
- * Creates new mutable sampler
- * @param graphics
- * @return
- */
-RefCountedSampler Sampler::New( Graphics& graphics, const vk::SamplerCreateInfo& createInfo )
-{
-  return RefCountedSampler( new Sampler( graphics, createInfo ) );
-}
-
-Sampler::Sampler( Graphics& graphics, const vk::SamplerCreateInfo& createInfo )
-        : mGraphics(&graphics),
-          mCreateInfo(createInfo)
-{
-}
-
-vk::SamplerCreateFlags Sampler::GetCreateFlags() const
-{
-  return mCreateInfo.flags;
-}
-
-vk::Filter Sampler::GetMinFilter() const
-{
-  return mCreateInfo.minFilter;
-}
-
-vk::Filter Sampler::GetMagFilter() const
-{
-  return mCreateInfo.magFilter;
-}
-
-vk::SamplerMipmapMode Sampler::GetMipMapMode() const
-{
-  return mCreateInfo.mipmapMode;
-}
-
-vk::SamplerAddressMode Sampler::GetAddressModeU() const
-{
-  return mCreateInfo.addressModeU;
-}
-
-vk::SamplerAddressMode Sampler::GetAddressModeV() const
-{
-  return mCreateInfo.addressModeV;
-}
-
-vk::SamplerAddressMode Sampler::GetAddressModeW() const
-{
-  return mCreateInfo.addressModeW;
-}
-
-float Sampler::GetMipLodBias() const
-{
-  return mCreateInfo.mipLodBias;
-}
-
-vk::Bool32 Sampler::AnisotropyEnabled() const
-{
-  return mCreateInfo.anisotropyEnable;
-}
-
-float Sampler::GetMaxAnisotropy() const
-{
-  return mCreateInfo.maxAnisotropy;
-}
-
-vk::Bool32 Sampler::CompareEnabled() const
-{
-  return mCreateInfo.compareEnable;
-}
-
-vk::CompareOp Sampler::GetCompareOperation() const
-{
-  return mCreateInfo.compareOp;
-}
-
-float Sampler::GetMinLod() const
-{
-  return mCreateInfo.minLod;
-}
-
-float Sampler::GetMaxLod() const
-{
-  return mCreateInfo.maxLod;
-}
-
-vk::BorderColor Sampler::GetBorderColor() const
-{
-  return mCreateInfo.borderColor;
-}
-
-vk::Bool32 Sampler::UsesUnnormalizedCoordinates() const
-{
-  return mCreateInfo.unnormalizedCoordinates;
-}
-
-Sampler::~Sampler() = default;
-
-vk::Sampler Sampler::GetVkHandle() const
-{
-  return mSampler;
-}
-
-const Sampler& Sampler::ConstRef()
-{
-  return *this;
-}
-
-Sampler& Sampler::Ref()
-{
-  return *this;
-}
-
-Sampler::operator vk::Sampler*()
-{
-  return &mSampler;
-}
-
-bool Sampler::OnDestroy()
-{
-  if( mGraphics->IsShuttingDown() )
-  {
-    mGraphics->RemoveSampler( *this );
-  }
-
-  auto device = mGraphics->GetDevice();
-  auto sampler = mSampler;
-  auto allocator = &mGraphics->GetAllocator();
-
-  mGraphics->DiscardResource( [device, sampler, allocator]() {
-    printf("Invoking SAMPLER deleter function\n");
-    device.destroySampler( sampler, allocator );
-  } );
-
-  return false;
-}
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
\ No newline at end of file
diff --git a/dali/graphics/vulkan/vulkan-sampler.h b/dali/graphics/vulkan/vulkan-sampler.h
deleted file mode 100644 (file)
index ef2e8f8..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_SAMPLER_H
-#define DALI_GRAPHICS_VULKAN_SAMPLER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-class Graphics;
-
-class Sampler : public VkManaged
-{
-public:
-
-  /**
-   * Creates a new Sampler
-   * @param graphics
-   * @return
-   */
-  static RefCountedSampler New( Graphics& graphics, const vk::SamplerCreateInfo& createInfo );
-
-  vk::SamplerCreateFlags GetCreateFlags() const;
-
-  vk::Filter GetMinFilter() const;
-
-  vk::Filter GetMagFilter() const;
-
-  vk::SamplerMipmapMode GetMipMapMode() const;
-
-  vk::SamplerAddressMode GetAddressModeU() const;
-
-  vk::SamplerAddressMode GetAddressModeV() const;
-
-  vk::SamplerAddressMode GetAddressModeW() const;
-
-  float GetMipLodBias() const;
-
-  vk::Bool32 AnisotropyEnabled() const;
-
-  float GetMaxAnisotropy() const;
-
-  vk::Bool32 CompareEnabled() const;
-
-  vk::CompareOp GetCompareOperation() const;
-
-  float GetMinLod() const;
-
-  float GetMaxLod() const;
-
-  vk::BorderColor GetBorderColor() const;
-
-  vk::Bool32 UsesUnnormalizedCoordinates() const;
-
-  /**
-   * Returns VkSampler object
-   * @return
-   */
-  vk::Sampler GetVkHandle() const;
-
-  const Sampler& ConstRef();
-
-  Sampler& Ref();
-
-  operator vk::Sampler*();
-
-  bool OnDestroy() override;
-
-private:
-
-  explicit Sampler( Graphics& graphics, const vk::SamplerCreateInfo& createInfo );
-
-  ~Sampler() override;
-
-private:
-  Graphics*             mGraphics;
-  vk::SamplerCreateInfo mCreateInfo;
-  vk::Sampler           mSampler;
-
-};
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-#endif //DALI_GRAPHICS_VULKAN_SAMPLER_H
diff --git a/dali/graphics/vulkan/vulkan-shader.cpp b/dali/graphics/vulkan/vulkan-shader.cpp
deleted file mode 100644 (file)
index 2f6f199..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-shader.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/spirv/vulkan-spirv.h>
-#include <iostream>
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-/*
- * Class: Shader::Impl
- */
-struct Shader::Impl
-{
-  Impl( Shader& owner, Graphics& graphics, const vk::ShaderModuleCreateInfo& info ) :
-    mOwner( owner ),
-    mGraphics( graphics ),
-    mCreateInfo( info ),
-    mPipelineShaderStage( vk::ShaderStageFlagBits::eAllGraphics )
-  {
-    mSPIRVShader = SpirV::SPIRVUtils::Parse( info.pCode, info.codeSize, vk::ShaderStageFlagBits::eVertex );
-  }
-
-  ~Impl()
-  {
-    if(mShaderModule)
-    {
-      mGraphics.GetDevice().destroyShaderModule( mShaderModule, mGraphics.GetAllocator() );
-    }
-  }
-
-  vk::Result Initialise()
-  {
-    if( (mShaderModule = VkAssert( mGraphics.GetDevice().createShaderModule( mCreateInfo, mGraphics.GetAllocator() ) )))
-    {
-      return vk::Result::eSuccess;
-    }
-    return vk::Result::eErrorInitializationFailed;
-  }
-
-  vk::ShaderModule GetVkHandle() const
-  {
-    return mShaderModule;
-  }
-
-  Shader& mOwner;
-  Graphics& mGraphics;
-  vk::ShaderModuleCreateInfo mCreateInfo;
-  vk::ShaderModule mShaderModule;
-  std::unique_ptr<SpirV::SPIRVShader> mSPIRVShader;
-  vk::ShaderStageFlagBits mPipelineShaderStage;
-};
-
-/*
- * Class: Shader
- */
-Handle<Shader> Shader::New(Graphics &graphics, const vk::ShaderModuleCreateInfo &info)
-{
-  auto shader = Handle<Shader>(new Shader(graphics, info)); // can't use make unique because of permissions
-  if(shader)
-  {
-    if( shader->mImpl->Initialise() == vk::Result::eSuccess )
-    {
-      graphics.AddShader( shader );
-    }
-  }
-  return shader;
-}
-
-Handle<Shader> Shader::New( Graphics& graphics, const void* bytes, std::size_t size )
-{
-  return New( graphics, vk::ShaderModuleCreateInfo{}
-                                .setCodeSize( size )
-                                .setPCode(reinterpret_cast<const uint32_t*>(bytes)));
-}
-
-Shader::Shader( Graphics& graphics, const vk::ShaderModuleCreateInfo& info )
-{
-  mImpl = MakeUnique<Impl>( *this, graphics, info );
-}
-
-Shader::~Shader() = default;
-
-vk::ShaderModule Shader::GetVkHandle() const
-{
-  return mImpl->GetVkHandle();
-}
-
-bool Shader::OnDestroy()
-{
-  if( !mImpl->mGraphics.IsShuttingDown() )
-  {
-    mImpl->mGraphics.RemoveShader( *this );
-  }
-
-  auto device = mImpl->mGraphics.GetDevice();
-  auto shaderModule = mImpl->mShaderModule;
-  auto allocator = &mImpl->mGraphics.GetAllocator();
-
-  mImpl->mGraphics.DiscardResource( [device, shaderModule, allocator]() {
-#ifndef NDEBUG
-    printf("Invoking SHADER MODULE deleter function\n");
-#endif
-    device.destroyShaderModule( shaderModule, allocator );
-  } );
-
-  return true;
-}
-
-const SpirV::SPIRVShader& Shader::GetSPIRVReflection() const
-{
-  return *mImpl->mSPIRVShader;
-}
-
-void Shader::SetExplicitShaderStage( vk::ShaderStageFlagBits shaderStage )
-{
-  mImpl->mPipelineShaderStage = shaderStage;
-}
-
-vk::ShaderStageFlagBits Shader::GetExplicitShaderStage() const
-{
-  return mImpl->mPipelineShaderStage;
-}
-
-
-}
-}
-}
\ No newline at end of file
diff --git a/dali/graphics/vulkan/vulkan-shader.h b/dali/graphics/vulkan/vulkan-shader.h
deleted file mode 100644 (file)
index e967d48..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_SHADER
-#define DALI_GRAPHICS_VULKAN_SHADER
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-namespace SpirV
-{
-class SPIRVShader;
-}
-
-class Graphics;
-class Shader : public VkManaged // can be overriden as ShaderGLSL for example
-{
-public:
-
-  enum class Type
-  {
-    VERTEX = static_cast<int>( vk::ShaderStageFlagBits::eVertex ),
-    FRAGMENT = static_cast<int>( vk::ShaderStageFlagBits::eFragment ),
-    COMPUTE = static_cast<int>( vk::ShaderStageFlagBits::eCompute ),
-    GEOMETRY = static_cast<int>( vk::ShaderStageFlagBits::eGeometry ),
-  };
-
-  /**
-   *
-   * @param graphics
-   * @param info
-   * @return
-   */
-  static Handle<Shader> New( Graphics& graphics, const vk::ShaderModuleCreateInfo& info );
-
-  /**
-   * Creates new shader module from SPIR-V code
-   * @param graphics
-   * @param bytes
-   * @param size
-   * @return
-   */
-  static Handle<Shader> New( Graphics& graphics, const void* bytes, std::size_t size );
-
-  /**
-   *
-   */
-  ~Shader() override;
-
-  vk::ShaderModule GetVkHandle() const;
-
-  const SpirV::SPIRVShader& GetSPIRVReflection() const;
-
-  bool OnDestroy() override;
-
-  operator vk::ShaderModule() const
-  {
-    return GetVkHandle();
-  }
-
-  /**
-   * Sets a unique pipeline stage to be used with the shader
-   * @param shaderStage
-   */
-  void SetExplicitShaderStage( vk::ShaderStageFlagBits shaderStage );
-
-  vk::ShaderStageFlagBits GetExplicitShaderStage() const;
-
-private:
-
-  Shader( Graphics& graphics, const vk::ShaderModuleCreateInfo& info );
-
-private:
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-} // Namespace Vulkan
-
-} // Namespace Graphics
-
-} // Namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_SHADER
diff --git a/dali/graphics/vulkan/vulkan-standalone-test.cpp b/dali/graphics/vulkan/vulkan-standalone-test.cpp
deleted file mode 100644 (file)
index 7e35409..0000000
+++ /dev/null
@@ -1,603 +0,0 @@
-/*
- * This is the test code that allows to run Vulkan backend
- * as standalone application. Supports both Xcb and Xlib window
- * integration. MUST NOT BE COMPILED WITH DALI!
- */
-
-// for surface implementation
-#ifndef VK_USE_PLATFORM_XLIB_KHR
-#define VK_USE_PLATFORM_XLIB_KHR
-#endif
-#ifndef VK_USE_PLATFORM_XCB_KHR
-#define VK_USE_PLATFORM_XCB_KHR
-#endif
-
-#include <glm/glm.hpp>
-#include <glm/gtc/matrix_transform.hpp>
-#include <glm/matrix.hpp>
-#include <glm/vector_relational.hpp>
-
-using namespace glm;
-
-#include <dali/integration-api/graphics/graphics.h>
-#include <dali/integration-api/graphics/vulkan/vk-surface-factory.h>
-#include <dali/integration-api/graphics/vulkan/vulkan-hpp-wrapper.h>
-
-#include <unistd.h>
-#include <xcb/xcb.h>
-
-// internals
-#include "generated/spv-shaders-gen.h"
-
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-#include <dali/graphics/vulkan/vulkan-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-descriptor-set.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-pipeline.h>
-#include <dali/graphics/vulkan/vulkan-shader.h>
-#include <dali/graphics/vulkan/vulkan-surface.h>
-#include <dali/graphics/vulkan/spirv/vulkan-spirv.h>
-
-#define USE_XLIB 0
-#include <iostream>
-
-using Dali::Graphics::Vulkan::Buffer;
-using Dali::Graphics::Vulkan::CommandBuffer;
-using Dali::Graphics::Vulkan::CommandPool;
-using Dali::Graphics::Vulkan::DescriptorPool;
-using Dali::Graphics::Vulkan::GpuMemoryAllocator;
-using Dali::Graphics::Vulkan::GpuMemoryManager;
-using Dali::Graphics::Vulkan::Pipeline;
-using Dali::Graphics::Vulkan::RefCountedPipeline;
-using Dali::Graphics::Vulkan::Shader;
-using Dali::Graphics::Vulkan::RefCountedShader;
-using Dali::Integration::Graphics::Graphics;
-using Dali::Integration::Graphics::Vulkan::VkSurfaceFactory;
-
-extern std::vector<uint8_t> VSH;
-extern std::vector<uint8_t> FSH;
-
-namespace // unnamed namespace
-{
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gVulkanFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_VULKAN");
-#endif
-}
-
-template<typename T, typename... Args>
-std::unique_ptr<T> MakeUnique( Args&&... args )
-{
-  return std::unique_ptr<T>( new T( std::forward<Args>( args )... ) );
-}
-
-class VkSurfaceXlib : public Dali::Integration::Graphics::Vulkan::VkSurfaceFactory
-{
-public:
-  /**
-   * Instantiates surface factory ( should
-   * @param display
-   * @param window
-   */
-  VkSurfaceXlib( Display* display, Window window ) : VkSurfaceFactory(), mDisplay( display ), mWindow( window )
-  {
-  }
-
-  virtual vk::SurfaceKHR Create( vk::Instance             instance,
-                                 vk::AllocationCallbacks* allocCallbacks,
-                                 vk::PhysicalDevice       physicalDevice ) const override
-  {
-    vk::XlibSurfaceCreateInfoKHR info;
-    info.setDpy( mDisplay ).setWindow( mWindow );
-    auto retval = instance.createXlibSurfaceKHR( info, allocCallbacks ).value;
-    return retval;
-  }
-
-private:
-  Display*       mDisplay;
-  Window         mWindow;
-  vk::SurfaceKHR mSurface;
-};
-
-class VkSurfaceXcb : public Dali::Integration::Graphics::Vulkan::VkSurfaceFactory
-{
-public:
-  /**
-   * Instantiates surface factory ( should
-   * @param display
-   * @param window
-   */
-  VkSurfaceXcb( xcb_connection_t* connection, xcb_window_t window )
-  : VkSurfaceFactory{}, mConnection( connection ), mWindow( window )
-  {
-  }
-
-  virtual vk::SurfaceKHR Create( vk::Instance             instance,
-                                 vk::AllocationCallbacks* allocCallbacks,
-                                 vk::PhysicalDevice       physicalDevice ) const override
-  {
-    vk::XcbSurfaceCreateInfoKHR info;
-    info.setConnection( mConnection ).setWindow( mWindow );
-    auto retval = instance.createXcbSurfaceKHR( info, allocCallbacks ).value;
-    return retval;
-  }
-
-private:
-  xcb_connection_t* mConnection;
-  xcb_window_t      mWindow;
-  vk::SurfaceKHR    mSurface;
-};
-
-namespace Test
-{
-struct xlib_window_t
-{
-  uint32_t width{0u};
-  uint32_t height{0u};
-  Window   window{};
-  Display* display{nullptr};
-
-  ~xlib_window_t()
-  {
-    XDestroyWindow( display, window );
-  }
-};
-
-std::unique_ptr<xlib_window_t> create_xlib_window( int width, int height )
-{
-  std::unique_ptr<xlib_window_t> wnd{new xlib_window_t};
-  // 1. Create Window ( done by DALI
-
-  wnd->width         = width;
-  wnd->height        = height;
-  wnd->display       = XOpenDisplay( nullptr );
-  auto defaultScreen = DefaultScreen( wnd->display );
-  wnd->window        = XCreateSimpleWindow( wnd->display,
-                                     RootWindow( wnd->display, defaultScreen ),
-                                     0,
-                                     0,
-                                     wnd->width,
-                                     wnd->height,
-                                     1,
-                                     BlackPixel( wnd->display, defaultScreen ),
-                                     WhitePixel( wnd->display, defaultScreen ) );
-
-  XSelectInput( wnd->display, wnd->window, ExposureMask | KeyPressMask );
-  XMapWindow( wnd->display, wnd->window );
-  XSync( wnd->display, false );
-
-  return wnd;
-}
-
-struct xcb_window_t
-{
-  uint32_t          width{0u};
-  uint32_t          height{0u};
-  ::xcb_window_t    window;
-  xcb_connection_t* connection;
-
-  ~xcb_window_t()
-  {
-    xcb_destroy_window( connection, window );
-  }
-};
-
-std::unique_ptr<Test::xcb_window_t> create_xcb_window( int width, int height )
-{
-  std::unique_ptr<Test::xcb_window_t> wnd{new Test::xcb_window_t};
-  // 1. Create Window ( done by DALI
-
-  wnd->width  = width;
-  wnd->height = height;
-
-  int screenNum( 0 );
-
-  xcb_connection_t*     connection = xcb_connect( NULL, &screenNum );
-  const xcb_setup_t*    setup      = xcb_get_setup( connection );
-  xcb_screen_iterator_t iter       = xcb_setup_roots_iterator( setup );
-  for( int i = 0; i < screenNum; ++i )
-    xcb_screen_next( &iter );
-
-  xcb_screen_t*  screen = iter.data;
-  ::xcb_window_t window = xcb_generate_id( connection );
-
-  uint32_t mask     = XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK;
-  uint32_t values[] = {screen->white_pixel, XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_KEY_PRESS};
-
-  xcb_create_window( connection,
-                     XCB_COPY_FROM_PARENT,
-                     window,
-                     screen->root,
-                     0,
-                     0,
-                     wnd->width,
-                     wnd->height,
-                     0,
-                     XCB_WINDOW_CLASS_INPUT_OUTPUT,
-                     screen->root_visual,
-                     mask,
-                     values );
-
-  xcb_map_window( connection, window );
-  const uint32_t coords[] = {100, 100};
-  xcb_configure_window( connection, window, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, coords );
-  xcb_flush( connection );
-
-  wnd->connection = connection;
-  wnd->window     = window;
-
-  return wnd;
-}
-} // namespace Test
-
-namespace VulkanTest
-{
-Dali::Graphics::Vulkan::RefCountedGpuMemoryBlock test_gpu_memory_manager(
-  Dali::Graphics::Vulkan::Graphics &graphics,
-  GpuMemoryManager &gpuManager,
-  const Dali::Graphics::Vulkan::Handle<Buffer> &buffer)
-{
-  auto device = graphics.GetDevice();
-  auto &allocator = graphics.GetAllocator();
-
-  auto &gpuAllocator = gpuManager.GetDefaultAllocator();
-  return gpuAllocator.Allocate(buffer, vk::MemoryPropertyFlagBits::eHostVisible);
-}
-
-struct UniformData
-{
-  mat4 mvp;
-  vec4 color;
-  vec3 size;
-} __attribute__(( aligned( 16 )));
-
-struct UniformClipData
-{
-  mat4 clip;
-} __attribute__(( aligned( 16 )));
-
-mat4 MVP;
-
-template<class T>
-void update_buffer(Dali::Graphics::Vulkan::RefCountedBuffer buffer, T &value)
-{
-  auto ptr = reinterpret_cast<T *>( buffer->GetMemoryHandle()
-                                          ->Map());
-  *ptr = value;
-  buffer->GetMemoryHandle()
-        ->Unmap();
-}
-
-void update_translation(Dali::Graphics::Vulkan::RefCountedBuffer buffer)
-{
-  static float x = 0.0f;
-  x += 0.5f;
-
-  /*
-  UniformData ub;
-
-  auto modelMat = glm::translate( mat4{1}, vec3( x, x, 0.0f ) );
-  modelMat      = glm::rotate( modelMat, glm::radians( x ), glm::vec3( 0.0f, 0.0f, 1.0f ) );
-
-  ub.mvp = ortho( 0.0f, 640.0f, 480.0f, 0.0f, 0.0f, 100.0f ) *
-           lookAt( vec3( 0.0f, 0.0f, 10.0f ), vec3( 0.0f, 0.0f, 0.0f ), vec3( 0.0f, 1.0f, 0.0f ) ) * modelMat;
-
-  update_buffer( buffer, ub );
-  */
-}
-
-Dali::Graphics::Vulkan::RefCountedBuffer create_uniform_buffer(Dali::Graphics::Vulkan::Graphics &gr)
-{
-  // create uniform buffer
-  auto uniformBuffer = Buffer::New(gr, sizeof(UniformData), Buffer::Type::UNIFORM);
-
-  // allocate memory
-  auto memory = gr.GetDeviceMemoryManager()
-                  .GetDefaultAllocator()
-                  .Allocate(uniformBuffer,
-                            vk::MemoryPropertyFlagBits::eHostVisible);
-
-  // bind memory
-  uniformBuffer->BindMemory(memory);
-
-  auto ub = reinterpret_cast<UniformData *>( memory->Map());
-
-  ub->mvp   = mat4{1.0f} * ortho(0.0f, 640.0f, 480.0f, 0.0f, 0.0f, 100.0f) *
-              lookAt(vec3(0.0f, 0.0f, 10.0f), vec3(0.0f, 0.0f, 0.0f), vec3(0.0f, 1.0f, 0.0f));
-  ub->color = vec4(0.0f, 1.0f, 1.0f, 1.0f);
-  ub->size  = vec3(1.0f, 1.0f, 1.0f);
-
-  memory->Unmap();
-
-  return uniformBuffer;
-}
-
-Dali::Graphics::Vulkan::RefCountedBuffer create_clip_buffer(Dali::Graphics::Vulkan::Graphics &gr)
-{
-  const glm::mat4 clip(
-    1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f, 0.0f, 0.0f, 0.5f, 1.0f);
-
-  // create uniform buffer
-  auto uniformBuffer = Buffer::New(gr, sizeof(UniformClipData), Buffer::Type::UNIFORM);
-
-  // allocate memory
-  auto memory = gr.GetDeviceMemoryManager()
-                  .GetDefaultAllocator()
-                  .Allocate(uniformBuffer,
-                            vk::MemoryPropertyFlagBits::eHostVisible);
-  // bind memory
-  uniformBuffer->BindMemory(memory);
-  auto dst = memory->MapTyped<mat4>();
-  std::copy(&clip, &clip + 1, dst);
-  memory->Unmap();
-  return uniformBuffer;
-}
-
-Dali::Graphics::Vulkan::Handle<DescriptorPool> create_descriptor_pool(Dali::Graphics::Vulkan::Graphics &gr)
-{
-  vk::DescriptorPoolSize size;
-  size.setDescriptorCount(1024)
-      .setType(vk::DescriptorType::eUniformBuffer);
-
-  // TODO: how to organize this???
-  auto pool = DescriptorPool::New(
-    gr, vk::DescriptorPoolCreateInfo{}.setMaxSets(1024)
-                                      .setPoolSizeCount(1)
-                                      .setPPoolSizes(&size));
-  return pool;
-}
-
-void test_framebuffer(Dali::Graphics::Vulkan::Graphics &graphics)
-{
-  using namespace Dali::Graphics::Vulkan;
-  // framebuffer
-  auto fb = NewRef<Framebuffer>(graphics, 640, 480);
-
-  // attachment
-  auto image = NewRef<Image>(graphics,
-                             vk::ImageCreateInfo{}
-                               .setFormat(vk::Format::eR32G32B32A32Sfloat)
-                               .setTiling(vk::ImageTiling::eOptimal)
-                               .setMipLevels(1)
-                               .setImageType(vk::ImageType::e2D)
-                               .setExtent(vk::Extent3D(640, 480, 1))
-                               .setArrayLayers(1)
-                               .setUsage(vk::ImageUsageFlagBits::eSampled | vk::ImageUsageFlagBits::eColorAttachment)
-                               .setSharingMode(vk::SharingMode::eExclusive)
-                               .setInitialLayout(vk::ImageLayout::eUndefined)
-                               .setSamples(vk::SampleCountFlagBits::e1));
-
-  auto imageView = NewRef<ImageView>(
-    graphics,
-    image,
-    vk::ImageViewCreateInfo{}
-      .setFormat(vk::Format::eR32G32B32A32Sfloat)
-      .setComponents(vk::ComponentMapping(
-        vk::ComponentSwizzle::eR, vk::ComponentSwizzle::eG, vk::ComponentSwizzle::eB, vk::ComponentSwizzle::eA))
-      .setImage(image->GetVkHandle())
-      .setSubresourceRange(vk::ImageSubresourceRange{}
-                             .setLayerCount(1)
-                             .setLevelCount(1)
-                             .setBaseMipLevel(0)
-                             .setBaseArrayLayer(0)
-                             .setAspectMask(vk::ImageAspectFlagBits::eColor))
-      .setViewType(vk::ImageViewType::e2D));
-
-  fb->SetAttachment(imageView, Framebuffer::AttachmentType::COLOR, 0u);
-
-  //fb->GetRenderPass();
-
-  //fb->SetAttachment( )
-}
-
-void test_handle()
-{
-  /*
-  using namespace Dali::Graphics::Vulkan;
-  RefCountedGpuMemoryBlock handle( new GpuMemoryBlock() );
-
-  decltype(handle) handle2 = handle;
-  handle.GetRefCount();*/
-}
-
-RefCountedPipeline create_pipeline(Dali::Graphics::Vulkan::Graphics &graphics,
-                                   Dali::Graphics::Vulkan::RefCountedShader vertexShader,
-                                   Dali::Graphics::Vulkan::RefCountedShader fragmentShader)
-{
-  using namespace Dali::Graphics::Vulkan;
-  auto pipelineInfo = vk::GraphicsPipelineCreateInfo{};
-  auto pipeline     = Pipeline::New(graphics, pipelineInfo);
-
-  pipeline->SetShader(vertexShader, Shader::Type::VERTEX);
-  pipeline->SetShader(fragmentShader, Shader::Type::FRAGMENT);
-  pipeline->SetViewport(0, 0, 640, 480);
-  pipeline->SetVertexInputState(
-    std::vector<vk::VertexInputAttributeDescription>{
-      vk::VertexInputAttributeDescription{}.setBinding(0)
-                                           .setOffset(0)
-                                           .setLocation(0)
-                                           .setFormat(
-                                             vk::Format::eR32G32B32Sfloat)},
-    std::vector<vk::VertexInputBindingDescription>{vk::VertexInputBindingDescription{}
-      .setBinding(0)
-      .setStride(sizeof(float) * 3)
-      .setInputRate(vk::VertexInputRate::eVertex)});
-  pipeline->SetInputAssemblyState(vk::PrimitiveTopology::eTriangleList, false);
-
-  if (!pipeline->Compile())
-  {
-    pipeline.Reset();
-  }
-  return pipeline;
-}
-
-int TextureTestMain( Dali::Graphics::Vulkan::Graphics& );
-
-int RunTestMain2()
-{
-#if USE_XLIB == 1
-  auto window         = Test::create_xlib_window( 640, 480 );
-  auto surfaceFactory = std::unique_ptr<VkSurfaceXlib>{new VkSurfaceXlib{window->display, window->window}};
-#else
-  auto window         = Test::create_xcb_window(640, 480);
-  auto surfaceFactory = std::unique_ptr<VkSurfaceXcb>{new VkSurfaceXcb{window->connection, window->window}};
-#endif
-
-  auto graphics = MakeUnique<Graphics>();
-  auto fbid     = graphics->Create(std::move(surfaceFactory));
-
-  // access internal implementation
-  auto &gr = graphics->GetImplementation<Dali::Graphics::Vulkan::Graphics>();
-
-  // GPU memory manager
-  auto &memmgr = gr.GetDeviceMemoryManager();
-
-  return TextureTestMain( gr );
-}
-
-int RunTestMain()
-{
-#if USE_XLIB == 1
-  auto window         = Test::create_xlib_window( 640, 480 );
-  auto surfaceFactory = std::unique_ptr<VkSurfaceXlib>{new VkSurfaceXlib{window->display, window->window}};
-#else
-  auto window         = Test::create_xcb_window(640, 480);
-  auto surfaceFactory = std::unique_ptr<VkSurfaceXcb>{new VkSurfaceXcb{window->connection, window->window}};
-#endif
-
-  auto graphics = MakeUnique<Graphics>();
-  auto fbid     = graphics->Create(std::move(surfaceFactory));
-
-  // access internal implementation
-  auto &gr = graphics->GetImplementation<Dali::Graphics::Vulkan::Graphics>();
-
-  // GPU memory manager
-  auto &memmgr = gr.GetDeviceMemoryManager();
-
-  const vec3 VERTICES[] = {
-    {0.0f,   0.0f,   0.0f},
-    {320.0f, 0.0f,   0.0f},
-    {0.0f,   160.0f, 0.0f},
-  };
-
-  // shaders
-  auto vertexShader = Shader::New(gr, VSH_CODE.data(), VSH_CODE.size());
-
-  auto fragmentShader = Shader::New(gr, FSH_CODE.data(), FSH_CODE.size());
-
-  // buffer
-  auto vertexBuffer = Buffer::New(gr, sizeof(float) * 3 * 3, Buffer::Type::VERTEX);
-
-  auto descriptorPool = create_descriptor_pool(gr);
-
-  auto &gpuManager = gr.GetDeviceMemoryManager();
-
-  auto bufferMemory = test_gpu_memory_manager(gr, gpuManager, vertexBuffer);
-  vertexBuffer->BindMemory(bufferMemory);
-
-  auto ptr = static_cast<uint8_t *>( bufferMemory->Map());
-  std::copy(reinterpret_cast<const uint8_t *>( VERTICES ),
-            reinterpret_cast<const uint8_t *>( VERTICES ) + (sizeof(float) * 9),
-            ptr);
-  bufferMemory->Unmap();
-
-  auto pipeline = create_pipeline(gr, vertexShader, fragmentShader);
-
-  auto descriptorSet = descriptorPool->AllocateDescriptorSets(
-    vk::DescriptorSetAllocateInfo{}
-      .setPSetLayouts(pipeline->GetVkDescriptorSetLayouts()
-                              .data())
-      .setDescriptorSetCount(pipeline->GetVkDescriptorSetLayouts()
-                                     .size()));
-
-
-  auto commandPool = CommandPool::New(gr);
-
-  auto uniformBuffer = create_uniform_buffer(gr);
-
-  auto clipBuffer = create_clip_buffer(gr);
-
-  descriptorSet[0]->WriteUniformBuffer(0, uniformBuffer, 0, uniformBuffer->GetSize());
-  descriptorSet[0]->WriteUniformBuffer(1, clipBuffer, 0, clipBuffer->GetSize());
-
-  // get new buffer
-  auto cmdDraw = commandPool->NewCommandBuffer(false);
-
-  // begin recording
-  cmdDraw->Begin(vk::CommandBufferUsageFlagBits::eRenderPassContinue);
-
-  // vertex buffer
-  cmdDraw->BindVertexBuffer(0, vertexBuffer, 0);
-
-  // pipeline
-  cmdDraw->BindGraphicsPipeline(pipeline);
-
-  // descriptor sets
-  cmdDraw->BindDescriptorSets(descriptorSet, 0);
-
-  // do draw
-  cmdDraw->Draw(3, 1, 0, 0);
-
-  // finish
-  cmdDraw->End();
-
-  bool running = true;
-
-  while (running)
-  {
-    graphics->PreRender(fbid);
-    // queue submit draw
-
-    auto cmdbuf = gr.GetSwapchainForFBID(fbid)
-                    ->GetPrimaryCommandBuffer();
-
-    // get command buffer for current frame and execute the draw call
-    cmdbuf->ExecuteCommands({cmdDraw});
-
-    graphics->PostRender(fbid);
-
-    update_translation(uniformBuffer);
-  }
-  return 0;
-}
-
-void texture_test(void *data, size_t size)
-{
-
-}
-
-using namespace Dali::Graphics::Vulkan::SpirV;
-void spirv_test0( std::vector<SPIRVWord> code )
-{
-  auto shader = SPIRVUtils::Parse( code, vk::ShaderStageFlagBits::eVertex );
-  auto opcodeCount = shader->GetOpCodeCount();
-  DEBUG_LOG_STREAMS( gVulkanFilter, Debug::General, "opcodecount" << opcodeCount );
-
-  auto layoutCreateInfo = shader->GenerateDescriptorSetLayoutCreateInfo();
-
-  DEBUG_LOG_STREAMS( gVulkanFilter, Debug::General, "yay!" );
-}
-
-void RunSPIRVTest()
-{
-  std::vector<SPIRVWord> data;
-  data.resize( VSH_CODE.size()/4 );
-  std::copy( VSH_CODE.begin(), VSH_CODE.end(), reinterpret_cast<decltype(VSH_CODE.data())>(data.data()) );
-  spirv_test0( data );
-}
-
-
-
-} // namespace VulkanTest
-
-int main()
-{
-  VulkanTest::RunTestMain2();
-
-  //VulkanTest::RunSPIRVTest();
-}
diff --git a/dali/graphics/vulkan/vulkan-surface.cpp b/dali/graphics/vulkan/vulkan-surface.cpp
deleted file mode 100644 (file)
index 71656cc..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-surface.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/integration-api/graphics/vulkan/vk-surface-factory.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-struct Surface::Impl
-{
-  Impl( Surface& owner, Graphics& graphics, std::unique_ptr<SurfaceFactory> surfaceFactory ) :
-  mOwner( owner ), mGraphics( graphics ), mSurfaceFactory( std::move(surfaceFactory) )
-  {
-    mVulkanSurfaceFactory = dynamic_cast<Dali::Integration::Graphics::Vulkan::VkSurfaceFactory*>(mSurfaceFactory.get());
-  }
-
-  ~Impl()
-  {
-
-  }
-
-  bool Initialise()
-  {
-    if(!mVulkanSurfaceFactory)
-    {
-      return false;
-    }
-
-    // fixme: should avoid const cast :(
-    auto* allocatorCallbacks = const_cast<vk::AllocationCallbacks*>(&mGraphics.GetAllocator());
-    mSurface = mVulkanSurfaceFactory->Create( mGraphics.GetInstance(), allocatorCallbacks, mGraphics.GetPhysicalDevice() );
-
-    if(!mSurface)
-    {
-      return false;
-    }
-
-    auto caps = VkAssert( mGraphics.GetPhysicalDevice().getSurfaceCapabilitiesKHR( mSurface ) );
-    mCurrentExtent = caps.currentExtent;
-
-    return true;
-  }
-
-  vk::Extent2D GetSize() const
-  {
-    return mCurrentExtent;
-  }
-
-  Surface&                        mOwner;
-  Graphics&                       mGraphics;
-  std::unique_ptr<SurfaceFactory> mSurfaceFactory;
-  Dali::Integration::Graphics::Vulkan::VkSurfaceFactory* mVulkanSurfaceFactory;
-  vk::SurfaceKHR   mSurface;
-  vk::Extent2D      mCurrentExtent;
-};
-
-/**
- * Surface
- */
-
-RefCountedSurface Surface::New( Graphics& graphics, std::unique_ptr<SurfaceFactory> surfaceFactory )
-{
-  return RefCountedSurface( new Surface( graphics, std::move(surfaceFactory) ));
-}
-
-Surface::Surface(Graphics& graphics, std::unique_ptr<SurfaceFactory> surfaceFactory )
-{
-  mImpl = std::make_unique<Impl>( *this, graphics, std::move(surfaceFactory) );
-}
-
-Surface::~Surface() = default;
-
-bool Surface::Create()
-{
-  return mImpl->Initialise();
-}
-
-vk::SurfaceKHR Surface::GetSurfaceKHR() const
-{
-  return mImpl->mSurface;
-}
-
-vk::Extent2D Surface::GetSize() const
-{
-  return mImpl->GetSize();
-}
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-surface.h b/dali/graphics/vulkan/vulkan-surface.h
deleted file mode 100644 (file)
index 8797c83..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_SURFACE
-#define DALI_GRAPHICS_VULKAN_SURFACE
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Integration
-{
-namespace Graphics
-{
-class SurfaceFactory;
-}
-}
-namespace Graphics
-{
-namespace Vulkan
-{
-using SurfaceFactory = Dali::Integration::Graphics::SurfaceFactory;
-class Graphics;
-class Surface : public VkManaged
-{
-public:
-
-  static RefCountedSurface New( Graphics& graphics, std::unique_ptr<SurfaceFactory> surfaceFactory );
-
-  Surface(Graphics& graphics, std::unique_ptr<SurfaceFactory> surfaceFactory );
-  ~Surface() final;
-
-  /**
-   * Creates surface from given factory
-   */
-  bool Create();
-
-  /**
-   *
-   * @return
-   */
-  vk::SurfaceKHR GetSurfaceKHR() const;
-
-  /**
-   * Returns size of surface
-   * @return
-   */
-  vk::Extent2D GetSize() const;
-
-private:
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_SURFACE
diff --git a/dali/graphics/vulkan/vulkan-swapchain.cpp b/dali/graphics/vulkan/vulkan-swapchain.cpp
deleted file mode 100644 (file)
index eea2f6c..0000000
+++ /dev/null
@@ -1,663 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-allocator.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-handle.h>
-#include <dali/graphics/vulkan/gpu-memory/vulkan-gpu-memory-manager.h>
-#include <dali/graphics/vulkan/vulkan-command-buffer.h>
-#include <dali/graphics/vulkan/vulkan-command-pool.h>
-#include <dali/graphics/vulkan/vulkan-fence.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-image.h>
-#include <dali/graphics/vulkan/vulkan-image-view.h>
-#include <dali/graphics/vulkan/vulkan-queue.h>
-#include <dali/graphics/vulkan/vulkan-surface.h>
-#include <dali/graphics/vulkan/vulkan-swapchain.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-/**
- * SwapchainBuffer stores all per-buffer data
- */
-struct SwapchainBuffer
-{
-  /*
-   * Each buffer has own master command buffer which executes
-   * secondary buffers
-   */
-  RefCountedCommandBuffer masterCmdBuffer;
-
-  /*
-   * Framebuffer object associated with the buffer
-   */
-  RefCountedFramebuffer framebuffer;
-
-  /*
-   * Sync primitives
-   */
-  RefCountedFence endOfFrameFence;
-
-  /*
-   * Buffer index
-   */
-  uint32_t index;
-
-  /*
-   * First use before presenting
-   */
-  bool firstUse;
-};
-
-struct Swapchain::Impl
-{
-  Impl( Swapchain& owner,
-        Graphics&  graphics,
-        Queue&     presentationQueue,
-        RefCountedSurface surface,
-        uint32_t   bufferCount,
-        uint32_t   flags )
-  : mOwner( owner ),
-    mGraphics( graphics ),
-    mQueue( presentationQueue ),
-    mSurface( surface ),
-    mBufferCount( bufferCount ),
-    mFlags( flags ),
-    mCurrentBufferIndex( 0u )
-  {
-    mSwapchainCreateInfoKHR.setSurface( mSurface->GetSurfaceKHR() )
-      .setPreTransform( vk::SurfaceTransformFlagBitsKHR::eIdentity )
-      .setPresentMode( vk::PresentModeKHR::eFifo )
-      .setOldSwapchain( nullptr ) //@todo support surface replacement!
-      .setMinImageCount( mBufferCount )
-      .setImageUsage( vk::ImageUsageFlagBits::eColorAttachment )
-      .setImageSharingMode( vk::SharingMode::eExclusive )
-      .setImageArrayLayers( 1 )
-      .setCompositeAlpha( vk::CompositeAlphaFlagBitsKHR::eOpaque )
-      .setClipped( true )
-      .setQueueFamilyIndexCount( 0 )
-      .setPQueueFamilyIndices( nullptr );
-  }
-
-  ~Impl() = default;
-
-  Impl( const Impl& ) = delete;
-  Impl& operator=( const Impl& ) = delete;
-
-  bool Initialise()
-  {
-    if( !SetImageFormat() )
-    {
-      return false;
-    }
-
-    // get extents
-    mSwapchainExtent = mSurface->GetSize();
-
-    mSwapchainCreateInfoKHR.setImageFormat( mSwapchainImageFormat );
-    mSwapchainCreateInfoKHR.setImageExtent( mSwapchainExtent );
-    mSwapchainCreateInfoKHR.setImageColorSpace( mSwapchainColorSpace );
-
-    Create();
-
-    InitialiseSwapchainBuffers();
-
-    PrepareFramebuffers();
-
-    mFirstPresent = true;
-    return true;
-  }
-
-  bool InitialiseSwapchainBuffers()
-  {
-    mSwapchainBuffer.clear();
-    for( auto&& fb : mFramebuffers )
-    {
-      auto masterCmd = mGraphics.CreateCommandBuffer( true );
-
-      auto swapBuffer              = SwapchainBuffer{};
-      swapBuffer.framebuffer       = fb;
-      swapBuffer.index             = 0;
-      swapBuffer.masterCmdBuffer   = masterCmd;
-      swapBuffer.endOfFrameFence   = mGraphics.CreateFence({});
-      swapBuffer.firstUse          = true;
-      mSwapchainBuffer.emplace_back( swapBuffer );
-    }
-
-    return true;
-  }
-
-  void PrepareFramebuffers()
-  {
-    /*
-     * After creating the new swapchain we need to make sure
-     * the layout of images is correct to start with. To do so
-     * we will wait till the whole device is idle ( there should
-     * be a mechanism preventing from using the GPU past that point )
-     * and submit pipeline barriers setting up the layouts of
-     * all framebuffer images in one go. There will be no fancy
-     * synchronisation here as it's not really needed at this point.
-     * Waiting for queue or device idle should be enough.
-     */
-
-    const auto& device    = mGraphics.GetDevice();
-
-    device.waitIdle();
-
-    /*
-     * Create temporary command pool
-     */
-    auto cmdBuffer   = mGraphics.CreateCommandBuffer( true );
-
-    std::vector<vk::ImageMemoryBarrier> barriers;
-    RefCountedImageView                        depthStencilImage{};
-
-    for( auto&& buffer : mSwapchainBuffer )
-    {
-      auto colorImages = buffer.framebuffer->GetAttachments( Framebuffer::AttachmentType::COLOR );
-
-      // expecting to use one depth stencil image for all swapbuffers
-      if( !depthStencilImage )
-      {
-        depthStencilImage = buffer.framebuffer->GetAttachment( Framebuffer::AttachmentType::DEPTH_STENCIL, 0u );
-      }
-
-      /*
-       * Add barriers for color images
-       */
-      for( auto&& colorImageView : colorImages )
-      {
-        auto image   = colorImageView->GetImage();
-        auto vkImage = image->GetVkHandle();
-
-        vk::ImageSubresourceRange range;
-        range.setLayerCount( image->GetLayerCount() )
-          .setLevelCount( image->GetMipLevelCount() )
-          .setBaseMipLevel( 0 )
-          .setBaseArrayLayer( 0 )
-          .setAspectMask( vk::ImageAspectFlagBits::eColor );
-        auto colorBarrier = vk::ImageMemoryBarrier{}
-                              .setImage( vkImage )
-                              .setSubresourceRange( range )
-                              .setSrcAccessMask( vk::AccessFlags{} )
-                              .setDstAccessMask( vk::AccessFlags{} )
-                              .setOldLayout( vk::ImageLayout::eUndefined )
-                              .setNewLayout( vk::ImageLayout::eColorAttachmentOptimal );
-
-        barriers.emplace_back( colorBarrier );
-      }
-    }
-
-    /*
-     * Add barrier for depth stencil image
-     */
-    if( depthStencilImage )
-    {
-      auto image   = depthStencilImage->GetImage();
-      auto vkImage = image->GetVkHandle();
-
-      vk::ImageSubresourceRange range;
-      range.setLayerCount( image->GetLayerCount() )
-        .setLevelCount( image->GetMipLevelCount() )
-        .setBaseMipLevel( 0 )
-        .setBaseArrayLayer( 0 )
-        .setAspectMask( vk::ImageAspectFlagBits::eDepth | vk::ImageAspectFlagBits::eStencil );
-      auto depthStencilBarrier = vk::ImageMemoryBarrier{}
-                                   .setImage( vkImage )
-                                   .setSubresourceRange( range )
-                                   .setSrcAccessMask( vk::AccessFlags{} )
-                                   .setDstAccessMask( vk::AccessFlags{} )//vk::AccessFlagBits::eDepthStencilAttachmentWrite )
-                                   .setOldLayout( vk::ImageLayout::eUndefined )
-                                   .setNewLayout( vk::ImageLayout::eDepthStencilAttachmentOptimal );
-      barriers.emplace_back( depthStencilBarrier );
-    }
-
-    /*
-     * Record command buffer with pipeline barrier
-     */
-    cmdBuffer->Begin( vk::CommandBufferUsageFlagBits::eOneTimeSubmit );
-    cmdBuffer->PipelineBarrier( vk::PipelineStageFlagBits::eTopOfPipe,
-                                vk::PipelineStageFlagBits::eTopOfPipe,
-                                vk::DependencyFlags{},
-                                std::vector<vk::MemoryBarrier>{},
-                                std::vector<vk::BufferMemoryBarrier>{},
-                                barriers );
-    cmdBuffer->End();
-
-    // use presentation queue to submit the call
-    auto submissionData = SubmissionData{}.SetCommandBuffers({ cmdBuffer });
-    mGraphics.Submit( mQueue, { submissionData }, RefCountedFence{} );
-    mGraphics.QueueWaitIdle( mQueue ); //TODO: Use a fence. Wait idle is bad
-  }
-
-  bool SetImageFormat()
-  {
-    // obtain supported image format
-    auto formats          = VkAssert( mGraphics.GetPhysicalDevice().getSurfaceFormatsKHR( mSurface->GetSurfaceKHR() ) );
-    mSwapchainImageFormat = vk::Format::eUndefined;
-
-    for( auto&& format : formats )
-    {
-      if( format.format != vk::Format::eUndefined )
-      {
-        mSwapchainColorSpace  = format.colorSpace;
-        mSwapchainImageFormat = format.format;
-        break;
-      }
-    }
-
-    return vk::Format::eUndefined != mSwapchainImageFormat;
-  }
-
-  /**
-   * Creates swapchain immediately
-   * @return
-   */
-  bool Create()
-  {
-    const auto& device    = mGraphics.GetDevice();
-    const auto& allocator = mGraphics.GetAllocator();
-
-    //@todo validation
-    mSwapchainKHR = VkAssert( device.createSwapchainKHR( mSwapchainCreateInfoKHR, allocator ) );
-
-    if( !mSwapchainKHR )
-    {
-      return false;
-    }
-
-    // pull images and create Framebuffers
-    auto images = VkAssert( device.getSwapchainImagesKHR( mSwapchainKHR ) );
-
-    // number of images must match requested buffering mode
-    if( images.size() != mBufferCount )
-    {
-      device.destroySwapchainKHR( mSwapchainKHR );
-      mSwapchainKHR = nullptr;
-      return false;
-    }
-
-    //@todo create depth-stencil image
-    auto depthStencilImageView = CreateDepthStencil();
-
-    /*
-     * CREATE FRAMEBUFFERS
-     */
-    for( auto&& image : images )
-    {
-      mFramebuffers.emplace_back( CreateFramebuffer( image ) );
-
-      // set depth/stencil if supported
-      if( depthStencilImageView )
-      {
-        mFramebuffers.back()->SetAttachment( depthStencilImageView, Framebuffer::AttachmentType::DEPTH_STENCIL, 0u );
-      }
-
-      // create framebuffer and compatible render pass right now, no need to defer it
-      mFramebuffers.back()->Commit();
-    }
-
-    return true;
-  }
-
-  /**
-   * Creates depth stencil if necessary
-   * @return
-   */
-  RefCountedImageView CreateDepthStencil()
-  {
-    //TODO: create the image using the Graphics class
-    auto imageCreateInfo = vk::ImageCreateInfo{}
-            .setFormat( vk::Format::eD24UnormS8Uint )
-            .setMipLevels( 1 )
-            .setTiling( vk::ImageTiling::eOptimal )
-            .setImageType( vk::ImageType::e2D )
-            .setArrayLayers( 1 )
-            .setExtent( {mSwapchainExtent.width, mSwapchainExtent.height, 1} )
-            .setUsage( vk::ImageUsageFlagBits::eDepthStencilAttachment )
-            .setSharingMode( vk::SharingMode::eExclusive )
-            .setInitialLayout( vk::ImageLayout::eUndefined )
-            .setSamples( vk::SampleCountFlagBits::e1 );
-
-    auto dsRefCountedImage = mGraphics.CreateImage( imageCreateInfo );
-
-    auto memory = mGraphics
-            .GetDeviceMemoryManager()
-            .GetDefaultAllocator()
-            .Allocate( dsRefCountedImage, vk::MemoryPropertyFlagBits::eDeviceLocal );
-
-    mGraphics.BindImageMemory( dsRefCountedImage, memory, 0 );
-
-    // create imageview to be used within framebuffer
-    auto dsImageViewRef = mGraphics.CreateImageView(dsRefCountedImage);
-    return dsImageViewRef;
-  }
-
-  /**
-   * Creates a Framebuffer and compatible RenderPass
-   * @param image
-   * @return
-   */
-  RefCountedFramebuffer CreateFramebuffer( vk::Image& image )
-  {
-    auto fbRef = Framebuffer::New( mGraphics, mSwapchainExtent.width, mSwapchainExtent.height );
-
-    auto imageCreateInfo = vk::ImageCreateInfo{}
-            .setFormat( mSwapchainImageFormat )
-            .setSamples( vk::SampleCountFlagBits::e1 )
-            .setInitialLayout( vk::ImageLayout::eUndefined )
-            .setSharingMode( vk::SharingMode::eExclusive )
-            .setUsage( vk::ImageUsageFlagBits::eColorAttachment )
-            .setExtent( {mSwapchainExtent.width, mSwapchainExtent.height, 1} )
-            .setArrayLayers( 1 )
-            .setImageType( vk::ImageType::e2D )
-            .setTiling( vk::ImageTiling::eOptimal )
-            .setMipLevels( 1 );
-
-    // Create external Image reference
-    // Note that despite we don't create VkImage, we still fill the createinfo structure
-    // as this data will be used later
-    auto refCountedImage = Image::NewFromExternal( mGraphics, imageCreateInfo, image );
-
-    // Create basic imageview ( all mipmaps, all layers )
-    auto refCountedImageView = mGraphics.CreateImageView(refCountedImage);
-
-    fbRef->SetAttachment( refCountedImageView, Framebuffer::AttachmentType::COLOR, 0u );
-
-    return fbRef;
-  }
-
-  /**
-   * This function acquires next framebuffer
-   * @todo we should rather use roundrobin method
-   * @return
-   */
-  RefCountedFramebuffer AcquireNextFramebuffer()
-  {
-    const auto& device    = mGraphics.GetDevice();
-
-    if( !mFrameFence )
-    {
-      mFrameFence = mGraphics.CreateFence({});
-    }
-
-    mCurrentBufferIndex =
-      VkAssert( device.acquireNextImageKHR( mSwapchainKHR, 1000000, nullptr, mFrameFence->GetVkHandle() ) );
-
-    mGraphics.WaitForFence(mFrameFence);
-    mGraphics.ResetFence(mFrameFence);
-
-    auto& swapBuffer = mSwapchainBuffer[mCurrentBufferIndex];
-
-    // start recording
-    auto inheritanceInfo = vk::CommandBufferInheritanceInfo{}
-      .setFramebuffer(swapBuffer.framebuffer->GetVkHandle() )
-      .setRenderPass(swapBuffer.framebuffer->GetRenderPassVkHandle())
-      .setSubpass( 0 );
-
-    swapBuffer.masterCmdBuffer->Reset();
-    swapBuffer.masterCmdBuffer->Begin( vk::CommandBufferUsageFlagBits::eRenderPassContinue, &inheritanceInfo );
-
-    // change layout from present to color attachment if not done yet
-    // ( swapchain must track that )
-    if(!swapBuffer.firstUse)
-    {
-      UpdateLayoutPresentToColorAttachment(swapBuffer);
-    }
-    swapBuffer.firstUse = false;
-
-    return swapBuffer.framebuffer;
-  }
-
-  void BeginPrimaryRenderPass()
-  {
-    auto& currentBuffer = mSwapchainBuffer[mCurrentBufferIndex];
-
-    vk::RenderPassBeginInfo rpInfo{};
-    rpInfo.setRenderPass(currentBuffer.framebuffer->GetRenderPassVkHandle() )
-      .setFramebuffer(currentBuffer.framebuffer->GetVkHandle() )
-      .setPClearValues( currentBuffer.framebuffer->GetDefaultClearValues().data() )
-      .setClearValueCount( U32( currentBuffer.framebuffer->GetDefaultClearValues().size() ) )
-      .setRenderArea( vk::Rect2D( {0, 0}, mSurface->GetSize() ) );
-
-    currentBuffer.masterCmdBuffer->BeginRenderPass( rpInfo, vk::SubpassContents::eSecondaryCommandBuffers );
-  }
-
-  void BeginPrimaryRenderPass( std::vector<std::array<float,4>> colors )
-  {
-    auto& currentBuffer = mSwapchainBuffer[mCurrentBufferIndex];
-
-    vk::RenderPassBeginInfo rpInfo{};
-
-    auto newColors = currentBuffer.framebuffer->GetDefaultClearValues();
-    newColors[0].color.setFloat32( { colors[0][0],
-                                     colors[0][1],
-                                     colors[0][2],
-                                     colors[0][3]
-                                   } );
-
-    rpInfo.setRenderArea( vk::Rect2D( {0, 0}, mSurface->GetSize() ) )
-          .setRenderPass( currentBuffer.framebuffer->GetRenderPassVkHandle() )
-          .setFramebuffer( currentBuffer.framebuffer->GetVkHandle() )
-          .setPClearValues( newColors.data() )
-          .setClearValueCount( U32( currentBuffer.framebuffer->GetDefaultClearValues().size() ) );
-
-    currentBuffer.masterCmdBuffer->BeginRenderPass( rpInfo, vk::SubpassContents::eSecondaryCommandBuffers );
-  }
-
-  void EndPrimaryRenderPass( SwapchainBuffer& currentBuffer )
-  {
-    currentBuffer.masterCmdBuffer->EndRenderPass();
-  }
-
-  /**
-   * Performs layout transition for all the color attachments
-   * in the current framebuffer.
-   * The master command buffer must be in the recording state
-   * @param swapBuffer
-   */
-  void UpdateLayoutPresentToColorAttachment( SwapchainBuffer& swapBuffer )
-  {
-    auto& cmdBuf = swapBuffer.masterCmdBuffer;
-
-    //todo: test the state of th ebuffer, must be recording
-
-    auto attachments = swapBuffer.framebuffer->GetAttachments( Framebuffer::AttachmentType::COLOR );
-
-    std::vector<vk::ImageMemoryBarrier> barriers;
-    vk::ImageMemoryBarrier              barrier;
-    barrier
-      .setSrcAccessMask( vk::AccessFlagBits::eMemoryRead | vk::AccessFlagBits::eColorAttachmentRead )
-      .setDstAccessMask( vk::AccessFlagBits::eShaderWrite )
-      .setOldLayout( vk::ImageLayout::ePresentSrcKHR )
-      .setNewLayout( vk::ImageLayout::eColorAttachmentOptimal )
-      .setSubresourceRange( vk::ImageSubresourceRange{}.setAspectMask( vk::ImageAspectFlagBits::eColor ).setBaseArrayLayer(0)
-                                                       .setBaseMipLevel(0)
-                                                       .setLevelCount(1)
-                                                       .setLayerCount(1));
-
-    for( auto&& imageView : attachments )
-    {
-      barriers.emplace_back( barrier.setImage( imageView->GetImage()->GetVkHandle() ) );
-    }
-
-    cmdBuf->PipelineBarrier( vk::PipelineStageFlagBits::eColorAttachmentOutput,
-                             vk::PipelineStageFlagBits::eFragmentShader,
-                             vk::DependencyFlags{},
-                             std::vector<vk::MemoryBarrier>{},
-                             std::vector<vk::BufferMemoryBarrier>{},
-                             barriers );
-  }
-
-  RefCountedCommandBuffer GetPrimaryCommandBuffer() const
-  {
-    return mSwapchainBuffer[mCurrentBufferIndex].masterCmdBuffer;
-  }
-
-  bool Present()
-  {
-    auto& swapBuffer = mSwapchainBuffer[mCurrentBufferIndex];
-
-    // end command buffer
-    swapBuffer.masterCmdBuffer->End();
-
-    // submit
-    mGraphics.ResetFence(swapBuffer.endOfFrameFence);
-
-    auto submissionData = SubmissionData{}.SetCommandBuffers({ swapBuffer.masterCmdBuffer });
-
-    mGraphics.Submit( mQueue, { std::move(submissionData) } , swapBuffer.endOfFrameFence );
-
-    mGraphics.WaitForFence( swapBuffer.endOfFrameFence );
-
-    // fixme: use semaphores to synchronize all previously submitted command buffers!
-    vk::PresentInfoKHR presentInfo{};
-    vk::Result result;
-    presentInfo.setPImageIndices( &mCurrentBufferIndex )
-      .setPResults( &result )
-      .setPSwapchains( &mSwapchainKHR )
-      .setSwapchainCount( 1 )
-      .setPWaitSemaphores( nullptr )
-      .setWaitSemaphoreCount( 0 );
-
-    mGraphics.Present( mQueue, presentInfo );
-
-    mGraphics.CollectGarbage();
-
-    return true;
-  }
-
-  // same as present but additionally waits for semaphores
-  // needed when present queue is different from graphics queue
-  bool Present( std::vector<vk::Semaphore> semaphores )
-  {
-    vk::PresentInfoKHR presentInfo{};
-    vk::Result         result{};
-    presentInfo.setPImageIndices( &mCurrentBufferIndex )
-      .setPResults( &result )
-      .setPSwapchains( &mSwapchainKHR )
-      .setSwapchainCount( 1 )
-      .setPWaitSemaphores( nullptr )
-      .setWaitSemaphoreCount( 0 );
-
-    mGraphics.Present( mQueue, presentInfo );
-
-    mGraphics.CollectGarbage();
-
-    return true;
-  }
-
-  Swapchain& mOwner;
-  Graphics&  mGraphics;
-  Queue&     mQueue;
-  RefCountedSurface mSurface;
-
-  uint32_t mBufferCount;
-  uint32_t mFlags;
-  uint32_t mCurrentBufferIndex;
-
-  RefCountedFence mFrameFence;
-
-  // swapchain framebuffers
-  std::vector<RefCountedFramebuffer> mFramebuffers;
-
-  vk::SwapchainKHR           mSwapchainKHR;
-  vk::SwapchainCreateInfoKHR mSwapchainCreateInfoKHR;
-
-  vk::Format        mSwapchainImageFormat;
-  vk::ColorSpaceKHR mSwapchainColorSpace;
-  vk::Extent2D      mSwapchainExtent;
-
-  std::vector<SwapchainBuffer> mSwapchainBuffer;
-
-  bool mFirstPresent;
-};
-
-/**
- * Swapchain API
- */
-RefCountedSwapchain Swapchain::New(
-  Graphics& graphics, Queue& presentationQueue, RefCountedSurface surface, uint8_t bufferCount, uint32_t flags )
-{
-  auto retval = RefCountedSwapchain( new Swapchain( graphics, presentationQueue, surface, bufferCount, flags ) );
-
-  if( retval->mImpl->Initialise() )
-  {
-    return retval;
-  }
-
-  return RefCountedSwapchain();
-}
-
-Swapchain::Swapchain(
-  Graphics& graphics, Queue& presentationQueue, RefCountedSurface surface, uint8_t bufferCount, uint32_t flags )
-{
-  mImpl = std::make_unique<Impl>( *this, graphics, presentationQueue, surface, bufferCount, flags );
-}
-
-Swapchain::Swapchain()  = default;
-Swapchain::~Swapchain() = default;
-
-RefCountedFramebuffer Swapchain::GetCurrentFramebuffer() const
-{
-  return GetFramebuffer( mImpl->mCurrentBufferIndex );
-}
-
-RefCountedFramebuffer Swapchain::GetFramebuffer( uint32_t index ) const
-{
-  return mImpl->mSwapchainBuffer[index].framebuffer;
-}
-
-RefCountedFramebuffer Swapchain::AcquireNextFramebuffer()
-{
-  return mImpl->AcquireNextFramebuffer();
-}
-
-void Swapchain::Present()
-{
-  mImpl->Present();
-}
-
-void Swapchain::Present( std::vector<vk::Semaphore> waitSemaphores )
-{
-  mImpl->Present( waitSemaphores );
-}
-
-RefCountedCommandBuffer Swapchain::GetPrimaryCommandBuffer() const
-{
-  return mImpl->GetPrimaryCommandBuffer();
-}
-
-void Swapchain::BeginPrimaryRenderPass()
-{
-  mImpl->BeginPrimaryRenderPass( );
-}
-
-void Swapchain::BeginPrimaryRenderPass( std::vector<std::array<float,4>> colors )
-{
-  mImpl->BeginPrimaryRenderPass( colors );
-}
-
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
diff --git a/dali/graphics/vulkan/vulkan-swapchain.h b/dali/graphics/vulkan/vulkan-swapchain.h
deleted file mode 100644 (file)
index 2ba2418..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_SWAPCHAIN_H
-#define DALI_GRAPHICS_VULKAN_SWAPCHAIN_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/graphics/vulkan/vulkan-types.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-class Surface;
-class Queue;
-
-/**
- * Creates swapchain for given surface and queue
- */
-class Swapchain : public VkManaged
-{
-public:
-
-  static RefCountedSwapchain New( Graphics& graphics, Queue& presentationQueue, RefCountedSurface surface, uint8_t bufferCount, uint32_t flags );
-
-public:
-
-  Swapchain( const Swapchain& ) = delete;
-  Swapchain& operator=( const Swapchain& ) = delete;
-
-  /**
-   * Returns current framebuffer ( the one which is rendering to )
-   * @return
-   */
-  RefCountedFramebuffer GetCurrentFramebuffer() const;
-
-  /**
-   * Returns any framebuffer from the queue
-   * @param index
-   * @return
-   */
-  RefCountedFramebuffer GetFramebuffer( uint32_t index ) const;
-
-  /**
-   * Requests for next framebuffer
-   * @return
-   */
-  RefCountedFramebuffer AcquireNextFramebuffer();
-
-  /**
-   * Returns primary command buffer associated with currently
-   * being recorded frame
-   * @return
-   */
-  RefCountedCommandBuffer GetPrimaryCommandBuffer() const;
-
-  /**
-   * Begins primary render pass, must be called after acquiring new image
-   */
-  void BeginPrimaryRenderPass();
-
-  /**
-   * Begins primary render pass, must be called after acquiring new image
-   * @param beginInfo custom initialisation structure
-   */
-  void BeginPrimaryRenderPass( std::vector<std::array<float,4>> colors );
-
-  /**
-   * Presents using default present queue, asynchronously
-   */
-  void Present();
-
-  /**
-   * Presents using default queue, synchronized with supplied semaphores
-   * @param waitSemaphores
-   */
-  void Present( std::vector<vk::Semaphore> waitSemaphores );
-
-private:
-
-  Swapchain();
-  Swapchain( Graphics& graphics, Queue& presentationQueue, RefCountedSurface surface, uint8_t bufferCount, uint32_t flags );
-  ~Swapchain() override;
-
-private:
-
-  struct Impl;
-  std::unique_ptr<Impl> mImpl;
-};
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-#endif //DALI_GRAPHICS_VULKAN_SWAPCHAIN_H
diff --git a/dali/graphics/vulkan/vulkan-types.h b/dali/graphics/vulkan/vulkan-types.h
deleted file mode 100644 (file)
index 9939019..0000000
+++ /dev/null
@@ -1,341 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_TYPES
-#define DALI_GRAPHICS_VULKAN_TYPES
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <atomic>
-#include <unordered_map>
-#include <memory>
-
-#include <dali/integration-api/graphics/vulkan/vulkan-hpp-wrapper.h>
-
-namespace Dali
-{
-namespace Graphics
-{
-
-template< typename T, typename... Args >
-std::unique_ptr< T > MakeUnique(Args&&... args)
-{
-  return std::unique_ptr< T  >(new T(std::forward< Args >(args)...));
-}
-
-namespace Vulkan
-{
-
-/**
- * Forward class declarations
- */
-class Graphics;
-class Surface;
-class Queue;
-
-/**
- * Unique pointers to Vulkan types
- */
-using UniqueQueue         = std::unique_ptr< Queue >;
-
-/**
- * Reference wrappers
- */
-using QueueRef         = std::reference_wrapper< Queue >;
-
-template< typename T >
-T VkAssert(const vk::ResultValue< T >& result, vk::Result expected = vk::Result::eSuccess)
-{
-  assert(result.result == expected);
-  return result.value;
-}
-
-inline vk::Result VkAssert(vk::Result result, vk::Result expected = vk::Result::eSuccess)
-{
-  assert(result == expected);
-  return result;
-}
-
-inline vk::Result VkTest(vk::Result result, vk::Result expected = vk::Result::eSuccess)
-{
-  // todo: log if result different than expected?
-  return result;
-}
-
-template< typename T >
-inline uint32_t U32(T value)
-{
-  return static_cast< uint32_t >(value);
-}
-
-/**
- * Vulkan object handle
- * @tparam T
- */
-template<class T>
-class Handle
-{
-public:
-
-  Handle();
-  explicit Handle(T* object );
-  Handle( const Handle& handle);
-  Handle& operator=( const Handle& handle );
-  Handle& operator=( Handle&& handle );
-  Handle( Handle&& handle ) noexcept;
-  ~Handle();
-
-  operator bool() const;
-
-  T* operator->() const
-  {
-    return mObject;
-  }
-
-  uint32_t GetRefCount() const
-  {
-    return mObject->GetRefCount();
-  }
-
-  T& operator*() const
-  {
-    return *mObject;
-  }
-
-  template <class K>
-  Handle<K> StaticCast()
-  {
-    return Handle<K>(static_cast<K*>(mObject));
-  }
-
-  template<class K>
-  bool operator==( const Handle<K>& object ) const
-  {
-    return mObject == &*object;
-  }
-
-  template <class K>
-  Handle<K> DynamicCast();
-
-  void Reset()
-  {
-    if( mObject )
-    {
-      mObject->Release();
-      mObject = nullptr;
-    }
-  }
-
-private:
-
-  T* mObject { nullptr };
-};
-
-template <class K, class T>
-static Handle<K> VkTypeCast( const Handle<T>& inval )
-{
-  return Handle<K>(static_cast<K*>(&*inval));
-}
-
-template<class T>
-Handle<T>::Handle(T* object)
-  : mObject( object )
-{
-  if(mObject)
-  {
-    mObject->Retain();
-  }
-}
-
-template<class T>
-Handle<T>::Handle()
-  : mObject( nullptr )
-{
-}
-
-template<class T>
-Handle<T>::Handle(const Handle& handle)
-{
-  mObject = handle.mObject;
-  if(mObject)
-  {
-    mObject->Retain();
-  }
-}
-
-template<class T>
-Handle<T>::Handle( Handle&& handle ) noexcept
-{
-  mObject = handle.mObject;
-  handle.mObject = nullptr;
-}
-
-template<class T>
-Handle<T>::operator bool() const
-{
-  return mObject != nullptr;
-}
-
-template<class T>
-Handle<T>& Handle<T>::operator=( Handle&& handle )
-{
-  mObject = handle.mObject;
-  handle.mObject = nullptr;
-  return *this;
-}
-
-template<class T>
-Handle<T>& Handle<T>::operator=( const Handle<T>& handle )
-{
-  mObject = handle.mObject;
-  if(mObject)
-  {
-    mObject->Retain();
-  }
-  return *this;
-}
-
-template<class T>
-Handle<T>::~Handle()
-{
-  if(mObject)
-  {
-    mObject->Release();
-  }
-}
-
-template<class T>
-template<class K>
-Handle<K> Handle<T>::DynamicCast()
-{
-  auto val = dynamic_cast<K*>(mObject);
-  if(val)
-  {
-    return Handle<K>(val);
-  }
-  return Handle<K>();
-}
-
-template< typename T, typename... Args >
-Handle< T > MakeRef(Args&&... args)
-{
-  return Handle< T >(new T(std::forward< Args >(args)...));
-}
-
-template< typename T, typename... Args >
-Handle< T > NewRef(Args&&... args)
-{
-  return Handle< T >(T::New(std::forward< Args >(args)...));
-}
-
-
-class VkManaged
-{
-public:
-
-  VkManaged() = default;
-
-  virtual ~VkManaged() = default;
-
-  void Release()
-  {
-    OnRelease(--mRefCount);
-    if(mRefCount == 0)
-    {
-      // orphaned
-      if(!Destroy())
-      {
-        delete this;
-      }
-    }
-  }
-
-  void Retain()
-  {
-    OnRetain(++mRefCount);
-  }
-
-  uint32_t GetRefCount()
-  {
-    return mRefCount;
-  }
-
-  bool Destroy()
-  {
-    return OnDestroy();
-  }
-
-  virtual void OnRetain( uint32_t refcount ) {};
-
-  virtual void OnRelease( uint32_t refcount ) {};
-
-  virtual bool OnDestroy() { return false; };
-
-private:
-
-  std::atomic_uint mRefCount { 0u };
-};
-
-using FBID = int32_t;
-
-#define NotImplemented() \
-{\
-printf("Function %s isn't implemented!\n", __FUNCTION__);\
-assert( false && "Function no implemented" );\
-}
-
-
-enum class BufferType
-{
-  VERTEX,
-  INDEX,
-  UNIFORM,
-  SHADER_STORAGE
-};
-
-enum class Platform
-{
-  UNDEFINED,
-  XLIB,
-  XCB,
-  WAYLAND,
-};
-
-/*
- * Forward declarations of reference types
- */
-using RefCountedShader = Handle<class Shader>;
-using RefCountedPipeline = Handle<class Pipeline>;
-using RefCountedFence = Handle<class Fence>;
-using RefCountedBuffer = Handle<class Buffer>;
-using RefCountedFramebuffer = Handle<class Framebuffer>;
-using RefCountedImage = Handle<class Image>;
-using RefCountedImageView = Handle<class ImageView>;
-using RefCountedDescriptorPool = Handle<class DescriptorPool>;
-using RefCountedCommandPool = Handle<class CommandPool>;
-using RefCountedCommandBuffer = Handle<class CommandBuffer>;
-using RefCountedGpuMemoryBlock = Handle<class GpuMemoryBlock>;
-using RefCountedDescriptorSet = Handle<class DescriptorSet>;
-using RefCountedSwapchain = Handle<class Swapchain>;
-using RefCountedSurface = Handle<class Surface>;
-using RefCountedSampler = Handle<class Sampler>;
-using RefCountedTexture = Handle<class Texture>;
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_TYPES
diff --git a/dali/integration-api/CMakeLists.txt b/dali/integration-api/CMakeLists.txt
deleted file mode 100644 (file)
index 8beedf4..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-# Add platform abstraction headers here
-
-SET(SOURCES ${SOURCES}
-  ${CMAKE_CURRENT_SOURCE_DIR}/bitmap.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/core.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/debug.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/profiling.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/input-options.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/system-overlay.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/lockless-buffer.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/gesture-event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/hover-event-integ.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/key-event-integ.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/long-press-gesture-event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/wheel-event-integ.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/multi-point-event-integ.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pan-gesture-event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pinch-gesture-event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/point.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/tap-gesture-event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-event-combiner.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-event-integ.cpp
-  PARENT_SCOPE )
-
-SET(INTEGRATION_API_HEADERS
-  ${CMAKE_CURRENT_SOURCE_DIR}/core.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/core-enumerations.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/context-notifier.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/debug.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/profiling.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/input-options.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/bitmap.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/resource-policies.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/resource-types.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/gl-abstraction.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/gl-defines.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/gl-sync-abstraction.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/gesture-manager.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/render-controller.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/platform-abstraction.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/system-overlay.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/lockless-buffer.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/gesture-event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/gesture-requests.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/hover-event-integ.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/key-event-integ.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/long-press-gesture-event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/wheel-event-integ.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/multi-point-event-integ.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pan-gesture-event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pinch-gesture-event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/point.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/tap-gesture-event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-event-combiner.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-event-integ.h
-
-  PARENT_SCOPE )
index d6b8868..ec4a4a0 100644 (file)
@@ -35,7 +35,7 @@ namespace Integration
 
 class Bitmap;
 typedef IntrusivePtr<Bitmap>    BitmapPtr;
-typedef unsigned char                 PixelBuffer;  ///< Pixel data buffers are composed of these
+typedef uint8_t                 PixelBuffer;  ///< Pixel data buffers are composed of these
 
 /**
  * Bitmap class.
@@ -60,8 +60,8 @@ protected:
    * @param[in] height        Image height in pixels
    */
   void Initialize(Pixel::Format pixelFormat,
-                           unsigned int width,
-                           unsigned int height);
+                           uint32_t width,
+                           uint32_t height);
 
 
 public:
@@ -105,7 +105,7 @@ public:
    * Get the width of the image
    * @return The width of the image
    */
-  unsigned int GetImageWidth() const
+  uint32_t GetImageWidth() const
   {
     return mImageWidth;
   }
@@ -114,7 +114,7 @@ public:
    * Get the height of the image
    * @return The height of the image
    */
-  unsigned int GetImageHeight() const
+  uint32_t GetImageHeight() const
   {
     return mImageHeight;
   }
@@ -151,7 +151,7 @@ public:
    * @return The buffer size in bytes.
    * @sa ReserveBuffer GetBuffer
    */
-  virtual size_t GetBufferSize() const = 0;
+  virtual uint32_t GetBufferSize() const = 0;
 
   /**
    * Queries if the bitmap has an alpha channel
@@ -203,10 +203,10 @@ public:
      * @return pixel buffer pointer
      */
     virtual PixelBuffer* ReserveBuffer(Pixel::Format pixelFormat,
-                                       unsigned int width,
-                                       unsigned int height,
-                                       unsigned int bufferWidth = 0,
-                                       unsigned int bufferHeight = 0) = 0;
+                                       uint32_t width,
+                                       uint32_t height,
+                                       uint32_t bufferWidth = 0,
+                                       uint32_t bufferHeight = 0) = 0;
 
     /**
      * Assign a pixel buffer. Any previously allocated pixel buffer is deleted.
@@ -230,29 +230,29 @@ public:
      */
     virtual void AssignBuffer(Pixel::Format pixelFormat,
                               PixelBuffer* buffer,
-                              std::size_t bufferSize,
-                              unsigned int width,
-                              unsigned int height,
-                              unsigned int bufferWidth = 0,
-                              unsigned int bufferHeight = 0) = 0;
+                              uint32_t bufferSize,
+                              uint32_t width,
+                              uint32_t height,
+                              uint32_t bufferWidth = 0,
+                              uint32_t bufferHeight = 0) = 0;
     /**
      * Get the width of the buffer (stride)
      * @return The width of the buffer in pixels
      */
-    virtual unsigned int GetBufferWidth() const = 0;
+    virtual uint32_t GetBufferWidth() const = 0;
 
     /**
      * Get the height of the buffer
      * @return The height of the buffer in pixels
      */
-    virtual unsigned int GetBufferHeight() const = 0;
+    virtual uint32_t GetBufferHeight() const = 0;
 
     /**
      * Get the pixel buffer stride.
      * @return The buffer stride (in bytes) if this is bitmap of non-compressed
      * packed pixels for which a stride is meaningful or 0 otherwise.
      */
-    virtual unsigned int GetBufferStride() const = 0;
+    virtual uint32_t GetBufferStride() const = 0;
 
     /**
      * Check the bitmap data and test whether it has any transparent pixels.
@@ -302,7 +302,7 @@ public:
     virtual PixelBuffer* ReserveBufferOfSize( Pixel::Format pixelFormat,
                                        const unsigned width,
                                        const unsigned height,
-                                       const size_t numBytes ) = 0;
+                                       const uint32_t numBytes ) = 0;
   protected:
 
     /**
@@ -345,8 +345,8 @@ protected:
 
 protected:
 
-  unsigned int  mImageWidth;          ///< Image width in pixels
-  unsigned int  mImageHeight;         ///< Image height in pixels
+  uint32_t  mImageWidth;          ///< Image width in pixels
+  uint32_t  mImageHeight;         ///< Image height in pixels
   Pixel::Format mPixelFormat;         ///< Pixel format
   bool          mHasAlphaChannel;   ///< Whether the image has an alpha channel
   bool          mAlphaChannelUsed;  ///< Whether the alpha channel is used in case the image owns one.
index e164b85..996ca1e 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/common/view-mode.h>
 #include <dali/integration-api/resource-policies.h>
 
 namespace Dali
index e837f0b..5619acd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // CLASS HEADER
 #include <dali/integration-api/core.h>
+#include <dali/integration-api/render-surface.h>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/integration-api/events/event.h>
 #include <dali/integration-api/debug.h>
-#include <dali/integration-api/graphics/graphics.h>
+#include <dali/graphics-api/graphics-api-controller.h>
+#include <dali/integration-api/processor-interface.h>
 #include <dali/internal/common/core-impl.h>
 
+
 namespace Dali
 {
-
 namespace Integration
 {
 
 Core* Core::New( RenderController& renderController,
                  PlatformAbstraction& platformAbstraction,
-                 Graphics::Graphics& graphics,
+                 Graphics::Controller& graphicsController,
                  GestureManager& gestureManager,
                  ResourcePolicy::DataRetention policy,
                  RenderToFrameBuffer renderToFboEnabled,
@@ -43,7 +47,7 @@ Core* Core::New( RenderController& renderController,
   Core* instance = new Core;
   instance->mImpl = new Internal::Core( renderController,
                                         platformAbstraction,
-                                        graphics,
+                                        graphicsController,
                                         gestureManager,
                                         policy,
                                         renderToFboEnabled,
@@ -58,19 +62,14 @@ Core::~Core()
   delete mImpl;
 }
 
-void Core::SurfaceResized( unsigned int width, unsigned int height )
-{
-  mImpl->SurfaceResized(width, height);
-}
-
-void Core::SetTopMargin( unsigned int margin )
+void Core::Initialize()
 {
-  mImpl->SetTopMargin(margin);
+  mImpl->Initialize();
 }
 
-void Core::SetDpi( unsigned int dpiHorizontal, unsigned int dpiVertical )
+void Core::SurfaceResized( Integration::RenderSurface* surface )
 {
-  mImpl->SetDpi(dpiHorizontal, dpiVertical);
+  mImpl->SurfaceResized(surface);
 }
 
 void Core::SceneCreated()
@@ -88,15 +87,15 @@ void Core::ProcessEvents()
   mImpl->ProcessEvents();
 }
 
-unsigned int Core::GetMaximumUpdateCount() const
+uint32_t Core::GetMaximumUpdateCount() const
 {
   return mImpl->GetMaximumUpdateCount();
 }
 
 void Core::Update(
   float elapsedSeconds,
-  unsigned int lastVSyncTimeMilliseconds,
-  unsigned int nextVSyncTimeMilliseconds,
+  uint32_t lastVSyncTimeMilliseconds,
+  uint32_t nextVSyncTimeMilliseconds,
   UpdateStatus& status,
   bool renderToFboEnabled,
   bool isRenderingToFbo )
@@ -110,29 +109,9 @@ void Core::Render( RenderStatus& status, bool forceClear )
   DALI_LOG_ERROR("Core::Render() called in error\n");
 }
 
-SystemOverlay& Core::GetSystemOverlay()
-{
-  return mImpl->GetSystemOverlay();
-}
-
-void Core::SetViewMode( ViewMode viewMode )
-{
-  mImpl->SetViewMode( viewMode );
-}
-
-ViewMode Core::GetViewMode() const
-{
-  return mImpl->GetViewMode();
-}
-
-void Core::SetStereoBase( float stereoBase )
-{
-  mImpl->SetStereoBase( stereoBase );
-}
-
-float Core::GetStereoBase() const
+void Core::GraphicsShutdown()
 {
-  return mImpl->GetStereoBase();
+  mImpl->GraphicsShutdown();
 }
 
 void Core::RegisterProcessor( Processor& processor )
index a0e6891..dc9c6ee 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_CORE_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/common/view-mode.h>
 #include <dali/integration-api/core-enumerations.h>
 #include <dali/integration-api/resource-policies.h>
 
 namespace Dali
 {
 
+class Layer;
+class RenderTaskList;
+
 namespace Internal
 {
 class Core;
 }
 
-namespace Integration
-{
 namespace Graphics
 {
-class Graphics;
+class Controller;
 }
 
+namespace Integration
+{
 class Core;
 class GestureManager;
 class PlatformAbstraction;
+class Processor;
 class RenderController;
-class SystemOverlay;
+class RenderSurface;
 struct Event;
 struct TouchData;
 
@@ -58,7 +64,8 @@ enum Reasons
   STAGE_KEEP_RENDERING    = 1<<1, ///<  - Stage::KeepRendering() is being used
   ANIMATIONS_RUNNING      = 1<<2, ///< - Animations are ongoing
   MONITORING_PERFORMANCE  = 1<<3, ///< - The --enable-performance-monitor option is being used
-  RENDER_TASK_SYNC        = 1<<4  ///< - A render task is waiting for render sync
+  RENDER_TASK_SYNC        = 1<<4, ///< - A render task is waiting for render sync
+  DISCARD_RESOURCES       = 1<<5  ///< - The discard queue has resources to clear
 };
 }
 
@@ -75,6 +82,7 @@ public:
   UpdateStatus()
   : keepUpdating(false),
     needsNotification(false),
+    surfaceRectChanged(false),
     secondsFromLastFrame( 0.0f )
   {
   }
@@ -85,7 +93,7 @@ public:
    * Query whether the Core has further frames to update & render e.g. when animations are ongoing.
    * @return A bitmask of KeepUpdating values
    */
-  unsigned int KeepUpdating() { return keepUpdating; }
+  uint32_t KeepUpdating() { return keepUpdating; }
 
   /**
    * Query whether the Core requires an Notification event.
@@ -95,6 +103,12 @@ public:
   bool NeedsNotification() { return needsNotification; }
 
   /**
+   * Query wheter the default surface rect is changed or not.
+   * @return true if the default surface rect is changed.
+   */
+  bool SurfaceRectChanged() { return surfaceRectChanged; }
+
+  /**
    * This method is provided so that FPS can be easily calculated with a release version
    * of Core.
    * @return the seconds from last frame as float
@@ -103,8 +117,9 @@ public:
 
 public:
 
-  unsigned int keepUpdating; ///< A bitmask of KeepUpdating values
+  uint32_t keepUpdating; ///< A bitmask of KeepUpdating values
   bool needsNotification;
+  bool surfaceRectChanged;
   float secondsFromLastFrame;
 };
 
@@ -167,22 +182,6 @@ private:
   bool needsPostRender  :1;  ///< True if post-render is required to be run.
 };
 
-/**
- * Interface to enable classes to be processed after the event loop. Classes are processed
- * in the order they are registered.
- */
-class DALI_CORE_API Processor
-{
-public:
-  /**
-   * @brief Run the processor
-   */
-  virtual void Process() = 0;
-
-protected:
-  virtual ~Processor() { }
-};
-
 
 /**
  * Integration::Core is used for integration with the native windowing system.
@@ -226,6 +225,7 @@ public:
    * This object is used for integration with the native windowing system.
    * @param[in] renderController The interface to an object which controls rendering.
    * @param[in] platformAbstraction The interface providing platform specific services.
+   * @param[in] graphicsController The interface providing graphics services
    * @param[in] gestureManager The interface providing gesture manager services.
    * @param[in] policy The data retention policy. This depends on application setting
    * and platform support. Dali should honour this policy when deciding to discard
@@ -237,7 +237,7 @@ public:
    */
   static Core* New( RenderController& renderController,
                     PlatformAbstraction& platformAbstraction,
-                    Graphics::Graphics& graphics,
+                    Graphics::Controller& graphics,
                     GestureManager& gestureManager,
                     ResourcePolicy::DataRetention policy,
                     RenderToFrameBuffer renderToFboEnabled,
@@ -250,34 +250,17 @@ public:
   ~Core();
 
   /**
-   * Notify the Core that the render surface has been resized.
-   * The Core will use the surface size for camera calculations, and to set the viewport.
-   * Multi-threading note: this method should be called from the main thread
-   * @param[in] width The new surface width.
-   * @param[in] height The new surface height.
-   */
-  void SurfaceResized(unsigned int width, unsigned int height);
-
-  /**
-   * Notify the Core about the top margin size.
-   * Available stage size is reduced by this size.
-   * The stage is located below the size at the top of the display
-   * It is mainly useful for indicator in mobile device
-   * @param[in] margin margin size
+   * Initialize the core
    */
-  void SetTopMargin( unsigned int margin );
-
-  // Core setters
+  void Initialize();
 
   /**
-   * Notify the Core about the display's DPI values.
-   * This should be done after the display is initialized and a Core instance is created.
-   * The Core will use the DPI values for font rendering.
+   * Notify the Core that the render surface has been resized.
+   * The Core will use the surface size for camera calculations, and to set the viewport.
    * Multi-threading note: this method should be called from the main thread
-   * @param[in] dpiHorizontal Horizontal DPI value.
-   * @param[in] dpiVertical   Vertical DPI value.
+   * @param[in] surface The resized surface
    */
-  void SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical);
+  void SurfaceResized( Integration::RenderSurface* surface );
 
   // Core Lifecycle
 
@@ -309,7 +292,7 @@ public:
    * the Core::Render() method for frame N has returned.
    * @return The maximum update count (>= 1).
    */
-  unsigned int GetMaximumUpdateCount() const;
+  uint32_t GetMaximumUpdateCount() const;
 
   /**
    * Update the scene for the next frame. This method must be called before each frame is rendered.
@@ -327,8 +310,8 @@ public:
    * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
    */
   void Update( float elapsedSeconds,
-               unsigned int lastVSyncTimeMilliseconds,
-               unsigned int nextVSyncTimeMilliseconds,
+               uint32_t lastVSyncTimeMilliseconds,
+               uint32_t nextVSyncTimeMilliseconds,
                UpdateStatus& status,
                bool renderToFboEnabled,
                bool isRenderingToFbo );
@@ -337,41 +320,16 @@ public:
    * Render the next frame. This method should be preceded by a call up Update.
    * Multi-threading note: this method should be called from a dedicated rendering thread.
    * @param[out] status showing whether update is required to run.
+   * @param[in] forceClear force the Clear on the framebuffer even if nothing is rendered.
    */
   void Render( RenderStatus& status, bool forceClear );
 
-  // System-level overlay
-
-  /**
-   * Use the SystemOverlay to draw content for system-level indicators, dialogs etc.
-   * @return The SystemOverlay.
-   */
-  SystemOverlay& GetSystemOverlay();
-
-  /**
-   * Set the stereoscopic 3D view mode
-   * @param[in] viewMode The new view mode
-   */
-  void SetViewMode( ViewMode viewMode );
-
-  /**
-   * Get the current view mode
-   * @return The current view mode
-   * @see SetViewMode.
-   */
-  ViewMode GetViewMode() const;
-
-  /**
-   * Set the stereo base (eye seperation) for stereoscopic 3D
-   * @param[in] stereoBase The stereo base (eye seperation) for stereoscopic 3D (mm)
-   */
-  void SetStereoBase( float stereoBase );
-
   /**
-   * Get the stereo base (eye seperation) for stereoscopic 3D
-   * @return The stereo base (eye seperation) for stereoscopic 3D (mm)
+   * Notify the Core that that Graphics interface is about to be destroyed.
+   * The Core will free any previously allocated Graphics resources.
+   * Multi-threading note: this method should be called from the update thread only
    */
-  float GetStereoBase() const;
+  void GraphicsShutdown();
 
   /**
    * @brief Register a processor
old mode 100644 (file)
new mode 100755 (executable)
index 1ba6c71..38a1f89
@@ -80,6 +80,7 @@ namespace Log
 
 enum DebugPriority
 {
+  DebugDebug,
   DebugInfo,
   DebugWarning,
   DebugError
@@ -119,44 +120,44 @@ DALI_CORE_API void UninstallLogFunction();
 /**
  * Provides unfiltered logging for global error level messages
  */
-#define DALI_LOG_ERROR(format, args...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError,   "%s " format, __PRETTY_FUNCTION__, ## args)
+#define DALI_LOG_ERROR(format, ...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError,   "%s " format, __FUNCTION__, ## __VA_ARGS__)
 
-#define DALI_LOG_ERROR_NOFN(format, args...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, format, ## args)
+#define DALI_LOG_ERROR_NOFN(format, ...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, format, ## __VA_ARGS__)
 
-#define DALI_LOG_WARNING_NOFN(format, args...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, format, ## args)
+#define DALI_LOG_WARNING_NOFN(format, ...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, format, ## __VA_ARGS__)
 
 /**
  * Provides unfiltered logging for fps monitor
  */
-#define DALI_LOG_FPS(format, args...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## args)
+#define DALI_LOG_FPS(format, ...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## __VA_ARGS__)
 
 /**
  * Provides unfiltered logging for update status
  */
-#define DALI_LOG_UPDATE_STATUS(format, args...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## args)
+#define DALI_LOG_UPDATE_STATUS(format, ...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## __VA_ARGS__)
 
 /**
  * Provides unfiltered logging for render information
  */
-#define DALI_LOG_RENDER_INFO(format, args...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## args)
+#define DALI_LOG_RENDER_INFO(format, ...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## __VA_ARGS__)
 
 /**
  * Provides unfiltered logging for release
  */
-#define DALI_LOG_RELEASE_INFO(format, args...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## args)
+#define DALI_LOG_RELEASE_INFO(format, ...)     Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugInfo, format, ## __VA_ARGS__)
 
 #ifdef DEBUG_ENABLED
 
 /**
  * Provides unfiltered logging for global warning level messages
  */
-#define DALI_LOG_WARNING(format, args...)   Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, "%s " format, __PRETTY_FUNCTION__, ## args)
+#define DALI_LOG_WARNING(format, ...)   Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, "%s " format, __PRETTY_FUNCTION__, ## __VA_ARGS__)
 
 
 #else // DEBUG_ENABLED
 
 // Don't warn on release build
-#define DALI_LOG_WARNING(format, args...)
+#define DALI_LOG_WARNING(format, ...)
 
 #endif
 
@@ -319,8 +320,8 @@ public:
 
 #ifdef DEBUG_ENABLED
 
-#define DALI_LOG_INFO(filter, level, format, args...)                        \
-  if(filter && filter->IsEnabledFor(level)) { filter->Log(level, format,  ## args); }
+#define DALI_LOG_INFO(filter, level, format, ...)                        \
+  if(filter && filter->IsEnabledFor(level)) { filter->Log(level, format,  ## __VA_ARGS__); }
 
 #define DALI_LOG_STREAM( filter, level, stream )  \
   if(filter && filter->IsEnabledFor(level))       \
@@ -332,7 +333,7 @@ public:
 
 #else // DEBUG_ENABLED
 
-#define DALI_LOG_INFO(filter, level, format, args...)
+#define DALI_LOG_INFO(filter, level, format, ...)
 #define DALI_LOG_STREAM( filter, level, stream )
 
 #endif // DEBUG_ENABLED
@@ -361,8 +362,8 @@ public:
 };
 
 
-#define DALI_LOG_TRACE_METHOD_FMT(filter, format, args...)                 \
-  Dali::Integration::Log::TraceObj debugTraceObj(filter, "%s: " format, __PRETTY_FUNCTION__, ## args)
+#define DALI_LOG_TRACE_METHOD_FMT(filter, format, ...)                 \
+  Dali::Integration::Log::TraceObj debugTraceObj(filter, "%s: " format, __PRETTY_FUNCTION__, ## __VA_ARGS__)
 
 #define DALI_LOG_TRACE_METHOD(filter)                                      \
   Dali::Integration::Log::TraceObj debugTraceObj(filter, __PRETTY_FUNCTION__)
@@ -370,7 +371,7 @@ public:
 
 #else // DEBUG_ENABLED
 
-#define DALI_LOG_TRACE_METHOD_FMT(filter, format, args...)
+#define DALI_LOG_TRACE_METHOD_FMT(filter, format, ...)
 #define DALI_LOG_TRACE_METHOD(filter)
 
 
@@ -414,7 +415,7 @@ public: \
 /**
  * Allows one object to set another object's std::string easily
  */
-#define DALI_LOG_FMT_OBJECT_STRING(object, fmt, args...) (object->mDebugString = FormatToString(fmt, ## args))
+#define DALI_LOG_FMT_OBJECT_STRING(object, fmt, ...) (object->mDebugString = FormatToString(fmt, ## __VA_ARGS__))
 
 /**
  * Allows one object to get another object's debug string
@@ -437,7 +438,7 @@ public: \
 #define DALI_LOG_OBJECT_STRING_DECLARATION
 #define DALI_LOG_ACTOR_TREE(node)
 #define DALI_LOG_SET_OBJECT_STRING(object, string)
-#define DALI_LOG_FMT_OBJECT_STRING(object, fmt, args...)
+#define DALI_LOG_FMT_OBJECT_STRING(object, fmt, ...)
 #define DALI_LOG_GET_OBJECT_STRING(object)
 #define DALI_LOG_GET_OBJECT_C_STR(object) ""
 #define DALI_LOG_OBJECT(filter, object)
index 5b58a66..fef2e66 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
 // CLASS HEADER
 #include <dali/integration-api/events/key-event-integ.h>
 
+// INTERNAL INCLUDES
+#include <dali/internal/event/events/key-event-impl.h>
+
 namespace Dali
 {
 
@@ -27,6 +30,7 @@ namespace Integration
 KeyEvent::KeyEvent()
 : Event( Key ),
   keyName(),
+  logicalKey(),
   keyString(),
   keyCode( -1 ),
   keyModifier( 0 ),
@@ -39,11 +43,12 @@ KeyEvent::KeyEvent()
 {
 }
 
-KeyEvent::KeyEvent( const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier,
+KeyEvent::KeyEvent( const std::string& keyName, const std::string& logicalKey, const std::string& keyString, int keyCode, int keyModifier,
                     unsigned long timeStamp, const State& keyState, const std::string& compose, const std::string& deviceName,
                     const Device::Class::Type deviceClass, const Device::Subclass::Type deviceSubclass )
 : Event( Key ),
   keyName( keyName ),
+  logicalKey( logicalKey ),
   keyString( keyString ),
   keyCode( keyCode ),
   keyModifier( keyModifier ),
@@ -59,6 +64,7 @@ KeyEvent::KeyEvent( const std::string& keyName, const std::string& keyString, in
 KeyEvent::KeyEvent( const Dali::KeyEvent& event )
 : Event( Key ),
   keyName( event.keyPressedName ),
+  logicalKey( "" ),
   keyString( event.keyPressed ),
   keyCode( event.keyCode ),
   keyModifier( event.keyModifier ),
@@ -69,6 +75,12 @@ KeyEvent::KeyEvent( const Dali::KeyEvent& event )
   deviceClass( Device::Class::NONE ),
   deviceSubclass( Device::Subclass::NONE )
 {
+  const Internal::KeyEventImpl* keyEventImpl = GetImplementation( &event );
+  logicalKey = keyEventImpl->GetLogicalKey();
+  compose = keyEventImpl->GetCompose();
+  deviceName = keyEventImpl->GetDeviceName();
+  deviceClass = keyEventImpl->GetDeviceClass();
+  deviceSubclass = keyEventImpl->GetDeviceSubclass();
 }
 
 KeyEvent::~KeyEvent()
index cf74794..d2b5484 100755 (executable)
@@ -2,7 +2,7 @@
 #define __DALI_INTEGRATION_KEY_EVENT_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,6 +56,7 @@ struct DALI_CORE_API KeyEvent : public Event
   /**
    * Constructor
    * @param[in]  keyName       The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
+   * @param[in]  logicalKey    The logical key symbol (eg. shift + 1 == "exclamation")
    * @param[in]  keyString     A string of input characters or key pressed
    * @param[in]  keyCode       The unique key code for the key pressed.
    * @param[in]  keyModifier   The key modifier for special keys like shift and alt
@@ -67,6 +68,7 @@ struct DALI_CORE_API KeyEvent : public Event
    * @param[in]  deviceSubclass  Subclass of device KeyEvent originated from
    */
   KeyEvent(const std::string& keyName,
+           const std::string& logicalKey,
            const std::string& keyString,
            int keyCode,
            int keyModifier,
@@ -77,7 +79,7 @@ struct DALI_CORE_API KeyEvent : public Event
            const Device::Class::Type deviceClass,
            const Device::Subclass::Type deviceSubclass );
 
-  /*
+  /**
    * Constructor, creates a Integration::KeyEvent from a Dali::KeyEvent
    * @param[in] event Dali::KeyEvent to convert from
    */
@@ -96,6 +98,11 @@ struct DALI_CORE_API KeyEvent : public Event
   std::string keyName;
 
   /**
+   * The logical key symbol
+   */
+  std::string logicalKey;
+
+  /**
    *@copydoc Dali::KeyEvent::keyPressed
    */
   std::string keyString;
index 780a04f..099bb3e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -48,21 +48,21 @@ void MultiPointEvent::AddPoint( const Point& point )
   points.push_back(point);
 }
 
-Point& MultiPointEvent::GetPoint( unsigned int point )
+Point& MultiPointEvent::GetPoint( uint32_t point )
 {
   DALI_ASSERT_ALWAYS(point < points.size() && "MultiPointEvent: Point index out of bounds");
   return points[point];
 }
 
-const Point& MultiPointEvent::GetPoint( unsigned int point ) const
+const Point& MultiPointEvent::GetPoint( uint32_t point ) const
 {
   DALI_ASSERT_ALWAYS(point < points.size() && "MultiPointEvent: Point index out of bounds");
   return points[point];
 }
 
-unsigned int MultiPointEvent::GetPointCount() const
+uint32_t MultiPointEvent::GetPointCount() const
 {
-  return points.size();
+  return static_cast<uint32_t>( points.size() ); // not going to overflow in practice
 }
 
 } // namespace Integration
index 364c541..7dec1be 100644 (file)
@@ -87,19 +87,19 @@ public:
    * @brief Retrieves the Point at position point.
    * @return The Point at position point.
    */
-  Point& GetPoint( unsigned int point );
+  Point& GetPoint( uint32_t point );
 
   /**
    * @brief Retrieves a const ref of the Point at position point.
    * @return The const ref of the Point at position point.
    */
-  const Point& GetPoint( unsigned int point ) const;
+  const Point& GetPoint( uint32_t point ) const;
 
   /**
    * @brief The total number of Points in this TouchEvent.
    * @return The point count.
    */
-  unsigned int GetPointCount() const;
+  uint32_t GetPointCount() const;
 };
 
 } // namespace Integration
old mode 100644 (file)
new mode 100755 (executable)
index 19b44b0..65b989d
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
 
 // CLASS HEADER
 #include <dali/integration-api/events/point.h>
+#include <dali/public-api/events/mouse-button.h>
 
 namespace Dali
 {
@@ -31,7 +32,8 @@ Point::Point()
   mDeviceClass( Device::Class::NONE ),
   mDeviceSubclass( Device::Subclass::NONE ),
   mPressure( 1.0f ),
-  mRadius( 0.0f )
+  mRadius( 0.0f ),
+  mMouseButton( MouseButton::INVALID )
 {
 }
 
@@ -42,7 +44,8 @@ Point::Point( const TouchPoint& touchPoint )
   mDeviceClass( Device::Class::NONE ),
   mDeviceSubclass( Device::Subclass::NONE ),
   mPressure( 1.0f ),
-  mRadius( 0.0f )
+  mRadius( 0.0f ),
+  mMouseButton( MouseButton::INVALID )
 {
 }
 
@@ -50,7 +53,7 @@ Point::~Point()
 {
 }
 
-void Point::SetDeviceId( int deviceId )
+void Point::SetDeviceId( int32_t deviceId )
 {
   mTouchPoint.deviceId = deviceId;
 }
@@ -166,6 +169,17 @@ Device::Subclass::Type Point::GetDeviceSubclass() const
   return mDeviceSubclass;
 }
 
+MouseButton::Type Point::GetMouseButton() const
+{
+  return mMouseButton;
+}
+
+void Point::SetMouseButton(MouseButton::Type button)
+{
+  mMouseButton = button;
+}
+
+
 } // namespace Integration
 
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index d0c4f0f..543e86e
@@ -24,6 +24,7 @@
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/events/touch-point.h>
 #include <dali/public-api/events/device.h>
+#include <dali/public-api/events/mouse-button.h>
 
 namespace Dali
 {
@@ -59,7 +60,7 @@ struct DALI_CORE_API Point
    *
    * @param[in]  deviceId  The Unique Device ID.
    */
-  void SetDeviceId( int deviceId );
+  void SetDeviceId( int32_t deviceId );
 
   /**
    * @brief Set the state of the point.
@@ -178,6 +179,16 @@ struct DALI_CORE_API Point
    */
   Device::Subclass::Type GetDeviceSubclass() const;
 
+  /**
+   * @brief Get Mouse Button value. (ex: right/left button)
+   * @return The mouse button value.
+   */
+  MouseButton::Type GetMouseButton() const;
+
+  /**
+   * @brief Set Mouse Button value. (ex: right/left button)
+   */
+  void SetMouseButton(MouseButton::Type button);
 
 
 public: // Not intended for Integration API developers
@@ -223,6 +234,7 @@ private:
   Device::Subclass::Type mDeviceSubclass;
   float mPressure; ///< The touch pressure.
   float mRadius; ///< Radius of the press point, an average of the ellipse radius.
+  MouseButton::Type mMouseButton; /// < mouse button value.
 };
 
 } // namespace Integration
index eda736f..dca4d0f 100644 (file)
@@ -1,67 +1,78 @@
-# Add platform abstraction headers here
+# Set the source directory
+SET( platform_abstraction_src_dir ${ROOT_SRC_DIR}/dali/integration-api )
 
-platform_abstraction_src_files = \
-   $(platform_abstraction_src_dir)/bitmap.cpp \
-   $(platform_abstraction_src_dir)/core.cpp \
-   $(platform_abstraction_src_dir)/debug.cpp \
-   $(platform_abstraction_src_dir)/trace.cpp \
-   $(platform_abstraction_src_dir)/profiling.cpp \
-   $(platform_abstraction_src_dir)/input-options.cpp \
-   $(platform_abstraction_src_dir)/system-overlay.cpp \
-   $(platform_abstraction_src_dir)/lockless-buffer.cpp \
-   $(platform_abstraction_src_dir)/events/event.cpp \
-   $(platform_abstraction_src_dir)/events/gesture-event.cpp \
-   $(platform_abstraction_src_dir)/events/hover-event-integ.cpp \
-   $(platform_abstraction_src_dir)/events/key-event-integ.cpp \
-   $(platform_abstraction_src_dir)/events/long-press-gesture-event.cpp \
-   $(platform_abstraction_src_dir)/events/wheel-event-integ.cpp \
-   $(platform_abstraction_src_dir)/events/multi-point-event-integ.cpp \
-   $(platform_abstraction_src_dir)/events/pan-gesture-event.cpp \
-   $(platform_abstraction_src_dir)/events/pinch-gesture-event.cpp \
-   $(platform_abstraction_src_dir)/events/point.cpp \
-   $(platform_abstraction_src_dir)/events/tap-gesture-event.cpp \
-   $(platform_abstraction_src_dir)/events/touch-event-combiner.cpp \
-   $(platform_abstraction_src_dir)/events/touch-event-integ.cpp
+# Add platform abstraction source files here
+SET( platform_abstraction_src_files
+   ${platform_abstraction_src_dir}/bitmap.cpp
+   ${platform_abstraction_src_dir}/core.cpp
+   ${platform_abstraction_src_dir}/debug.cpp
+   ${platform_abstraction_src_dir}/trace.cpp
+   ${platform_abstraction_src_dir}/profiling.cpp
+   ${platform_abstraction_src_dir}/input-options.cpp
+   ${platform_abstraction_src_dir}/lockless-buffer.cpp
+   ${platform_abstraction_src_dir}/render-task-list-integ.cpp
+   ${platform_abstraction_src_dir}/scene.cpp
+)
 
-platform_abstraction_header_files = \
-   $(platform_abstraction_src_dir)/core.h \
-   $(platform_abstraction_src_dir)/core-enumerations.h \
-   $(platform_abstraction_src_dir)/debug.h \
-   $(platform_abstraction_src_dir)/trace.h \
-   $(platform_abstraction_src_dir)/profiling.h \
-   $(platform_abstraction_src_dir)/input-options.h \
-   $(platform_abstraction_src_dir)/bitmap.h \
-   $(platform_abstraction_src_dir)/resource-policies.h \
-   $(platform_abstraction_src_dir)/resource-types.h \
-   $(platform_abstraction_src_dir)/gesture-manager.h \
-   $(platform_abstraction_src_dir)/render-controller.h \
-   $(platform_abstraction_src_dir)/platform-abstraction.h \
-   $(platform_abstraction_src_dir)/system-overlay.h \
-   $(platform_abstraction_src_dir)/lockless-buffer.h
+SET( platform_abstraction_events_src_files
+   ${platform_abstraction_src_dir}/events/event.cpp
+   ${platform_abstraction_src_dir}/events/gesture-event.cpp
+   ${platform_abstraction_src_dir}/events/hover-event-integ.cpp
+   ${platform_abstraction_src_dir}/events/key-event-integ.cpp
+   ${platform_abstraction_src_dir}/events/long-press-gesture-event.cpp
+   ${platform_abstraction_src_dir}/events/multi-point-event-integ.cpp
+   ${platform_abstraction_src_dir}/events/pan-gesture-event.cpp
+   ${platform_abstraction_src_dir}/events/pinch-gesture-event.cpp
+   ${platform_abstraction_src_dir}/events/point.cpp
+   ${platform_abstraction_src_dir}/events/tap-gesture-event.cpp
+   ${platform_abstraction_src_dir}/events/touch-event-combiner.cpp
+   ${platform_abstraction_src_dir}/events/touch-event-integ.cpp
+   ${platform_abstraction_src_dir}/events/wheel-event-integ.cpp
+)
 
-platform_abstraction_events_header_files = \
-   $(platform_abstraction_src_dir)/events/event.h \
-   $(platform_abstraction_src_dir)/events/gesture-event.h \
-   $(platform_abstraction_src_dir)/events/gesture-requests.h \
-   $(platform_abstraction_src_dir)/events/hover-event-integ.h \
-   $(platform_abstraction_src_dir)/events/key-event-integ.h \
-   $(platform_abstraction_src_dir)/events/long-press-gesture-event.h \
-   $(platform_abstraction_src_dir)/events/wheel-event-integ.h \
-   $(platform_abstraction_src_dir)/events/multi-point-event-integ.h \
-   $(platform_abstraction_src_dir)/events/pan-gesture-event.h \
-   $(platform_abstraction_src_dir)/events/pinch-gesture-event.h \
-   $(platform_abstraction_src_dir)/events/point.h \
-   $(platform_abstraction_src_dir)/events/tap-gesture-event.h \
-   $(platform_abstraction_src_dir)/events/touch-event-combiner.h \
-   $(platform_abstraction_src_dir)/events/touch-event-integ.h
+SET( platform_abstraction_header_files
+   ${platform_abstraction_src_dir}/core.h
+   ${platform_abstraction_src_dir}/core-enumerations.h
+   ${platform_abstraction_src_dir}/debug.h
+   ${platform_abstraction_src_dir}/trace.h
+   ${platform_abstraction_src_dir}/profiling.h
+   ${platform_abstraction_src_dir}/input-options.h
+   ${platform_abstraction_src_dir}/bitmap.h
+   ${platform_abstraction_src_dir}/resource-policies.h
+   ${platform_abstraction_src_dir}/resource-types.h
+   ${platform_abstraction_src_dir}/gesture-manager.h
+   ${platform_abstraction_src_dir}/render-controller.h
+   ${platform_abstraction_src_dir}/platform-abstraction.h
+   ${platform_abstraction_src_dir}/processor-interface.h
+   ${platform_abstraction_src_dir}/lockless-buffer.h
+   ${platform_abstraction_src_dir}/render-task-list-integ.h
+   ${platform_abstraction_src_dir}/scene.h
+   ${platform_abstraction_src_dir}/render-surface.h
+)
 
-graphics_integration_src_files = \
-   $(platform_abstraction_src_dir)/graphics/graphics.cpp
+SET( platform_abstraction_events_header_files
+   ${platform_abstraction_src_dir}/events/event.h
+   ${platform_abstraction_src_dir}/events/gesture-event.h
+   ${platform_abstraction_src_dir}/events/gesture-requests.h
+   ${platform_abstraction_src_dir}/events/hover-event-integ.h
+   ${platform_abstraction_src_dir}/events/key-event-integ.h
+   ${platform_abstraction_src_dir}/events/long-press-gesture-event.h
+   ${platform_abstraction_src_dir}/events/wheel-event-integ.h
+   ${platform_abstraction_src_dir}/events/multi-point-event-integ.h
+   ${platform_abstraction_src_dir}/events/pan-gesture-event.h
+   ${platform_abstraction_src_dir}/events/pinch-gesture-event.h
+   ${platform_abstraction_src_dir}/events/point.h
+   ${platform_abstraction_src_dir}/events/tap-gesture-event.h
+   ${platform_abstraction_src_dir}/events/touch-event-combiner.h
+   ${platform_abstraction_src_dir}/events/touch-event-integ.h
+)
 
-graphics_integration_header_files = \
-  $(platform_abstraction_src_dir)/graphics/graphics.h \
-  $(platform_abstraction_src_dir)/graphics/surface-factory.h
+SET( SOURCES ${SOURCES}
+  ${platform_abstraction_src_files}
+  ${platform_abstraction_events_src_files}
+)
 
-graphics_vulkan_integration_header_files = \
-  $(platform_abstraction_src_dir)/graphics/vulkan/vk-surface-factory.h \
-  $(platform_abstraction_src_dir)/graphics/vulkan/vulkan-hpp-wrapper.h
+SET( INTEGRATION_API_HEADERS ${INTEGRATION_API_HEADERS}
+  ${platform_abstraction_header_files}
+  ${platform_abstraction_events_header_files}
+)
diff --git a/dali/integration-api/graphics/file.list b/dali/integration-api/graphics/file.list
deleted file mode 100644 (file)
index 9c7d63b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# Add graphics integration source files here
-
-graphics_integration_src_files = \
-   $(graphics_integration_dir)/graphics.cpp
diff --git a/dali/integration-api/graphics/graphics.cpp b/dali/integration-api/graphics/graphics.cpp
deleted file mode 100644 (file)
index 758e40d..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/graphics/vulkan/vulkan-types.h>
-#include <dali/graphics/vulkan/vulkan-graphics.h>
-#include <dali/graphics/vulkan/vulkan-surface.h>
-#include <dali/graphics/vulkan/vulkan-framebuffer.h>
-#include <dali/graphics-api/graphics-api-controller.h>
-#include <dali/integration-api/graphics/graphics.h>
-
-extern "C" std::vector<uint32_t> GraphicsGetBuiltinShader( const std::string& tag );
-
-namespace Dali
-{
-/// fixme: substituting directly the vulkan implementation
-namespace Graphics
-{
-using GraphicsImpl = Dali::Graphics::Vulkan::Graphics;
-}
-
-namespace Integration
-{
-namespace Graphics
-{
-using Swapchain = Dali::Graphics::Vulkan::Swapchain;
-using SwapchainRef = Dali::Graphics::Vulkan::RefCountedSwapchain;
-
-Graphics::Graphics()
-{
-  // create device
-  auto impl = Dali::Graphics::MakeUnique<Dali::Graphics::GraphicsImpl>();
-
-  impl->Create();
-
-  mGraphicsImpl = std::move(impl);
-}
-
-Graphics::~Graphics()
-{
-
-}
-
-Dali::Graphics::FBID Graphics::Create(
-  std::unique_ptr<Dali::Integration::Graphics::SurfaceFactory> surfaceFactory)
-{
-  //@todo do we really need to have a surface that early???
-
-  // create surface
-  auto retval = mGraphicsImpl->CreateSurface(std::move(surfaceFactory));
-
-  // create device
-  mGraphicsImpl->CreateDevice();
-
-  // create swapchain from surface
-  auto surface = mGraphicsImpl->GetSurface( retval );
-
-  // create swapchain
-  mGraphicsImpl->CreateSwapchainForSurface( surface );
-
-  return retval;
-}
-
-Dali::Graphics::FBID Graphics::CreateSurface(
-  std::unique_ptr<Dali::Integration::Graphics::SurfaceFactory> surfaceFactory)
-{
-  return 0u;
-}
-
-void Graphics::PreRender(Dali::Graphics::FBID framebufferId)
-{
-  assert(framebufferId != 0 && "Invalid FBID!");
-  auto swapchain = mGraphicsImpl->GetSwapchainForFBID( framebufferId );
-  swapchain->AcquireNextFramebuffer();
-}
-
-Dali::Graphics::API::Controller& Graphics::GetController()
-{
-  return mGraphicsImpl->GetController();
-}
-
-/*
- * Postrender
- */
-void Graphics::PostRender(Dali::Graphics::FBID framebufferId)
-{
-  auto swapchain = mGraphicsImpl->GetSwapchainForFBID( framebufferId );
-  swapchain->Present();
-}
-
-void IncludeThisLibrary()
-{
-  // dummy function to create linker dependency
-  //GraphicsGetBuiltinShader("");
-}
-
-} // Namespace Graphics
-} // Namespace Integration
-} // Namespace Dali
diff --git a/dali/integration-api/graphics/graphics.h b/dali/integration-api/graphics/graphics.h
deleted file mode 100644 (file)
index 8b98599..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-#ifndef DALI_INTEGRATION_GRAPHICS_H
-#define DALI_INTEGRATION_GRAPHICS_H
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <memory>
-
-#define EXPORT_API __attribute__ ((visibility ("default")))
-
-namespace Dali
-{
-namespace Graphics
-{
-namespace API
-{
-class Controller;
-}
-// frame buffer id
-using FBID = int32_t;
-
-namespace Vulkan
-{
-class Graphics;
-} // Vulkan
-using GraphicsImpl = Vulkan::Graphics;
-
-} // Graphics
-
-namespace Integration
-{
-namespace Graphics
-{
-class SurfaceFactory;
-class EXPORT_API Graphics final
-{
-public:
-
-
-  Graphics();
-  ~Graphics();
-
-  /**
-   *
-   * @param surfaceFactory
-   * @return
-   */
-  Dali::Graphics::FBID CreateSurface( std::unique_ptr<Dali::Integration::Graphics::SurfaceFactory> surfaceFactory );
-
-
-  /**
-   * When creating Graphics at least one surfaceFactory must be supplied ( no headless mode )
-   * @param surfaceFactory
-   * @return
-   */
-  Dali::Graphics::FBID Create( std::unique_ptr<Dali::Integration::Graphics::SurfaceFactory> surfaceFactory );
-
-  /**
-   * Prerender
-   */
-  void PreRender( Dali::Graphics::FBID framebufferId = 0u );
-
-  /*
-   * Postrender
-   */
-  void PostRender( Dali::Graphics::FBID framebufferId = 0u );
-
-  /**
-   * Returns controller object
-   * @return
-   */
-  Dali::Graphics::API::Controller& GetController();
-
-  // this function is used only by the standalone test
-  template <class T>
-  T& GetImplementation() const
-  {
-    return static_cast<T&>(*mGraphicsImpl.get());
-  }
-
-private:
-
-  std::unique_ptr<Dali::Graphics::GraphicsImpl> mGraphicsImpl;
-};
-
-
-
-/**
- * fixme: dummy function to make sure the static library won't be discarded entirely during linking
- */
-EXPORT_API void IncludeThisLibrary();
-
-} // Namespace Graphics
-} // Namespace Integration
-} // Namespace Dali
-
-#endif // DALI_INTEGRATION_GRAPHICS_H
diff --git a/dali/integration-api/graphics/vulkan/vk-surface-factory.h b/dali/integration-api/graphics/vulkan/vk-surface-factory.h
deleted file mode 100644 (file)
index cf8bbc2..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef DALI_GRAPHICS_VULKAN_VKSURFACEFACTORY_H
-#define DALI_GRAPHICS_VULKAN_VKSURFACEFACTORY_H
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/graphics/vulkan/vulkan-hpp-wrapper.h>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/graphics/surface-factory.h>
-
-
-namespace Dali
-{
-namespace Integration
-{
-namespace Graphics
-{
-namespace Vulkan
-{
-
-class VkSurfaceFactory : public SurfaceFactory
-{
-public:
-
-  VkSurfaceFactory() = default;
-
-  virtual vk::SurfaceKHR Create(vk::Instance instance, vk::AllocationCallbacks *allocCallbacks,
-                                vk::PhysicalDevice physicalDevice) const = 0;
-};
-
-} // namespace Vulkan
-} // namespace Graphics
-} // namespace Integration
-} // namespace Dali
-
-#endif // DALI_GRAPHICS_VULKAN_VKSURFACEFACTORY_H
index b704dbc..dd2217d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,13 +27,13 @@ namespace Dali
 namespace Integration
 {
 
-LocklessBuffer::LocklessBuffer( size_t size )
+LocklessBuffer::LocklessBuffer( uint32_t size )
 : mState( R0W1 ),
   mSize( size )
 {
   // allocate memory to speed up operation
-  mBuffer[0] = new unsigned char[size];
-  mBuffer[1] = new unsigned char[size];
+  mBuffer[0] = new uint8_t[size];
+  mBuffer[1] = new uint8_t[size];
 
   memset (mBuffer[0], 0, size );
   memset (mBuffer[1], 0, size );
@@ -45,7 +45,7 @@ LocklessBuffer::~LocklessBuffer()
   delete[] mBuffer[1];
 }
 
-void LocklessBuffer::Write( const unsigned char *src, size_t size )
+void LocklessBuffer::Write( const uint8_t *src, uint32_t size )
 {
   DALI_ASSERT_ALWAYS( size <= mSize );
 
@@ -66,7 +66,7 @@ void LocklessBuffer::Write( const unsigned char *src, size_t size )
   (void)checkState; // Avoid unused variable warning
 }
 
-const unsigned char* LocklessBuffer::Read()
+const uint8_t* LocklessBuffer::Read()
 {
   // current state (only to avoid multiple memory reads with volatile variable)
   BufferState currentState( mState );
@@ -90,7 +90,7 @@ const unsigned char* LocklessBuffer::Read()
   return mBuffer[!currentWriteBuf];
 }
 
-unsigned int LocklessBuffer::GetSize() const
+uint32_t LocklessBuffer::GetSize() const
 {
   return static_cast<unsigned int>(mSize);
 }
index 8c0530d..163eac7 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t, uint8_t
 
 // INTERNAL INCLUDES
 #include <cstring>
@@ -52,7 +53,7 @@ public:
    * Constructor.
    * @param[in] size The size of buffers in bytes.
    */
-  LocklessBuffer( size_t size );
+  LocklessBuffer( uint32_t size );
 
   /**
    * Destructor.
@@ -64,19 +65,19 @@ public:
    * @param[in] src data source
    * @param[in] size size of data in bytes
    */
-  void Write( const unsigned char *src, size_t size );
+  void Write( const uint8_t *src, uint32_t size );
 
   /**
    * Try to swap buffers and read data.
    * @note returned value only valid until Read() is called again or object is destroyed
    * @return current read buffer contents
    */
-  const unsigned char* Read();
+  const uint8_t* Read();
 
   /**
    * @return the buffer size in bytes
    */
-  unsigned int GetSize() const;
+  uint32_t GetSize() const;
 
 private:
   /**
@@ -101,9 +102,9 @@ private:
   LocklessBuffer& operator=( const LocklessBuffer& ); ///< undefined assignment operator
 
 private:
-  unsigned char* mBuffer[2];     ///< bitmap buffers
-  BufferState volatile mState;   ///< readbuffer number and whether we're currently writing into writebuffer or not
-  size_t mSize;                  ///< size of buffers
+  uint8_t* mBuffer[2];         ///< bitmap buffers
+  BufferState volatile mState; ///< readbuffer number and whether we're currently writing into writebuffer or not
+  uint32_t mSize;              ///< size of buffers
 };
 
 } // Internal
index 7a41087..79161fb 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTEGRATION_PLATFORM_ABSTRACTION_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ namespace Dali
 
 namespace Integration
 {
-typedef unsigned int ResourceId;
+typedef uint32_t ResourceId;
 typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
 
 /**
@@ -116,7 +116,7 @@ public:
    * @param[out] buffer  A buffer to receive the file.
    * @result             true if the file is loaded.
    */
-  virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const = 0;
+  virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< uint8_t >& buffer ) const = 0;
 
   /**
    * Save a shader binary file to the resource file system.
@@ -125,7 +125,7 @@ public:
    * @param[in] numbytes Size of the buffer.
    * @result             true if the file is saved, else false.
    */
-  virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const = 0;
+  virtual bool SaveShaderBinaryFile( const std::string& filename, const uint8_t * buffer, uint32_t numBytes ) const = 0;
 
 protected:
 
similarity index 50%
rename from dali/integration-api/graphics/surface-factory.h
rename to dali/integration-api/processor-interface.h
index 313aae8..1043ac3 100644 (file)
@@ -1,5 +1,8 @@
+#ifndef DALI_INTEGRATION_PROCESSOR_INTERFACE_H
+#define DALI_INTEGRATION_PROCESSOR_INTERFACE_H
+
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-#ifndef DALI_INTEGRATION_GRAPHICS_SURFACE_FACTORY_H
-#define DALI_INTEGRATION_GRAPHICS_SURFACE_FACTORY_H
+// INTERNAL INCLUDES
+#include <dali/public-api/common/dali-common.h>
 
 namespace Dali
 {
+
 namespace Integration
 {
-namespace Graphics
-{
 
-class SurfaceFactory
+/**
+ * Interface to enable classes to be processed after the event loop. Classes are processed
+ * in the order they are registered.
+ */
+class DALI_CORE_API Processor
 {
 public:
-  SurfaceFactory()          = default;
-  virtual ~SurfaceFactory() = default;
+  /**
+   * @brief Run the processor
+   */
+  virtual void Process() = 0;
+
+protected:
 
-  SurfaceFactory( const SurfaceFactory& ) = delete;
-  SurfaceFactory& operator=( const SurfaceFactory& ) = delete;
+  /**
+   * Virtual protected destructor
+   */
+  virtual ~Processor() { }
 };
 
-} // Namespace Graphics
-} // Namespace Integration
-} // Namespace Dali
+} // Dali
+
+} // Integration
 
-#endif // DALI_INTEGRATION_GRAPHICS_SURFACE_FACTORY_H
+#endif // DALI_INTEGRATION_PROCESSOR_INTERFACE_H
\ No newline at end of file
index cb9d5cf..b72777f 100644 (file)
@@ -78,42 +78,42 @@ void EnableProfiling( ProfilingType type )
 namespace Profiling
 {
 
-const int ANIMATION_MEMORY_SIZE(
+const std::size_t ANIMATION_MEMORY_SIZE(
   sizeof( Internal::Animation ) +
   sizeof( Internal::AnimatorConnector<float> ) +
   sizeof( Internal::SceneGraph::Animation ) );
-const int CONSTRAINT_MEMORY_SIZE(
+const std::size_t CONSTRAINT_MEMORY_SIZE(
   sizeof( Internal::Constraint<float> ) +
   sizeof( Internal::SceneGraph::Constraint<float, Internal::PropertyAccessor<float> > ) );
-const int ACTOR_MEMORY_SIZE(
+const std::size_t ACTOR_MEMORY_SIZE(
   sizeof( Internal::Actor ) +
   sizeof( Internal::SceneGraph::Node ) );
-const int CAMERA_ACTOR_MEMORY_SIZE(
+const std::size_t CAMERA_ACTOR_MEMORY_SIZE(
   sizeof( Internal::CameraActor ) +
   sizeof( Internal::SceneGraph::Node ) +
   sizeof( Internal::SceneGraph::Camera ) );
-const int LAYER_MEMORY_SIZE(
+const std::size_t LAYER_MEMORY_SIZE(
   sizeof( Internal::Layer ) +
   sizeof( Internal::SceneGraph::Layer ) );
-const int IMAGE_MEMORY_SIZE(
+const std::size_t IMAGE_MEMORY_SIZE(
   sizeof( Internal::Image ) +
   sizeof( Integration::Bitmap ) );
-const int RENDERER_MEMORY_SIZE(
+const std::size_t RENDERER_MEMORY_SIZE(
   sizeof( Internal::Renderer ) +
   sizeof( Internal::SceneGraph::Renderer ) );
-const int GEOMETRY_MEMORY_SIZE(
+const std::size_t GEOMETRY_MEMORY_SIZE(
   sizeof( Internal::Geometry ) +
   sizeof( Internal::SceneGraph::Geometry) );
-const int PROPERTY_BUFFER_MEMORY_SIZE(
+const std::size_t PROPERTY_BUFFER_MEMORY_SIZE(
   sizeof( Internal::PropertyBuffer ) +
   sizeof( Internal::SceneGraph::PropertyBuffer ) );
-const int TEXTURE_SET_MEMORY_SIZE(
+const std::size_t TEXTURE_SET_MEMORY_SIZE(
   sizeof( Internal::TextureSet ) +
   sizeof( Internal::SceneGraph::TextureSet ) );
-const int SAMPLER_MEMORY_SIZE(
+const std::size_t SAMPLER_MEMORY_SIZE(
   sizeof( Internal::Sampler ) +
   sizeof( Internal::SceneGraph::Sampler ) );
-const int SHADER_MEMORY_SIZE(
+const std::size_t SHADER_MEMORY_SIZE(
   sizeof( Internal::Shader ) +
   sizeof( Internal::SceneGraph::Shader ) );
 
index 21896fa..aec615c 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstddef>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -48,20 +49,20 @@ DALI_CORE_API void EnableProfiling( ProfilingType type );
 namespace Profiling
 {
 
-DALI_CORE_API extern const int ANIMATION_MEMORY_SIZE;    ///< Total size of animation and associated internal objects
-DALI_CORE_API extern const int CONSTRAINT_MEMORY_SIZE;   ///< Total size of constraint and associated internal objects
-DALI_CORE_API extern const int ACTOR_MEMORY_SIZE;        ///< Total size of actor and associated internal objects
-DALI_CORE_API extern const int CAMERA_ACTOR_MEMORY_SIZE; ///< Total size of camera actor and associated internal objects
-DALI_CORE_API extern const int IMAGE_ACTOR_MEMORY_SIZE;  ///< Total size of image actor and associated internal objects
-DALI_CORE_API extern const int LAYER_MEMORY_SIZE;        ///< Total size of layer and associated internal objects
-DALI_CORE_API extern const int IMAGE_MEMORY_SIZE;        ///< Total size of image and associated internal objects
+DALI_CORE_API extern const std::size_t ANIMATION_MEMORY_SIZE;    ///< Total size of animation and associated internal objects
+DALI_CORE_API extern const std::size_t CONSTRAINT_MEMORY_SIZE;   ///< Total size of constraint and associated internal objects
+DALI_CORE_API extern const std::size_t ACTOR_MEMORY_SIZE;        ///< Total size of actor and associated internal objects
+DALI_CORE_API extern const std::size_t CAMERA_ACTOR_MEMORY_SIZE; ///< Total size of camera actor and associated internal objects
+DALI_CORE_API extern const std::size_t IMAGE_ACTOR_MEMORY_SIZE;  ///< Total size of image actor and associated internal objects
+DALI_CORE_API extern const std::size_t LAYER_MEMORY_SIZE;        ///< Total size of layer and associated internal objects
+DALI_CORE_API extern const std::size_t IMAGE_MEMORY_SIZE;        ///< Total size of image and associated internal objects
 
-DALI_CORE_API extern const int RENDERER_MEMORY_SIZE;     ///< Total size of renderer and associated internal objects
-DALI_CORE_API extern const int GEOMETRY_MEMORY_SIZE;     ///< Total size of geometry and associated internal objects
-DALI_CORE_API extern const int PROPERTY_BUFFER_MEMORY_SIZE;     ///< Total size of property-0buffer and associated internal objects
-DALI_CORE_API extern const int TEXTURE_SET_MEMORY_SIZE;     ///< Total size of TextureSet and associated internal objects
-DALI_CORE_API extern const int SAMPLER_MEMORY_SIZE;     ///< Total size of Sampler and associated internal objects
-DALI_CORE_API extern const int SHADER_MEMORY_SIZE;     ///< Total size of shader and associated internal objects
+DALI_CORE_API extern const std::size_t RENDERER_MEMORY_SIZE;     ///< Total size of renderer and associated internal objects
+DALI_CORE_API extern const std::size_t GEOMETRY_MEMORY_SIZE;     ///< Total size of geometry and associated internal objects
+DALI_CORE_API extern const std::size_t PROPERTY_BUFFER_MEMORY_SIZE;     ///< Total size of property-0buffer and associated internal objects
+DALI_CORE_API extern const std::size_t TEXTURE_SET_MEMORY_SIZE;     ///< Total size of TextureSet and associated internal objects
+DALI_CORE_API extern const std::size_t SAMPLER_MEMORY_SIZE;     ///< Total size of Sampler and associated internal objects
+DALI_CORE_API extern const std::size_t SHADER_MEMORY_SIZE;     ///< Total size of shader and associated internal objects
 } // namespace Profiling
 
 } // namespace Integration
diff --git a/dali/integration-api/render-surface.h b/dali/integration-api/render-surface.h
new file mode 100644 (file)
index 0000000..b56a3f6
--- /dev/null
@@ -0,0 +1,208 @@
+#ifndef DALI_RENDER_SURFACE_H
+#define DALI_RENDER_SURFACE_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/math/rect.h>
+#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/object/any.h>
+#include <dali/public-api/common/view-mode.h>
+#include <dali/integration-api/core-enumerations.h>
+
+namespace Dali
+{
+
+class DisplayConnection;
+class ThreadSynchronizationInterface;
+
+namespace Graphics
+{
+class GraphicsInterface;
+}
+
+/**
+ * @brief The position and size of the render surface.
+ */
+typedef Dali::Rect<int> PositionSize;
+
+namespace Integration
+{
+
+class GlAbstraction;
+
+/**
+ * @brief Interface for a render surface onto which Dali draws.
+ *
+ * Dali::Adaptor requires a render surface to draw on to. This is
+ * usually a window in the native windowing system, or some other
+ * mapped pixel buffer.
+ *
+ * Dali::Application will automatically create a render surface using a window.
+ *
+ * The implementation of the factory method below should choose an appropriate
+ * implementation of RenderSurface for the given platform
+ */
+
+class DALI_CORE_API RenderSurface
+{
+public:
+
+  enum Type
+  {
+    WINDOW_RENDER_SURFACE,
+    PIXMAP_RENDER_SURFACE,
+    NATIVE_RENDER_SURFACE
+  };
+
+  /**
+   * @brief Constructor
+   * Inlined as this is a pure abstract interface
+   */
+  RenderSurface() {}
+
+  /**
+   * @brief Virtual Destructor.
+   * Inlined as this is a pure abstract interface
+   */
+  virtual ~RenderSurface() {}
+
+  /**
+   * @brief Return the size and position of the surface.
+   * @return The position and size
+   */
+  virtual PositionSize GetPositionSize() const = 0;
+
+  /**
+   * @brief Get DPI
+   * @param[out] dpiHorizontal set to the horizontal dpi
+   * @param[out] dpiVertical set to the vertical dpi
+   */
+  virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) = 0;
+
+  /**
+   * @brief InitializeGraphics the platform specific graphics surface interfaces
+   */
+  virtual void InitializeGraphics( Dali::Graphics::GraphicsInterface& graphics ) = 0;
+
+  /**
+   * @brief Creates the Surface
+   */
+  virtual void CreateSurface() = 0;
+
+  /**
+   * @brief Destroys the Surface
+   */
+  virtual void DestroySurface() = 0;
+
+  /**
+   * @brief Replace the Surface
+   * @return true if context was lost
+   */
+  virtual bool ReplaceGraphicsSurface() = 0;
+
+  /**
+   * @brief Resizes the underlying surface.
+   * @param[in] The dimensions of the new position
+   */
+  virtual void MoveResize( Dali::PositionSize positionSize ) = 0;
+
+  /**
+   * @brief Called when Render thread has started
+   */
+  virtual void StartRender() = 0;
+
+  /**
+   * @brief Invoked by render thread before Core::Render
+   * If the operation fails, then Core::Render should not be called until there is
+   * a surface to render onto.
+   * @param[in] resizingSurface True if the surface is being resized
+   * @return True if the operation is successful, False if the operation failed
+   */
+  virtual bool PreRender( bool resizingSurface ) = 0;
+
+  /**
+   * @brief Invoked by render thread after Core::Render
+   * @param[in] renderToFbo True if render to FBO.
+   * @param[in] replacingSurface True if the surface is being replaced.
+   * @param[in] resizingSurface True if the surface is being resized.
+   */
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) = 0;
+
+  /**
+   * @brief Invoked by render thread when the thread should be stop
+   */
+  virtual void StopRender() = 0;
+
+  /**
+   * @brief Invoked by Event Thread when the compositor lock should be released and rendering should resume.
+   */
+  virtual void ReleaseLock() = 0;
+
+  /**
+   * @brief Gets the surface type
+   */
+  virtual RenderSurface::Type GetSurfaceType() = 0;
+
+  /**
+   * @brief Makes the graphics context current
+   */
+  virtual void MakeContextCurrent() = 0;
+
+  /**
+   * @brief Gets whether the depth buffer is required
+   * @return TRUE if the depth buffer is required
+   */
+  virtual Integration::DepthBufferAvailable GetDepthBufferRequired() = 0;
+
+  /**
+   * @brief Gets whether the stencil buffer is required
+   * @return TRUE if the stencil buffer is required
+   */
+  virtual Integration::StencilBufferAvailable GetStencilBufferRequired() = 0;
+
+  /**
+   * @brief Sets the background color of the surface.
+   * @param[in] color The new background color
+   */
+  virtual void SetBackgroundColor(Vector4 color) = 0;
+
+  /**
+   * @brief Gets the background color of the surface.
+   * @return The background color
+   */
+  virtual Vector4 GetBackgroundColor() = 0;
+
+private:
+
+  /**
+   * @brief Undefined copy constructor. RenderSurface cannot be copied
+   */
+  RenderSurface( const RenderSurface& rhs ) = delete;
+
+  /**
+   * @brief Undefined assignment operator. RenderSurface cannot be copied
+   */
+  RenderSurface& operator=( const RenderSurface& rhs ) = delete;
+};
+
+} // namespace Integration
+
+} // namespace Dali
+
+#endif // DALI_RENDER_SURFACE_H
old mode 100644 (file)
new mode 100755 (executable)
similarity index 50%
rename from dali/integration-api/system-overlay.cpp
rename to dali/integration-api/render-task-list-integ.cpp
index a6ab5ad..22c2140
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // CLASS HEADER
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-task-list-integ.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
-#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/internal/event/render-tasks/render-task-list-impl.h>
 #include <dali/internal/event/actors/actor-impl.h>
-#include <dali/internal/event/common/system-overlay-impl.h>
+#include <dali/internal/event/actors/camera-actor-impl.h>
 
 namespace Dali
 {
@@ -30,35 +29,21 @@ namespace Dali
 namespace Integration
 {
 
-SystemOverlay::~SystemOverlay()
+namespace RenderTaskList
 {
-  delete mImpl;
-}
 
-void SystemOverlay::Add( Actor actor )
+Dali::RenderTaskList New()
 {
-  mImpl->Add( GetImplementation(actor) );
+  Dali::Internal::RenderTaskListPtr renderTaskList = Dali::Internal::RenderTaskList::New();
+  return Dali::RenderTaskList( renderTaskList.Get() );
 }
 
-void SystemOverlay::Remove( Actor actor )
+Dali::RenderTask CreateTask( Dali::RenderTaskList& taskList, Dali::Actor& sourceActor, Dali::CameraActor& cameraActor)
 {
-  mImpl->Remove( GetImplementation(actor) );
+  return RenderTask( GetImplementation(taskList).CreateTask( &GetImplementation( sourceActor), &GetImplementation(cameraActor) ).Get() );
 }
 
-RenderTaskList SystemOverlay::GetOverlayRenderTasks()
-{
-  return RenderTaskList( &mImpl->GetOverlayRenderTasks() );
-}
-
-SystemOverlay::SystemOverlay( Internal::SystemOverlay* impl )
-: mImpl( impl )
-{
-}
-
-Internal::SystemOverlay* SystemOverlay::GetImpl()
-{
-  return mImpl;
-}
+} // namespace RenderTaskList
 
 } // namespace Integration
 
diff --git a/dali/integration-api/render-task-list-integ.h b/dali/integration-api/render-task-list-integ.h
new file mode 100755 (executable)
index 0000000..3df930a
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef __DALI_INTEGRATION_RENDER_TASK_LIST_H__
+#define __DALI_INTEGRATION_RENDER_TASK_LIST_H__
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/render-tasks/render-task-list.h>
+
+namespace Dali
+{
+
+class Actor;
+class CameraActor;
+
+namespace Integration
+{
+
+namespace RenderTaskList
+{
+
+  /**
+   * @brief Helper function to create a new RenderTaskList object.
+   *
+   * A RenderTaskList is an ordered list of render tasks that describes
+   * how the Dali scene should be rendered.
+   *
+   * @return A handle to a newly allocated RenderTaskList
+   */
+  DALI_CORE_API Dali::RenderTaskList New();
+
+  /**
+   * @brief Helper function to create a new RenderTask.
+   *
+   * The created task will be appended to the list of render-tasks.
+   *
+   * @param[in] taskList    The render task list containing all the render-tasks.
+   * @param[in] sourceActor The actor and its children to be rendered for this render task.
+   * @param[in] cameraActor The actor from which the scene is viewed for this render task.
+   * @return A valid handle to a new RenderTask
+   */
+  DALI_CORE_API Dali::RenderTask CreateTask( Dali::RenderTaskList& taskList, Dali::Actor& sourceActor, Dali::CameraActor& cameraActor);
+
+} // namespace RenderTaskList
+
+} // namespace Integration
+
+} // namespace Dali
+
+#endif // __DALI_INTEGRATION_RENDER_TASK_LIST_H__
diff --git a/dali/integration-api/scene.cpp b/dali/integration-api/scene.cpp
new file mode 100644 (file)
index 0000000..0a1f690
--- /dev/null
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/integration-api/scene.h>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/internal/event/common/scene-impl.h>
+
+namespace Dali
+{
+
+namespace Integration
+{
+
+Scene Scene::New( const Size& size )
+{
+  Internal::ScenePtr internal = Internal::Scene::New( size );
+  return Scene( internal.Get() );
+}
+
+Scene Scene::DownCast( BaseHandle handle )
+{
+  return Scene( dynamic_cast<Dali::Internal::Scene*>( handle.GetObjectPtr()) );
+}
+
+Scene::Scene()
+{
+}
+
+Scene::~Scene()
+{
+}
+
+Scene::Scene( const Scene& handle )
+:BaseHandle(handle)
+{
+}
+
+Scene::Scene( Internal::Scene* internal )
+: BaseHandle(internal)
+{
+}
+
+Scene& Scene::operator=( const Scene& rhs )
+{
+  BaseHandle::operator=(rhs);
+  return *this;
+}
+
+void Scene::Add( Actor& actor )
+{
+  GetImplementation(*this).Add( GetImplementation(actor) );
+}
+
+void Scene::Remove( Actor& actor )
+{
+  GetImplementation(*this).Remove( GetImplementation(actor) );
+}
+
+Size Scene::GetSize() const
+{
+  return GetImplementation(*this).GetSize();
+}
+
+void Scene::SetDpi( Vector2 dpi )
+{
+  GetImplementation(*this).SetDpi( dpi );
+}
+
+Vector2 Scene::GetDpi() const
+{
+  return GetImplementation(*this).GetDpi();
+}
+
+RenderTaskList Scene::GetRenderTaskList() const
+{
+  return RenderTaskList( &GetImplementation(*this).GetRenderTaskList() );
+}
+
+Layer Scene::GetRootLayer() const
+{
+  return GetImplementation(*this).GetRootLayer();
+}
+
+uint32_t Scene::GetLayerCount() const
+{
+  return GetImplementation(*this).GetLayerCount();
+}
+
+Layer Scene::GetLayer( uint32_t depth ) const
+{
+  return GetImplementation(*this).GetLayer( depth );
+}
+
+void Scene::SetSurface( Integration::RenderSurface& surface )
+{
+  GetImplementation(*this).SetSurface( surface );
+}
+
+Integration::RenderSurface* Scene::GetSurface() const
+{
+  return GetImplementation(*this).GetSurface();
+}
+
+void Scene::QueueEvent( const Integration::Event& event )
+{
+  GetImplementation(*this).QueueEvent( event );
+}
+
+void Scene::ProcessEvents()
+{
+  GetImplementation(*this).ProcessEvents();
+}
+
+Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
+{
+  return GetImplementation(*this).EventProcessingFinishedSignal();
+}
+
+Scene::KeyEventSignalType& Scene::KeyEventSignal()
+{
+  return GetImplementation(*this).KeyEventSignal();
+}
+
+Scene::TouchSignalType& Scene::TouchSignal()
+{
+  return GetImplementation(*this).TouchSignal();
+}
+
+Scene::WheelEventSignalType& Scene::WheelEventSignal()
+{
+  return GetImplementation(*this).WheelEventSignal();
+}
+
+} // Integration
+
+} // Dali
diff --git a/dali/integration-api/scene.h b/dali/integration-api/scene.h
new file mode 100644 (file)
index 0000000..092b6c3
--- /dev/null
@@ -0,0 +1,267 @@
+#ifndef DALI_SCENE_H
+#define DALI_SCENE_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/object/handle.h>
+#include <dali/public-api/math/vector2.h>
+
+namespace Dali
+{
+
+class Actor;
+class KeyEvent;
+class Layer;
+class RenderTaskList;
+class TouchData;
+class WheelEvent;
+
+namespace Internal DALI_INTERNAL
+{
+  class Scene;
+}
+
+namespace Integration
+{
+
+class RenderSurface;
+struct Event;
+
+/**
+ * @brief
+ *
+ * Scene creates a "world" that can be bound to a surface for rendering.
+ *
+ */
+class DALI_CORE_API Scene : public BaseHandle
+{
+public:
+  typedef Signal< void () > EventProcessingFinishedSignalType; ///< Event Processing finished signal type
+  typedef Signal< void (const Dali::KeyEvent&) > KeyEventSignalType; ///< Key event signal type
+  typedef Signal< void (const Dali::TouchData&) > TouchSignalType; ///< Touch signal type
+  typedef Signal< void (const Dali::WheelEvent&) > WheelEventSignalType; ///< Touched signal type
+
+  /**
+   * @brief Create an initialized Scene handle.
+   *
+   * @param[in] size The size of the scene in pixels as a Vector
+   *
+   * @return a handle to a newly allocated Dali resource.
+   */
+  static Scene New( const Size& size );
+
+  /**
+   * @brief Downcast an Object handle to Scene handle.
+   *
+   * If handle points to a Scene object the downcast produces
+   * valid handle. If not the returned handle is left uninitialized.
+   * @param[in] handle to An object
+   * @return handle to a Scene object or an uninitialized handle
+   */
+  static Scene DownCast( BaseHandle handle );
+
+  /**
+   * @brief Create an uninitialized Scene handle.
+   *
+   * This can be initialized with Scene::New(). Calling member
+   * functions with an uninitialized Dali::Object is not allowed.
+   */
+  Scene();
+
+  /**
+   * @brief Destructor
+   *
+   * This is non-virtual since derived Handle types must not contain data or virtual methods.
+   */
+  ~Scene();
+
+  /**
+   * @brief This copy constructor is required for (smart) pointer semantics.
+   *
+   * @param [in] handle A reference to the copied handle
+   */
+  Scene(const Scene& handle);
+
+  /**
+   * @brief This assignment operator is required for (smart) pointer semantics.
+   *
+   * @param [in] rhs  A reference to the copied handle
+   * @return A reference to this
+   */
+  Scene& operator=(const Scene& rhs);
+
+  /**
+   * @brief Adds a child Actor to the Scene.
+   *
+   * The child will be referenced.
+   * @param[in] actor The child
+   * @pre The actor has been initialized.
+   * @pre The actor does not have a parent.
+   */
+  void Add(Actor& actor);
+
+  /**
+   * @brief Removes a child Actor from the Scene.
+   *
+   * The child will be unreferenced.
+   * @param[in] actor The child
+   * @pre The actor has been added to the stage.
+   */
+  void Remove(Actor& actor);
+
+  /**
+   * @brief Returns the size of the Scene in pixels as a Vector.
+   *
+   * The x component will be the width of the Scene in pixels.
+   * The y component will be the height of the Scene in pixels.
+   *
+   * @return The size of the Scene as a Vector
+   */
+  Size GetSize() const;
+
+  /**
+   * Sets horizontal and vertical pixels per inch value that is used by the display
+   * @param[in] dpi Horizontal and vertical dpi value
+   */
+  void SetDpi( Vector2 dpi );
+
+  /**
+   * @brief Retrieves the DPI of the display device to which the scene is connected.
+   *
+   * @return The horizontal and vertical DPI
+   */
+  Vector2 GetDpi() const;
+
+  /**
+   * @brief Retrieves the list of render-tasks.
+   *
+   * @return A valid handle to a RenderTaskList
+   */
+  Dali::RenderTaskList GetRenderTaskList() const;
+
+  /**
+   * @brief Returns the Scene's Root Layer.
+   *
+   * @return The root layer
+   */
+  Layer GetRootLayer() const;
+
+  /**
+   * @brief Queries the number of on-stage layers.
+   *
+   * Note that a default layer is always provided (count >= 1).
+   * @return The number of layers
+   */
+  uint32_t GetLayerCount() const;
+
+  /**
+   * @brief Retrieves the layer at a specified depth.
+   *
+   * @param[in] depth The depth
+   * @return The layer found at the given depth
+   * @pre Depth is less than layer count; see GetLayerCount().
+   */
+  Layer GetLayer( uint32_t depth ) const;
+
+  /**
+   * @brief Binds the rendering surface to the scene
+   *
+   * @return The root layer
+   */
+  void SetSurface( Integration::RenderSurface& surface );
+
+  /**
+   * @brief Gets the rendering surface bound to the scene
+   *
+   * @return The render surface
+   */
+  Integration::RenderSurface* GetSurface() const;
+
+  /**
+   * This function is called when an event is queued.
+   * @param[in] event A event to queue.
+   */
+  void QueueEvent( const Integration::Event& event );
+
+  /**
+   * This function is called by Core when events are processed.
+   */
+  void ProcessEvents();
+
+  /**
+   * @brief This signal is emitted just after the event processing is finished.
+   *
+   * @return The signal to connect to
+   */
+  EventProcessingFinishedSignalType& EventProcessingFinishedSignal();
+
+  /**
+   * @brief This signal is emitted when key event is received.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName(const KeyEvent& event);
+   * @endcode
+   * @return The signal to connect to
+   */
+  KeyEventSignalType& KeyEventSignal();
+
+  /**
+   * @brief This signal is emitted when the screen is touched and when the touch ends
+   * (i.e. the down & up touch events only).
+   *
+   * If there are multiple touch points, then this will be emitted when the first touch occurs and
+   * then when the last finger is lifted.
+   * An interrupted event will also be emitted (if it occurs).
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName( TouchData event );
+   * @endcode
+   *
+   * @return The touch signal to connect to
+   * @note Motion events are not emitted.
+   */
+  TouchSignalType& TouchSignal();
+
+  /**
+   * @brief This signal is emitted when wheel event is received.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName(const WheelEvent& event);
+   * @endcode
+   * @return The signal to connect to
+   */
+  WheelEventSignalType& WheelEventSignal();
+
+public: // Not intended for application developers
+
+  /**
+   * @brief This constructor is used by Dali::New() methods.
+   *
+   * @param[in] scene A pointer to an internal Scene resource
+   */
+  explicit DALI_INTERNAL Scene(Internal::Scene* scene);
+};
+
+} // namespace Integration
+
+} // namespace Dali
+
+#endif // DALI_SCENE_H
diff --git a/dali/integration-api/system-overlay.h b/dali/integration-api/system-overlay.h
deleted file mode 100644 (file)
index 12f432e..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-#ifndef __DALI_INTEGRATION_SYSTEM_OVERLAY_H__
-#define __DALI_INTEGRATION_SYSTEM_OVERLAY_H__
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-
-namespace Dali
-{
-
-class Actor;
-class RenderTaskList;
-
-namespace Internal
-{
-class SystemOverlay;
-}
-
-namespace Integration
-{
-
-/**
- * Use this interface to draw content for system-level indicators, dialogs etc.
- * The SystemOverlay is accessible using Dali::Integration::Core::GetSystemOverlay().
- */
-class DALI_CORE_API SystemOverlay
-{
-public:
-
-  /**
-   * Non-virtual destructor. SystemOverlay is not intended as a base class.
-   */
-  ~SystemOverlay();
-
-  /**
-   * Add an Actor to the SystemOverlay.
-   * @pre The actor handle is not empty.
-   * @param [in] actor A handle to the actor to add.
-   * @post The actor will be referenced.
-   */
-  void Add( Actor actor );
-
-  /**
-   * Remove an Actor that was added to the SystemOverlay.
-   * @pre The actor handle is not empty.
-   * @param [in] actor A handle to the actor to remove.
-   * @post The actor will be unreferenced.
-   */
-  void Remove( Actor actor );
-
-  /**
-   * Retrieve the list of render-tasks for system-level overlays.
-   * This is a seperate list, processed after the render-tasks provided by Stage::GetRenderTaskList().
-   * @return The list of overlay render-tasks.
-   */
-  RenderTaskList GetOverlayRenderTasks();
-
-  /**
-   * Create the SystemOverlay entrance.
-   * This is not intended for adaptor implementors; see also Dali::Integration::Core::GetSystemOverlay().
-   * @param[in] impl The SystemOverlay implementation.
-   */
-  SystemOverlay( Internal::SystemOverlay* impl );
-
-  /**
-   * Retreive the internal implementation; this is not intended for adaptor implementors.
-   * @return The SystemOverlay implementation.
-   */
-  Internal::SystemOverlay* GetImpl();
-
-private:
-
-  // Undefined copy-constructor.
-  SystemOverlay( const SystemOverlay& core );
-
-  // Undefined assignment operator.
-  SystemOverlay& operator=( const SystemOverlay& rhs );
-
-private:
-
-  Dali::Internal::SystemOverlay* mImpl;
-};
-
-} // namespace Integration
-
-} // namespace Dali
-
-#endif // __DALI_INTEGRATION_SYSTEM_OVERLAY_H__
index 2abb3a1..17ce42a 100644 (file)
@@ -36,8 +36,8 @@ SET(SOURCES ${SOURCES}
   ${CMAKE_CURRENT_SOURCE_DIR}/event/common/property-notification-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/common/property-notification-manager.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/common/property-helper.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/event/common/scene-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/common/stage-impl.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/event/common/system-overlay-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/common/thread-local-storage.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/common/type-info-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/common/type-registry-impl.cpp
@@ -74,7 +74,6 @@ SET(SOURCES ${SOURCES}
   ${CMAKE_CURRENT_SOURCE_DIR}/event/images/resource-image-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/images/native-image-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/images/pixel-data-impl.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/event/object/custom-object-internal.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/render-tasks/render-task-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/render-tasks/render-task-list-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/event/rendering/frame-buffer-impl.cpp
@@ -100,7 +99,8 @@ SET(SOURCES ${SOURCES}
   ${CMAKE_CURRENT_SOURCE_DIR}/render/gl-resources/gl-call-debug.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/render/gl-resources/gpu-buffer.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/render/queue/render-queue.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/render/renderers/render-frame-buffer.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/render/renderers/render-texture-frame-buffer.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/render/renderers/render-surface-frame-buffer.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/render/renderers/render-geometry.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/render/renderers/render-property-buffer.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/render/renderers/render-renderer.cpp
@@ -127,12 +127,15 @@ SET(SOURCES ${SOURCES}
   ${CMAKE_CURRENT_SOURCE_DIR}/update/gestures/pan-gesture-profiling.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/gestures/scene-graph-pan-gesture.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/queue/update-message-queue.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/frame-callback-processor.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/render-instruction-processor.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/render-task-processor.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/scene-graph-frame-callback.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/transform-manager.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/update-algorithms.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/update-manager.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/update-manager-debug.cpp
+  ${CMAKE_CURRENT_SOURCE_DIR}/update/manager/update-proxy-impl.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/render-tasks/scene-graph-camera.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/nodes/node.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/update/nodes/node-messages.cpp
index f5dee67..2c6fca0 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_BUFFER_INDEX_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint>
+
 namespace Dali
 {
 
 namespace Internal
 {
 
-typedef unsigned int BufferIndex;
+typedef uint32_t BufferIndex;
 
 } // namespace Internal
 
index 945fa66..03b0171 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/internal/common/core-impl.h>
 
 // INTERNAL INCLUDES
-
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/events/event.h>
-#include <dali/integration-api/graphics/graphics.h>
 #include <dali/integration-api/platform-abstraction.h>
+#include <dali/integration-api/processor-interface.h>
 #include <dali/integration-api/render-controller.h>
-#include <dali/integration-api/system-overlay.h>
+#include <dali/integration-api/render-surface.h>
 
 #include <dali/internal/common/performance-monitor.h>
 
@@ -36,6 +35,7 @@
 #include <dali/internal/event/common/property-notification-manager.h>
 #include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/common/thread-local-storage.h>
+#include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/event/common/type-registry-impl.h>
 #include <dali/internal/event/effects/shader-factory.h>
 #include <dali/internal/event/events/event-processor.h>
@@ -54,10 +54,10 @@ using Dali::Internal::SceneGraph::DiscardQueue;
 namespace
 {
 // The Update for frame N+1 may be processed whilst frame N is being rendered.
-const unsigned int MAXIMUM_UPDATE_COUNT = 2u;
+const uint32_t MAXIMUM_UPDATE_COUNT = 2u;
 
 #if defined(DEBUG_ENABLED)
-Debug::Filter* gCoreFilter = Debug::Filter::New(Debug::Concise, false, "LOG_CORE");
+Debug::Filter* gCoreFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_CORE");
 #endif
 }
 
@@ -72,12 +72,10 @@ using Integration::GestureManager;
 using Integration::Event;
 using Integration::UpdateStatus;
 using Integration::RenderStatus;
-using Integration::Graphics::Graphics;
-
 
 Core::Core( RenderController& renderController,
             PlatformAbstraction& platform,
-            Graphics& graphics,
+            Graphics::Controller& graphicsController,
             GestureManager& gestureManager,
             ResourcePolicy::DataRetention dataRetentionPolicy,
             Integration::RenderToFrameBuffer renderToFboEnabled,
@@ -85,12 +83,10 @@ Core::Core( RenderController& renderController,
             Integration::StencilBufferAvailable stencilBufferAvailable )
 : mRenderController( renderController ),
   mPlatform(platform),
+  mGraphicsController(graphicsController),
   mProcessingEvent(false),
-  mGraphics(graphics)
+  mForceNextUpdate( false )
 {
-  // fixme: for now to ensure libgraphics.a won't be removed during linking due to being
-  Integration::Graphics::IncludeThisLibrary();
-
   // Create the thread local storage
   CreateThreadLocalStorage();
 
@@ -113,18 +109,17 @@ Core::Core( RenderController& renderController,
                                       *mDiscardQueue,
                                        renderController,
                                       *mRenderTaskProcessor,
-                                       graphics );
+                                       graphicsController );
 
 
-  mStage = IntrusivePtr<Stage>( Stage::New( *mAnimationPlaylist, *mPropertyNotificationManager, *mUpdateManager, *mNotificationManager, mRenderController ) );
+  mObjectRegistry = ObjectRegistry::New();
+
+  mStage = IntrusivePtr<Stage>( Stage::New( *mUpdateManager ) );
 
   // This must be called after stage is created but before stage initialization
   mRelayoutController = IntrusivePtr< RelayoutController >( new RelayoutController( mRenderController ) );
 
-  mStage->Initialize( renderToFboEnabled == Integration::RenderToFrameBuffer::TRUE );
-
-  mGestureEventProcessor = new GestureEventProcessor( *mStage, *mUpdateManager, gestureManager, mRenderController );
-  mEventProcessor = new EventProcessor( *mStage, *mNotificationManager, *mGestureEventProcessor );
+  mGestureEventProcessor = new GestureEventProcessor( *mUpdateManager, gestureManager, mRenderController );
 
   mShaderFactory = new ShaderFactory();
 
@@ -147,40 +142,33 @@ Core::~Core()
     delete tls;
   }
 
+  mObjectRegistry.Reset();
+
   // Stop relayout requests being raised on stage destruction
   mRelayoutController.Reset();
 
-  // Clean-up stage - remove default camera and root layer
-  mStage->Uninitialize();
-
   // remove (last?) reference to stage
   mStage.Reset();
-}
-
-void Core::SurfaceResized( unsigned int width, unsigned int height )
-{
-  mStage->SurfaceResized( width, height );
 
-  // The stage-size may be less than surface-size (reduced by top-margin)
-  Vector2 size = mStage->GetSize();
-  mRelayoutController->SetStageSize( size.width, size.height );
 }
 
-void Core::SetTopMargin( unsigned int margin )
+void Core::Initialize()
 {
-  mStage->SetTopMargin( margin );
-
-  // The stage-size may be less than surface-size (reduced by top-margin)
-  Vector2 size = mStage->GetSize();
-  mRelayoutController->SetStageSize( size.width, size.height );
+  mStage->Initialize( *mScenes[0] );
 }
 
-void Core::SetDpi( unsigned int dpiHorizontal, unsigned int dpiVertical )
+void Core::SurfaceResized( Integration::RenderSurface* surface )
 {
-  mStage->SetDpi( Vector2( dpiHorizontal , dpiVertical) );
+  for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter )
+  {
+    if( (*iter)->GetSurface() == surface )
+    {
+      (*iter)->SetSurface( *surface );
+    }
+  }
 }
 
-void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
+void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
 {
   // set the time delta so adaptor can easily print FPS with a release build with 0 as
   // it is cached by frametime
@@ -197,6 +185,9 @@ void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds,
   // Check the Notification Manager message queue to set needsNotification
   status.needsNotification = mNotificationManager->MessagesToProcess();
 
+  // Check if the default surface is changed
+  status.surfaceRectChanged = mUpdateManager->IsDefaultSurfaceRectChanged();
+
   // No need to keep update running if there are notifications to process.
   // Any message to update will wake it up anyways
 }
@@ -207,16 +198,31 @@ void Core::Render( RenderStatus& status, bool forceClear )
   (void)status;
 }
 
+void Core::GraphicsShutdown()
+{
+  DALI_LOG_INFO(gCoreFilter, Debug::Concise, "Render thread is closing down - kill off graphics objects\n");
+  mUpdateManager->DestroyGraphicsObjects();
+}
+
 void Core::SceneCreated()
 {
   mStage->EmitSceneCreatedSignal();
 
   mRelayoutController->OnApplicationSceneCreated();
+
+  for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter )
+  {
+    Dali::Actor sceneRootLayer = (*iter)->GetRootLayer();
+    mRelayoutController->RequestRelayoutTree( sceneRootLayer );
+  }
 }
 
 void Core::QueueEvent( const Integration::Event& event )
 {
-  mEventProcessor->QueueEvent( event );
+  if (mScenes.size() != 0)
+  {
+    mScenes.front()->QueueEvent( event );
+  }
 }
 
 void Core::ProcessEvents()
@@ -235,21 +241,31 @@ void Core::ProcessEvents()
   // Signal that any messages received will be flushed soon
   mUpdateManager->EventProcessingStarted();
 
-  mEventProcessor->ProcessEvents();
+  // process events in all scenes
+  for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter )
+  {
+    (*iter)->ProcessEvents();
+  }
 
   mNotificationManager->ProcessMessages();
 
   // Emit signal here to inform listeners that event processing has finished.
-  mStage->EmitEventProcessingFinishedSignal();
-
-  // Run the size negotiation after event processing finished signal
-  mRelayoutController->Relayout();
+  for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter )
+  {
+    (*iter)->EmitEventProcessingFinishedSignal();
+  }
 
   // Run any registered processors
   RunProcessors();
 
+  // Run the size negotiation after event processing finished signal
+  mRelayoutController->Relayout();
+
   // Rebuild depth tree after event processing has finished
-  mStage->RebuildDepthTree();
+  for( auto iter = mScenes.begin(); iter != mScenes.end(); ++iter )
+  {
+    (*iter)->RebuildDepthTree();
+  }
 
   // Flush any queued messages for the update-thread
   const bool messagesToProcess = mUpdateManager->FlushQueue();
@@ -257,7 +273,7 @@ void Core::ProcessEvents()
   // Check if the touch or gestures require updates.
   const bool gestureNeedsUpdate = mGestureEventProcessor->NeedsUpdate();
   // Check if the next update is forced.
-  const bool forceUpdate = mStage->IsNextUpdateForced();
+  const bool forceUpdate = IsNextUpdateForced();
 
   if( messagesToProcess || gestureNeedsUpdate || forceUpdate )
   {
@@ -271,31 +287,11 @@ void Core::ProcessEvents()
   mProcessingEvent = false;
 }
 
-unsigned int Core::GetMaximumUpdateCount() const
+uint32_t Core::GetMaximumUpdateCount() const
 {
   return MAXIMUM_UPDATE_COUNT;
 }
 
-Integration::SystemOverlay& Core::GetSystemOverlay()
-{
-  return mStage->GetSystemOverlay();
-}
-
-void Core::SetViewMode( ViewMode viewMode )
-{
-  mStage->SetViewMode( viewMode );
-}
-
-ViewMode Core::GetViewMode() const
-{
-  return mStage->GetViewMode();
-}
-
-void Core::SetStereoBase( float stereoBase )
-{
-  mStage->SetStereoBase( stereoBase );
-}
-
 void Core::RegisterProcessor( Integration::Processor& processor )
 {
   mProcessors.PushBack(&processor);
@@ -324,11 +320,6 @@ void Core::RunProcessors()
   }
 }
 
-float Core::GetStereoBase() const
-{
-  return mStage->GetStereoBase();
-}
-
 StagePtr Core::GetCurrentStage()
 {
   return mStage.Get();
@@ -365,6 +356,40 @@ RelayoutController& Core::GetRelayoutController()
   return *(mRelayoutController.Get());
 }
 
+ObjectRegistry& Core::GetObjectRegistry() const
+{
+  return *(mObjectRegistry.Get());
+}
+
+EventThreadServices& Core::GetEventThreadServices()
+{
+  return *this;
+}
+
+PropertyNotificationManager& Core::GetPropertyNotificationManager() const
+{
+  return *(mPropertyNotificationManager);
+}
+
+AnimationPlaylist& Core::GetAnimationPlaylist() const
+{
+  return *(mAnimationPlaylist);
+}
+
+void Core::AddScene( Scene* scene )
+{
+  mScenes.push_back( scene );
+}
+
+void Core::RemoveScene( Scene* scene )
+{
+  auto iter = std::find( mScenes.begin(), mScenes.end(), scene );
+  if( iter != mScenes.end() )
+  {
+    mScenes.erase( iter );
+  }
+}
+
 void Core::CreateThreadLocalStorage()
 {
   // a pointer to the ThreadLocalStorage object will be stored in TLS
@@ -372,6 +397,45 @@ void Core::CreateThreadLocalStorage()
   new ThreadLocalStorage(this);
 }
 
+void Core::RegisterObject( Dali::BaseObject* object )
+{
+  mObjectRegistry = &ThreadLocalStorage::Get().GetObjectRegistry();
+  mObjectRegistry->RegisterObject( object );
+}
+
+void Core::UnregisterObject( Dali::BaseObject* object )
+{
+  mObjectRegistry = &ThreadLocalStorage::Get().GetObjectRegistry();
+  mObjectRegistry->UnregisterObject( object );
+}
+
+Integration::RenderController& Core::GetRenderController()
+{
+  return mRenderController;
+}
+
+uint32_t* Core::ReserveMessageSlot( uint32_t size, bool updateScene )
+{
+  return mUpdateManager->ReserveMessageSlot( size, updateScene );
+}
+
+BufferIndex Core::GetEventBufferIndex() const
+{
+  return mUpdateManager->GetEventBufferIndex();
+}
+
+void Core::ForceNextUpdate()
+{
+  mForceNextUpdate = true;
+}
+
+bool Core::IsNextUpdateForced()
+{
+  bool nextUpdateForced = mForceNextUpdate;
+  mForceNextUpdate = false;
+  return nextUpdateForced;
+}
+
 } // namespace Internal
 
 } // namespace Dali
index 82e2993..caf62cd 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_CORE_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include <dali/integration-api/core-enumerations.h>
 #include <dali/integration-api/resource-policies.h>
+#include <dali/graphics-api/graphics-api-controller.h>
 #include <dali/internal/common/owner-pointer.h>
+#include <dali/devel-api/common/owner-container.h>
 #include <dali/internal/event/animation/animation-playlist-declarations.h>
 #include <dali/internal/event/common/stage-def.h>
+#include <dali/integration-api/resource-policies.h>
+#include <dali/internal/event/common/scene-impl.h>
+#include <dali/internal/event/common/object-registry-impl.h>
 
 namespace Dali
 {
 
 namespace Integration
 {
-namespace Graphics
-{
-class Graphics;
-}
 class Processor;
 class RenderController;
 class PlatformAbstraction;
 class GestureManager;
-
-class SystemOverlay;
 class UpdateStatus;
 class RenderStatus;
+class RenderSurface;
 struct Event;
 struct TouchData;
 }
@@ -61,6 +61,7 @@ class GestureEventProcessor;
 class ShaderFactory;
 class TouchResampler;
 class RelayoutController;
+class EventThreadServices;
 
 namespace SceneGraph
 {
@@ -72,7 +73,7 @@ class RenderTaskProcessor;
 /**
  * Internal class for Dali::Integration::Core
  */
-class Core
+class Core : public EventThreadServices
 {
 public:
 
@@ -81,7 +82,7 @@ public:
    */
   Core( Integration::RenderController& renderController,
         Integration::PlatformAbstraction& platform,
-        Integration::Graphics::Graphics& graphics,
+        Graphics::Controller& graphicsController,
         Integration::GestureManager& gestureManager,
         ResourcePolicy::DataRetention dataRetentionPolicy,
         Integration::RenderToFrameBuffer renderToFboEnabled,
@@ -94,29 +95,24 @@ public:
   ~Core();
 
   /**
-   * @copydoc Dali::Integration::Core::SurfaceResized(unsigned int, unsigned int)
-   */
-  void SurfaceResized(unsigned int width, unsigned int height);
-
-  /**
-   * @copydoc Dali::Integration::Core::SetTopMargin( unsigned int margin )
+   * @copydoc Dali::Integration::Core::Initialize()
    */
-  void SetTopMargin( unsigned int margin );
+  void Initialize();
 
   /**
-   * @copydoc Dali::Integration::Core::SetDpi(unsigned int, unsigned int)
+   * @copydoc Dali::Integration::Core::SurfaceResized(Integration::RenderSurface*)
    */
-  void SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical);
+  void SurfaceResized( Integration::RenderSurface* surface );
 
   /**
-   * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(unsigned int)
+   * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(uint32_t)
    */
-  void SetMinimumFrameTimeInterval(unsigned int interval);
+  void SetMinimumFrameTimeInterval(uint32_t interval);
 
   /**
    * @copydoc Dali::Integration::Core::Update()
    */
-  void Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo );
+  void Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo );
 
   /**
    * @copydoc Dali::Integration::Core::Render()
@@ -124,6 +120,11 @@ public:
   void Render( Integration::RenderStatus& status, bool forceClear );
 
   /**
+   * @copydoc Dali::Integration::Core::GraphicsShutdown()
+   */
+  void GraphicsShutdown();
+
+  /**
    * @copydoc Dali::Integration::Core::SceneCreated()
    */
   void SceneCreated();
@@ -141,45 +142,69 @@ public:
   /**
    * @copydoc Dali::Integration::Core::GetMaximumUpdateCount()
    */
-  unsigned int GetMaximumUpdateCount() const;
+  uint32_t GetMaximumUpdateCount() const;
 
   /**
-   * @copydoc Dali::Integration::Core::GetSystemOverlay()
+   * @copydoc Dali::Integration::Core::RegisterProcessor
    */
-  Integration::SystemOverlay& GetSystemOverlay();
+  void RegisterProcessor( Dali::Integration::Processor& processor );
 
-  // Stereoscopy
+  /**
+   * @copydoc Dali::Integration::Core::UnregisterProcessor
+   */
+  void UnregisterProcessor( Dali::Integration::Processor& processor );
 
   /**
-   * @copydoc Dali::Integration::Core::SetViewMode()
+   * @copydoc Dali::Internal::ThreadLocalStorage::AddScene()
    */
-  void SetViewMode( ViewMode viewMode );
+  void AddScene( Scene* scene );
 
   /**
-   * @copydoc Dali::Integration::Core::GetViewMode()
+   * @copydoc Dali::Internal::ThreadLocalStorage::RemoveScene()
    */
-  ViewMode GetViewMode() const;
+  void RemoveScene( Scene* scene );
+
+public: // Implementation of EventThreadServices
 
   /**
-   * @copydoc Dali::Integration::Core::SetStereoBase()
+   * @copydoc EventThreadServices::RegisterObject
    */
-  void SetStereoBase( float stereoBase );
+  void RegisterObject( BaseObject* object) override;
 
   /**
-   * @copydoc Dali::Integration::Core::GetStereoBase()
+   * @copydoc EventThreadServices::UnregisterObject
    */
-  float GetStereoBase() const;
+  void UnregisterObject( BaseObject* object) override;
 
+  /**
+   * @copydoc EventThreadServices::GetUpdateManager
+   */
+  SceneGraph::UpdateManager& GetUpdateManager() override;
 
   /**
-   * @copydoc Dali::Integration::Core::RegisterProcessor
+   * @copydoc EventThreadServices::GetRenderController
    */
-  void RegisterProcessor( Dali::Integration::Processor& processor );
+  Integration::RenderController& GetRenderController() override;
 
   /**
-   * @copydoc Dali::Integration::Core::UnregisterProcessor
+   * @copydoc EventThreadServices::ReserveMessageSlot
    */
-  void UnregisterProcessor( Dali::Integration::Processor& processor );
+  uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene ) override;
+
+  /**
+   * @copydoc EventThreadServices::GetEventBufferIndex
+   */
+  BufferIndex GetEventBufferIndex() const override;
+
+  /**
+   * @copydoc EventThreadServices::ForceNextUpdate
+   */
+  void ForceNextUpdate() override;
+
+  /**
+   * @copydoc EventThreadServices::IsNextUpdateForced
+   */
+  bool IsNextUpdateForced() override;
 
 private:
   /**
@@ -202,13 +227,6 @@ private:
   Integration::PlatformAbstraction& GetPlatform();
 
   /**
-   * Returns the update manager.
-   * @return A reference to the update manager.
-   */
-  SceneGraph::UpdateManager& GetUpdateManager();
-
-
-  /**
    * Returns the notification manager.
    * @return A reference to the Notification Manager.
    */
@@ -232,13 +250,37 @@ private:
    */
   RelayoutController& GetRelayoutController();
 
+  /**
+   * @brief Gets the Object registry.
+   * @return A reference to the object registry
+   */
+  ObjectRegistry& GetObjectRegistry() const;
+
+  /**
+   * @brief Gets the event thread services.
+   * @return A reference to the event thread services
+   */
+  EventThreadServices& GetEventThreadServices();
+
+  /**
+   * @brief Gets the property notification manager.
+   * @return A reference to the property notification manager
+   */
+  PropertyNotificationManager& GetPropertyNotificationManager() const;
+
+  /**
+   * @brief Gets the animation play list.
+   * @return A reference to the animation play list
+   */
+  AnimationPlaylist& GetAnimationPlaylist() const;
+
 private:
 
   /**
    * Undefined copy and assignment operators
    */
-  Core(const Core& core);  // No definition
-  Core& operator=(const Core& core);  // No definition
+  Core(const Core& core) = delete;  // No definition
+  Core& operator=(const Core& core) = delete;  // No definition
 
   /**
    * Create Thread local storage
@@ -249,23 +291,27 @@ private:
 
   Integration::RenderController&            mRenderController;            ///< Reference to Render controller to tell it to keep rendering
   Integration::PlatformAbstraction&         mPlatform;                    ///< The interface providing platform specific services.
-
+  Graphics::Controller&                     mGraphicsController;          ///< Graphics object
   IntrusivePtr<Stage>                       mStage;                       ///< The current stage
   AnimationPlaylistOwner                    mAnimationPlaylist;           ///< For 'Fire and forget' animation support
   OwnerPointer<PropertyNotificationManager> mPropertyNotificationManager; ///< For safe signal emmision of property changed notifications
   IntrusivePtr< RelayoutController >        mRelayoutController;          ///< Size negotiation relayout controller
-  bool                                      mProcessingEvent  : 1;        ///< True during ProcessEvents()
 
-  OwnerPointer<SceneGraph::RenderTaskProcessor> mRenderTaskProcessor;         ///< Handles the processing of render tasks
-  OwnerPointer<SceneGraph::UpdateManager>       mUpdateManager;               ///< Update manager
-  OwnerPointer<SceneGraph::DiscardQueue>        mDiscardQueue;                ///< Used to cleanup nodes & resources when no longer in use.
-  OwnerPointer<ShaderFactory>                   mShaderFactory;               ///< Shader resource factory
-  OwnerPointer<NotificationManager>             mNotificationManager;         ///< Notification manager
-  OwnerPointer<GestureEventProcessor>           mGestureEventProcessor;       ///< The gesture event processor
-  OwnerPointer<EventProcessor>                  mEventProcessor;              ///< The event processor
-  Dali::Vector<Integration::Processor*>         mProcessors;                  ///< Registered processors (not owned)
+  OwnerPointer<SceneGraph::RenderTaskProcessor> mRenderTaskProcessor;     ///< Handles the processing of render tasks
+  OwnerPointer<SceneGraph::UpdateManager>   mUpdateManager;               ///< Update manager
+  OwnerPointer<SceneGraph::DiscardQueue>    mDiscardQueue;                ///< Used to cleanup nodes & resources when no longer in use.
+  OwnerPointer<ShaderFactory>               mShaderFactory;               ///< Shader resource factory
+  OwnerPointer<NotificationManager>         mNotificationManager;         ///< Notification manager
+  OwnerPointer<GestureEventProcessor>       mGestureEventProcessor;       ///< The gesture event processor
+  Dali::Vector<Integration::Processor*>     mProcessors;                  ///< Registered processors (not owned)
 
-  Integration::Graphics::Graphics& mGraphics; ///< Graphics object
+  std::vector<ScenePtr>                         mScenes;                      ///< A container of scenes that bound to a surface for rendering, owned by Core
+
+  // The object registry
+  ObjectRegistryPtr                             mObjectRegistry;
+
+  bool                                      mProcessingEvent  : 1;        ///< True during ProcessEvents()
+  bool                                      mForceNextUpdate:1;           ///< True if the next rendering is really required.
 
   friend class ThreadLocalStorage;
 
index 774d20c..c3cefa1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -196,7 +196,7 @@ void* FixedSizeMemoryPool::Allocate()
   }
 
   // Placement new the object in block memory
-  unsigned char* objectAddress = static_cast< unsigned char* >( mImpl->mCurrentBlock->blockMemory );
+  uint8_t* objectAddress = static_cast< uint8_t* >( mImpl->mCurrentBlock->blockMemory );
   objectAddress += mImpl->mCurrentBlockSize * mImpl->mFixedSize;
   mImpl->mCurrentBlockSize++;
 
old mode 100644 (file)
new mode 100755 (executable)
index 25e53b8..9adf588
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -67,10 +67,10 @@ struct ImageAttributes::ImageAttributesImpl
     return *this;
   }
 
-  unsigned int  width : 16;       ///< image width in pixels
-  unsigned int  height : 16;      ///< image height in pixels
+  uint16_t  width;       ///< image width in pixels
+  uint16_t  height;      ///< image height in pixels
   ScalingMode   scaling : 3;      ///< scaling option, ShrinkToFit is default
-  FilterMode    filtering : 3;    ///< filtering option. Box is the default
+  FilterMode    filtering : 4;    ///< filtering option. Box is the default
   bool          mOrientationCorrection : 1; ///< If true, image pixels are reordered according to orientation metadata on load.
 };
 
@@ -97,16 +97,16 @@ ImageAttributes::~ImageAttributes()
   delete impl;
 }
 
-void ImageAttributes::SetSize(unsigned int width, unsigned int height)
+void ImageAttributes::SetSize(uint32_t width, uint32_t height)
 {
-  impl->width = width;
-  impl->height = height;
+  impl->width = static_cast<uint16_t>( width ); // truncated
+  impl->height = static_cast<uint16_t>( height ); // truncated
 }
 
 void ImageAttributes::SetSize( const Size& size )
 {
-  impl->width = size.width;
-  impl->height = size.height;
+  impl->width = static_cast<uint16_t>( size.width ); // truncated
+  impl->height = static_cast<uint16_t>( size.height ); // truncated
 }
 
 void ImageAttributes::SetScalingMode( ScalingMode scale )
@@ -133,12 +133,12 @@ void ImageAttributes::Reset( ImageDimensions dimensions, ScalingMode scaling, Fi
   impl->mOrientationCorrection = orientationCorrection;
 }
 
-unsigned int ImageAttributes::GetWidth() const
+uint32_t ImageAttributes::GetWidth() const
 {
   return impl->width;
 }
 
-unsigned int ImageAttributes::GetHeight() const
+uint32_t ImageAttributes::GetHeight() const
 {
   return impl->height;
 }
@@ -168,14 +168,6 @@ ImageAttributes ImageAttributes::New()
   return ImageAttributes();
 }
 
-ImageAttributes ImageAttributes::New(unsigned int imageWidth, unsigned int imageHeight)
-{
-  ImageAttributes attributes;
-  attributes.impl->width = imageWidth;
-  attributes.impl->height = imageHeight;
-  return attributes;
-}
-
 /**
  * Less then comparison operator.
  * @param [in] a parameter tested
index a0803cb..94a2343 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_IMAGE_ATTRIBUTES_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -128,15 +128,6 @@ public:
   static ImageAttributes New();
 
   /**
-   * @brief Create an initialised image attributes object.
-   *
-   * @param [in] width         desired width.
-   * @param [in] height        desired height
-   * @return A handle to a newly allocated object
-   */
-   static ImageAttributes New(unsigned int width, unsigned int height);
-
-  /**
    * @brief Set the size properties.
    *
    * By default width and height are set to zero which means the image loaded has the original size.
@@ -146,7 +137,7 @@ public:
    * @param [in] width  desired width.
    * @param [in] height desired height
    */
-  void SetSize(unsigned int width, unsigned int height);
+  void SetSize( uint32_t width, uint32_t height);
 
   /**
    * @brief Set the image dimension properties.
index 9e89789..2933619 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,16 +29,16 @@ namespace // unnamed namespace
 {
 
 // Increase capacity by 1.5 when buffer limit reached
-const unsigned int INCREMENT_NUMERATOR   = 3u;
-const unsigned int INCREMENT_DENOMINATOR = 2u;
+const uint32_t INCREMENT_NUMERATOR   = 3u;
+const uint32_t INCREMENT_DENOMINATOR = 2u;
 
-const unsigned int MESSAGE_SIZE_FIELD = 1u; // Size required to mark the message size
-const unsigned int MESSAGE_END_FIELD  = 1u; // Size required to mark the end of messages
+const uint32_t MESSAGE_SIZE_FIELD = 1u; // Size required to mark the message size
+const uint32_t MESSAGE_END_FIELD  = 1u; // Size required to mark the end of messages
 
-const unsigned int MESSAGE_SIZE_PLUS_END_FIELD = MESSAGE_SIZE_FIELD + MESSAGE_END_FIELD;
+const uint32_t MESSAGE_SIZE_PLUS_END_FIELD = MESSAGE_SIZE_FIELD + MESSAGE_END_FIELD;
 
-const unsigned int MAX_DIVISION_BY_WORD_REMAINDER = sizeof(Dali::Internal::MessageBuffer::WordType) - 1u; // For word alignment on ARM
-const unsigned int WORD_SIZE = sizeof(Dali::Internal::MessageBuffer::WordType);
+const std::size_t MAX_DIVISION_BY_WORD_REMAINDER = sizeof(Dali::Internal::MessageBuffer::WordType) - 1u; // For word alignment on ARM
+const std::size_t WORD_SIZE = sizeof(Dali::Internal::MessageBuffer::WordType);
 
 } // unnamed namespace
 
@@ -62,7 +62,7 @@ MessageBuffer::~MessageBuffer()
   free( mData );
 }
 
-unsigned int* MessageBuffer::ReserveMessageSlot( std::size_t size )
+uint32_t* MessageBuffer::ReserveMessageSlot( std::size_t size )
 {
   DALI_ASSERT_DEBUG( 0 != size );
 
@@ -97,7 +97,7 @@ unsigned int* MessageBuffer::ReserveMessageSlot( std::size_t size )
   // End marker
   *mNextSlot = 0;
 
-  return reinterpret_cast<unsigned int*>(slot);
+  return reinterpret_cast<uint32_t*>(slot);
 }
 
 std::size_t MessageBuffer::GetCapacity() const
index 8e1a17a..eabeb78 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_MESSAGE_BUFFER_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
-#include <cstddef>
+#include <cstddef> // size_t
+#include <cstdint> // uint32_t
 
 namespace Dali
 {
@@ -53,7 +54,7 @@ public:
    * @param[in] size The message size with respect to the size of type "char".
    * @return A pointer to the address allocated for the message, aligned to a word boundary
    */
-  unsigned int* ReserveMessageSlot( std::size_t size );
+  uint32_t* ReserveMessageSlot( std::size_t size );
 
   /**
    * Query the capacity of the message buffer.
index 73ad04a..1aaa4c9 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_MESSAGE_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -85,6 +85,7 @@ public:
     object( const_cast< T* >( obj ) ),
     memberFunction( member )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -99,7 +100,6 @@ public:
    */
   virtual void Process( BufferIndex /*bufferIndex*/ )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)();
   }
 
@@ -139,6 +139,7 @@ public:
     memberFunction( member ),
     param1( p1 )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -153,7 +154,6 @@ public:
    */
   virtual void Process( BufferIndex /*bufferIndex*/ )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( param1 );
   }
 
@@ -200,6 +200,7 @@ public:
     param1( p1 ),
     param2( p2 )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -214,7 +215,6 @@ public:
    */
   virtual void Process( BufferIndex /*bufferIndex*/ )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( param1, param2 );
   }
 
@@ -265,6 +265,7 @@ public:
     param2( p2 ),
     param3( p3 )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -279,7 +280,6 @@ public:
    */
   virtual void Process( BufferIndex /*bufferIndex*/ )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( param1, param2, param3 );
   }
 
@@ -335,6 +335,7 @@ public:
     param3( p3 ),
     param4( p4 )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -349,7 +350,6 @@ public:
    */
   virtual void Process( BufferIndex /*bufferIndex*/ )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( param1, param2, param3, param4 );
   }
 
@@ -410,6 +410,7 @@ public:
     param4( p4 ),
     param5( p5 )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -424,9 +425,7 @@ public:
    */
   virtual void Process( BufferIndex /*bufferIndex*/ )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( param1, param2, param3, param4, param5 );
-
   }
 
 private:
@@ -491,6 +490,7 @@ public:
     param5( p5 ),
     param6( p6 )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -505,9 +505,7 @@ public:
    */
   virtual void Process( BufferIndex /*bufferIndex*/ )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( param1, param2, param3, param4, param5, param6 );
-
   }
 
 private:
@@ -546,6 +544,7 @@ public:
     object( const_cast< T* >( obj ) ),
     memberFunction( member )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -560,7 +559,6 @@ public:
    */
   virtual void Process( BufferIndex bufferIndex )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( bufferIndex );
   }
 
@@ -603,6 +601,7 @@ public:
     memberFunction( member ),
     param( p )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -617,7 +616,6 @@ public:
    */
   virtual void Process( BufferIndex bufferIndex )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( bufferIndex,  param );
   }
 
@@ -664,6 +662,7 @@ public:
     param2( p2 ),
     param3( p3 )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -678,9 +677,7 @@ public:
    */
   virtual void Process( BufferIndex bufferIndex )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
-    (object->*memberFunction)(
-        bufferIndex, param2, param3 );
+    (object->*memberFunction)( bufferIndex, param2, param3 );
   }
 
 private:
@@ -732,6 +729,7 @@ public:
     param3( p3 ),
     param4( p4 )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -746,7 +744,6 @@ public:
    */
   virtual void Process( BufferIndex bufferIndex )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( bufferIndex, param2, param3, param4 );
   }
 
@@ -803,6 +800,7 @@ public:
     param4( p4 ),
     param5( p5 )
   {
+    DALI_ASSERT_DEBUG( object && "nullptr passed into message as object" );
   }
 
   /**
@@ -817,7 +815,6 @@ public:
    */
   virtual void Process( BufferIndex bufferIndex )
   {
-    DALI_ASSERT_DEBUG( object && "Message does not have an object" );
     (object->*memberFunction)( bufferIndex, param2, param3, param4, param5 );
   }
 
index 0eabae6..165747a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_OWNER_POINTER_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,9 +18,6 @@
  *
  */
 
-// EXTERNAL INCLUDES
-#include <cstddef>    // NULL
-
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 
@@ -30,15 +27,19 @@ namespace Dali
 namespace Internal
 {
 
-template < typename T >
+template< typename T >
 class OwnerPointer
 {
 public:
+
   /**
    * Default constructor. Creates an OwnerPointer that does not own any object.
+   * @note This does not protect against two different OwnerPointers pointing to the same object.
+   *       Both OwnerPointers will try to release the memory of the same object in that case which
+   *       could lead to a crash.
    */
   OwnerPointer()
-  : mObject(NULL)
+  : mObject( nullptr )
   {
   }
 
@@ -47,7 +48,7 @@ public:
    * @param[in] object A pointer to a heap allocated object.
    */
   OwnerPointer( T* object )
-  : mObject(object)
+  : mObject( object )
   {
   }
 
@@ -56,11 +57,20 @@ public:
    * @param[in] other The pointer that gives away the ownership.
    */
   OwnerPointer( const OwnerPointer& other )
-  : mObject(NULL)
+  : OwnerPointer( static_cast< OwnerPointer&& >( const_cast<OwnerPointer&>( other ) ) ) // Remove constness & cast to rvalue to use the move constructor
   {
     // other needs to be const for compiler to pick up this as copy constructor;
     // though we are using this as move as there can only be one owner
-    Swap( const_cast<OwnerPointer&>( other ) );
+  }
+
+  /**
+   * Move constructor. Passes the ownership of a pointer to another.
+   * @param[in] other The pointer that gives away the ownership.
+   */
+  OwnerPointer( OwnerPointer&& other )
+  : mObject( nullptr )
+  {
+    Swap( other );
   }
 
   /**
@@ -71,8 +81,9 @@ public:
   {
     if( this != &other )    // no self-assignment
     {
-      // Creation of temportaty object to prevent premature deletion of object
-      OwnerPointer(other).Swap(*this);
+      delete mObject;
+      mObject = other.mObject;
+      other.mObject = nullptr;
     }
 
     // return self
@@ -80,6 +91,16 @@ public:
   }
 
   /**
+   * Move assignment operator. Passes the ownership of a pointer to another.
+   * @param[in] other The pointer that gives away the ownership.
+   */
+  OwnerPointer& operator=( OwnerPointer&& other )
+  {
+    // Reuse operator=
+    return operator=( other );
+  }
+
+  /**
    * Assignment operator. Takes the ownership of the object.
    * If it owns an object already, it will be deleted.
    * @param[in] pointer A pointer to a heap allocated object.
@@ -109,7 +130,7 @@ public:
    */
   T& operator*()
   {
-    DALI_ASSERT_DEBUG( mObject != NULL );
+    DALI_ASSERT_DEBUG( mObject );
 
     return *mObject;
   }
@@ -120,7 +141,7 @@ public:
    */
   T& operator*() const
   {
-    DALI_ASSERT_DEBUG( mObject != NULL );
+    DALI_ASSERT_DEBUG( mObject );
 
     // Pointer semantics: A const pointer does not mean const data.
     return const_cast< T& >( *mObject );
@@ -159,11 +180,8 @@ public:
    */
   void Reset()
   {
-    if ( mObject != NULL )
-    {
-      delete mObject;
-      mObject = NULL;
-    }
+    delete mObject;
+    mObject = nullptr;
   }
 
   /**
@@ -173,7 +191,7 @@ public:
   T* Release()
   {
     T* tmp = mObject;
-    mObject = NULL;
+    mObject = nullptr;
     return tmp;
   }
 
@@ -188,12 +206,16 @@ public:
 
   /**
    * Swap owned objects
+   * @param[in] other The pointer to swap the owned objects with.
    */
   void Swap( OwnerPointer& other )
   {
-    T* tmp = mObject;
-    mObject = other.mObject;
-    other.mObject = tmp;
+    if( this != &other )
+    {
+      T* tmp = mObject;
+      mObject = other.mObject;
+      other.mObject = tmp;
+    }
   }
 
   // Handle comparisons - This is a variation of the safe bool idiom
@@ -209,7 +231,7 @@ public:
    */
   operator BooleanType() const
   {
-    return (mObject != NULL) ? &OwnerPointer::ThisIsSaferThanReturningVoidStar : NULL;
+    return ( mObject != nullptr ) ? &OwnerPointer::ThisIsSaferThanReturningVoidStar : nullptr;
   }
 
 private:
index fee18da..a72aae7 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SHADER_DATA_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -175,7 +175,7 @@ public: // API
    * Allocate a buffer for the compiled binary bytecode
    * @param[in] size  The size of the buffer in bytes
    */
-  void AllocateBuffer( size_t size )
+  void AllocateBuffer( std::size_t size )
   {
     mBuffer.Resize( size );
   }
@@ -184,7 +184,7 @@ public: // API
    * Get the program buffer
    * @return reference to the buffer
    */
-  size_t GetBufferSize() const
+  std::size_t GetBufferSize() const
   {
     return mBuffer.Size();
   }
@@ -193,7 +193,7 @@ public: // API
    * Get the data that the buffer points to
    * @return raw pointer to the buffer data
    */
-  unsigned char* GetBufferData()
+  uint8_t* GetBufferData()
   {
     DALI_ASSERT_DEBUG( mBuffer.Size() > 0 );
     return &mBuffer[0];
@@ -203,7 +203,7 @@ public: // API
    * Get the data that the buffer points to
    * @return raw pointer to the buffer data
    */
-  Dali::Vector<unsigned char>& GetBuffer()
+  Dali::Vector<uint8_t>& GetBuffer()
   {
     return mBuffer;
   }
@@ -218,12 +218,12 @@ public: // API
 
 private: // Data
 
-  size_t                      mShaderHash;     ///< hash key created with vertex and fragment shader code
-  std::vector<char>           mVertexShader;   ///< binary code for vertex program
-  std::vector<char>           mFragmentShader; ///< binary code for fragment program
-  Dali::Shader::Hint::Value   mHints;          ///< take a hint
-  Dali::Vector<unsigned char> mBuffer;         ///< buffer containing compiled binary bytecode
-  Type                        mType;           ///< Type of shader data ( text or binary )
+  std::size_t               mShaderHash; ///< hash key created with vertex and fragment shader code
+  std::vector<char>         mVertexShader; ///< binary code for vertex program
+  std::vector<char>         mFragmentShader; ///< binary code for fragment program
+  Dali::Shader::Hint::Value mHints; ///< take a hint
+  Dali::Vector<uint8_t>     mBuffer; ///< buffer containing compiled binary bytecode
+  Type                      mType; ///< Type of shader data ( text or binary )
 
 };
 
index a788e60..f1de447 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TYPE_ABSTRACTION_ENUMS_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/rendering/renderer.h>
+#include <dali/devel-api/common/stage-devel.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/internal/common/type-abstraction.h>
 
 namespace Dali
@@ -28,14 +30,16 @@ namespace Dali
 namespace Internal
 {
 
-template <> struct ParameterType< Dali::FaceCullingMode::Type >  : public BasicType< Dali::FaceCullingMode::Type > {};
-template <> struct ParameterType< Dali::BlendMode::Type >        : public BasicType< Dali::BlendMode::Type > {};
-template <> struct ParameterType< Dali::DepthWriteMode::Type >   : public BasicType< Dali::DepthWriteMode::Type > {};
-template <> struct ParameterType< Dali::DepthTestMode::Type >    : public BasicType< Dali::DepthTestMode::Type > {};
-template <> struct ParameterType< Dali::DepthFunction::Type >    : public BasicType< Dali::DepthFunction::Type > {};
-template <> struct ParameterType< Dali::RenderMode::Type >       : public BasicType< Dali::RenderMode::Type > {};
-template <> struct ParameterType< Dali::StencilFunction::Type >  : public BasicType< Dali::StencilFunction::Type > {};
-template <> struct ParameterType< Dali::StencilOperation::Type > : public BasicType< Dali::StencilOperation::Type > {};
+template <> struct ParameterType< Dali::FaceCullingMode::Type >          : public BasicType< Dali::FaceCullingMode::Type > {};
+template <> struct ParameterType< Dali::BlendMode::Type >                : public BasicType< Dali::BlendMode::Type > {};
+template <> struct ParameterType< Dali::DepthWriteMode::Type >           : public BasicType< Dali::DepthWriteMode::Type > {};
+template <> struct ParameterType< Dali::DepthTestMode::Type >            : public BasicType< Dali::DepthTestMode::Type > {};
+template <> struct ParameterType< Dali::DepthFunction::Type >            : public BasicType< Dali::DepthFunction::Type > {};
+template <> struct ParameterType< Dali::RenderMode::Type >               : public BasicType< Dali::RenderMode::Type > {};
+template <> struct ParameterType< Dali::StencilFunction::Type >          : public BasicType< Dali::StencilFunction::Type > {};
+template <> struct ParameterType< Dali::StencilOperation::Type >         : public BasicType< Dali::StencilOperation::Type > {};
+template <> struct ParameterType< Dali::DevelStage::Rendering >          : public BasicType< Dali::DevelStage::Rendering > {};
+template <> struct ParameterType< Dali::DevelRenderer::Rendering::Type > : public BasicType< Dali::DevelRenderer::Rendering::Type > {};
 
 } //namespace Internal
 
index a7a979a..4ecd0d4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,6 +42,8 @@
 #include <dali/internal/event/common/property-helper.h>
 #include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/common/type-info-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
+#include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/internal/event/animation/constraint-impl.h>
 #include <dali/internal/event/common/projection.h>
 #include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
@@ -68,8 +70,6 @@ namespace Dali
 namespace Internal
 {
 
-unsigned int Actor::mActorCounter = 0;
-
 namespace
 {
 /// Using a function because of library initialisation order. Vector3::ONE may not have been initialised yet.
@@ -103,7 +103,7 @@ struct Actor::RelayoutData
     : sizeModeFactor( GetDefaultSizeModeFactor() ), preferredSize( GetDefaultPreferredSize() ), sizeSetPolicy( DEFAULT_SIZE_SCALE_POLICY ), relayoutEnabled( false ), insideRelayout( false )
   {
     // Set size negotiation defaults
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       resizePolicies[ i ] = ResizePolicy::DEFAULT;
       useAssignedSize[ i ] = false;
@@ -194,7 +194,7 @@ DALI_PROPERTY( "leaveRequired",             BOOLEAN,  true,  false, false, Dali:
 DALI_PROPERTY( "inheritOrientation",        BOOLEAN,  true,  false, false, Dali::Actor::Property::INHERIT_ORIENTATION )
 DALI_PROPERTY( "inheritScale",              BOOLEAN,  true,  false, false, Dali::Actor::Property::INHERIT_SCALE )
 DALI_PROPERTY( "colorMode",                 STRING,   true,  false, false, Dali::Actor::Property::COLOR_MODE )
-DALI_PROPERTY( "positionInheritance",       STRING,   true,  false, false, Dali::Actor::Property::POSITION_INHERITANCE )
+DALI_PROPERTY( "reservedProperty01",        STRING,   true,  false, false, Dali::Actor::Property::RESERVED_PROPERTY_01 ) // This property was removed, but to keep binary compatibility and TypeRegister test app, remain it here.
 DALI_PROPERTY( "drawMode",                  STRING,   true,  false, false, Dali::Actor::Property::DRAW_MODE )
 DALI_PROPERTY( "sizeModeFactor",            VECTOR3,  true,  false, false, Dali::Actor::Property::SIZE_MODE_FACTOR )
 DALI_PROPERTY( "widthResizePolicy",         STRING,   true,  false, false, Dali::Actor::Property::WIDTH_RESIZE_POLICY )
@@ -213,7 +213,8 @@ DALI_PROPERTY( "siblingOrder",              INTEGER,  true,  false, false, Dali:
 DALI_PROPERTY( "opacity",                   FLOAT,    true,  true,  true,  Dali::DevelActor::Property::OPACITY )
 DALI_PROPERTY( "screenPosition",            VECTOR2,  false, false, false, Dali::DevelActor::Property::SCREEN_POSITION )
 DALI_PROPERTY( "positionUsesAnchorPoint",   BOOLEAN,  true,  false, false, Dali::DevelActor::Property::POSITION_USES_ANCHOR_POINT )
-DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
+DALI_PROPERTY( "culled",                    BOOLEAN,  false, false, true, Dali::DevelActor::Property::CULLED )
+DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultProperties )
 
 // Signals
 
@@ -239,7 +240,7 @@ BaseHandle CreateActor()
   return Dali::Actor::New();
 }
 
-TypeRegistration mType( typeid(Dali::Actor), typeid(Dali::Handle), CreateActor );
+TypeRegistration mType( typeid(Dali::Actor), typeid(Dali::Handle), CreateActor, ActorDefaultProperties );
 
 SignalConnectorType signalConnector1( mType, SIGNAL_TOUCHED, &Actor::DoConnectSignal );
 SignalConnectorType signalConnector2( mType, SIGNAL_HOVERED, &Actor::DoConnectSignal );
@@ -281,17 +282,9 @@ DALI_ENUM_TO_STRING( USE_OWN_MULTIPLY_PARENT_COLOR )
 DALI_ENUM_TO_STRING( USE_OWN_MULTIPLY_PARENT_ALPHA )
 DALI_ENUM_TO_STRING_TABLE_END( COLOR_MODE )
 
-DALI_ENUM_TO_STRING_TABLE_BEGIN( POSITION_INHERITANCE_MODE )
-DALI_ENUM_TO_STRING( INHERIT_PARENT_POSITION )
-DALI_ENUM_TO_STRING( USE_PARENT_POSITION )
-DALI_ENUM_TO_STRING( USE_PARENT_POSITION_PLUS_LOCAL_POSITION )
-DALI_ENUM_TO_STRING( DONT_INHERIT_POSITION )
-DALI_ENUM_TO_STRING_TABLE_END( POSITION_INHERITANCE_MODE )
-
 DALI_ENUM_TO_STRING_TABLE_BEGIN( DRAW_MODE )
 DALI_ENUM_TO_STRING_WITH_SCOPE( DrawMode, NORMAL )
 DALI_ENUM_TO_STRING_WITH_SCOPE( DrawMode, OVERLAY_2D )
-DALI_ENUM_TO_STRING_WITH_SCOPE( DrawMode, STENCIL )
 DALI_ENUM_TO_STRING_TABLE_END( DRAW_MODE )
 
 DALI_ENUM_TO_STRING_TABLE_BEGIN( RESIZE_POLICY )
@@ -323,9 +316,9 @@ DALI_ENUM_TO_STRING_TABLE_END( LAYOUT_DIRECTION )
 
 bool GetAnchorPointConstant( const std::string& value, Vector3& anchor )
 {
-  for( unsigned int i = 0; i < ANCHOR_CONSTANT_TABLE_COUNT; ++i )
+  for( uint32_t i = 0; i < ANCHOR_CONSTANT_TABLE_COUNT; ++i )
   {
-    size_t sizeIgnored = 0;
+    uint32_t sizeIgnored = 0;
     if( CompareTokens( value.c_str(), ANCHOR_CONSTANT_TABLE[ i ].name, sizeIgnored ) )
     {
       anchor = ANCHOR_CONSTANT_TABLE[ i ].value;
@@ -407,7 +400,8 @@ void EmitVisibilityChangedSignalRecursively( ActorPtr actor, bool visible, Devel
 
 ActorPtr Actor::New()
 {
-  ActorPtr actor( new Actor( BASIC ) );
+  // pass a reference to actor, actor does not own its node
+  ActorPtr actor( new Actor( BASIC, *CreateNode() ) );
 
   // Second-phase construction
   actor->Initialize();
@@ -415,6 +409,17 @@ ActorPtr Actor::New()
   return actor;
 }
 
+const SceneGraph::Node* Actor::CreateNode()
+{
+  // create node. Nodes are owned by the update manager
+  SceneGraph::Node* node = SceneGraph::Node::New();
+  OwnerPointer< SceneGraph::Node > transferOwnership( node );
+  Internal::ThreadLocalStorage* tls = Internal::ThreadLocalStorage::GetInternal();
+  AddNodeMessage( tls->GetUpdateManager(), transferOwnership );
+
+  return node;
+}
+
 const std::string& Actor::GetName() const
 {
   return mName;
@@ -424,16 +429,13 @@ void Actor::SetName( const std::string& name )
 {
   mName = name;
 
-  if( NULL != mNode )
-  {
-    // ATTENTION: string for debug purposes is not thread safe.
-    DALI_LOG_SET_OBJECT_STRING( const_cast< SceneGraph::Node* >( mNode ), name );
-  }
+  // ATTENTION: string for debug purposes is not thread safe.
+  DALI_LOG_SET_OBJECT_STRING( const_cast< SceneGraph::Node* >( &GetNode() ), name );
 }
 
-unsigned int Actor::GetId() const
+uint32_t Actor::GetId() const
 {
-  return mId;
+  return GetNode().GetId();
 }
 
 bool Actor::OnStage() const
@@ -570,12 +572,12 @@ void Actor::Unparent()
   }
 }
 
-unsigned int Actor::GetChildCount() const
+uint32_t Actor::GetChildCount() const
 {
-  return ( NULL != mChildren ) ? mChildren->size() : 0;
+  return ( NULL != mChildren ) ? static_cast<uint32_t>( mChildren->size() ) : 0; // only 4,294,967,295 children per actor
 }
 
-ActorPtr Actor::GetChildAt( unsigned int index ) const
+ActorPtr Actor::GetChildAt( uint32_t index ) const
 {
   DALI_ASSERT_ALWAYS( index < GetChildCount() );
 
@@ -605,10 +607,10 @@ ActorPtr Actor::FindChildByName( const std::string& actorName )
   return child;
 }
 
-ActorPtr Actor::FindChildById( const unsigned int id )
+ActorPtr Actor::FindChildById( const uint32_t id )
 {
   ActorPtr child = 0;
-  if( id == mId )
+  if( id == GetId() )
   {
     child = this;
   }
@@ -630,11 +632,8 @@ ActorPtr Actor::FindChildById( const unsigned int id )
 
 void Actor::SetParentOrigin( const Vector3& origin )
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SetParentOriginMessage( GetEventThreadServices(), *mNode, origin );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SetParentOriginMessage( GetEventThreadServices(), GetNode(), origin );
 
   // Cache for event-thread access
   if( !mParentOrigin )
@@ -681,11 +680,8 @@ const Vector3& Actor::GetCurrentParentOrigin() const
 
 void Actor::SetAnchorPoint( const Vector3& anchor )
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SetAnchorPointMessage( GetEventThreadServices(), *mNode, anchor );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SetAnchorPointMessage( GetEventThreadServices(), GetNode(), anchor );
 
   // Cache for event-thread access
   if( !mAnchorPoint )
@@ -744,66 +740,46 @@ void Actor::SetPosition( const Vector3& position )
 {
   mTargetPosition = position;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, position );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, position );
 }
 
 void Actor::SetX( float x )
 {
   mTargetPosition.x = x;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, x );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, x );
 }
 
 void Actor::SetY( float y )
 {
   mTargetPosition.y = y;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, y );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, y );
 }
 
 void Actor::SetZ( float z )
 {
   mTargetPosition.z = z;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, z );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, z );
 }
 
 void Actor::TranslateBy( const Vector3& distance )
 {
   mTargetPosition += distance;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeRelative, distance );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeRelative, distance );
 }
 
 const Vector3& Actor::GetCurrentPosition() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->GetPosition(GetEventThreadServices().GetEventBufferIndex());
-  }
-
-  return Vector3::ZERO;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().GetPosition(GetEventThreadServices().GetEventBufferIndex());
 }
 
 const Vector3& Actor::GetTargetPosition() const
@@ -813,60 +789,37 @@ const Vector3& Actor::GetTargetPosition() const
 
 const Vector3& Actor::GetCurrentWorldPosition() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->GetWorldPosition( GetEventThreadServices().GetEventBufferIndex() );
-  }
-
-  return Vector3::ZERO;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().GetWorldPosition( GetEventThreadServices().GetEventBufferIndex() );
 }
 
 const Vector2 Actor::GetCurrentScreenPosition() const
 {
-  StagePtr stage = Stage::GetCurrent();
-  if( stage && OnStage() && NULL != mNode )
+  if( mScene && OnStage() )
   {
-    Vector3 worldPosition =  mNode->GetWorldPosition( GetEventThreadServices().GetEventBufferIndex() );
-    Vector3 cameraPosition = stage->GetDefaultCameraActor().mNode->GetWorldPosition( GetEventThreadServices().GetEventBufferIndex() );
+    Vector3 worldPosition =  GetNode().GetWorldPosition( GetEventThreadServices().GetEventBufferIndex() );
+    Vector3 cameraPosition = mScene->GetDefaultCameraActor().GetNode().GetWorldPosition( GetEventThreadServices().GetEventBufferIndex() );
     worldPosition -= cameraPosition;
 
     Vector3 actorSize = GetCurrentSize() * GetCurrentWorldScale();
-    Vector2 halfStageSize( stage->GetSize() * 0.5f ); // World position origin is center of stage
+    Vector2 halfSceneSize( mScene->GetSize() * 0.5f ); // World position origin is center of scene
     Vector3 halfActorSize( actorSize * 0.5f );
     Vector3 anchorPointOffSet = halfActorSize - actorSize * ( mPositionUsesAnchorPoint ? GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT );
 
-    return Vector2( halfStageSize.width + worldPosition.x - anchorPointOffSet.x,
-                    halfStageSize.height + worldPosition.y - anchorPointOffSet.y );
+    return Vector2( halfSceneSize.width + worldPosition.x - anchorPointOffSet.x,
+                    halfSceneSize.height + worldPosition.y - anchorPointOffSet.y );
   }
 
   return Vector2::ZERO;
 }
 
-void Actor::SetPositionInheritanceMode( PositionInheritanceMode mode )
-{
-  // this flag is not animatable so keep the value
-  mPositionInheritanceMode = mode;
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value
-    SetInheritPositionMessage( GetEventThreadServices(), *mNode, mode == INHERIT_PARENT_POSITION );
-  }
-}
-
-PositionInheritanceMode Actor::GetPositionInheritanceMode() const
-{
-  // Cached for event-thread access
-  return mPositionInheritanceMode;
-}
-
 void Actor::SetInheritPosition( bool inherit )
 {
-  if( mInheritPosition != inherit && NULL != mNode )
+  if( mInheritPosition != inherit )
   {
-    // non animateable so keep local copy
+    // non animatable so keep local copy
     mInheritPosition = inherit;
-    SetInheritPositionMessage( GetEventThreadServices(), *mNode, inherit );
+    SetInheritPositionMessage( GetEventThreadServices(), GetNode(), inherit );
   }
 }
 
@@ -889,11 +842,8 @@ void Actor::SetOrientation( const Quaternion& orientation )
 {
   mTargetOrientation = orientation;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformPropertyMessage<Quaternion>::Send( GetEventThreadServices(), mNode, &mNode->mOrientation, &SceneGraph::TransformManagerPropertyHandler<Quaternion>::Bake, orientation );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformPropertyMessage<Quaternion>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mOrientation, &SceneGraph::TransformManagerPropertyHandler<Quaternion>::Bake, orientation );
 }
 
 void Actor::RotateBy( const Radian& angle, const Vector3& axis )
@@ -905,33 +855,20 @@ void Actor::RotateBy( const Quaternion& relativeRotation )
 {
   mTargetOrientation *= Quaternion( relativeRotation );
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformPropertyMessage<Quaternion>::Send( GetEventThreadServices(), mNode, &mNode->mOrientation, &SceneGraph::TransformManagerPropertyHandler<Quaternion>::BakeRelative, relativeRotation );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformPropertyMessage<Quaternion>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mOrientation, &SceneGraph::TransformManagerPropertyHandler<Quaternion>::BakeRelative, relativeRotation );
 }
 
 const Quaternion& Actor::GetCurrentOrientation() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->GetOrientation(GetEventThreadServices().GetEventBufferIndex());
-  }
-
-  return Quaternion::IDENTITY;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().GetOrientation(GetEventThreadServices().GetEventBufferIndex());
 }
 
 const Quaternion& Actor::GetCurrentWorldOrientation() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->GetWorldOrientation( GetEventThreadServices().GetEventBufferIndex() );
-  }
-
-  return Quaternion::IDENTITY;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().GetWorldOrientation( GetEventThreadServices().GetEventBufferIndex() );
 }
 
 void Actor::SetScale( float scale )
@@ -948,88 +885,62 @@ void Actor::SetScale( const Vector3& scale )
 {
   mTargetScale = scale;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, scale );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, scale );
 }
 
 void Actor::SetScaleX( float x )
 {
   mTargetScale.x = x;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, x );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, x );
 }
 
 void Actor::SetScaleY( float y )
 {
   mTargetScale.y = y;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, y );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, y );
 }
 
 void Actor::SetScaleZ( float z )
 {
   mTargetScale.z = z;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, z );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, z );
 }
 
 void Actor::ScaleBy(const Vector3& relativeScale)
 {
   mTargetScale *= relativeScale;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeRelativeMultiply, relativeScale );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeRelativeMultiply, relativeScale );
 }
 
 const Vector3& Actor::GetCurrentScale() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->GetScale(GetEventThreadServices().GetEventBufferIndex());
-  }
-
-  return Vector3::ONE;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().GetScale(GetEventThreadServices().GetEventBufferIndex());
 }
 
 const Vector3& Actor::GetCurrentWorldScale() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->GetWorldScale( GetEventThreadServices().GetEventBufferIndex() );
-  }
-
-  return Vector3::ONE;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().GetWorldScale( GetEventThreadServices().GetEventBufferIndex() );
 }
 
 void Actor::SetInheritScale( bool inherit )
 {
-
-  if( mInheritScale != inherit && NULL != mNode )
+  if( mInheritScale != inherit )
   {
-    // non animateable so keep local copy
+    // non animatable so keep local copy
     mInheritScale = inherit;
-    // mNode is being used in a separate thread; queue a message to set the value
-    SetInheritScaleMessage( GetEventThreadServices(), *mNode, inherit );
+    // node is being used in a separate thread; queue a message to set the value
+    SetInheritScaleMessage( GetEventThreadServices(), GetNode(), inherit );
   }
 }
 
@@ -1040,12 +951,7 @@ bool Actor::IsScaleInherited() const
 
 Matrix Actor::GetCurrentWorldMatrix() const
 {
-  if( NULL != mNode )
-  {
-    return mNode->GetWorldMatrix(0);
-  }
-
-  return Matrix::IDENTITY;
+  return GetNode().GetWorldMatrix(0);
 }
 
 void Actor::SetVisible( bool visible )
@@ -1055,35 +961,22 @@ void Actor::SetVisible( bool visible )
 
 bool Actor::IsVisible() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->IsVisible( GetEventThreadServices().GetEventBufferIndex() );
-  }
-
-  return true;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().IsVisible( GetEventThreadServices().GetEventBufferIndex() );
 }
 
 void Actor::SetOpacity( float opacity )
 {
   mTargetColor.a = opacity;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), mNode, &mNode->mColor, &AnimatableProperty<Vector4>::BakeW, opacity );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::BakeW, opacity );
 }
 
 float Actor::GetCurrentOpacity() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->GetOpacity(GetEventThreadServices().GetEventBufferIndex());
-  }
-
-  return 1.0f;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().GetOpacity(GetEventThreadServices().GetEventBufferIndex());
 }
 
 ClippingMode::Type Actor::GetClippingMode() const
@@ -1091,84 +984,62 @@ ClippingMode::Type Actor::GetClippingMode() const
   return mClippingMode;
 }
 
-unsigned int Actor::GetSortingDepth()
+uint32_t Actor::GetSortingDepth()
 {
   return mSortedDepth;
 }
 
 const Vector4& Actor::GetCurrentWorldColor() const
 {
-  if( NULL != mNode )
-  {
-    return mNode->GetWorldColor( GetEventThreadServices().GetEventBufferIndex() );
-  }
-
-  return Color::WHITE;
+  return GetNode().GetWorldColor( GetEventThreadServices().GetEventBufferIndex() );
 }
 
 void Actor::SetColor( const Vector4& color )
 {
   mTargetColor = color;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodePropertyMessage<Vector4>::Send( GetEventThreadServices(), mNode, &mNode->mColor, &AnimatableProperty<Vector4>::Bake, color );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodePropertyMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::Bake, color );
 }
 
 void Actor::SetColorRed( float red )
 {
   mTargetColor.r = red;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), mNode, &mNode->mColor, &AnimatableProperty<Vector4>::BakeX, red );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::BakeX, red );
 }
 
 void Actor::SetColorGreen( float green )
 {
   mTargetColor.g = green;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), mNode, &mNode->mColor, &AnimatableProperty<Vector4>::BakeY, green );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::BakeY, green );
 }
 
 void Actor::SetColorBlue( float blue )
 {
   mTargetColor.b = blue;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), mNode, &mNode->mColor, &AnimatableProperty<Vector4>::BakeZ, blue );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::BakeZ, blue );
 }
 
 const Vector4& Actor::GetCurrentColor() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->GetColor(GetEventThreadServices().GetEventBufferIndex());
-  }
-
-  return Color::WHITE;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().GetColor(GetEventThreadServices().GetEventBufferIndex());
 }
 
 void Actor::SetInheritOrientation( bool inherit )
 {
-  if( mInheritOrientation != inherit && NULL != mNode)
+  if( mInheritOrientation != inherit )
   {
-    // non animateable so keep local copy
+    // non animatable so keep local copy
     mInheritOrientation = inherit;
-    // mNode is being used in a separate thread; queue a message to set the value
-    SetInheritOrientationMessage( GetEventThreadServices(), *mNode, inherit );
+    // node is being used in a separate thread; queue a message to set the value
+    SetInheritOrientationMessage( GetEventThreadServices(), GetNode(), inherit );
   }
 }
 
@@ -1196,13 +1067,10 @@ const Vector3& Actor::GetSizeModeFactor() const
 
 void Actor::SetColorMode( ColorMode colorMode )
 {
-  // non animateable so keep local copy
+  // non animatable so keep local copy
   mColorMode = colorMode;
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value
-    SetColorModeMessage( GetEventThreadServices(), *mNode, colorMode );
-  }
+  // node is being used in a separate thread; queue a message to set the value
+  SetColorModeMessage( GetEventThreadServices(), GetNode(), colorMode );
 }
 
 ColorMode Actor::GetColorMode() const
@@ -1249,15 +1117,14 @@ void Actor::SetSizeInternal( const Vector3& size )
   // dont allow recursive loop
   DALI_ASSERT_ALWAYS( !mInsideOnSizeSet && "Cannot call SetSize from OnSizeSet" );
   // check that we have a node AND the new size width, height or depth is at least a little bit different from the old one
-  if( ( NULL != mNode )&&
-      ( ( fabsf( mTargetSize.width - size.width  ) > Math::MACHINE_EPSILON_1 )||
-        ( fabsf( mTargetSize.height- size.height ) > Math::MACHINE_EPSILON_1 )||
-        ( fabsf( mTargetSize.depth - size.depth  ) > Math::MACHINE_EPSILON_1 ) ) )
+  if( ( fabsf( mTargetSize.width - size.width  ) > Math::MACHINE_EPSILON_1 )||
+      ( fabsf( mTargetSize.height- size.height ) > Math::MACHINE_EPSILON_1 )||
+      ( fabsf( mTargetSize.depth - size.depth  ) > Math::MACHINE_EPSILON_1 ) )
   {
     mTargetSize = size;
 
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, mTargetSize );
+    // node is being used in a separate thread; queue a message to set the value & base value
+    SceneGraph::NodeTransformPropertyMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, mTargetSize );
 
     // Notification for derived classes
     mInsideOnSizeSet = true;
@@ -1283,11 +1150,8 @@ void Actor::SetWidth( float width )
   {
     mTargetSize.width = width;
 
-    if( NULL != mNode )
-    {
-      // mNode is being used in a separate thread; queue a message to set the value & base value
-      SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, width );
-    }
+    // node is being used in a separate thread; queue a message to set the value & base value
+    SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, width );
   }
 
   RelayoutRequest();
@@ -1304,11 +1168,8 @@ void Actor::SetHeight( float height )
   {
     mTargetSize.height = height;
 
-    if( NULL != mNode )
-    {
-      // mNode is being used in a separate thread; queue a message to set the value & base value
-      SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, height );
-    }
+    // node is being used in a separate thread; queue a message to set the value & base value
+    SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, height );
   }
 
   RelayoutRequest();
@@ -1318,11 +1179,8 @@ void Actor::SetDepth( float depth )
 {
   mTargetSize.depth = depth;
 
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value & base value
-    SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, &mNode->mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, depth );
-  }
+  // node is being used in a separate thread; queue a message to set the value & base value
+  SceneGraph::NodeTransformComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, depth );
 }
 
 Vector3 Actor::GetTargetSize() const
@@ -1344,13 +1202,8 @@ Vector3 Actor::GetTargetSize() const
 
 const Vector3& Actor::GetCurrentSize() const
 {
-  if( NULL != mNode )
-  {
-    // mNode is being used in a separate thread; copy the value from the previous update
-    return mNode->GetSize( GetEventThreadServices().GetEventBufferIndex() );
-  }
-
-  return Vector3::ZERO;
+  // node is being used in a separate thread; copy the value from the previous update
+  return GetNode().GetSize( GetEventThreadServices().GetEventBufferIndex() );
 }
 
 Vector3 Actor::GetNaturalSize() const
@@ -1366,7 +1219,7 @@ void Actor::SetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimensio
   ResizePolicy::Type originalWidthPolicy = GetResizePolicy(Dimension::WIDTH);
   ResizePolicy::Type originalHeightPolicy = GetResizePolicy(Dimension::HEIGHT);
 
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -1437,7 +1290,7 @@ ResizePolicy::Type Actor::GetResizePolicy( Dimension::Type dimension ) const
   if ( mRelayoutData )
   {
     // If more than one dimension is requested, just return the first one found
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       if( ( dimension & ( 1 << i ) ) )
       {
@@ -1477,7 +1330,7 @@ void Actor::SetDimensionDependency( Dimension::Type dimension, Dimension::Type d
 {
   EnsureRelayoutData();
 
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -1491,7 +1344,7 @@ Dimension::Type Actor::GetDimensionDependency( Dimension::Type dimension ) const
   if ( mRelayoutData )
   {
     // If more than one dimension is requested, just return the first one found
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       if( ( dimension & ( 1 << i ) ) )
       {
@@ -1528,7 +1381,7 @@ void Actor::SetLayoutDirty( bool dirty, Dimension::Type dimension )
 {
   EnsureRelayoutData();
 
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -1541,7 +1394,7 @@ bool Actor::IsLayoutDirty( Dimension::Type dimension ) const
 {
   if ( mRelayoutData )
   {
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       if( ( dimension & ( 1 << i ) ) && mRelayoutData->dimensionDirty[ i ] )
       {
@@ -1563,32 +1416,32 @@ bool Actor::RelayoutRequired( Dimension::Type dimension ) const
   return mRelayoutData && mRelayoutData->relayoutEnabled && IsLayoutDirty( dimension );
 }
 
-unsigned int Actor::AddRenderer( Renderer& renderer )
+uint32_t Actor::AddRenderer( Renderer& renderer )
 {
   if( !mRenderers )
   {
     mRenderers = new RendererContainer;
   }
 
-  unsigned int index = mRenderers->size();
+  uint32_t index = static_cast<uint32_t>( mRenderers->size() ); //  4,294,967,295 renderers per actor
   RendererPtr rendererPtr = RendererPtr( &renderer );
   mRenderers->push_back( rendererPtr );
-  AddRendererMessage( GetEventThreadServices(), *mNode, renderer.GetRendererSceneObject() );
+  AttachRendererMessage( GetEventThreadServices(), GetNode(), renderer.GetRendererSceneObject() );
   return index;
 }
 
-unsigned int Actor::GetRendererCount() const
+uint32_t Actor::GetRendererCount() const
 {
-  unsigned int rendererCount(0);
+  uint32_t rendererCount(0);
   if( mRenderers )
   {
-    rendererCount = mRenderers->size();
+    rendererCount = static_cast<uint32_t>( mRenderers->size() ); //  4,294,967,295 renderers per actor
   }
 
   return rendererCount;
 }
 
-RendererPtr Actor::GetRendererAt( unsigned int index )
+RendererPtr Actor::GetRendererAt( uint32_t index )
 {
   RendererPtr renderer;
   if( index < GetRendererCount() )
@@ -1609,19 +1462,19 @@ void Actor::RemoveRenderer( Renderer& renderer )
       if( (*iter).Get() == &renderer )
       {
         mRenderers->erase( iter );
-        RemoveRendererMessage( GetEventThreadServices(), *mNode, renderer.GetRendererSceneObject() );
+        DetachRendererMessage( GetEventThreadServices(), GetNode(), renderer.GetRendererSceneObject() );
         break;
       }
     }
   }
 }
 
-void Actor::RemoveRenderer( unsigned int index )
+void Actor::RemoveRenderer( uint32_t index )
 {
   if( index < GetRendererCount() )
   {
     RendererPtr renderer = ( *mRenderers )[ index ];
-    RemoveRendererMessage( GetEventThreadServices(), *mNode, renderer.Get()->GetRendererSceneObject() );
+    DetachRendererMessage( GetEventThreadServices(), GetNode(), renderer.Get()->GetRendererSceneObject() );
     mRenderers->erase( mRenderers->begin()+index );
   }
 }
@@ -1635,11 +1488,9 @@ void Actor::SetDrawMode( DrawMode::Type drawMode )
 {
   // this flag is not animatable so keep the value
   mDrawMode = drawMode;
-  if( ( NULL != mNode ) && ( drawMode != DrawMode::STENCIL ) )
-  {
-    // mNode is being used in a separate thread; queue a message to set the value
-    SetDrawModeMessage( GetEventThreadServices(), *mNode, drawMode );
-  }
+
+  // node is being used in a separate thread; queue a message to set the value
+  SetDrawModeMessage( GetEventThreadServices(), GetNode(), drawMode );
 }
 
 DrawMode::Type Actor::GetDrawMode() const
@@ -1650,19 +1501,18 @@ DrawMode::Type Actor::GetDrawMode() const
 bool Actor::ScreenToLocal( float& localX, float& localY, float screenX, float screenY ) const
 {
   // only valid when on-stage
-  StagePtr stage = Stage::GetCurrent();
-  if( stage && OnStage() )
+  if( mScene && OnStage() )
   {
-    const RenderTaskList& taskList = stage->GetRenderTaskList();
+    const RenderTaskList& taskList = mScene->GetRenderTaskList();
 
     Vector2 converted( screenX, screenY );
 
     // do a reverse traversal of all lists (as the default onscreen one is typically the last one)
-    const int taskCount = taskList.GetTaskCount();
-    for( int i = taskCount - 1; i >= 0; --i )
+    uint32_t taskCount = taskList.GetTaskCount();
+    for( uint32_t i = taskCount; i > 0; --i )
     {
-      Dali::RenderTask task = taskList.GetTask( i );
-      if( ScreenToLocal( Dali::GetImplementation( task ), localX, localY, screenX, screenY ) )
+      RenderTaskPtr task = taskList.GetTask( i - 1 );
+      if( ScreenToLocal( *task, localX, localY, screenX, screenY ) )
       {
         // found a task where this conversion was ok so return
         return true;
@@ -1697,7 +1547,7 @@ bool Actor::ScreenToLocal( const RenderTask& renderTask, float& localX, float& l
 
 bool Actor::ScreenToLocal( const Matrix& viewMatrix, const Matrix& projectionMatrix, const Viewport& viewport, float& localX, float& localY, float screenX, float screenY ) const
 {
-  // Early-out if mNode is NULL
+  // Early-out if not on stage
   if( !OnStage() )
   {
     return false;
@@ -1705,7 +1555,7 @@ bool Actor::ScreenToLocal( const Matrix& viewMatrix, const Matrix& projectionMat
 
   // Get the ModelView matrix
   Matrix modelView;
-  Matrix::Multiply( modelView, mNode->GetWorldMatrix(0), viewMatrix );
+  Matrix::Multiply( modelView, GetNode().GetWorldMatrix(0), viewMatrix );
 
   // Calculate the inverted ModelViewProjection matrix; this will be used for 2 unprojects
   Matrix invertedMvp( false/*don't init*/);
@@ -1713,19 +1563,19 @@ bool Actor::ScreenToLocal( const Matrix& viewMatrix, const Matrix& projectionMat
   bool success = invertedMvp.Invert();
 
   // Convert to GL coordinates
-  Vector4 screenPos( screenX - viewport.x, viewport.height - ( screenY - viewport.y ), 0.f, 1.f );
+  Vector4 screenPos( screenX - static_cast<float>( viewport.x ), static_cast<float>( viewport.height ) - screenY - static_cast<float>( viewport.y ), 0.f, 1.f );
 
   Vector4 nearPos;
   if( success )
   {
-    success = Unproject( screenPos, invertedMvp, viewport.width, viewport.height, nearPos );
+    success = Unproject( screenPos, invertedMvp, static_cast<float>( viewport.width ), static_cast<float>( viewport.height ), nearPos );
   }
 
   Vector4 farPos;
   if( success )
   {
     screenPos.z = 1.0f;
-    success = Unproject( screenPos, invertedMvp, viewport.width, viewport.height, farPos );
+    success = Unproject( screenPos, invertedMvp, static_cast<float>( viewport.width ), static_cast<float>( viewport.height ), farPos );
   }
 
   if( success )
@@ -1808,8 +1658,8 @@ bool Actor::RaySphereTest( const Vector4& rayOrigin, const Vector4& rayDir ) con
    C = o dot o - r^2
    */
 
-  // Early out if mNode is NULL
-  if( !mNode )
+  // Early-out if not on stage
+  if( !OnStage() )
   {
     return false;
   }
@@ -1817,14 +1667,14 @@ bool Actor::RaySphereTest( const Vector4& rayOrigin, const Vector4& rayDir ) con
   BufferIndex bufferIndex( GetEventThreadServices().GetEventBufferIndex() );
 
   // Transforms the ray to the local reference system. As the test is against a sphere, only the translation and scale are needed.
-  const Vector3& translation( mNode->GetWorldPosition( bufferIndex ) );
+  const Vector3& translation( GetNode().GetWorldPosition( bufferIndex ) );
   Vector3 rayOriginLocal( rayOrigin.x - translation.x, rayOrigin.y - translation.y, rayOrigin.z - translation.z );
 
   // Compute the radius is not needed, square radius it's enough.
-  const Vector3& size( mNode->GetSize( bufferIndex ) );
+  const Vector3& size( GetNode().GetSize( bufferIndex ) );
 
   // Scale the sphere.
-  const Vector3& scale( mNode->GetWorldScale( bufferIndex ) );
+  const Vector3& scale( GetNode().GetWorldScale( bufferIndex ) );
 
   const float width = size.width * scale.width;
   const float height = size.height * scale.height;
@@ -1842,14 +1692,14 @@ bool Actor::RayActorTest( const Vector4& rayOrigin, const Vector4& rayDir, Vecto
 {
   bool hit = false;
 
-  if( OnStage() && NULL != mNode )
+  if( OnStage() )
   {
     // Transforms the ray to the local reference system.
     // Calculate the inverse of Model matrix
     Matrix invModelMatrix( false/*don't init*/);
 
     BufferIndex bufferIndex( GetEventThreadServices().GetEventBufferIndex() );
-    invModelMatrix = mNode->GetWorldMatrix(0);
+    invModelMatrix = GetNode().GetWorldMatrix(0);
     invModelMatrix.Invert();
 
     Vector4 rayOriginLocal( invModelMatrix * rayOrigin );
@@ -1865,7 +1715,7 @@ bool Actor::RayActorTest( const Vector4& rayOrigin, const Vector4& rayDir, Vecto
       // Ray travels distance * rayDirLocal to intersect with plane.
       distance = a / b;
 
-      const Vector3& size = mNode->GetSize( bufferIndex );
+      const Vector3& size = GetNode().GetSize( bufferIndex );
 
       hitPointLocal.x = rayOriginLocal.x + rayDirLocal.x * distance + size.x * 0.5f;
       hitPointLocal.y = rayOriginLocal.y + rayDirLocal.y * distance + size.y * 0.5f;
@@ -2088,6 +1938,11 @@ DevelActor::ChildChangedSignalType& Actor::ChildRemovedSignal()
   return mChildRemovedSignal;
 }
 
+DevelActor::ChildOrderChangedSignalType& Actor::ChildOrderChangedSignal()
+{
+  return mChildOrderChangedSignal;
+}
+
 bool Actor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   bool connected( true );
@@ -2146,11 +2001,12 @@ bool Actor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   return connected;
 }
 
-Actor::Actor( DerivedType derivedType )
-: mParent( NULL ),
+Actor::Actor( DerivedType derivedType, const SceneGraph::Node& node )
+: Object( &node ),
+  mScene( nullptr ),
+  mParent( NULL ),
   mChildren( NULL ),
   mRenderers( NULL ),
-  mNode( NULL ),
   mParentOrigin( NULL ),
   mAnchorPoint( NULL ),
   mRelayoutData( NULL ),
@@ -2166,13 +2022,13 @@ Actor::Actor( DerivedType derivedType )
   mLayoutDirectionChangedSignal(),
   mChildAddedSignal(),
   mChildRemovedSignal(),
+  mChildOrderChangedSignal(),
   mTargetOrientation( Quaternion::IDENTITY ),
   mTargetColor( Color::WHITE ),
   mTargetSize( Vector3::ZERO ),
   mTargetPosition( Vector3::ZERO ),
   mTargetScale( Vector3::ONE ),
   mName(),
-  mId( ++mActorCounter ), // actor ID is initialised to start from 1, and 0 is reserved
   mSortedDepth( 0u ),
   mDepth( 0u ),
   mIsRoot( ROOT_LAYER == derivedType ),
@@ -2194,7 +2050,6 @@ Actor::Actor( DerivedType derivedType )
   mInheritLayoutDirection( true ),
   mLayoutDirection( LayoutDirection::LEFT_TO_RIGHT ),
   mDrawMode( DrawMode::NORMAL ),
-  mPositionInheritanceMode( Node::DEFAULT_POSITION_INHERITANCE_MODE ),
   mColorMode( Node::DEFAULT_COLOR_MODE ),
   mClippingMode( ClippingMode::DISABLED )
 {
@@ -2202,11 +2057,6 @@ Actor::Actor( DerivedType derivedType )
 
 void Actor::Initialize()
 {
-  // Node creation, keep raw-pointer to Node for messaging
-  mNode = CreateNode();
-  OwnerPointer< SceneGraph::Node > transferOwnership( const_cast< SceneGraph::Node* >( mNode ) );
-  AddNodeMessage( GetEventThreadServices().GetUpdateManager(), transferOwnership );
-
   OnInitialize();
 
   GetEventThreadServices().RegisterObject( this );
@@ -2230,11 +2080,7 @@ Actor::~Actor()
   // Guard to allow handle destruction after Core has been destroyed
   if( EventThreadServices::IsCoreRunning() )
   {
-    if( NULL != mNode )
-    {
-      DestroyNodeMessage( GetEventThreadServices().GetUpdateManager(), *mNode );
-      mNode = NULL; // Node is about to be destroyed
-    }
+    DestroyNodeMessage( GetEventThreadServices().GetUpdateManager(), GetNode() );
 
     GetEventThreadServices().UnregisterObject( this );
   }
@@ -2247,22 +2093,18 @@ Actor::~Actor()
   delete mAnchorPoint;
 
   // Delete optional relayout data
-  if( mRelayoutData )
-  {
-    delete mRelayoutData;
-  }
+  delete mRelayoutData;
 }
 
-void Actor::ConnectToStage( unsigned int parentDepth )
+void Actor::ConnectToStage( uint32_t parentDepth )
 {
   // This container is used instead of walking the Actor hierarchy.
   // It protects us when the Actor hierarchy is modified during OnStageConnectionExternal callbacks.
   ActorContainer connectionList;
 
-  StagePtr stage = Stage::GetCurrent();
-  if( stage )
+  if( mScene )
   {
-    stage->RequestRebuildDepthTree();
+    mScene->RequestRebuildDepthTree();
   }
 
   // This stage is atomic i.e. not interrupted by user callbacks.
@@ -2278,12 +2120,12 @@ void Actor::ConnectToStage( unsigned int parentDepth )
   RelayoutRequest();
 }
 
-void Actor::RecursiveConnectToStage( ActorContainer& connectionList, unsigned int depth )
+void Actor::RecursiveConnectToStage( ActorContainer& connectionList, uint32_t depth )
 {
   DALI_ASSERT_ALWAYS( !OnStage() );
 
   mIsOnStage = true;
-  mDepth = depth;
+  mDepth = static_cast< uint16_t >( depth ); // overflow ignored, not expected in practice
 
   ConnectToSceneGraph();
 
@@ -2299,7 +2141,8 @@ void Actor::RecursiveConnectToStage( ActorContainer& connectionList, unsigned in
     ActorConstIter endIter = mChildren->end();
     for( ActorIter iter = mChildren->begin(); iter != endIter; ++iter )
     {
-      (*iter)->RecursiveConnectToStage( connectionList, depth+1 );
+      (*iter)->SetScene( *mScene );
+      (*iter)->RecursiveConnectToStage( connectionList, depth + 1 );
     }
   }
 }
@@ -2312,13 +2155,10 @@ void Actor::RecursiveConnectToStage( ActorContainer& connectionList, unsigned in
  */
 void Actor::ConnectToSceneGraph()
 {
-  DALI_ASSERT_DEBUG( mNode != NULL); DALI_ASSERT_DEBUG( mParent != NULL); DALI_ASSERT_DEBUG( mParent->mNode != NULL );
+  DALI_ASSERT_DEBUG( mParent != NULL);
 
-  if( NULL != mNode )
-  {
-    // Reparent Node in next Update
-    ConnectNodeMessage( GetEventThreadServices().GetUpdateManager(), *(mParent->mNode), *mNode );
-  }
+  // Reparent Node in next Update
+  ConnectNodeMessage( GetEventThreadServices().GetUpdateManager(), mParent->GetNode(), GetNode() );
 
   // Request relayout on all actors that are added to the scenegraph
   RelayoutRequest();
@@ -2356,10 +2196,9 @@ void Actor::DisconnectFromStage()
   // It protects us when the Actor hierachy is modified during OnStageDisconnectionExternal callbacks.
   ActorContainer disconnectionList;
 
-  StagePtr stage = Stage::GetCurrent();
-  if( stage )
+  if( mScene )
   {
-    stage->RequestRebuildDepthTree();
+    mScene->RequestRebuildDepthTree();
   }
 
   // This stage is atomic i.e. not interrupted by user callbacks
@@ -2375,7 +2214,8 @@ void Actor::DisconnectFromStage()
 
 void Actor::RecursiveDisconnectFromStage( ActorContainer& disconnectionList )
 {
-  DALI_ASSERT_ALWAYS( OnStage() );
+  // need to change state first so that internals relying on IsOnStage() inside OnStageDisconnectionInternal() get the correct value
+  mIsOnStage = false;
 
   // Recursively disconnect children
   if( mChildren )
@@ -2394,8 +2234,6 @@ void Actor::RecursiveDisconnectFromStage( ActorContainer& disconnectionList )
   OnStageDisconnectionInternal();
 
   DisconnectFromSceneGraph();
-
-  mIsOnStage = false;
 }
 
 /**
@@ -2436,9 +2274,9 @@ bool Actor::IsNodeConnected() const
 {
   bool connected( false );
 
-  if( OnStage() && ( NULL != mNode ) )
+  if( OnStage() )
   {
-    if( IsRoot() || mNode->GetParent() )
+    if( IsRoot() || GetNode().GetParent() )
     {
       connected = true;
     }
@@ -2461,17 +2299,17 @@ void Actor::RebuildDepthTree()
   // in a single message
   OwnerPointer<SceneGraph::NodeDepths> sceneGraphNodeDepths( new SceneGraph::NodeDepths() );
 
-  int depthIndex = 1;
+  int32_t depthIndex = 1;
   DepthTraverseActorTree( sceneGraphNodeDepths, depthIndex );
 
   SetDepthIndicesMessage( GetEventThreadServices().GetUpdateManager(), sceneGraphNodeDepths );
   DALI_LOG_TIMER_END(depthTimer, gLogFilter, Debug::Concise, "Depth tree traversal time: ");
 }
 
-void Actor::DepthTraverseActorTree( OwnerPointer<SceneGraph::NodeDepths>& sceneGraphNodeDepths, int& depthIndex )
+void Actor::DepthTraverseActorTree( OwnerPointer<SceneGraph::NodeDepths>& sceneGraphNodeDepths, int32_t& depthIndex )
 {
   mSortedDepth = depthIndex * DevelLayer::SIBLING_ORDER_MULTIPLIER;
-  sceneGraphNodeDepths->Add( const_cast<SceneGraph::Node*>( mNode ), mSortedDepth );
+  sceneGraphNodeDepths->Add( const_cast<SceneGraph::Node*>( &GetNode() ), mSortedDepth );
 
   // Create/add to children of this node
   if( mChildren )
@@ -2485,90 +2323,6 @@ void Actor::DepthTraverseActorTree( OwnerPointer<SceneGraph::NodeDepths>& sceneG
   }
 }
 
-unsigned int Actor::GetDefaultPropertyCount() const
-{
-  return DEFAULT_PROPERTY_COUNT;
-}
-
-void Actor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  indices.Reserve( DEFAULT_PROPERTY_COUNT );
-
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    indices.PushBack( i );
-  }
-}
-
-const char* Actor::GetDefaultPropertyName( Property::Index index ) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[ index ].name;
-  }
-
-  return NULL;
-}
-
-Property::Index Actor::GetDefaultPropertyIndex( const std::string& name ) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
-    if( 0 == name.compare( property->name ) )
-    {
-      index = i;
-      break;
-    }
-  }
-
-  return index;
-}
-
-bool Actor::IsDefaultPropertyWritable( Property::Index index ) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[ index ].writable;
-  }
-
-  return false;
-}
-
-bool Actor::IsDefaultPropertyAnimatable( Property::Index index ) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[ index ].animatable;
-  }
-
-  return false;
-}
-
-bool Actor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[ index ].constraintInput;
-  }
-
-  return false;
-}
-
-Property::Type Actor::GetDefaultPropertyType( Property::Index index ) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[ index ].type;
-  }
-
-  // index out of range...return Property::NONE
-  return Property::NONE;
-}
-
 void Actor::SetDefaultProperty( Property::Index index, const Property::Value& property )
 {
   switch( index )
@@ -2814,16 +2568,6 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr
       break;
     }
 
-    case Dali::Actor::Property::POSITION_INHERITANCE:
-    {
-      PositionInheritanceMode mode = mPositionInheritanceMode;
-      if( Scripting::GetEnumerationProperty< PositionInheritanceMode >( property, POSITION_INHERITANCE_MODE_TABLE, POSITION_INHERITANCE_MODE_TABLE_COUNT, mode ) )
-      {
-        SetPositionInheritanceMode( mode );
-      }
-      break;
-    }
-
     case Dali::Actor::Property::DRAW_MODE:
     {
       DrawMode::Type mode = mDrawMode;
@@ -2842,7 +2586,7 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr
 
     case Dali::Actor::Property::WIDTH_RESIZE_POLICY:
     {
-      ResizePolicy::Type type = static_cast< ResizePolicy::Type >( -1 ); // Set to invalid number so it definitely gets set.
+      ResizePolicy::Type type = GetResizePolicy( Dimension::WIDTH );
       if( Scripting::GetEnumerationProperty< ResizePolicy::Type >( property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type ) )
       {
         SetResizePolicy( type, Dimension::WIDTH );
@@ -2852,7 +2596,7 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr
 
     case Dali::Actor::Property::HEIGHT_RESIZE_POLICY:
     {
-      ResizePolicy::Type type = static_cast< ResizePolicy::Type >( -1 ); // Set to invalid number so it definitely gets set.
+      ResizePolicy::Type type = GetResizePolicy( Dimension::HEIGHT );
       if( Scripting::GetEnumerationProperty< ResizePolicy::Type >( property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type ) )
       {
         SetResizePolicy( type, Dimension::HEIGHT );
@@ -2862,7 +2606,7 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr
 
     case Dali::Actor::Property::SIZE_SCALE_POLICY:
     {
-      SizeScalePolicy::Type type;
+      SizeScalePolicy::Type type = GetSizeScalePolicy();
       if( Scripting::GetEnumeration< SizeScalePolicy::Type >( property.Get< std::string >().c_str(), SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT, type ) )
       {
         SetSizeScalePolicy( type );
@@ -2929,10 +2673,7 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr
       if( Scripting::GetEnumerationProperty< ClippingMode::Type >( property, CLIPPING_MODE_TABLE, CLIPPING_MODE_TABLE_COUNT, convertedValue ) )
       {
         mClippingMode = convertedValue;
-        if( NULL != mNode )
-        {
-          SetClippingModeMessage( GetEventThreadServices(), *mNode, mClippingMode );
-        }
+        SetClippingModeMessage( GetEventThreadServices(), GetNode(), mClippingMode );
       }
       break;
     }
@@ -2943,10 +2684,7 @@ void Actor::SetDefaultProperty( Property::Index index, const Property::Value& pr
       if( property.Get( value ) && value != mPositionUsesAnchorPoint )
       {
         mPositionUsesAnchorPoint = value;
-        if( NULL != mNode )
-        {
-          SetPositionUsesAnchorPointMessage( GetEventThreadServices(), *mNode, mPositionUsesAnchorPoint );
-        }
+        SetPositionUsesAnchorPointMessage( GetEventThreadServices(), GetNode(), mPositionUsesAnchorPoint );
       }
       break;
     }
@@ -2992,7 +2730,7 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
       DALI_ASSERT_DEBUG( NULL != property );
 
       // property is being used in a separate thread; queue a message to set the property
-      SceneGraph::NodePropertyMessage<bool>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<bool>::Bake, value.Get<bool>() );
+      SceneGraph::NodePropertyMessage<bool>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<bool>::Bake, value.Get<bool>() );
 
       break;
     }
@@ -3003,7 +2741,7 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
       DALI_ASSERT_DEBUG( NULL != property );
 
       // property is being used in a separate thread; queue a message to set the property
-      SceneGraph::NodePropertyMessage<int>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<int>::Bake, value.Get<int>() );
+      SceneGraph::NodePropertyMessage<int>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<int>::Bake, value.Get<int>() );
 
       break;
     }
@@ -3014,7 +2752,7 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
       DALI_ASSERT_DEBUG( NULL != property );
 
       // property is being used in a separate thread; queue a message to set the property
-      SceneGraph::NodePropertyMessage<float>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<float>::Bake, value.Get<float>() );
+      SceneGraph::NodePropertyMessage<float>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<float>::Bake, value.Get<float>() );
 
       break;
     }
@@ -3027,15 +2765,15 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
       // property is being used in a separate thread; queue a message to set the property
       if(entry.componentIndex == 0)
       {
-        SceneGraph::NodePropertyComponentMessage<Vector2>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector2>::BakeX, value.Get<float>() );
+        SceneGraph::NodePropertyComponentMessage<Vector2>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector2>::BakeX, value.Get<float>() );
       }
       else if(entry.componentIndex == 1)
       {
-        SceneGraph::NodePropertyComponentMessage<Vector2>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector2>::BakeY, value.Get<float>() );
+        SceneGraph::NodePropertyComponentMessage<Vector2>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector2>::BakeY, value.Get<float>() );
       }
       else
       {
-        SceneGraph::NodePropertyMessage<Vector2>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector2>::Bake, value.Get<Vector2>() );
+        SceneGraph::NodePropertyMessage<Vector2>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector2>::Bake, value.Get<Vector2>() );
       }
 
       break;
@@ -3049,19 +2787,19 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
       // property is being used in a separate thread; queue a message to set the property
       if(entry.componentIndex == 0)
       {
-        SceneGraph::NodePropertyComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector3>::BakeX, value.Get<float>() );
+        SceneGraph::NodePropertyComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector3>::BakeX, value.Get<float>() );
       }
       else if(entry.componentIndex == 1)
       {
-        SceneGraph::NodePropertyComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector3>::BakeY, value.Get<float>() );
+        SceneGraph::NodePropertyComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector3>::BakeY, value.Get<float>() );
       }
       else if(entry.componentIndex == 2)
       {
-        SceneGraph::NodePropertyComponentMessage<Vector3>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector3>::BakeZ, value.Get<float>() );
+        SceneGraph::NodePropertyComponentMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector3>::BakeZ, value.Get<float>() );
       }
       else
       {
-        SceneGraph::NodePropertyMessage<Vector3>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector3>::Bake, value.Get<Vector3>() );
+        SceneGraph::NodePropertyMessage<Vector3>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector3>::Bake, value.Get<Vector3>() );
       }
 
       break;
@@ -3075,23 +2813,23 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
       // property is being used in a separate thread; queue a message to set the property
       if(entry.componentIndex == 0)
       {
-        SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector4>::BakeX, value.Get<float>() );
+        SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::BakeX, value.Get<float>() );
       }
       else if(entry.componentIndex == 1)
       {
-        SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector4>::BakeY, value.Get<float>() );
+        SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::BakeY, value.Get<float>() );
       }
       else if(entry.componentIndex == 2)
       {
-        SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector4>::BakeZ, value.Get<float>() );
+        SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::BakeZ, value.Get<float>() );
       }
       else if(entry.componentIndex == 3)
       {
-        SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector4>::BakeW, value.Get<float>() );
+        SceneGraph::NodePropertyComponentMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::BakeW, value.Get<float>() );
       }
       else
       {
-        SceneGraph::NodePropertyMessage<Vector4>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<Vector4>::Bake, value.Get<Vector4>() );
+        SceneGraph::NodePropertyMessage<Vector4>::Send( GetEventThreadServices(), &GetNode(), property, &AnimatableProperty<Vector4>::Bake, value.Get<Vector4>() );
       }
 
       break;
@@ -3103,7 +2841,7 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
       DALI_ASSERT_DEBUG( NULL != property );
 
       // property is being used in a separate thread; queue a message to set the property
-      SceneGraph::NodePropertyMessage<Quaternion>::Send( GetEventThreadServices(), mNode, property,&AnimatableProperty<Quaternion>::Bake,  value.Get<Quaternion>() );
+      SceneGraph::NodePropertyMessage<Quaternion>::Send( GetEventThreadServices(), &GetNode(), property,&AnimatableProperty<Quaternion>::Bake,  value.Get<Quaternion>() );
 
       break;
     }
@@ -3114,7 +2852,7 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
       DALI_ASSERT_DEBUG( NULL != property );
 
       // property is being used in a separate thread; queue a message to set the property
-      SceneGraph::NodePropertyMessage<Matrix>::Send( GetEventThreadServices(), mNode, property,&AnimatableProperty<Matrix>::Bake,  value.Get<Matrix>() );
+      SceneGraph::NodePropertyMessage<Matrix>::Send( GetEventThreadServices(), &GetNode(), property,&AnimatableProperty<Matrix>::Bake,  value.Get<Matrix>() );
 
       break;
     }
@@ -3125,7 +2863,7 @@ void Actor::SetSceneGraphProperty( Property::Index index, const PropertyMetadata
       DALI_ASSERT_DEBUG( NULL != property );
 
       // property is being used in a separate thread; queue a message to set the property
-      SceneGraph::NodePropertyMessage<Matrix3>::Send( GetEventThreadServices(), mNode, property,&AnimatableProperty<Matrix3>::Bake,  value.Get<Matrix3>() );
+      SceneGraph::NodePropertyMessage<Matrix3>::Send( GetEventThreadServices(), &GetNode(), property,&AnimatableProperty<Matrix3>::Bake,  value.Get<Matrix3>() );
 
       break;
     }
@@ -3467,128 +3205,65 @@ void Actor::OnNotifyDefaultPropertyAnimation( Animation& animation, Property::In
   }
 }
 
-const SceneGraph::PropertyOwner* Actor::GetPropertyOwner() const
-{
-  return mNode;
-}
-
-const SceneGraph::PropertyOwner* Actor::GetSceneObject() const
-{
-  // This method should only return an object connected to the scene-graph
-  return OnStage() ? mNode : NULL;
-}
-
 const PropertyBase* Actor::GetSceneObjectAnimatableProperty( Property::Index index ) const
 {
-  DALI_ASSERT_ALWAYS( IsPropertyAnimatable( index ) && "Property is not animatable" );
-
   const PropertyBase* property( NULL );
 
-  // This method should only return a property of an object connected to the scene-graph
-  if( !OnStage() )
-  {
-    return property;
-  }
-
-  if ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX && index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )
-  {
-    AnimatablePropertyMetadata* animatable = RegisterAnimatableProperty( index );
-    DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
-
-    property = animatable->GetSceneGraphProperty();
-  }
-  else if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
-            ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
-  {
-    CustomPropertyMetadata* custom = FindCustomProperty( index );
-    DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
-
-    property = custom->GetSceneGraphProperty();
-  }
-  else if( NULL != mNode )
+  switch( index )
   {
-    switch( index )
+    case Dali::Actor::Property::SIZE:        // FALLTHROUGH
+    case Dali::Actor::Property::SIZE_WIDTH:  // FALLTHROUGH
+    case Dali::Actor::Property::SIZE_HEIGHT: // FALLTHROUGH
+    case Dali::Actor::Property::SIZE_DEPTH:
     {
-      case Dali::Actor::Property::SIZE:
-        property = &mNode->mSize;
-        break;
-
-      case Dali::Actor::Property::SIZE_WIDTH:
-        property = &mNode->mSize;
-        break;
-
-      case Dali::Actor::Property::SIZE_HEIGHT:
-        property = &mNode->mSize;
-        break;
-
-      case Dali::Actor::Property::SIZE_DEPTH:
-        property = &mNode->mSize;
-        break;
-
-      case Dali::Actor::Property::POSITION:
-        property = &mNode->mPosition;
-        break;
-
-      case Dali::Actor::Property::POSITION_X:
-        property = &mNode->mPosition;
-        break;
-
-      case Dali::Actor::Property::POSITION_Y:
-        property = &mNode->mPosition;
-        break;
-
-      case Dali::Actor::Property::POSITION_Z:
-        property = &mNode->mPosition;
-        break;
-
-      case Dali::Actor::Property::ORIENTATION:
-        property = &mNode->mOrientation;
-        break;
-
-      case Dali::Actor::Property::SCALE:
-        property = &mNode->mScale;
-        break;
-
-      case Dali::Actor::Property::SCALE_X:
-        property = &mNode->mScale;
-        break;
-
-      case Dali::Actor::Property::SCALE_Y:
-        property = &mNode->mScale;
-        break;
-
-      case Dali::Actor::Property::SCALE_Z:
-        property = &mNode->mScale;
-        break;
-
-      case Dali::Actor::Property::VISIBLE:
-        property = &mNode->mVisible;
-        break;
-
-      case Dali::Actor::Property::COLOR:
-        property = &mNode->mColor;
-        break;
-
-      case Dali::Actor::Property::COLOR_RED:
-        property = &mNode->mColor;
-        break;
-
-      case Dali::Actor::Property::COLOR_GREEN:
-        property = &mNode->mColor;
-        break;
-
-      case Dali::Actor::Property::COLOR_BLUE:
-        property = &mNode->mColor;
-        break;
-
-      case Dali::Actor::Property::COLOR_ALPHA:
-      case Dali::DevelActor::Property::OPACITY:
-        property = &mNode->mColor;
-        break;
-
-      default:
-        break;
+      property = &GetNode().mSize;
+      break;
+    }
+    case Dali::Actor::Property::POSITION:   // FALLTHROUGH
+    case Dali::Actor::Property::POSITION_X: // FALLTHROUGH
+    case Dali::Actor::Property::POSITION_Y: // FALLTHROUGH
+    case Dali::Actor::Property::POSITION_Z:
+    {
+      property = &GetNode().mPosition;
+      break;
+    }
+    case Dali::Actor::Property::ORIENTATION:
+    {
+      property = &GetNode().mOrientation;
+      break;
+    }
+    case Dali::Actor::Property::SCALE:   // FALLTHROUGH
+    case Dali::Actor::Property::SCALE_X: // FALLTHROUGH
+    case Dali::Actor::Property::SCALE_Y: // FALLTHROUGH
+    case Dali::Actor::Property::SCALE_Z:
+    {
+      property = &GetNode().mScale;
+      break;
     }
+    case Dali::Actor::Property::VISIBLE:
+    {
+      property = &GetNode().mVisible;
+      break;
+    }
+    case Dali::Actor::Property::COLOR:       // FALLTHROUGH
+    case Dali::Actor::Property::COLOR_RED:   // FALLTHROUGH
+    case Dali::Actor::Property::COLOR_GREEN: // FALLTHROUGH
+    case Dali::Actor::Property::COLOR_BLUE:  // FALLTHROUGH
+    case Dali::Actor::Property::COLOR_ALPHA: // FALLTHROUGH
+    case Dali::DevelActor::Property::OPACITY:
+    {
+      property = &GetNode().mColor;
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+  if( !property )
+  {
+    // not our property, ask base
+    property = Object::GetSceneObjectAnimatableProperty( index );
   }
 
   return property;
@@ -3598,248 +3273,132 @@ const PropertyInputImpl* Actor::GetSceneObjectInputProperty( Property::Index ind
 {
   const PropertyInputImpl* property( NULL );
 
-  // This method should only return a property of an object connected to the scene-graph
-  if( !OnStage() )
-  {
-    return property;
-  }
-
-  if ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX && index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )
-  {
-    AnimatablePropertyMetadata* animatable = RegisterAnimatableProperty( index );
-    DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
-
-    property = animatable->GetSceneGraphProperty();
-  }
-  else if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
-            ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
-  {
-    CustomPropertyMetadata* custom = FindCustomProperty( index );
-    DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
-    property = custom->GetSceneGraphProperty();
-  }
-  else if( NULL != mNode )
+  switch( index )
   {
-    switch( index )
+    case Dali::Actor::Property::PARENT_ORIGIN:   // FALLTHROUGH
+    case Dali::Actor::Property::PARENT_ORIGIN_X: // FALLTHROUGH
+    case Dali::Actor::Property::PARENT_ORIGIN_Y: // FALLTHROUGH
+    case Dali::Actor::Property::PARENT_ORIGIN_Z:
     {
-      case Dali::Actor::Property::PARENT_ORIGIN:
-        property = &mNode->mParentOrigin;
-        break;
-
-      case Dali::Actor::Property::PARENT_ORIGIN_X:
-        property = &mNode->mParentOrigin;
-        break;
-
-      case Dali::Actor::Property::PARENT_ORIGIN_Y:
-        property = &mNode->mParentOrigin;
-        break;
-
-      case Dali::Actor::Property::PARENT_ORIGIN_Z:
-        property = &mNode->mParentOrigin;
-        break;
-
-      case Dali::Actor::Property::ANCHOR_POINT:
-        property = &mNode->mAnchorPoint;
-        break;
-
-      case Dali::Actor::Property::ANCHOR_POINT_X:
-        property = &mNode->mAnchorPoint;
-        break;
-
-      case Dali::Actor::Property::ANCHOR_POINT_Y:
-        property = &mNode->mAnchorPoint;
-        break;
-
-      case Dali::Actor::Property::ANCHOR_POINT_Z:
-        property = &mNode->mAnchorPoint;
-        break;
-
-      case Dali::Actor::Property::SIZE:
-        property = &mNode->mSize;
-        break;
-
-      case Dali::Actor::Property::SIZE_WIDTH:
-        property = &mNode->mSize;
-        break;
-
-      case Dali::Actor::Property::SIZE_HEIGHT:
-        property = &mNode->mSize;
-        break;
-
-      case Dali::Actor::Property::SIZE_DEPTH:
-        property = &mNode->mSize;
-        break;
-
-      case Dali::Actor::Property::POSITION:
-        property = &mNode->mPosition;
-        break;
-
-      case Dali::Actor::Property::POSITION_X:
-        property = &mNode->mPosition;
-        break;
-
-      case Dali::Actor::Property::POSITION_Y:
-        property = &mNode->mPosition;
-        break;
-
-      case Dali::Actor::Property::POSITION_Z:
-        property = &mNode->mPosition;
-        break;
-
-      case Dali::Actor::Property::WORLD_POSITION:
-        property = &mNode->mWorldPosition;
-        break;
-
-      case Dali::Actor::Property::WORLD_POSITION_X:
-        property = &mNode->mWorldPosition;
-        break;
-
-      case Dali::Actor::Property::WORLD_POSITION_Y:
-        property = &mNode->mWorldPosition;
-        break;
-
-      case Dali::Actor::Property::WORLD_POSITION_Z:
-        property = &mNode->mWorldPosition;
-        break;
-
-      case Dali::Actor::Property::ORIENTATION:
-        property = &mNode->mOrientation;
-        break;
-
-      case Dali::Actor::Property::WORLD_ORIENTATION:
-        property = &mNode->mWorldOrientation;
-        break;
-
-      case Dali::Actor::Property::SCALE:
-        property = &mNode->mScale;
-        break;
-
-      case Dali::Actor::Property::SCALE_X:
-        property = &mNode->mScale;
-        break;
-
-      case Dali::Actor::Property::SCALE_Y:
-        property = &mNode->mScale;
-        break;
-
-      case Dali::Actor::Property::SCALE_Z:
-        property = &mNode->mScale;
-        break;
-
-      case Dali::Actor::Property::WORLD_SCALE:
-        property = &mNode->mWorldScale;
-        break;
-
-      case Dali::Actor::Property::VISIBLE:
-        property = &mNode->mVisible;
-        break;
-
-      case Dali::Actor::Property::COLOR:
-        property = &mNode->mColor;
-        break;
-
-      case Dali::Actor::Property::COLOR_RED:
-        property = &mNode->mColor;
-        break;
-
-      case Dali::Actor::Property::COLOR_GREEN:
-        property = &mNode->mColor;
-        break;
-
-      case Dali::Actor::Property::COLOR_BLUE:
-        property = &mNode->mColor;
-        break;
-
-      case Dali::Actor::Property::COLOR_ALPHA:
-      case Dali::DevelActor::Property::OPACITY:
-      {
-        property = &mNode->mColor;
-        break;
-      }
-
-      case Dali::Actor::Property::WORLD_COLOR:
-        property = &mNode->mWorldColor;
-        break;
-
-      case Dali::Actor::Property::WORLD_MATRIX:
-        property = &mNode->mWorldMatrix;
-        break;
-
-      default:
-        break;
+      property = &GetNode().mParentOrigin;
+      break;
     }
+    case Dali::Actor::Property::ANCHOR_POINT:   // FALLTHROUGH
+    case Dali::Actor::Property::ANCHOR_POINT_X: // FALLTHROUGH
+    case Dali::Actor::Property::ANCHOR_POINT_Y: // FALLTHROUGH
+    case Dali::Actor::Property::ANCHOR_POINT_Z:
+    {
+      property = &GetNode().mAnchorPoint;
+      break;
+    }
+    case Dali::Actor::Property::WORLD_POSITION:   // FALLTHROUGH
+    case Dali::Actor::Property::WORLD_POSITION_X: // FALLTHROUGH
+    case Dali::Actor::Property::WORLD_POSITION_Y: // FALLTHROUGH
+    case Dali::Actor::Property::WORLD_POSITION_Z:
+    {
+      property = &GetNode().mWorldPosition;
+      break;
+    }
+    case Dali::Actor::Property::WORLD_ORIENTATION:
+    {
+      property = &GetNode().mWorldOrientation;
+      break;
+    }
+    case Dali::Actor::Property::WORLD_SCALE:
+    {
+      property = &GetNode().mWorldScale;
+      break;
+    }
+    case Dali::Actor::Property::WORLD_COLOR:
+    {
+      property = &GetNode().mWorldColor;
+      break;
+    }
+    case Dali::Actor::Property::WORLD_MATRIX:
+    {
+      property = &GetNode().mWorldMatrix;
+      break;
+    }
+    case Dali::DevelActor::Property::CULLED:
+    {
+      property = &GetNode().mCulled;
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+  if( !property )
+  {
+    // reuse animatable property getter as animatable properties are inputs as well
+    // animatable property chains back to Object::GetSceneObjectInputProperty() so all properties get covered
+    property = GetSceneObjectAnimatableProperty( index );
   }
 
   return property;
 }
 
-int Actor::GetPropertyComponentIndex( Property::Index index ) const
+int32_t Actor::GetPropertyComponentIndex( Property::Index index ) const
 {
-  int componentIndex( Property::INVALID_COMPONENT_INDEX );
+  int32_t componentIndex = Property::INVALID_COMPONENT_INDEX;
 
-  if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  switch( index )
   {
-    // check whether the animatable property is registered already, if not then register one.
-    AnimatablePropertyMetadata* animatableProperty = RegisterAnimatableProperty(index);
-    if( animatableProperty )
+    case Dali::Actor::Property::PARENT_ORIGIN_X:
+    case Dali::Actor::Property::ANCHOR_POINT_X:
+    case Dali::Actor::Property::SIZE_WIDTH:
+    case Dali::Actor::Property::POSITION_X:
+    case Dali::Actor::Property::WORLD_POSITION_X:
+    case Dali::Actor::Property::SCALE_X:
+    case Dali::Actor::Property::COLOR_RED:
     {
-      componentIndex = animatableProperty->componentIndex;
+      componentIndex = 0;
+      break;
     }
-  }
-  else
-  {
-    switch( index )
-    {
-      case Dali::Actor::Property::PARENT_ORIGIN_X:
-      case Dali::Actor::Property::ANCHOR_POINT_X:
-      case Dali::Actor::Property::SIZE_WIDTH:
-      case Dali::Actor::Property::POSITION_X:
-      case Dali::Actor::Property::WORLD_POSITION_X:
-      case Dali::Actor::Property::SCALE_X:
-      case Dali::Actor::Property::COLOR_RED:
-      {
-        componentIndex = 0;
-        break;
-      }
 
-      case Dali::Actor::Property::PARENT_ORIGIN_Y:
-      case Dali::Actor::Property::ANCHOR_POINT_Y:
-      case Dali::Actor::Property::SIZE_HEIGHT:
-      case Dali::Actor::Property::POSITION_Y:
-      case Dali::Actor::Property::WORLD_POSITION_Y:
-      case Dali::Actor::Property::SCALE_Y:
-      case Dali::Actor::Property::COLOR_GREEN:
-      {
-        componentIndex = 1;
-        break;
-      }
+    case Dali::Actor::Property::PARENT_ORIGIN_Y:
+    case Dali::Actor::Property::ANCHOR_POINT_Y:
+    case Dali::Actor::Property::SIZE_HEIGHT:
+    case Dali::Actor::Property::POSITION_Y:
+    case Dali::Actor::Property::WORLD_POSITION_Y:
+    case Dali::Actor::Property::SCALE_Y:
+    case Dali::Actor::Property::COLOR_GREEN:
+    {
+      componentIndex = 1;
+      break;
+    }
 
-      case Dali::Actor::Property::PARENT_ORIGIN_Z:
-      case Dali::Actor::Property::ANCHOR_POINT_Z:
-      case Dali::Actor::Property::SIZE_DEPTH:
-      case Dali::Actor::Property::POSITION_Z:
-      case Dali::Actor::Property::WORLD_POSITION_Z:
-      case Dali::Actor::Property::SCALE_Z:
-      case Dali::Actor::Property::COLOR_BLUE:
-      {
-        componentIndex = 2;
-        break;
-      }
+    case Dali::Actor::Property::PARENT_ORIGIN_Z:
+    case Dali::Actor::Property::ANCHOR_POINT_Z:
+    case Dali::Actor::Property::SIZE_DEPTH:
+    case Dali::Actor::Property::POSITION_Z:
+    case Dali::Actor::Property::WORLD_POSITION_Z:
+    case Dali::Actor::Property::SCALE_Z:
+    case Dali::Actor::Property::COLOR_BLUE:
+    {
+      componentIndex = 2;
+      break;
+    }
 
-      case Dali::Actor::Property::COLOR_ALPHA:
-      case Dali::DevelActor::Property::OPACITY:
-      {
-        componentIndex = 3;
-        break;
-      }
+    case Dali::Actor::Property::COLOR_ALPHA:
+    case Dali::DevelActor::Property::OPACITY:
+    {
+      componentIndex = 3;
+      break;
+    }
 
-      default:
-      {
-        // Do nothing
-        break;
-      }
+    default:
+    {
+      // Do nothing
+      break;
     }
   }
+  if( Property::INVALID_COMPONENT_INDEX == componentIndex )
+  {
+    // ask base
+    componentIndex = Object::GetPropertyComponentIndex( index );
+  }
 
   return componentIndex;
 }
@@ -3852,6 +3411,8 @@ void Actor::SetParent( Actor* parent )
 
     mParent = parent;
 
+    mScene = parent->mScene;
+
     if ( EventThreadServices::IsCoreRunning() && // Don't emit signals or send messages during Core destruction
          parent->OnStage() )
     {
@@ -3871,23 +3432,15 @@ void Actor::SetParent( Actor* parent )
     if ( EventThreadServices::IsCoreRunning() && // Don't emit signals or send messages during Core destruction
          OnStage() )
     {
-      DALI_ASSERT_ALWAYS( mNode != NULL );
-
-      if( NULL != mNode )
-      {
-        // Disconnect the Node & its children from the scene-graph.
-        DisconnectNodeMessage( GetEventThreadServices().GetUpdateManager(), *mNode );
-      }
+      // Disconnect the Node & its children from the scene-graph.
+      DisconnectNodeMessage( GetEventThreadServices().GetUpdateManager(), GetNode() );
 
       // Instruct each actor to discard pointers to the scene-graph
       DisconnectFromStage();
     }
-  }
-}
 
-SceneGraph::Node* Actor::CreateNode() const
-{
-  return Node::New();
+    mScene = nullptr;
+  }
 }
 
 bool Actor::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& /* attributes */ )
@@ -4123,12 +3676,6 @@ bool Actor::GetCachedPropertyValue( Property::Index index, Property::Value& valu
       break;
     }
 
-    case Dali::Actor::Property::POSITION_INHERITANCE:
-    {
-      value = Scripting::GetLinearEnumerationName< PositionInheritanceMode >( GetPositionInheritanceMode(), POSITION_INHERITANCE_MODE_TABLE, POSITION_INHERITANCE_MODE_TABLE_COUNT );
-      break;
-    }
-
     case Dali::Actor::Property::DRAW_MODE:
     {
       value = Scripting::GetEnumerationName< DrawMode::Type >( GetDrawMode(), DRAW_MODE_TABLE, DRAW_MODE_TABLE_COUNT );
@@ -4407,6 +3954,12 @@ bool Actor::GetCurrentPropertyValue( Property::Index index, Property::Value& val
       break;
     }
 
+    case DevelActor::Property::CULLED:
+    {
+      value = GetNode().IsCulled( GetEventThreadServices().GetEventBufferIndex() );
+      break;
+    }
+
     default:
     {
       // Must be an event-side only property
@@ -4430,7 +3983,7 @@ void Actor::EnsureRelayoutData()
 bool Actor::RelayoutDependentOnParent( Dimension::Type dimension )
 {
   // Check if actor is dependent on parent
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( ( dimension & ( 1 << i ) ) )
     {
@@ -4448,7 +4001,7 @@ bool Actor::RelayoutDependentOnParent( Dimension::Type dimension )
 bool Actor::RelayoutDependentOnChildren( Dimension::Type dimension )
 {
   // Check if actor is dependent on children
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( ( dimension & ( 1 << i ) ) )
     {
@@ -4480,7 +4033,7 @@ bool Actor::RelayoutDependentOnChildrenBase( Dimension::Type dimension )
 bool Actor::RelayoutDependentOnDimension( Dimension::Type dimension, Dimension::Type dependentDimension )
 {
   // Check each possible dimension and see if it is dependent on the input one
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -4493,7 +4046,7 @@ bool Actor::RelayoutDependentOnDimension( Dimension::Type dimension, Dimension::
 
 void Actor::SetNegotiatedDimension( float negotiatedDimension, Dimension::Type dimension )
 {
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -4505,7 +4058,7 @@ void Actor::SetNegotiatedDimension( float negotiatedDimension, Dimension::Type d
 float Actor::GetNegotiatedDimension( Dimension::Type dimension ) const
 {
   // If more than one dimension is requested, just return the first one found
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( ( dimension & ( 1 << i ) ) )
     {
@@ -4520,7 +4073,7 @@ void Actor::SetPadding( const Vector2& padding, Dimension::Type dimension )
 {
   EnsureRelayoutData();
 
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -4534,7 +4087,7 @@ Vector2 Actor::GetPadding( Dimension::Type dimension ) const
   if ( mRelayoutData )
   {
     // If more than one dimension is requested, just return the first one found
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       if( ( dimension & ( 1 << i ) ) )
       {
@@ -4550,7 +4103,7 @@ void Actor::SetLayoutNegotiated( bool negotiated, Dimension::Type dimension )
 {
   EnsureRelayoutData();
 
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -4563,7 +4116,7 @@ bool Actor::IsLayoutNegotiated( Dimension::Type dimension ) const
 {
   if ( mRelayoutData )
   {
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       if( ( dimension & ( 1 << i ) ) && mRelayoutData->dimensionNegotiated[ i ] )
       {
@@ -4683,7 +4236,7 @@ float Actor::NegotiateFromChildren( Dimension::Type dimension )
 {
   float maxDimensionPoint = 0.0f;
 
-  for( unsigned int i = 0, count = GetChildCount(); i < count; ++i )
+  for( uint32_t i = 0, count = GetChildCount(); i < count; ++i )
   {
     ActorPtr child = GetChildAt( i );
 
@@ -4798,7 +4351,7 @@ void Actor::NegotiateDimension( Dimension::Type dimension, const Vector2& alloca
       recursionStack.push_back( ActorDimensionPair( this, dimension ) );
 
       // Dimension dependency check
-      for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+      for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
       {
         Dimension::Type dimensionToCheck = static_cast< Dimension::Type >( 1 << i );
 
@@ -4818,7 +4371,7 @@ void Actor::NegotiateDimension( Dimension::Type dimension, const Vector2& alloca
       // Children dependency check
       if( RelayoutDependentOnChildren( dimension ) )
       {
-        for( unsigned int i = 0, count = GetChildCount(); i < count; ++i )
+        for( uint32_t i = 0, count = GetChildCount(); i < count; ++i )
         {
           ActorPtr child = GetChildAt( i );
 
@@ -4858,7 +4411,7 @@ void Actor::NegotiateDimensions( const Vector2& allocatedSize )
   // Negotiate all dimensions that require it
   ActorDimensionStack recursionStack;
 
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     const Dimension::Type dimension = static_cast< Dimension::Type >( 1 << i );
 
@@ -4989,7 +4542,7 @@ void Actor::NegotiateSize( const Vector2& allocatedSize, RelayoutContainer& cont
   SetNegotiatedSize( container );
 
   // Negotiate down to children
-  for( unsigned int i = 0, count = GetChildCount(); i < count; ++i )
+  for( uint32_t i = 0, count = GetChildCount(); i < count; ++i )
   {
     ActorPtr child = GetChildAt( i );
 
@@ -5020,7 +4573,7 @@ void Actor::SetUseAssignedSize( bool use, Dimension::Type dimension )
 {
   if( mRelayoutData )
   {
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       if( dimension & ( 1 << i ) )
       {
@@ -5035,7 +4588,7 @@ bool Actor::GetUseAssignedSize( Dimension::Type dimension ) const
   if ( mRelayoutData )
   {
     // If more than one dimension is requested, just return the first one found
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       if( dimension & ( 1 << i ) )
       {
@@ -5098,7 +4651,7 @@ void Actor::SetMinimumSize( float size, Dimension::Type dimension )
 {
   EnsureRelayoutData();
 
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -5113,7 +4666,7 @@ float Actor::GetMinimumSize( Dimension::Type dimension ) const
 {
   if ( mRelayoutData )
   {
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       if( dimension & ( 1 << i ) )
       {
@@ -5129,7 +4682,7 @@ void Actor::SetMaximumSize( float size, Dimension::Type dimension )
 {
   EnsureRelayoutData();
 
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -5144,7 +4697,7 @@ float Actor::GetMaximumSize( Dimension::Type dimension ) const
 {
   if ( mRelayoutData )
   {
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       if( dimension & ( 1 << i ) )
       {
@@ -5165,10 +4718,10 @@ void Actor::SetVisibleInternal( bool visible, SendMessage::Type sendMessage )
 {
   if( mVisible != visible )
   {
-    if( sendMessage == SendMessage::TRUE && NULL != mNode )
+    if( sendMessage == SendMessage::TRUE )
     {
-      // mNode is being used in a separate thread; queue a message to set the value & base value
-      SceneGraph::NodePropertyMessage<bool>::Send( GetEventThreadServices(), mNode, &mNode->mVisible, &AnimatableProperty<bool>::Bake, visible );
+      // node is being used in a separate thread; queue a message to set the value & base value
+      SceneGraph::NodePropertyMessage<bool>::Send( GetEventThreadServices(), &GetNode(), &GetNode().mVisible, &AnimatableProperty<bool>::Bake, visible );
     }
 
     mVisible = visible;
@@ -5178,12 +4731,12 @@ void Actor::SetVisibleInternal( bool visible, SendMessage::Type sendMessage )
   }
 }
 
-void Actor::SetSiblingOrder( unsigned int order )
+void Actor::SetSiblingOrder( uint32_t order )
 {
   if ( mParent )
   {
     ActorContainer& siblings = *(mParent->mChildren);
-    unsigned int currentOrder = GetSiblingOrder();
+    uint32_t currentOrder = GetSiblingOrder();
 
     if( order != currentOrder )
     {
@@ -5210,18 +4763,18 @@ void Actor::SetSiblingOrder( unsigned int order )
   }
 }
 
-unsigned int Actor::GetSiblingOrder() const
+uint32_t Actor::GetSiblingOrder() const
 {
-  unsigned int order = 0;
+  uint32_t order = 0;
 
   if ( mParent )
   {
     ActorContainer& siblings = *(mParent->mChildren);
-    for( size_t i=0; i<siblings.size(); ++i )
+    for( std::size_t i = 0; i < siblings.size(); ++i )
     {
       if( siblings[i] == this )
       {
-        order = i;
+        order = static_cast<uint32_t>( i );
         break;
       }
     }
@@ -5234,10 +4787,9 @@ void Actor::RequestRebuildDepthTree()
 {
   if( mIsOnStage )
   {
-    StagePtr stage = Stage::GetCurrent();
-    if( stage )
+    if( mScene )
     {
-      stage->RequestRebuildDepthTree();
+      mScene->RequestRebuildDepthTree();
     }
   }
 }
@@ -5249,7 +4801,7 @@ void Actor::Raise()
     ActorContainer& siblings = *(mParent->mChildren);
     if( siblings.back() != this ) // If not already at end
     {
-      for( size_t i=0; i<siblings.size(); ++i )
+      for( std::size_t i=0; i<siblings.size(); ++i )
       {
         if( siblings[i] == this )
         {
@@ -5261,6 +4813,10 @@ void Actor::Raise()
         }
       }
     }
+
+    Dali::Actor handle( this );
+    mParent->mChildOrderChangedSignal.Emit( handle );
+
     RequestRebuildDepthTree();
   }
   else
@@ -5276,7 +4832,7 @@ void Actor::Lower()
     ActorContainer& siblings = *(mParent->mChildren);
     if( siblings.front() != this ) // If not already at beginning
     {
-      for( size_t i=1; i<siblings.size(); ++i )
+      for( std::size_t i=1; i<siblings.size(); ++i )
       {
         if( siblings[i] == this )
         {
@@ -5288,6 +4844,10 @@ void Actor::Lower()
         }
       }
     }
+
+    Dali::Actor handle( this );
+    mParent->mChildOrderChangedSignal.Emit( handle );
+
     RequestRebuildDepthTree();
   }
   else
@@ -5310,6 +4870,10 @@ void Actor::RaiseToTop()
         siblings.push_back(ActorPtr(this));
       }
     }
+
+    Dali::Actor handle( this );
+    mParent->mChildOrderChangedSignal.Emit( handle );
+
     RequestRebuildDepthTree();
   }
   else
@@ -5334,6 +4898,10 @@ void Actor::LowerToBottom()
         siblings.insert(siblings.begin(), thisPtr);
       }
     }
+
+    Dali::Actor handle( this );
+    mParent->mChildOrderChangedSignal.Emit( handle );
+
     RequestRebuildDepthTree();
   }
   else
@@ -5362,6 +4930,10 @@ void Actor::RaiseAbove( Internal::Actor& target )
         ++targetIter;
         siblings.insert(targetIter, thisPtr);
       }
+
+      Dali::Actor handle( this );
+      mParent->mChildOrderChangedSignal.Emit( handle );
+
       RequestRebuildDepthTree();
     }
   }
@@ -5388,6 +4960,10 @@ void Actor::LowerBelow( Internal::Actor& target )
         siblings.erase(thisIter); // this only invalidates iterators at or after this point.
         siblings.insert(targetIter, thisPtr);
       }
+
+      Dali::Actor handle( this );
+      mParent->mChildOrderChangedSignal.Emit( handle );
+
       RequestRebuildDepthTree();
     }
   }
@@ -5397,6 +4973,16 @@ void Actor::LowerBelow( Internal::Actor& target )
   }
 }
 
+void Actor::SetScene( Scene& scene )
+{
+  mScene = &scene;
+}
+
+Scene& Actor::GetScene() const
+{
+  return *mScene;
+}
+
 void Actor::SetInheritLayoutDirection( bool inherit )
 {
   if( mInheritLayoutDirection != inherit )
@@ -5419,7 +5005,7 @@ void Actor::InheritLayoutDirectionRecursively( ActorPtr actor, Dali::LayoutDirec
 {
   if( actor && ( actor->mInheritLayoutDirection || set ) )
   {
-    if( actor->mLayoutDirection != direction)
+    if( actor->mLayoutDirection != direction )
     {
       actor->mLayoutDirection = direction;
       actor->EmitLayoutDirectionChangedSignal( direction );
old mode 100644 (file)
new mode 100755 (executable)
index b9734c7..800288a
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ACTOR_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,6 +54,7 @@ class ActorGestureData;
 class Animation;
 class RenderTask;
 class Renderer;
+class Scene;
 
 typedef std::vector< ActorPtr > ActorContainer;
 typedef ActorContainer::iterator ActorIter;
@@ -122,6 +123,12 @@ public:
   static ActorPtr New();
 
   /**
+   * Helper to create node for derived classes who don't have their own node type
+   * @return pointer to newly created unique node
+   */
+  static const SceneGraph::Node* CreateNode();
+
+  /**
    * Retrieve the name of the actor.
    * @return The name.
    */
@@ -136,7 +143,7 @@ public:
   /**
    * @copydoc Dali::Actor::GetId
    */
-  unsigned int GetId() const;
+  uint32_t GetId() const;
 
   // Containment
 
@@ -205,12 +212,12 @@ public:
    * Retrieve the number of children held by the actor.
    * @return The number of children
    */
-  unsigned int GetChildCount() const;
+  uint32_t GetChildCount() const;
 
   /**
    * @copydoc Dali::Actor::GetChildAt
    */
-  ActorPtr GetChildAt( unsigned int index ) const;
+  ActorPtr GetChildAt( uint32_t index ) const;
 
   /**
    * Retrieve a reference to Actor's children.
@@ -231,7 +238,7 @@ public:
   /**
    * @copydoc Dali::Actor::FindChildById
    */
-  ActorPtr FindChildById( const unsigned int id );
+  ActorPtr FindChildById( const uint32_t id );
 
   /**
    * Retrieve the parent of an Actor.
@@ -463,16 +470,6 @@ public:
   const Vector3& GetCurrentWorldPosition() const;
 
   /**
-   * @copydoc Dali::Actor::SetPositionInheritanceMode()
-   */
-  void SetPositionInheritanceMode( PositionInheritanceMode mode );
-
-  /**
-   * @copydoc Dali::Actor::GetPositionInheritanceMode()
-   */
-  PositionInheritanceMode GetPositionInheritanceMode() const;
-
-  /**
    * @copydoc Dali::Actor::SetInheritPosition()
    */
   void SetInheritPosition( bool inherit );
@@ -750,11 +747,11 @@ public:
   /**
    * @copydoc Dali::Actor::GetHierarchyDepth()
    */
-  inline int GetHierarchyDepth() const
+  inline int32_t GetHierarchyDepth() const
   {
     if( mIsOnStage )
     {
-      return static_cast<int>(mDepth);
+      return mDepth;
     }
 
     return -1;
@@ -765,7 +762,7 @@ public:
    *
    * @return The depth used for hit-testing and renderer sorting
    */
-  unsigned int GetSortingDepth();
+  uint32_t GetSortingDepth();
 
 public:
 
@@ -1226,17 +1223,17 @@ public:
   /**
    * @copydoc Dali::Actor::AddRenderer()
    */
-  unsigned int AddRenderer( Renderer& renderer );
+  uint32_t AddRenderer( Renderer& renderer );
 
   /**
    * @copydoc Dali::Actor::GetRendererCount()
    */
-  unsigned int GetRendererCount() const;
+  uint32_t GetRendererCount() const;
 
   /**
    * @copydoc Dali::Actor::GetRendererAt()
    */
-  RendererPtr GetRendererAt( unsigned int index );
+  RendererPtr GetRendererAt( uint32_t index );
 
   /**
    * @copydoc Dali::Actor::RemoveRenderer()
@@ -1246,7 +1243,7 @@ public:
   /**
    * @copydoc Dali::Actor::RemoveRenderer()
    */
-  void RemoveRenderer( unsigned int index );
+  void RemoveRenderer( uint32_t index );
 
 public:
 
@@ -1492,6 +1489,11 @@ public:
   DevelActor::ChildChangedSignalType& ChildRemovedSignal();
 
   /**
+   * @copydoc DevelActor::ChildOrderChangedSignal
+   */
+  DevelActor::ChildOrderChangedSignalType& ChildOrderChangedSignal();
+
+  /**
    * Connects a callback function with the object's signals.
    * @param[in] object The object providing the signal.
    * @param[in] tracker Used to disconnect the signal.
@@ -1538,8 +1540,9 @@ protected:
    * Protected Constructor.  See Actor::New().
    * The second-phase construction Initialize() member should be called immediately after this.
    * @param[in] derivedType The derived type of actor (if any).
+   * @param[in] reference to the node
    */
-  Actor( DerivedType derivedType );
+  Actor( DerivedType derivedType, const SceneGraph::Node& node );
 
   /**
    * Second-phase constructor. Must be called immediately after creating a new Actor;
@@ -1555,7 +1558,7 @@ protected:
    * Called on a child during Add() when the parent actor is connected to the Stage.
    * @param[in] parentDepth The depth of the parent in the hierarchy.
    */
-  void ConnectToStage( unsigned int parentDepth );
+  void ConnectToStage( uint32_t parentDepth );
 
   /**
    * Helper for ConnectToStage, to recursively connect a tree of actors.
@@ -1563,7 +1566,7 @@ protected:
    * @param[in]  depth The depth in the hierarchy of the actor
    * @param[out] connectionList On return, the list of connected actors which require notification.
    */
-  void RecursiveConnectToStage( ActorContainer& connectionList, unsigned int depth );
+  void RecursiveConnectToStage( ActorContainer& connectionList, uint32_t depth );
 
   /**
    * Connect the Node associated with this Actor to the scene-graph.
@@ -1618,53 +1621,13 @@ protected:
    * @param[in] sceneGraphNodeDepths A vector capturing the nodes and their depth index
    * @param[in,out] depthIndex The current depth index (traversal index)
    */
-  void DepthTraverseActorTree( OwnerPointer<SceneGraph::NodeDepths>& sceneGraphNodeDepths, int& depthIndex );
+  void DepthTraverseActorTree( OwnerPointer<SceneGraph::NodeDepths>& sceneGraphNodeDepths, int32_t& depthIndex );
 
 public:
 
   // Default property extensions from Object
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex( const std::string& name ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType( Property::Index index ) const;
-
-  /**
    * @copydoc Dali::Internal::Object::SetDefaultProperty()
    */
   virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue );
@@ -1690,16 +1653,6 @@ public:
   virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType );
 
   /**
-   * @copydoc Dali::Internal::Object::GetPropertyOwner()
-   */
-  virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
-  /**
    * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
    */
   virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
@@ -1712,7 +1665,16 @@ public:
   /**
    * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
    */
-  virtual int GetPropertyComponentIndex( Property::Index index ) const;
+  virtual int32_t GetPropertyComponentIndex( Property::Index index ) const;
+
+  /**
+   * Retrieve the actor's node.
+   * @return The node used by this actor
+   */
+  const SceneGraph::Node& GetNode() const
+  {
+    return *static_cast<const SceneGraph::Node*>( mUpdateObject );
+  }
 
   /**
    * @copydoc Dali::DevelActor::Raise()
@@ -1744,6 +1706,20 @@ public:
    */
   void LowerBelow( Internal::Actor& target );
 
+public:
+
+  /**
+   * Sets the scene which this actor is added to.
+   * @param[in] scene The scene
+   */
+  void SetScene( Scene& scene );
+
+  /**
+   * Gets the scene which this actor is added to.
+   * @return The scene
+   */
+  Scene& GetScene() const;
+
 private:
 
   struct SendMessage
@@ -1756,11 +1732,9 @@ private:
   };
 
   // Remove default constructor and copy constructor
-  Actor()=delete;
-  Actor( const Actor& )=delete;
-
-  // Undefined
-  Actor& operator=( const Actor& rhs );
+  Actor() = delete;
+  Actor( const Actor& ) = delete;
+  Actor& operator=( const Actor& rhs ) = delete;
 
   /**
    * Set the actors parent.
@@ -1769,13 +1743,6 @@ private:
   void SetParent( Actor* parent );
 
   /**
-   * Helper to create a Node for this Actor.
-   * To be overriden in derived classes.
-   * @return A newly allocated node.
-   */
-  virtual SceneGraph::Node* CreateNode() const;
-
-  /**
    * For use in derived classes, called after Initialize()
    */
   virtual void OnInitialize()
@@ -1913,13 +1880,13 @@ private:
    * @param[in] order The sibling order this Actor should be. It will place
    * the actor at this index in it's parent's child array.
    */
-  void SetSiblingOrder( unsigned int order);
+  void SetSiblingOrder( uint32_t order);
 
   /**
    * Get Sibling order
    * @return the order of this actor amongst it's siblings
    */
-  unsigned int GetSiblingOrder() const;
+  uint32_t GetSiblingOrder() const;
 
   /**
    * Request that the stage rebuilds the actor depth indices.
@@ -1961,11 +1928,12 @@ private:
 
 protected:
 
+  Scene* mScene;                  ///< The scene the actor is added to
+
   Actor* mParent;                 ///< Each actor (except the root) can have one parent
   ActorContainer* mChildren;      ///< Container of referenced actors, lazily initialized
   RendererContainer* mRenderers;   ///< Renderer container
 
-  const SceneGraph::Node* mNode;  ///< Not owned
   Vector3* mParentOrigin;         ///< NULL means ParentOrigin::DEFAULT. ParentOrigin is non-animatable
   Vector3* mAnchorPoint;          ///< NULL means AnchorPoint::DEFAULT. AnchorPoint is non-animatable
 
@@ -1986,6 +1954,7 @@ protected:
   Dali::Actor::LayoutDirectionChangedSignalType  mLayoutDirectionChangedSignal;
   DevelActor::ChildChangedSignalType       mChildAddedSignal;
   DevelActor::ChildChangedSignalType       mChildRemovedSignal;
+  DevelActor::ChildOrderChangedSignalType  mChildOrderChangedSignal;
 
   Quaternion      mTargetOrientation; ///< Event-side storage for orientation
   Vector4         mTargetColor;       ///< Event-side storage for color
@@ -1993,12 +1962,9 @@ protected:
   Vector3         mTargetPosition;    ///< Event-side storage for position (not a pointer as most actors will have a position)
   Vector3         mTargetScale;       ///< Event-side storage for scale
 
-  std::string     mName;      ///< Name of the actor
-  unsigned int    mId;        ///< A unique ID to identify the actor starting from 1, and 0 is reserved
-
-  uint32_t mSortedDepth;      ///< The sorted depth index. A combination of tree traversal and sibling order.
-  uint16_t mDepth;            ///< The depth in the hierarchy of the actor. Only 4096 levels of depth are supported
-
+  std::string     mName;              ///< Name of the actor
+  uint32_t        mSortedDepth;       ///< The sorted depth index. A combination of tree traversal and sibling order.
+  int16_t         mDepth;             ///< The depth in the hierarchy of the actor. Only 32,767 levels of depth are supported
 
   const bool mIsRoot                               : 1; ///< Flag to identify the root actor
   const bool mIsLayer                              : 1; ///< Flag to identify that this is a layer
@@ -2017,16 +1983,15 @@ protected:
   bool mPositionUsesAnchorPoint                    : 1; ///< Cached: Whether the position uses the anchor point or not.
   bool mVisible                                    : 1; ///< Cached: Whether the actor is visible or not.
   bool mInheritLayoutDirection                     : 1; ///< Whether the actor inherits the layout direction from parent.
-  LayoutDirection::Type mLayoutDirection  : 1; ///< Layout direction, Left to Right or Right to Left.
-  DrawMode::Type mDrawMode                         : 2; ///< Cached: How the actor and its children should be drawn
-  PositionInheritanceMode mPositionInheritanceMode : 2; ///< Cached: Determines how position is inherited
-  ColorMode mColorMode                             : 2; ///< Cached: Determines whether mWorldColor is inherited
-  ClippingMode::Type mClippingMode                 : 2; ///< Cached: Determines which clipping mode (if any) to use.
+  LayoutDirection::Type mLayoutDirection           : 2; ///< Layout direction, Left to Right or Right to Left.
+  DrawMode::Type mDrawMode                         : 3; ///< Cached: How the actor and its children should be drawn
+  ColorMode mColorMode                             : 3; ///< Cached: Determines whether mWorldColor is inherited
+  ClippingMode::Type mClippingMode                 : 3; ///< Cached: Determines which clipping mode (if any) to use.
 
 private:
 
   static ActorContainer mNullChildren;  ///< Empty container (shared by all actors, returned by GetChildren() const)
-  static unsigned int mActorCounter;    ///< A counter to track the actor instance creation
+
 };
 
 } // namespace Internal
index c8f5d75..ae63c9f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/integration-api/debug.h>
 #include <dali/internal/event/common/property-helper.h>
 #include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
 #include <dali/internal/event/render-tasks/render-task-list-impl.h>
 #include <dali/internal/event/common/projection.h>
+#include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
 
 namespace Dali
@@ -64,7 +66,7 @@ DALI_PROPERTY( "targetPosition",         VECTOR3,  true,    false,   true,   Dal
 DALI_PROPERTY( "projectionMatrix",       MATRIX,   false,   false,   true,   Dali::CameraActor::Property::PROJECTION_MATRIX     )
 DALI_PROPERTY( "viewMatrix",             MATRIX,   false,   false,   true,   Dali::CameraActor::Property::VIEW_MATRIX           )
 DALI_PROPERTY( "invertYAxis",            BOOLEAN,  true,    false,   true,   Dali::CameraActor::Property::INVERT_Y_AXIS         )
-DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, CameraDefaultProperties )
 
 // calculate the far plane distance for a 16bit depth buffer with 4 bits per unit precision
 void CalculateClippingAndZ( float width, float height, float& nearClippingPlane, float& farClippingPlane, float& cameraZ )
@@ -79,7 +81,7 @@ BaseHandle Create()
   return Dali::CameraActor::New();
 }
 
-TypeRegistration mType( typeid( Dali::CameraActor ), typeid( Dali::Actor ), Create );
+TypeRegistration mType( typeid( Dali::CameraActor ), typeid( Dali::Actor ), Create, CameraDefaultProperties );
 
 /**
  * Builds the picking ray in the world reference system from an orthographic camera
@@ -112,8 +114,10 @@ void BuildOrthoPickingRay( const Matrix& viewMatrix,
     DALI_ASSERT_DEBUG( false );
   }
 
-  Vector4 near( screenX - viewport.x, viewport.height - (screenY - viewport.y), 0.f, 1.f );
-  if( !Unproject( near, invViewProjection, viewport.width, viewport.height, rayOrigin ) )
+  Vector4 near( screenX - static_cast<float>( viewport.x ),
+                static_cast<float>( viewport.height ) - (screenY - static_cast<float>( viewport.y ) ),
+                0.f, 1.f );
+  if( !Unproject( near, invViewProjection, static_cast<float>( viewport.width ), static_cast<float>( viewport.height ), rayOrigin ) )
   {
     DALI_ASSERT_DEBUG( false );
   }
@@ -138,7 +142,7 @@ void BuildOrthoPickingRay( const Matrix& viewMatrix,
 
 CameraActorPtr CameraActor::New( const Size& size )
 {
-  CameraActorPtr actor( new CameraActor() );
+  CameraActorPtr actor( new CameraActor( *CreateNode() ) );
 
   // Second-phase construction
   actor->Initialize();
@@ -153,8 +157,8 @@ CameraActorPtr CameraActor::New( const Size& size )
   return actor;
 }
 
-CameraActor::CameraActor()
-: Actor( Actor::BASIC ),
+CameraActor::CameraActor( const SceneGraph::Node& node )
+: Actor( Actor::BASIC, node ),
   mSceneObject( NULL ),
   mTarget( SceneGraph::Camera::DEFAULT_TARGET_POSITION ),
   mType( SceneGraph::Camera::DEFAULT_TYPE ),
@@ -186,7 +190,7 @@ void CameraActor::OnInitialize()
   SceneGraph::Camera* sceneGraphCamera = SceneGraph::Camera::New();
 
   // Store a pointer to this camera node inside the scene-graph camera.
-  sceneGraphCamera->SetNode( mNode );
+  sceneGraphCamera->SetNode( &GetNode() );
 
   mSceneObject = sceneGraphCamera;
   OwnerPointer< SceneGraph::Camera > sceneGraphCameraOwner( sceneGraphCamera );
@@ -366,30 +370,18 @@ bool CameraActor::GetInvertYAxis() const
   return mInvertYAxis;
 }
 
-void CameraActor::SetPerspectiveProjection( const Size& size, const Vector2& stereoBias /* = Vector2::ZERO */ )
+void CameraActor::SetPerspectiveProjection( const Size& size )
 {
-  float width = size.width;
-  float height = size.height;
-
-  if( Size::ZERO == size )
+  if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) )
   {
-    StagePtr stage = Stage::GetCurrent();
-    if( stage )
-    {
-      const Size& stageSize = stage->GetSize();
-
-      width = stageSize.width;
-      height = stageSize.height;
-    }
-  }
-
-  if( ( width < Math::MACHINE_EPSILON_1000 ) || ( height < Math::MACHINE_EPSILON_1000 ) )
-  {
-    // On the stage initialization this method is called but the size has not been set.
-    // There is no point to set any value if width or height is zero.
+    // Not allowed to set the canvas size to be 0.
+    DALI_LOG_ERROR( "Canvas size can not be 0\n" );
     return;
   }
 
+  float width = size.width;
+  float height = size.height;
+
   float nearClippingPlane;
   float farClippingPlane;
   float cameraZ;
@@ -407,13 +399,12 @@ void CameraActor::SetPerspectiveProjection( const Size& size, const Vector2& ste
 
   const float aspectRatio = width / height;
 
+  // sceneObject is being used in a separate thread; queue a message to set
   SetProjectionMode(Dali::Camera::PERSPECTIVE_PROJECTION);
   SetFieldOfView( fieldOfView );
   SetNearClippingPlane( nearClippingPlane );
   SetFarClippingPlane( farClippingPlane );
   SetAspectRatio( aspectRatio );
-  // sceneObject is being used in a separate thread; queue a message to set
-  SetStereoBiasMessage( GetEventThreadServices(), *mSceneObject, stereoBias );
   SetZ( cameraZ );
 }
 
@@ -451,13 +442,15 @@ bool CameraActor::BuildPickingRay( const Vector2& screenCoordinates,
   {
     // Build a picking ray in the world reference system.
     // ray starts from the camera world position
-    rayOrigin = mNode->GetWorldMatrix(0).GetTranslation();
+    rayOrigin = GetNode().GetWorldMatrix(0).GetTranslation();
     rayOrigin.w = 1.0f;
 
     // Transform the touch point from the screen coordinate system to the world coordinates system.
-    Vector4 near( screenCoordinates.x - viewport.x, viewport.height - (screenCoordinates.y - viewport.y), 0.f, 1.f );
+    Vector4 near( screenCoordinates.x - static_cast<float>(viewport.x),
+                  static_cast<float>( viewport.height ) - (screenCoordinates.y - static_cast<float>( viewport.y ) ),
+                  0.f, 1.f );
     const Matrix& inverseViewProjection = mSceneObject->GetInverseViewProjectionMatrix( GetEventThreadServices().GetEventBufferIndex() );
-    success = Unproject( near, inverseViewProjection, viewport.width, viewport.height, near );
+    success = Unproject( near, inverseViewProjection, static_cast<float>( viewport.width ), static_cast<float>( viewport.height ), near );
 
     // Compute the ray's director vector.
     rayDirection.x = near.x - rayOrigin.x;
@@ -509,117 +502,6 @@ const SceneGraph::Camera* CameraActor::GetCamera() const
   return mSceneObject;
 }
 
-unsigned int CameraActor::GetDefaultPropertyCount() const
-{
-  return Actor::GetDefaultPropertyCount() + DEFAULT_PROPERTY_COUNT;
-}
-
-void CameraActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  Actor::GetDefaultPropertyIndices( indices ); // Actor class properties
-
-  indices.Reserve( indices.Size() + DEFAULT_PROPERTY_COUNT );
-
-  int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-  for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
-  {
-    indices.PushBack( index );
-  }
-}
-
-bool CameraActor::IsDefaultPropertyWritable( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::IsDefaultPropertyWritable( index );
-  }
-
-  return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].writable;
-}
-
-bool CameraActor::IsDefaultPropertyAnimatable( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::IsDefaultPropertyAnimatable( index );
-  }
-
-  return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].animatable;
-}
-
-bool CameraActor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::IsDefaultPropertyAConstraintInput( index );
-  }
-
-  return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].constraintInput;
-}
-
-Property::Type CameraActor::GetDefaultPropertyType( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::GetDefaultPropertyType( index );
-  }
-  else
-  {
-    index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-
-    if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-    {
-      return DEFAULT_PROPERTY_DETAILS[index].type;
-    }
-    else
-    {
-      // index out-of-bounds
-      return Property::NONE;
-    }
-  }
-}
-
-const char* CameraActor::GetDefaultPropertyName( Property::Index index ) const
-{
-  if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
-  {
-    return Actor::GetDefaultPropertyName(index);
-  }
-  else
-  {
-    index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-
-    if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-    {
-      return DEFAULT_PROPERTY_DETAILS[index].name;
-    }
-    return NULL;
-  }
-}
-
-Property::Index CameraActor::GetDefaultPropertyIndex(const std::string& name) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in current class' default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_DETAILS[i].name ) ) // dont want to convert rhs to string
-    {
-      index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-      break;
-    }
-  }
-
-  // If not found, check in base class
-  if( Property::INVALID_INDEX == index )
-  {
-    index = Actor::GetDefaultPropertyIndex( name );
-  }
-
-  return index;
-}
-
 void CameraActor::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
 {
   if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
@@ -842,61 +724,28 @@ Property::Value CameraActor::GetDefaultPropertyCurrentValue( Property::Index ind
   return ret;
 }
 
-const SceneGraph::PropertyBase* CameraActor::GetSceneObjectAnimatableProperty( Property::Index index ) const
-{
-  DALI_ASSERT_ALWAYS( IsPropertyAnimatable(index) && "Property is not animatable" );
-
-  const SceneGraph::PropertyBase* property( NULL );
-
-  // This method should only return a property of an object connected to the scene-graph
-  if ( !OnStage() )
-  {
-    return property;
-  }
-
-  // let actor handle animatable properties, we have no animatable properties
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    property = Actor::GetSceneObjectAnimatableProperty(index);
-  }
-
-  return property;
-}
-
 const PropertyInputImpl* CameraActor::GetSceneObjectInputProperty( Property::Index index ) const
 {
   const PropertyInputImpl* property( NULL );
 
-  // This method should only return a property of an object connected to the scene-graph
-  if ( !OnStage() )
+  switch( index )
   {
-    return property;
+    case Dali::CameraActor::Property::PROJECTION_MATRIX:
+    {
+      property = mSceneObject->GetProjectionMatrix();
+      break;
+    }
+    case Dali::CameraActor::Property::VIEW_MATRIX:
+    {
+      property = mSceneObject->GetViewMatrix();
+      break;
+    }
+    // no default on purpose as we chain method up to actor
   }
-
-  // if its an actor default property or a custom property (actor already handles custom properties)
-  if( ( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT ) || ( index >= DEFAULT_PROPERTY_MAX_COUNT ) )
+  if( !property )
   {
     property = Actor::GetSceneObjectInputProperty( index );
   }
-  else
-  {
-    switch( index )
-    {
-      case Dali::CameraActor::Property::PROJECTION_MATRIX:
-      {
-        property = mSceneObject->GetProjectionMatrix();
-        break;
-      }
-      case Dali::CameraActor::Property::VIEW_MATRIX:
-      {
-        property = mSceneObject->GetViewMatrix();
-        break;
-      }
-      default:
-        DALI_LOG_WARNING("Not an input property (%d)\n", index);
-        break;
-    }
-  }
 
   return property;
 }
index a3a4ae6..1694ba3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_CAMERA_ACTOR_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -154,9 +154,8 @@ public:
 
   /**
    * @copydoc Dali::CameraActor::SetPerspectiveProjection()
-   * @param[in] stereoBias The frustum horizontal and vertical offset for stereoscopic cameras
    */
-  void SetPerspectiveProjection( const Size& size, const Vector2& stereoBias = Vector2::ZERO );
+  void SetPerspectiveProjection( const Size& size );
 
   /**
    * @copydoc Dali::CameraActor::SetOrthographicProjection(const Vector2& size);
@@ -199,41 +198,6 @@ public:
 public: // properties
 
   /**
-   * copydoc Dali::Internal::Object
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * copydoc Dali::Internal::Object
-   */
-  virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * copydoc Dali::Internal::Object
-   */
-  virtual Property::Type GetDefaultPropertyType( Property::Index index ) const;
-
-  /**
-   * copydoc Dali::Internal::Object
-   */
-  virtual const char* GetDefaultPropertyName( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
    * copydoc Dali::Internal::Object::SetDefaultProperty()
    */
   virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue );
@@ -249,16 +213,6 @@ public: // properties
   virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
 
   /**
-   * copydoc Dali::Internal::Object
-   */
-  virtual bool IsDefaultPropertyWritable( Property::Index index ) const ;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
-
-  /**
    * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
    */
   virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
@@ -267,8 +221,9 @@ private:
 
   /**
    * Constructor; see also CameraActor::New()
+   * @param node the scene graph node
    */
-  CameraActor();
+  CameraActor( const SceneGraph::Node& node );
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
index 2c709d2..268899d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ namespace Internal
 
 CustomActorPtr CustomActor::New(CustomActorImpl& extension)
 {
-  CustomActorPtr actor(new CustomActor(extension));
+  CustomActorPtr actor(new CustomActor( *CreateNode(), extension));
 
   // Second-phase construction
   extension.Initialize(*actor);
@@ -36,8 +36,8 @@ CustomActorPtr CustomActor::New(CustomActorImpl& extension)
   return actor;
 }
 
-CustomActor::CustomActor(CustomActorImpl& extension)
-: Actor( Actor::BASIC ),
+CustomActor::CustomActor( const SceneGraph::Node& node, CustomActorImpl& extension)
+: Actor( Actor::BASIC, node ),
   mImpl( &extension )
 {
   mDerivedRequiresTouch = extension.RequiresTouchEvents();
index 3b50022..11f17d2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_CUSTOM_ACTOR_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -77,7 +77,7 @@ private:
   /**
    * @copydoc Internal::Actor::OnStageConnectionExternal
    */
-  virtual void OnStageConnectionExternal( int depth )
+  virtual void OnStageConnectionExternal( int32_t depth )
   {
     mImpl->OnStageConnection( depth );
   }
@@ -240,17 +240,17 @@ private:
   /**
    * Private constructor; see also CustomActor::New()
    */
-  CustomActor(CustomActorImpl& extension);
+  CustomActor( const SceneGraph::Node& node, CustomActorImpl& extension );
 
-  // Undefined
-  CustomActor(const CustomActor&);
-
-  // Undefined
-  CustomActor& operator=(const CustomActor& rhs);
+  // no default or copy constructor or assignment
+  CustomActor() = delete;
+  CustomActor( const CustomActor& ) = delete;
+  CustomActor& operator=( const CustomActor& rhs ) = delete;
 
 protected:
 
   CustomActorImplPtr mImpl;
+
 };
 
 } // namespace Internal
index 3e1236b..8040640 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,7 +26,8 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/internal/event/actors/layer-list.h>
 #include <dali/internal/event/common/property-helper.h>
-#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
+#include <dali/internal/event/common/event-thread-services.h>
 
 using Dali::Internal::SceneGraph::UpdateManager;
 
@@ -39,7 +40,7 @@ namespace
 typedef Layer::Behavior Behavior;
 
 DALI_ENUM_TO_STRING_TABLE_BEGIN( BEHAVIOR )
-DALI_ENUM_TO_STRING_WITH_SCOPE( Layer, LAYER_2D )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Layer, LAYER_UI )
 DALI_ENUM_TO_STRING_WITH_SCOPE( Layer, LAYER_3D )
 DALI_ENUM_TO_STRING_TABLE_END( BEHAVIOR )
 
@@ -58,7 +59,7 @@ DALI_PROPERTY_TABLE_BEGIN
 DALI_PROPERTY( "clippingEnable",    BOOLEAN,    true,    false,   true,   Dali::Layer::Property::CLIPPING_ENABLE )
 DALI_PROPERTY( "clippingBox",       RECTANGLE,  true,    false,   true,   Dali::Layer::Property::CLIPPING_BOX    )
 DALI_PROPERTY( "behavior",          STRING,     true,    false,   false,  Dali::Layer::Property::BEHAVIOR        )
-DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, LayerDefaultProperties )
 
 // Actions
 
@@ -72,7 +73,7 @@ BaseHandle Create()
   return Dali::Layer::New();
 }
 
-TypeRegistration mType( typeid( Dali::Layer ), typeid( Dali::Actor ), Create );
+TypeRegistration mType( typeid( Dali::Layer ), typeid( Dali::Actor ), Create, LayerDefaultProperties );
 
 TypeAction a1( mType, ACTION_RAISE, &Layer::DoAction );
 TypeAction a2( mType, ACTION_LOWER, &Layer::DoAction );
@@ -84,7 +85,11 @@ TypeAction a4( mType, ACTION_LOWER_TO_BOTTOM, &Layer::DoAction );
 
 LayerPtr Layer::New()
 {
-  LayerPtr layer( new Layer( Actor::LAYER ) );
+  // create node, nodes are owned by UpdateManager
+  SceneGraph::Layer* layerNode = SceneGraph::Layer::New();
+  OwnerPointer< SceneGraph::Node > transferOwnership( layerNode );
+  AddNodeMessage( EventThreadServices::Get().GetUpdateManager(), transferOwnership );
+  LayerPtr layer( new Layer( Actor::LAYER, *layerNode ) );
 
   // Second-phase construction
   layer->Initialize();
@@ -92,15 +97,14 @@ LayerPtr Layer::New()
   return layer;
 }
 
-LayerPtr Layer::NewRoot( LayerList& layerList, UpdateManager& manager, bool systemLevel )
+LayerPtr Layer::NewRoot( LayerList& layerList, UpdateManager& manager )
 {
-  LayerPtr root( new Layer( Actor::ROOT_LAYER ) );
-
-  // Second-phase construction, keep a raw pointer to the layer node.
-  SceneGraph::Layer* rootLayer = static_cast<SceneGraph::Layer*>( root->CreateNode() );
-  root->mNode = rootLayer;
+  // create node, nodes are owned by UpdateManager
+  SceneGraph::Layer* rootLayer = SceneGraph::Layer::New();
   OwnerPointer< SceneGraph::Layer > transferOwnership( rootLayer );
-  InstallRootMessage( manager, transferOwnership, systemLevel );
+  InstallRootMessage( manager, transferOwnership );
+
+  LayerPtr root( new Layer( Actor::ROOT_LAYER, *rootLayer ) );
 
   // root actor is immediately considered to be on-stage
   root->mIsOnStage = true;
@@ -110,17 +114,18 @@ LayerPtr Layer::NewRoot( LayerList& layerList, UpdateManager& manager, bool syst
 
   // layer-list must be set for the root layer
   root->mLayerList = &layerList;
+  layerList.SetRootLayer( &(*root) );
   layerList.RegisterLayer( *root );
 
   return root;
 }
 
-Layer::Layer( Actor::DerivedType type )
-: Actor( type ),
+Layer::Layer( Actor::DerivedType type, const SceneGraph::Layer& layer )
+: Actor( type, layer ),
   mLayerList( NULL ),
   mClippingBox( 0, 0, 0, 0 ),
   mSortFunction( Layer::ZValue ),
-  mBehavior( Dali::Layer::LAYER_2D ),
+  mBehavior( Dali::Layer::LAYER_UI ),
   mIsClipping( false ),
   mDepthTestDisabled( true ),
   mTouchConsumed( false ),
@@ -163,7 +168,7 @@ void Layer::RaiseAbove( const Internal::Layer& target )
   if( ( this != &target ) && OnStage() && target.OnStage() )
   {
     // get parameters depth
-    const unsigned int targetDepth = target.GetDepth();
+    const uint32_t targetDepth = target.GetDepth();
     if( GetDepth() < targetDepth )
     {
       MoveAbove( target );
@@ -177,7 +182,7 @@ void Layer::LowerBelow( const Internal::Layer& target )
   if( ( this != &target ) && OnStage() && target.OnStage() )
   {
     // get parameters depth
-    const unsigned int targetDepth = target.GetDepth();
+    const uint32_t targetDepth = target.GetDepth();
     if( GetDepth() > targetDepth )
     {
       MoveBelow( target );
@@ -225,8 +230,8 @@ void Layer::SetBehavior( Dali::Layer::Behavior behavior )
 
   // Notify update side object.
   SetBehaviorMessage( GetEventThreadServices(), GetSceneLayerOnStage(), behavior );
-  // By default, disable depth test for LAYER_2D, and enable for LAYER_3D.
-  SetDepthTestDisabled( mBehavior == Dali::Layer::LAYER_2D );
+  // By default, disable depth test for LAYER_UI, and enable for LAYER_3D.
+  SetDepthTestDisabled( mBehavior == Dali::Layer::LAYER_UI );
 }
 
 void Layer::SetClipping(bool enabled)
@@ -253,10 +258,9 @@ void Layer::SetClippingBox(int x, int y, int width, int height)
     // Convert mClippingBox to GL based coordinates (from bottom-left)
     ClippingBox clippingBox( mClippingBox );
 
-    StagePtr stage = Stage::GetCurrent();
-    if( stage )
+    if( mScene )
     {
-      clippingBox.y = stage->GetSize().height - clippingBox.y - clippingBox.height;
+      clippingBox.y = static_cast<int32_t>( mScene->GetSize().height ) - clippingBox.y - clippingBox.height;
 
       // layerNode is being used in a separate thread; queue a message to set the value
       SetClippingBoxMessage( GetEventThreadServices(), GetSceneLayerOnStage(), clippingBox );
@@ -312,11 +316,6 @@ bool Layer::IsHoverConsumed() const
   return mHoverConsumed;
 }
 
-SceneGraph::Node* Layer::CreateNode() const
-{
-  return SceneGraph::Layer::New();
-}
-
 void Layer::OnStageConnectionInternal()
 {
   if ( !mIsRoot )
@@ -324,7 +323,6 @@ void Layer::OnStageConnectionInternal()
     DALI_ASSERT_DEBUG( NULL == mLayerList );
 
     // Find the ordered layer-list
-    // This is different for Layers added via Integration::GetSystemOverlay()
     for ( Actor* parent = mParent; parent != NULL; parent = parent->GetParent() )
     {
       if( parent->IsLayer() )
@@ -349,112 +347,7 @@ void Layer::OnStageDisconnectionInternal()
 
 const SceneGraph::Layer& Layer::GetSceneLayerOnStage() const
 {
-  DALI_ASSERT_DEBUG( mNode != NULL );
-  return dynamic_cast< const SceneGraph::Layer& >( *mNode );
-}
-
-unsigned int Layer::GetDefaultPropertyCount() const
-{
-  return Actor::GetDefaultPropertyCount() + DEFAULT_PROPERTY_COUNT;
-}
-
-void Layer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  Actor::GetDefaultPropertyIndices( indices ); // Actor class properties
-  indices.Reserve( indices.Size() + DEFAULT_PROPERTY_COUNT );
-
-  int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-  for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
-  {
-    indices.PushBack( index );
-  }
-}
-
-bool Layer::IsDefaultPropertyWritable( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::IsDefaultPropertyWritable( index );
-  }
-
-  return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].writable;
-}
-
-bool Layer::IsDefaultPropertyAnimatable( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::IsDefaultPropertyAnimatable( index );
-  }
-
-  return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].animatable;
-}
-
-bool Layer::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::IsDefaultPropertyAConstraintInput( index );
-  }
-
-  return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX ].constraintInput;
-}
-
-Property::Type Layer::GetDefaultPropertyType( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::GetDefaultPropertyType( index );
-  }
-
-  index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-
-  if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].type;
-  }
-
-  // index out-of-bounds
-  return Property::NONE;
-}
-
-const char* Layer::GetDefaultPropertyName( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::GetDefaultPropertyName( index );
-  }
-
-  index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-  if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].name;
-  }
-
-  return NULL;
-}
-
-Property::Index Layer::GetDefaultPropertyIndex(const std::string& name) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in current class' default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[i];
-    if( 0 == name.compare( property->name ) ) // dont want to convert rhs to string
-    {
-      index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-      break;
-    }
-  }
-  if( Property::INVALID_INDEX == index )
-  {
-    // If not found, check in base class
-    index = Actor::GetDefaultPropertyIndex( name );
-  }
-
-  return index;
+  return static_cast< const SceneGraph::Layer& >( GetNode() ); // we know our node is a layer node
 }
 
 void Layer::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
@@ -474,13 +367,13 @@ void Layer::SetDefaultProperty( Property::Index index, const Property::Value& pr
       }
       case Dali::Layer::Property::CLIPPING_BOX:
       {
-        Rect<int> clippingBox( propertyValue.Get<Rect<int> >() );
+        Rect<int32_t> clippingBox( propertyValue.Get<Rect<int32_t> >() );
         SetClippingBox( clippingBox.x, clippingBox.y, clippingBox.width, clippingBox.height );
         break;
       }
       case Dali::Layer::Property::BEHAVIOR:
       {
-        Behavior behavior(Dali::Layer::LAYER_2D);
+        Behavior behavior(Dali::Layer::LAYER_UI);
         if( Scripting::GetEnumeration< Behavior >( propertyValue.Get< std::string >().c_str(), BEHAVIOR_TABLE, BEHAVIOR_TABLE_COUNT, behavior ) )
         {
           SetBehavior( behavior );
index c1f3b32..87f00f1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_LAYER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -70,10 +70,9 @@ public:
    * Create a new root layer; this is typically owned by the stage.
    * @param[in] layerList The layer will be added to this ordered list.
    * @param[in] manager The update manager to install a root node with.
-   * @param[in] systemLevel True if using the SystemOverlay API; see Integration::GetSystemOverlay() for more details.
    * @return A smart-pointer to the newly allocated Actor.
    */
-  static LayerPtr NewRoot( LayerList& layerList, SceneGraph::UpdateManager& manager, bool systemLevel );
+  static LayerPtr NewRoot( LayerList& layerList, SceneGraph::UpdateManager& manager );
 
   /**
    * @copydoc Dali::Internal::Actor::OnInitialize
@@ -212,45 +211,6 @@ public:
   static bool DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes);
 
 public: // Default property extensions from Object
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
 
   /**
    * @copydoc Dali::Internal::Object::SetDefaultProperty()
@@ -272,8 +232,9 @@ protected:
   /**
    * Construct a new layer.
    * @param[in] type Either Actor::LAYER or Actor::ROOT_LAYER if this is the root actor.
+   * @param[in] layer the scene graph layer
    */
-  Layer( Actor::DerivedType type );
+  Layer( Actor::DerivedType type, const SceneGraph::Layer& layer );
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
@@ -283,12 +244,6 @@ protected:
 private: // From Actor
 
   /**
-   * From Actor; create a node to represent the layer in the scene-graph.
-   * @return A newly allocated layer node.
-   */
-  virtual SceneGraph::Node* CreateNode() const;
-
-  /**
    * From Actor.
    */
   virtual void OnStageConnectionInternal();
index 82be760..c78c1e9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,30 +60,30 @@ template<class InputIterator> InputIterator Find( InputIterator first, InputIter
 
 } // unnamed namespace
 
-LayerList* LayerList::New( SceneGraph::UpdateManager& updateManager, bool systemLevel )
+LayerList* LayerList::New( SceneGraph::UpdateManager& updateManager )
 {
-  return new LayerList( updateManager, systemLevel );
+  return new LayerList( updateManager );
 }
 
 LayerList::~LayerList()
 {
 }
 
-unsigned int LayerList::GetLayerCount() const
+uint32_t LayerList::GetLayerCount() const
 {
-  return mLayers.size();
+  return static_cast<uint32_t>( mLayers.size() ); //  // only 4,294,967,295 layers supported
 }
 
-Layer* LayerList::GetLayer( unsigned int depth ) const
+Layer* LayerList::GetLayer( uint32_t depth ) const
 {
   DALI_ASSERT_ALWAYS( depth < mLayers.size() );
 
   return mLayers[ depth ];
 }
 
-unsigned int LayerList::GetDepth( const Layer* layer ) const
+uint32_t LayerList::GetDepth( const Layer* layer ) const
 {
-  for( unsigned int count = 0; count < mLayers.size(); ++count )
+  for( uint32_t count = 0; count < mLayers.size(); ++count )
   {
     if( layer == mLayers[ count ] )
     {
@@ -234,9 +234,9 @@ void LayerList::MoveLayerBelow( const Layer& layer, const Layer& target )
   }
 }
 
-LayerList::LayerList( SceneGraph::UpdateManager& updateManager, bool systemLevel )
+LayerList::LayerList( SceneGraph::UpdateManager& updateManager )
 : mUpdateManager( updateManager ),
-  mIsSystemLevel( systemLevel )
+  mRoot( NULL )
 {
 }
 
@@ -255,7 +255,14 @@ void LayerList::SetLayerDepths()
   }
 
   // Layers are being used in a separate thread; queue a message to set order
-  SetLayerDepthsMessage( mUpdateManager, layers, mIsSystemLevel );
+  SetLayerDepthsMessage( mUpdateManager, layers, &( mRoot->GetSceneLayerOnStage() ) );
+}
+
+void LayerList::SetRootLayer(Layer* rootLayer)
+{
+  mRoot = rootLayer;
+
+  SetLayerDepths();
 }
 
 } // namespace Internal
index 22b5bfc..22a18b6 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_LAYER_LIST_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 
@@ -38,7 +41,6 @@ class Layer;
  * An ordered list of layers.
  * Layers are not owned by the LayerList; each layer is responsible for registering & unregistering.
  * This is used by the Stage, to keep track of layer depths.
- * A separate LayerList is maintained for actors added via the SystemOverlay::Add().
  */
 class LayerList
 {
@@ -47,9 +49,8 @@ public:
   /**
    * Create a new list of layers.
    * @param[in] updateManager A reference to the update manager.
-   * @param[in] systemLevel True if the layers are added via the SystemOverlay API.
    */
-  static LayerList* New( SceneGraph::UpdateManager& updateManager, bool systemLevel );
+  static LayerList* New( SceneGraph::UpdateManager& updateManager );
 
   /**
    * Non-virtual destructor; not suitable as a base class.
@@ -60,7 +61,7 @@ public:
    * Query the number of layers.
    * @return The number of layers.
    */
-  unsigned int GetLayerCount() const;
+  uint32_t GetLayerCount() const;
 
   /**
    * Retrieve the layer at a specified depth.
@@ -68,13 +69,13 @@ public:
    * @param[in] depth The depth.
    * @return The layer found at the given depth.
    */
-  Layer* GetLayer( unsigned int depth ) const;
+  Layer* GetLayer( uint32_t depth ) const;
 
   /**
    * Gets the depth of a given layer
    * @param layer which depth to check
    */
-  unsigned int GetDepth( const Layer* layer ) const;
+  uint32_t GetDepth( const Layer* layer ) const;
 
   /**
    * Register a layer with the stage.
@@ -131,14 +132,20 @@ public:
    */
   void MoveLayerBelow( const Layer& layer, const Layer& target );
 
+  /**
+   * Sets the root layer that this layer list belongs to
+   * @pre the root layer is created
+   * @param rootLayer The root layer
+   */
+  void SetRootLayer(Layer* rootLayer);
+
 private:
 
   /**
    * Protected constructor; see also LayerList::New().
    * @param[in] updateManager to send messages.
-   * @param[in] systemLevel True if the layers are added via the SystemOverlay API.
    */
-  LayerList( SceneGraph::UpdateManager& updateManager, bool systemLevel );
+  LayerList( SceneGraph::UpdateManager& updateManager );
 
   /**
    * A private helper method to set the depth for each layer.
@@ -151,7 +158,7 @@ private:
 
   SceneGraph::UpdateManager& mUpdateManager;
 
-  bool mIsSystemLevel; ///< True if the layers are added via the SystemOverlay API.
+  Layer* mRoot;        ///< The root layer that this ordered list of layers belong to
 
   typedef std::vector<Layer*> LayerContainer;
 
index 876c7e6..876ec29 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -82,34 +82,77 @@ const Dali::Animation::EndAction DEFAULT_DISCONNECT_ACTION( Dali::Animation::Bak
 const Dali::Animation::Interpolation DEFAULT_INTERPOLATION( Dali::Animation::Linear );
 const Dali::AlphaFunction DEFAULT_ALPHA_FUNCTION( Dali::AlphaFunction::DEFAULT );
 
-} // anon namespace
-
-
-AnimationPtr Animation::New(float durationSeconds)
+/**
+ * Helper to tell if a property is animatable (if we have animators for it)
+ *
+ * @param type type to check
+ * @return true if animatable
+ */
+inline bool IsAnimatable( Property::Type type )
 {
-  Stage* stage = Stage::GetCurrent();
-
-  if( stage )
+  bool animatable = false;
+  switch( type )
   {
-    AnimationPlaylist& playlist = stage->GetAnimationPlaylist();
-
-    if( durationSeconds < 0.0f )
+    case Property::BOOLEAN :
+    case Property::FLOAT :
+    case Property::INTEGER :
+    case Property::VECTOR2 :
+    case Property::VECTOR3 :
+    case Property::VECTOR4 :
+    case Property::ROTATION :
+    {
+      animatable = true;
+      break;
+    }
+    case Property::MATRIX : // matrix is allowed as a scene graph property but there's no animators for it
+    case Property::MATRIX3 : // matrix3 is allowed as a scene graph property but there's no animators for it
+    case Property::NONE :
+    case Property::RECTANGLE :
+    case Property::STRING :
+    case Property::ARRAY :
+    case Property::MAP :
+    case Property::EXTENTS :
     {
-      DALI_LOG_WARNING("duration should be greater than 0.0f.\n");
-      durationSeconds = 0.0f;
+      break;
     }
+  }
+  return animatable;
+}
+
+/**
+ * Helper to validate animation input values
+ *
+ * @param propertyType type of the property that is being animated
+ * @param destinationType type of the target
+ * @param period time period of the animation
+ */
+void ValidateParameters( Property::Type propertyType, Property::Type destinationType, const TimePeriod& period )
+{
+  // destination value has to be animatable
+  DALI_ASSERT_ALWAYS( IsAnimatable( propertyType ) && "Property type is not animatable" );
+  DALI_ASSERT_ALWAYS( IsAnimatable( destinationType ) && "Target value is not animatable" );
+  DALI_ASSERT_ALWAYS( propertyType == destinationType && "Property and target types don't match" );
+  DALI_ASSERT_ALWAYS( period.durationSeconds >= 0 && "Duration must be >=0" );
+}
 
-    AnimationPtr animation = new Animation( *stage, playlist, durationSeconds, DEFAULT_END_ACTION, DEFAULT_DISCONNECT_ACTION, DEFAULT_ALPHA_FUNCTION );
+} // anonymous namespace
 
-    // Second-phase construction
-    animation->Initialize();
 
-    return animation;
-  }
-  else
+AnimationPtr Animation::New(float durationSeconds)
+{
+  if( durationSeconds < 0.0f )
   {
-    return NULL;
+    DALI_LOG_WARNING("duration should be greater than 0.0f.\n");
+    durationSeconds = 0.0f;
   }
+
+  ThreadLocalStorage& tls = ThreadLocalStorage::Get();
+  AnimationPtr animation = new Animation( tls.GetEventThreadServices(), tls.GetAnimationPlaylist(), durationSeconds, DEFAULT_END_ACTION, DEFAULT_DISCONNECT_ACTION, DEFAULT_ALPHA_FUNCTION );
+
+  // Second-phase construction
+  animation->Initialize();
+
+  return animation;
 }
 
 Animation::Animation( EventThreadServices& eventThreadServices, AnimationPlaylist& playlist, float durationSeconds, EndAction endAction, EndAction disconnectAction, AlphaFunction defaultAlpha )
@@ -187,7 +230,6 @@ void Animation::SetDuration(float seconds)
     seconds = 0.0f;
   }
 
-  // Cache for public getters
   mDurationSeconds = seconds;
 
   // mAnimation is being used in a separate thread; queue a message to set the value
@@ -216,7 +258,7 @@ void Animation::SetLooping(bool on)
   SetLoopCount( on ? 0 : 1 );
 }
 
-void Animation::SetLoopCount(int count)
+void Animation::SetLoopCount(int32_t count)
 {
   // Cache for public getters
   mLoopCount = count;
@@ -225,12 +267,12 @@ void Animation::SetLoopCount(int count)
   SetLoopingMessage( mEventThreadServices, *mAnimation, mLoopCount );
 }
 
-int Animation::GetLoopCount()
+int32_t Animation::GetLoopCount()
 {
   return mLoopCount;
 }
 
-int Animation::GetCurrentLoop()
+int32_t Animation::GetCurrentLoop()
 {
   return mCurrentLoop;
 }
@@ -365,35 +407,30 @@ void Animation::Clear()
   mPlaylist.OnClear( *this );
 }
 
-void Animation::AnimateBy(Property& target, Property::Value& relativeValue)
+void Animation::AnimateBy( Property& target, Property::Value& relativeValue )
 {
-  AnimateBy(target, relativeValue, mDefaultAlpha, TimePeriod(mDurationSeconds));
+  AnimateBy( target, relativeValue, mDefaultAlpha, TimePeriod(mDurationSeconds) );
 }
 
-void Animation::AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha)
+void Animation::AnimateBy( Property& target, Property::Value& relativeValue, AlphaFunction alpha )
 {
-  AnimateBy(target, relativeValue, alpha, TimePeriod(mDurationSeconds));
+  AnimateBy( target, relativeValue, alpha, TimePeriod(mDurationSeconds) );
 }
 
-void Animation::AnimateBy(Property& target, Property::Value& relativeValue, TimePeriod period)
+void Animation::AnimateBy( Property& target, Property::Value& relativeValue, TimePeriod period )
 {
-  AnimateBy(target, relativeValue, mDefaultAlpha, period);
+  AnimateBy( target, relativeValue, mDefaultAlpha, period );
 }
 
-void Animation::AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateBy( Property& target, Property::Value& relativeValue, AlphaFunction alpha, TimePeriod period )
 {
   Object& object = GetImplementation(target.object);
-  const Property::Type targetType = object.GetPropertyType(target.propertyIndex);
+  const Property::Type propertyType = object.GetPropertyType( target.propertyIndex );
   const Property::Type destinationType = relativeValue.GetType();
 
-  if ( object.GetPropertyComponentIndex( target.propertyIndex ) != Property::INVALID_COMPONENT_INDEX )
-  {
-    DALI_ASSERT_ALWAYS(Property::FLOAT == destinationType && "Animated value and Property type don't match");
-  }
-  else
-  {
-    DALI_ASSERT_ALWAYS(targetType == destinationType && "Animated value and Property type don't match");
-  }
+  // validate animation parameters, if component index is set then use float as checked type
+  ValidateParameters( (target.componentIndex == Property::INVALID_COMPONENT_INDEX) ? propertyType : Property::FLOAT,
+                      destinationType, period );
 
   ExtendDuration(period);
 
@@ -405,7 +442,8 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
   connectorPair.animatorType = Animation::BY;
   mConnectorTargetValues.push_back( connectorPair );
 
-  switch ( targetType )
+  // using destination type so component animation gets correct type
+  switch ( destinationType )
   {
     case Property::BOOLEAN:
     {
@@ -420,12 +458,12 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
 
     case Property::INTEGER:
     {
-      AddAnimatorConnector( AnimatorConnector<int>::New( object,
-                                                         target.propertyIndex,
-                                                         target.componentIndex,
-                                                         new AnimateByInteger(relativeValue.Get<int>()),
-                                                         alpha,
-                                                         period ) );
+      AddAnimatorConnector( AnimatorConnector<int32_t>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
+                                                             new AnimateByInteger(relativeValue.Get<int32_t>()),
+                                                             alpha,
+                                                             period ) );
       break;
     }
 
@@ -493,42 +531,30 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
   }
 }
 
-void Animation::AnimateTo(Property& target, Property::Value& destinationValue)
+void Animation::AnimateTo( Property& target, Property::Value& destinationValue )
 {
-  AnimateTo(target, destinationValue, mDefaultAlpha, TimePeriod(mDurationSeconds));
+  AnimateTo( target, destinationValue, mDefaultAlpha, TimePeriod(mDurationSeconds) );
 }
 
-void Animation::AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha)
+void Animation::AnimateTo( Property& target, Property::Value& destinationValue, AlphaFunction alpha )
 {
-  AnimateTo(target, destinationValue, alpha, TimePeriod(mDurationSeconds));
+  AnimateTo( target, destinationValue, alpha, TimePeriod(mDurationSeconds));
 }
 
-void Animation::AnimateTo(Property& target, Property::Value& destinationValue, TimePeriod period)
+void Animation::AnimateTo( Property& target, Property::Value& destinationValue, TimePeriod period )
 {
-  AnimateTo(target, destinationValue, mDefaultAlpha, period);
+  AnimateTo( target, destinationValue, mDefaultAlpha, period );
 }
 
-void Animation::AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateTo( Property& target, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period )
 {
-  Object& object = GetImplementation(target.object);
-
-  AnimateTo( object, target.propertyIndex, target.componentIndex, destinationValue, alpha, period );
-}
-
-void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIndex, int componentIndex, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period)
-{
-  Property::Type targetType = targetObject.GetPropertyType(targetPropertyIndex);
-  if( componentIndex != Property::INVALID_COMPONENT_INDEX )
-  {
-    if( ( targetType == Property::VECTOR2 ) ||
-        ( targetType == Property::VECTOR3 ) ||
-        ( targetType == Property::VECTOR4 ) )
-    {
-      targetType = Property::FLOAT;
-    }
-  }
+  Object& object = GetImplementation( target.object );
+  const Property::Type propertyType = object.GetPropertyType( target.propertyIndex );
   const Property::Type destinationType = destinationValue.GetType();
-  DALI_ASSERT_ALWAYS( targetType == destinationType && "Animated value and Property type don't match" );
+
+  // validate animation parameters, if component index is set then use float as checked type
+  ValidateParameters( (target.componentIndex == Property::INVALID_COMPONENT_INDEX) ? propertyType : Property::FLOAT,
+                      destinationType, period );
 
   ExtendDuration( period );
 
@@ -540,13 +566,14 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
   connectorPair.animatorType = Animation::TO;
   mConnectorTargetValues.push_back( connectorPair );
 
+  // using destination type so component animation gets correct type
   switch ( destinationType )
   {
     case Property::BOOLEAN:
     {
-      AddAnimatorConnector( AnimatorConnector<bool>::New( targetObject,
-                                                          targetPropertyIndex,
-                                                          componentIndex,
+      AddAnimatorConnector( AnimatorConnector<bool>::New( object,
+                                                          target.propertyIndex,
+                                                          target.componentIndex,
                                                           new AnimateToBoolean( destinationValue.Get<bool>() ),
                                                           alpha,
                                                           period ) );
@@ -555,20 +582,20 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::INTEGER:
     {
-      AddAnimatorConnector( AnimatorConnector<int>::New( targetObject,
-                                                         targetPropertyIndex,
-                                                         componentIndex,
-                                                         new AnimateToInteger( destinationValue.Get<int>() ),
-                                                         alpha,
-                                                         period ) );
+      AddAnimatorConnector( AnimatorConnector<int32_t>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
+                                                             new AnimateToInteger( destinationValue.Get<int32_t>() ),
+                                                             alpha,
+                                                             period ) );
       break;
     }
 
     case Property::FLOAT:
     {
-      AddAnimatorConnector( AnimatorConnector<float>::New( targetObject,
-                                                           targetPropertyIndex,
-                                                           componentIndex,
+      AddAnimatorConnector( AnimatorConnector<float>::New( object,
+                                                           target.propertyIndex,
+                                                           target.componentIndex,
                                                            new AnimateToFloat( destinationValue.Get<float>() ),
                                                            alpha,
                                                            period ) );
@@ -577,9 +604,9 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::VECTOR2:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector2>::New( targetObject,
-                                                             targetPropertyIndex,
-                                                             componentIndex,
+      AddAnimatorConnector( AnimatorConnector<Vector2>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
                                                              new AnimateToVector2( destinationValue.Get<Vector2>() ),
                                                              alpha,
                                                              period ) );
@@ -588,9 +615,9 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::VECTOR3:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector3>::New( targetObject,
-                                                             targetPropertyIndex,
-                                                             componentIndex,
+      AddAnimatorConnector( AnimatorConnector<Vector3>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
                                                              new AnimateToVector3( destinationValue.Get<Vector3>() ),
                                                              alpha,
                                                              period ) );
@@ -599,9 +626,9 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::VECTOR4:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector4>::New( targetObject,
-                                                             targetPropertyIndex,
-                                                             componentIndex,
+      AddAnimatorConnector( AnimatorConnector<Vector4>::New( object,
+                                                             target.propertyIndex,
+                                                             target.componentIndex,
                                                              new AnimateToVector4( destinationValue.Get<Vector4>() ),
                                                              alpha,
                                                              period ) );
@@ -610,9 +637,9 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::ROTATION:
     {
-      AddAnimatorConnector( AnimatorConnector<Quaternion>::New( targetObject,
-                                                                targetPropertyIndex,
-                                                                componentIndex,
+      AddAnimatorConnector( AnimatorConnector<Quaternion>::New( object,
+                                                                target.propertyIndex,
+                                                                target.componentIndex,
                                                                 new RotateToQuaternion( destinationValue.Get<Quaternion>() ),
                                                                 alpha,
                                                                 period ) );
@@ -626,44 +653,50 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
   }
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames )
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION );
+  AnimateBetween( target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Interpolation interpolation )
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, Interpolation interpolation )
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), interpolation );
+  AnimateBetween( target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), interpolation );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, TimePeriod period )
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, period, DEFAULT_INTERPOLATION);
+  AnimateBetween( target, keyFrames, mDefaultAlpha, period, DEFAULT_INTERPOLATION );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation )
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, period, interpolation);
+  AnimateBetween( target, keyFrames, mDefaultAlpha, period, interpolation );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, AlphaFunction alpha )
 {
-  AnimateBetween(target, keyFrames, alpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION);
+  AnimateBetween( target, keyFrames, alpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation )
 {
-  AnimateBetween(target, keyFrames, alpha, TimePeriod(mDurationSeconds), interpolation);
+  AnimateBetween( target, keyFrames, alpha, TimePeriod(mDurationSeconds), interpolation );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period )
 {
-  AnimateBetween(target, keyFrames, alpha, period, DEFAULT_INTERPOLATION);
+  AnimateBetween( target, keyFrames, alpha, period, DEFAULT_INTERPOLATION );
 }
 
-void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation)
+void Animation::AnimateBetween( Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation )
 {
   Object& object = GetImplementation( target.object );
+  const Property::Type propertyType = object.GetPropertyType( target.propertyIndex );
+  const Property::Type destinationType = keyFrames.GetType();
+
+  // validate animation parameters, if component index is set then use float as checked type
+  ValidateParameters( (target.componentIndex == Property::INVALID_COMPONENT_INDEX) ? propertyType : Property::FLOAT,
+                      destinationType, period );
 
   ExtendDuration( period );
 
@@ -675,7 +708,8 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
   connectorPair.animatorType = BETWEEN;
   mConnectorTargetValues.push_back( connectorPair );
 
-  switch(keyFrames.GetType())
+  // using destination type so component animation gets correct type
+  switch( destinationType )
   {
     case Dali::Property::BOOLEAN:
     {
@@ -696,7 +730,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
       const KeyFrameInteger* kf;
       GetSpecialization(keyFrames, kf);
       KeyFrameIntegerPtr kfCopy = KeyFrameInteger::Clone(*kf);
-      AddAnimatorConnector( AnimatorConnector<int>::New( object,
+      AddAnimatorConnector( AnimatorConnector<int32_t>::New( object,
                                                          target.propertyIndex,
                                                          target.componentIndex,
                                                          new KeyFrameIntegerFunctor(kfCopy,interpolation),
@@ -785,7 +819,7 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
 bool Animation::HasFinished()
 {
   bool hasFinished(false);
-  const int playedCount(mAnimation->GetPlayedCount());
+  const int32_t playedCount(mAnimation->GetPlayedCount());
 
   // If the play count has been incremented, then another notification is required
   mCurrentLoop = mAnimation->GetCurrentLoop();
@@ -833,17 +867,13 @@ void Animation::EmitSignalProgressReached()
 
 bool Animation::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
-  bool connected( true );
+  bool connected( false );
   Animation* animation = static_cast< Animation* >(object); // TypeRegistry guarantees that this is the correct type.
 
   if( 0 == signalName.compare( SIGNAL_FINISHED ) )
   {
     animation->FinishedSignal().Connect( tracker, functor );
-  }
-  else
-  {
-    // signalName does not match any signal
-    connected = false;
+    connected = true;
   }
 
   return connected;
@@ -967,12 +997,13 @@ void Animation::SetCurrentProgress(float progress)
 
 float Animation::GetCurrentProgress()
 {
-  if( mAnimation )
+  float progress = 0.f;
+  if( mAnimation ) // always exists in practice
   {
-    return mAnimation->GetCurrentProgress();
+    progress = mAnimation->GetCurrentProgress();
   }
 
-  return 0.0f;
+  return progress;
 }
 
 void Animation::ExtendDuration( const TimePeriod& timePeriod )
index ad61dba..c605ec2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ANIMATION_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -107,17 +107,17 @@ public:
   /**
    * @copydoc Dali::Animation::SetLoopCount()
    */
-  void SetLoopCount(int count);
+  void SetLoopCount(int32_t count);
 
   /**
    * @copydoc Dali::Animation::GetLoopCount()
    */
-  int GetLoopCount();
+  int32_t GetLoopCount();
 
   /**
    * @copydoc Dali::Animation::GetCurrentLoop()
    */
-  int GetCurrentLoop();
+  int32_t GetCurrentLoop();
 
   /**
    * @copydoc Dali::Animation::IsLooping()
@@ -283,17 +283,6 @@ public:
   void AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period);
 
   /**
-   * Animate a property to a destination value.
-   * @param [in] targetObject The target object to animate.
-   * @param [in] targetPropertyIndex The index of the target property.
-   * @param [in] componentIndex Index to a sub component of a property, for use with Vector2, Vector3 and Vector4
-   * @param [in] destinationValue The destination value.
-   * @param [in] alpha The alpha function to apply.
-   * @param [in] period The effect will occur during this time period.
-   */
-  void AnimateTo(Object& targetObject, Property::Index targetPropertyIndex, int componentIndex, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period);
-
-  /**
    * @copydoc Dali::Animation::AnimateBetween(Property target, KeyFrames& keyFrames)
    */
   void AnimateBetween(Property target, const KeyFrames& keyFrames);
@@ -497,7 +486,7 @@ private:
 
     Property::Value targetValue;
     TimePeriod timePeriod;
-    unsigned int connectorIndex;
+    std::size_t connectorIndex;
     Animation::Type animatorType;
   };
 
@@ -542,9 +531,9 @@ private:
 
   float mDurationSeconds;
   float mSpeedFactor;
-  int mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
-  int mLoopCount;
-  int mCurrentLoop;
+  int32_t mNotificationCount; ///< Keep track of how many Finished signals have been emitted.
+  int32_t mLoopCount;
+  int32_t mCurrentLoop;
   EndAction mEndAction;
   EndAction mDisconnectAction;
   AlphaFunction mDefaultAlpha;
index 15cee6f..6a48269 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // INTERNAL INCLUDES
-#include <dali/internal/event/common/object-impl.h>
 #include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/common/dali-common.h>
+#include <dali/internal/event/common/object-impl.h>
+#include <dali/internal/update/common/property-resetter.h>
+#include <dali/internal/update/manager/update-manager.h>
+
 
 namespace Dali
 {
@@ -33,10 +36,11 @@ namespace Internal
 class Animation;
 
 /**
- * An abstract base class for animator connectors.
+ * An abstract base class to create animator connectors and property re-setters for them when needed.
  *
  * The scene-graph objects are created by a Object e.g. Actor is a proxy for SceneGraph::Node.
- * AnimatorConnectorBase observes the proxy object, in order to detect when a scene-graph object is created.
+ * AnimatorConnectorBase observes the proxy object, in order to detect when a scene-graph object is created
+ * to avoid having unnecessary animations on the scene-graph and allow apps to create animations in initialisation
  */
 class AnimatorConnectorBase: public Object::Observer
 {
@@ -48,11 +52,14 @@ public:
   AnimatorConnectorBase(
       Object& object,
       Property::Index propertyIndex,
-      int componentIndex,
+      int32_t componentIndex,
+      Internal::AnimatorFunctionBase* animatorFunction,
       AlphaFunction alpha,
       const TimePeriod& period)
-  : mParent( NULL ),
+  : mParent( nullptr ),
     mObject( &object ),
+    mAnimator( nullptr ),
+    mAnimatorFunction( animatorFunction ),
     mAlphaFunction(alpha),
     mTimePeriod(period),
     mPropertyIndex( propertyIndex ),
@@ -66,18 +73,88 @@ public:
    */
   virtual ~AnimatorConnectorBase()
   {
+    if( mObject )
+    {
+      mObject->RemoveObserver( *this );
+    }
+
+    // If there is not a SceneGraph::Animator, the AnimatorConnector is responsible for deleting the mAnimatorFunction
+    // otherwise, the animator function ownership is transferred to the SceneGraph::Animator
+    if( !mAnimator )
+    {
+      delete mAnimatorFunction;
+    }
+  }
+
+  /**
+   * Helper function to create a Scenegraph::Animator and PropertyResetter and add it to its correspondent
+   * SceneGraph::Animation.
+   *
+   * @note This function will only be called the first time the object is added to the scene or at creation time if
+   * the object was already in the scene
+   */
+  void CreateAnimator()
+  {
+    DALI_ASSERT_DEBUG( mAnimator == nullptr );
+    DALI_ASSERT_DEBUG( mAnimatorFunction != nullptr );
+    DALI_ASSERT_DEBUG( mParent != nullptr );
+
+    //Get the PropertyOwner the animator is going to animate
+    const SceneGraph::PropertyOwner& propertyOwner = mObject->GetSceneObject();
+
+    // Get SceneGraph::BaseProperty
+    const SceneGraph::PropertyBase* baseProperty = mObject->GetSceneObjectAnimatableProperty( mPropertyIndex );
+    DALI_ASSERT_ALWAYS( baseProperty && "Property is not animatable" );
+
+    // Check if property is a component of another property
+    const int32_t componentIndex = mObject->GetPropertyComponentIndex( mPropertyIndex );
+    if( componentIndex != Property::INVALID_COMPONENT_INDEX )
+    {
+      mComponentIndex = componentIndex;
+    }
+
+    // call the type specific method to create the concrete animator
+    bool resetterRequired = DoCreateAnimator( propertyOwner, *baseProperty );
+
+    DALI_ASSERT_DEBUG( mAnimator != nullptr );
+
+    // Add the new SceneGraph::Animator to its correspondent SceneGraph::Animation via message
+    const SceneGraph::Animation* animation = mParent->GetSceneObject();
+    DALI_ASSERT_DEBUG( nullptr != animation );
+    AddAnimatorMessage( mParent->GetEventThreadServices(), *animation, *mAnimator );
+
+    // Add the new SceneGraph::PropertyResetter to the update manager via message
+    if( resetterRequired )
+    {
+      OwnerPointer<SceneGraph::PropertyResetterBase> resetter = SceneGraph::AnimatorResetter::New( propertyOwner, *baseProperty, *mAnimator );
+      AddResetterMessage( mParent->GetEventThreadServices().GetUpdateManager(), resetter );
+    }
   }
 
   /**
+   * Type specific extension of animator creation
+   */
+  virtual bool DoCreateAnimator( const SceneGraph::PropertyOwner& propertyOwner, const SceneGraph::PropertyBase& baseProperty ) = 0;
+
+  /**
    * Set the parent of the AnimatorConnector.
    * @pre The connector does not already have a parent.
    * @param [in] parent The parent object.
    */
-  virtual void SetParent(Animation& parent) = 0;
+  void SetParent( Animation& parent )
+  {
+    DALI_ASSERT_ALWAYS( mParent == nullptr && "AnimationConnector already has a parent" );
+    mParent = &parent;
+
+    if( mObject )
+    {
+      CreateAnimator();
+    }
+  }
 
   /**
    * Retrieve the parent of the AnimatorConnector.
-   * @return The parent object, or NULL.
+   * @return The parent object, or nullptr.
    */
   Animation* GetParent() const
   {
@@ -94,7 +171,7 @@ public:
     return mPropertyIndex;
   }
 
-  int GetComponentIndex() const
+  int32_t GetComponentIndex() const
   {
     return mComponentIndex;
   }
@@ -104,14 +181,19 @@ private:
   /**
    * From Object::Observer
    */
-  virtual void SceneObjectAdded( Object& object )
+  virtual void SceneObjectAdded( Object& object ) override final
   {
+    // If the animator has not been created yet, create it now.
+    if( !mAnimator && mObject )
+    {
+      CreateAnimator();
+    }
   }
 
   /**
    * From Object::Observer
    */
-  virtual void SceneObjectRemoved( Object& object )
+  virtual void SceneObjectRemoved( Object& object ) override final
   {
   }
 
@@ -120,19 +202,21 @@ private:
    */
   virtual void ObjectDestroyed( Object& object )
   {
-    mObject = NULL;
+    mObject = nullptr;
   }
 
 protected:
 
   Animation* mParent; ///< The parent owns the connector.
   Object* mObject; ///< Not owned by the animator connector. Valid until ObjectDestroyed() is called.
+  SceneGraph::AnimatorBase* mAnimator;
+  Internal::AnimatorFunctionBase* mAnimatorFunction;  ///< Owned by the animator connector until an Scenegraph::Animator is created
 
   AlphaFunction mAlphaFunction;
   TimePeriod mTimePeriod;
 
   Property::Index mPropertyIndex;
-  int mComponentIndex;
+  int32_t mComponentIndex;
 
 };
 
index 8119063..923f6e6 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ANIMATOR_CONNECTOR_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,8 +24,6 @@
 #include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/animation/property-accessor.h>
 #include <dali/internal/update/animation/property-component-accessor.h>
-#include <dali/internal/update/common/property-resetter.h>
-#include <dali/internal/update/manager/update-manager.h>
 
 namespace Dali
 {
@@ -34,19 +32,19 @@ namespace Internal
 {
 
 /**
- * AnimatorConnector is used to connect SceneGraph::Animators and
- * PropertyResetters for newly created scene-graph objects.
+ * AnimatorConnector is used to connect SceneGraph::Animators.
  *
  * SceneGraph::Animators weakly reference scene objects, and are automatically deleted when orphaned.
  * Therefore the AnimatorConnector is NOT responsible for disconnecting animators.
+ * This is the common template for non float properties, there's a specialization for float properties as they can be component properties
  */
 template < typename PropertyType >
 class AnimatorConnector : public AnimatorConnectorBase
 {
 public:
 
-  typedef SceneGraph::Animator< PropertyType, PropertyAccessor<PropertyType> > AnimatorType;
-  typedef SceneGraph::AnimatableProperty< PropertyType > PropertyInterfaceType;
+  using AnimatorType = SceneGraph::Animator< PropertyType, PropertyAccessor<PropertyType> >;
+  using PropertyInterfaceType = SceneGraph::AnimatableProperty< PropertyType >;
 
   /**
    * Construct a new animator connector.
@@ -60,17 +58,17 @@ public:
    */
   static AnimatorConnectorBase* New( Object& object,
                                      Property::Index propertyIndex,
-                                     int componentIndex,
+                                     int32_t componentIndex,
                                      AnimatorFunctionBase* animatorFunction,
                                      AlphaFunction alpha,
                                      const TimePeriod& period )
   {
-    return new AnimatorConnector< PropertyType >( object,
-                                                  propertyIndex,
-                                                  componentIndex,
-                                                  animatorFunction,
-                                                  alpha,
-                                                  period );
+    return new AnimatorConnector( object,
+                                  propertyIndex,
+                                  componentIndex,
+                                  animatorFunction,
+                                  alpha,
+                                  period );
   }
 
   /**
@@ -78,33 +76,6 @@ public:
    */
   virtual ~AnimatorConnector()
   {
-    if( mObject )
-    {
-      mObject->RemoveObserver( *this );
-    }
-
-    // If there is not a SceneGraph::Animator, the AnimatorConnector is responsible for deleting the mAnimatorFunction
-    // otherwise, the animator function ownership is transferred to the SceneGraph::Animator
-    if( !mAnimator )
-    {
-      delete mAnimatorFunction;
-      mAnimatorFunction = 0;
-    }
-  }
-
-  /**
-   * From AnimatorConnectorBase.
-   * This is only expected to be called once, when added to an Animation.
-   */
-  void SetParent( Animation& parent )
-  {
-    DALI_ASSERT_ALWAYS( mParent == NULL && "AnimationConnector already has a parent" );
-    mParent = &parent;
-
-    if( mObject && mObject->GetSceneObject() )
-    {
-      CreateAnimator();
-    }
   }
 
 private:
@@ -114,107 +85,168 @@ private:
    */
   AnimatorConnector( Object& object,
                      Property::Index propertyIndex,
-                     int componentIndex,
+                     int32_t componentIndex,
                      Internal::AnimatorFunctionBase* animatorFunction,
                      AlphaFunction alpha,
                      const TimePeriod& period )
-  : AnimatorConnectorBase( object, propertyIndex, componentIndex, alpha, period ),
-    mAnimator(0),
-    mAnimatorFunction( animatorFunction )
+  : AnimatorConnectorBase( object, propertyIndex, componentIndex, animatorFunction, alpha, period )
   {
   }
 
   // Undefined
-  AnimatorConnector( const AnimatorConnector& );
-
-  // Undefined
-  AnimatorConnector& operator=( const AnimatorConnector& rhs );
+  AnimatorConnector() = delete;
+  AnimatorConnector( const AnimatorConnector& ) = delete;
+  AnimatorConnector& operator=( const AnimatorConnector& rhs ) = delete;
 
   /**
-   * From Object::Observer
+   * @copydoc AnimatorConnectorBase::DoCreateAnimator()
    */
-  virtual void SceneObjectAdded( Object& object )
+  bool DoCreateAnimator( const SceneGraph::PropertyOwner& propertyOwner, const SceneGraph::PropertyBase& baseProperty ) override final
   {
-    //If the animator has not been created yet, create it now.
-    if( !mAnimator && mObject )
+    bool resetterRequired = false;
+    // components only supported for float property type
+    DALI_ASSERT_DEBUG( mComponentIndex == Property::INVALID_COMPONENT_INDEX );
+    // Animating the whole property
+
+    // Cast to AnimatableProperty
+    const PropertyInterfaceType* animatableProperty = dynamic_cast< const PropertyInterfaceType* >( &baseProperty );
+
+    if( animatableProperty == nullptr )
     {
-      CreateAnimator();
+      if( baseProperty.IsTransformManagerProperty() )
+      {
+        mAnimator = SceneGraph::AnimatorTransformProperty< PropertyType,TransformManagerPropertyAccessor<PropertyType> >::New( propertyOwner, baseProperty, mAnimatorFunction, mAlphaFunction, mTimePeriod );
+        // Don't reset transform manager properties - TransformManager will do it more efficiently
+      }
+      else
+      {
+        DALI_ASSERT_DEBUG( animatableProperty && "Animating non-animatable property" );
+      }
     }
+    else
+    {
+      // Create the animator and resetter
+      mAnimator = AnimatorType::New( propertyOwner, *animatableProperty, mAnimatorFunction,
+                                     mAlphaFunction, mTimePeriod );
+      resetterRequired = true;
+    }
+    return resetterRequired;
   }
+};
 
-   /**
-   * Helper function to create a Scenegraph::Animator and PropertyResetter and add it to its correspondent
-   * SceneGraph::Animation.
-   *
-   * @note This function will only be called the first time the object is added to the scene or at creation time if
-   * the object was already in the scene
+/**
+ * Specialization for float as that type supports component properties
+ */
+template <>
+class AnimatorConnector< float > : public AnimatorConnectorBase
+{
+public:
+
+  using AnimatorType = SceneGraph::Animator< float, PropertyAccessor<float> >;
+  using PropertyInterfaceType = SceneGraph::AnimatableProperty< float >;
+
+  /**
+   * Construct a new animator connector.
+   * @param[in] object The object for a scene-graph object to animate.
+   * @param[in] propertyIndex The index of a property provided by the object.
+   * @param[in] componentIndex Index to a sub component of a property, for use with Vector2, Vector3 and Vector4 (INVALID_PROPERTY_COMPONENTINDEX to use the whole property)
+   * @param[in] animatorFunction A function used to animate the property.
+   * @param[in] alpha The alpha function to apply.
+   * @param[in] period The time period of the animator.
+   * @return A pointer to a newly allocated animator connector.
    */
-  void CreateAnimator()
+  static AnimatorConnectorBase* New( Object& object,
+                                     Property::Index propertyIndex,
+                                     int32_t componentIndex,
+                                     AnimatorFunctionBase* animatorFunction,
+                                     AlphaFunction alpha,
+                                     const TimePeriod& period )
   {
-    DALI_ASSERT_DEBUG( mAnimator == NULL );
-    DALI_ASSERT_DEBUG( mAnimatorFunction != NULL );
-    DALI_ASSERT_DEBUG( mParent != NULL );
+    return new AnimatorConnector( object,
+                                  propertyIndex,
+                                  componentIndex,
+                                  animatorFunction,
+                                  alpha,
+                                  period );
+  }
 
-    //Get the PropertyOwner the animator is going to animate
-    const SceneGraph::PropertyOwner* propertyOwner = mObject->GetSceneObject();
+  /**
+   * Virtual destructor.
+   */
+  virtual ~AnimatorConnector()
+  {
+  }
 
-    // Get SceneGraph::BaseProperty
-    const SceneGraph::PropertyBase* baseProperty = mObject->GetSceneObjectAnimatableProperty( mPropertyIndex );
+private:
 
-    OwnerPointer<SceneGraph::PropertyResetterBase> resetter;
+  /**
+   * Private constructor; see also AnimatorConnector::New().
+   */
+  AnimatorConnector( Object& object,
+                     Property::Index propertyIndex,
+                     int32_t componentIndex,
+                     Internal::AnimatorFunctionBase* animatorFunction,
+                     AlphaFunction alpha,
+                     const TimePeriod& period )
+  : AnimatorConnectorBase( object, propertyIndex, componentIndex, animatorFunction, alpha, period )
+  {
+  }
 
-    // Check if property is a component of another property
-    const int componentIndex = mObject->GetPropertyComponentIndex( mPropertyIndex );
-    if( componentIndex != Property::INVALID_COMPONENT_INDEX )
-    {
-      mComponentIndex = componentIndex;
-    }
+  // Undefined
+  AnimatorConnector() = delete;
+  AnimatorConnector( const AnimatorConnector& ) = delete;
+  AnimatorConnector& operator=( const AnimatorConnector& rhs ) = delete;
 
+  /**
+   * @copydoc AnimatorConnectorBase::DoCreateAnimator()
+   */
+  bool DoCreateAnimator( const SceneGraph::PropertyOwner& propertyOwner, const SceneGraph::PropertyBase& baseProperty ) override final
+  {
+    bool resetterRequired = false;
     if( mComponentIndex == Property::INVALID_COMPONENT_INDEX )
     {
       // Animating the whole property
 
       // Cast to AnimatableProperty
-      const PropertyInterfaceType* animatableProperty = dynamic_cast< const PropertyInterfaceType* >( baseProperty );
+      const PropertyInterfaceType* animatableProperty = dynamic_cast< const PropertyInterfaceType* >( &baseProperty );
 
-      if( animatableProperty == NULL )
+      if( animatableProperty == nullptr )
       {
-        if( baseProperty->IsTransformManagerProperty() )
+        if( baseProperty.IsTransformManagerProperty() )
         {
-          mAnimator = SceneGraph::AnimatorTransformProperty< PropertyType,TransformManagerPropertyAccessor<PropertyType> >::New( *propertyOwner, *baseProperty, mAnimatorFunction, mAlphaFunction, mTimePeriod );
+          mAnimator = SceneGraph::AnimatorTransformProperty< float,TransformManagerPropertyAccessor<float> >::New( propertyOwner, baseProperty, mAnimatorFunction, mAlphaFunction, mTimePeriod );
           // Don't reset transform manager properties - TransformManager will do it more efficiently
         }
         else
         {
-          DALI_ASSERT_DEBUG( animatableProperty != NULL && "Animating non-animatable property" );
+          DALI_ASSERT_DEBUG( animatableProperty && "Animating non-animatable property" );
         }
-
       }
       else
       {
         // Create the animator and resetter
-        mAnimator = AnimatorType::New( *propertyOwner, *animatableProperty, mAnimatorFunction,
+        mAnimator = AnimatorType::New( propertyOwner, *animatableProperty, mAnimatorFunction,
                                        mAlphaFunction, mTimePeriod );
-        resetter = SceneGraph::AnimatorResetter::New( *propertyOwner, *baseProperty, *mAnimator );
+        resetterRequired = true;
       }
     }
     else
     {
       {
         // Animating a component of the property
-        if ( PropertyTypes::Get< Vector2 >() == baseProperty->GetType() )
+        if ( PropertyTypes::Get< Vector2 >() == baseProperty.GetType() )
         {
           // Animate float component of Vector2 property
 
           // Cast to AnimatableProperty of type Vector2
-          const SceneGraph::AnimatableProperty<Vector2>* animatableProperty = dynamic_cast< const SceneGraph::AnimatableProperty<Vector2>* >( baseProperty );
-          DALI_ASSERT_DEBUG( animatableProperty != NULL && "Animating non-animatable property" );
+          const SceneGraph::AnimatableProperty<Vector2>* animatableProperty = dynamic_cast< const SceneGraph::AnimatableProperty<Vector2>* >( &baseProperty );
+          DALI_ASSERT_DEBUG( animatableProperty && "Animating non-animatable property" );
 
           switch( mComponentIndex )
           {
             case 0:
             {
-              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorX<Vector2> >::New( *propertyOwner,
+              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorX<Vector2> >::New( propertyOwner,
                                                                                                    *animatableProperty,
                                                                                                    mAnimatorFunction,
                                                                                                    mAlphaFunction,
@@ -223,7 +255,7 @@ private:
             }
             case 1:
             {
-              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorY<Vector2> >::New( *propertyOwner,
+              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorY<Vector2> >::New( propertyOwner,
                                                                                                    *animatableProperty,
                                                                                                    mAnimatorFunction,
                                                                                                    mAlphaFunction,
@@ -236,51 +268,48 @@ private:
             }
           }
 
-          if( mAnimator != nullptr )
-          {
-            resetter = SceneGraph::AnimatorResetter::New( *propertyOwner, *baseProperty, *mAnimator );
-          }
+          resetterRequired = ( mAnimator != nullptr );
         }
 
-        else if ( PropertyTypes::Get< Vector3 >() == baseProperty->GetType() )
+        else if ( PropertyTypes::Get< Vector3 >() == baseProperty.GetType() )
         {
           // Animate float component of Vector3 property
           // Cast to AnimatableProperty of type Vector3
-          const SceneGraph::AnimatableProperty<Vector3>* animatableProperty = dynamic_cast< const SceneGraph::AnimatableProperty<Vector3>* >( baseProperty );
+          const SceneGraph::AnimatableProperty<Vector3>* animatableProperty = dynamic_cast< const SceneGraph::AnimatableProperty<Vector3>* >( &baseProperty );
 
-          if( animatableProperty == NULL )
+          if( animatableProperty == nullptr )
           {
-            if( baseProperty->IsTransformManagerProperty() )
+            if( baseProperty.IsTransformManagerProperty() )
             {
               if( mComponentIndex == 0 )
               {
-                mAnimator = SceneGraph::AnimatorTransformProperty< float,TransformManagerPropertyComponentAccessor<Vector3,0> >::New( *propertyOwner, *baseProperty, mAnimatorFunction, mAlphaFunction, mTimePeriod );
+                mAnimator = SceneGraph::AnimatorTransformProperty< float,TransformManagerPropertyComponentAccessor<Vector3,0> >::New( propertyOwner, baseProperty, mAnimatorFunction, mAlphaFunction, mTimePeriod );
               }
               else if( mComponentIndex == 1 )
               {
-                mAnimator = SceneGraph::AnimatorTransformProperty< float,TransformManagerPropertyComponentAccessor<Vector3,1> >::New( *propertyOwner, *baseProperty, mAnimatorFunction, mAlphaFunction, mTimePeriod );
+                mAnimator = SceneGraph::AnimatorTransformProperty< float,TransformManagerPropertyComponentAccessor<Vector3,1> >::New( propertyOwner, baseProperty, mAnimatorFunction, mAlphaFunction, mTimePeriod );
               }
               else if( mComponentIndex == 2 )
               {
-                mAnimator = SceneGraph::AnimatorTransformProperty< float,TransformManagerPropertyComponentAccessor<Vector3,2> >::New( *propertyOwner, *baseProperty, mAnimatorFunction, mAlphaFunction, mTimePeriod );
+                mAnimator = SceneGraph::AnimatorTransformProperty< float,TransformManagerPropertyComponentAccessor<Vector3,2> >::New( propertyOwner, baseProperty, mAnimatorFunction, mAlphaFunction, mTimePeriod );
               }
             }
             else
             {
-              DALI_ASSERT_DEBUG( animatableProperty != NULL && "Animating non-animatable property" );
+              DALI_ASSERT_DEBUG( animatableProperty && "Animating non-animatable property" );
             }
             // Don't manually reset transform property - TransformManager will do it more efficiently
           }
           else
           {
             // Dynamic cast will fail if BaseProperty is not a Vector3 AnimatableProperty
-            DALI_ASSERT_DEBUG( animatableProperty != NULL && "Animating non-animatable property" );
+            DALI_ASSERT_DEBUG( animatableProperty && "Animating non-animatable property" );
 
             switch( mComponentIndex )
             {
               case 0:
               {
-                mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorX<Vector3> >::New( *propertyOwner,
+                mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorX<Vector3> >::New( propertyOwner,
                                                                                                      *animatableProperty,
                                                                                                      mAnimatorFunction,
                                                                                                      mAlphaFunction,
@@ -289,7 +318,7 @@ private:
               }
               case 1:
               {
-                mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorY<Vector3> >::New( *propertyOwner,
+                mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorY<Vector3> >::New( propertyOwner,
                                                                                                      *animatableProperty,
                                                                                                      mAnimatorFunction,
                                                                                                      mAlphaFunction,
@@ -298,7 +327,7 @@ private:
               }
               case 2:
               {
-                mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorZ<Vector3> >::New( *propertyOwner,
+                mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorZ<Vector3> >::New( propertyOwner,
                                                                                                      *animatableProperty,
                                                                                                      mAnimatorFunction,
                                                                                                      mAlphaFunction,
@@ -311,27 +340,24 @@ private:
               }
             }
 
-            if( mAnimator != nullptr )
-            {
-              resetter = SceneGraph::AnimatorResetter::New( *propertyOwner, *baseProperty, *mAnimator );
-            }
+            resetterRequired = ( mAnimator != nullptr );
           }
         }
-        else if ( PropertyTypes::Get< Vector4 >() == baseProperty->GetType() )
+        else if ( PropertyTypes::Get< Vector4 >() == baseProperty.GetType() )
         {
           // Animate float component of Vector4 property
 
           // Cast to AnimatableProperty of type Vector4
-          const SceneGraph::AnimatableProperty<Vector4>* animatableProperty = dynamic_cast< const SceneGraph::AnimatableProperty<Vector4>* >( baseProperty );
+          const SceneGraph::AnimatableProperty<Vector4>* animatableProperty = dynamic_cast< const SceneGraph::AnimatableProperty<Vector4>* >( &baseProperty );
 
           //Dynamic cast will fail if BaseProperty is not a Vector4 AnimatableProperty
-          DALI_ASSERT_DEBUG( animatableProperty != NULL && "Animating non-animatable property" );
+          DALI_ASSERT_DEBUG( animatableProperty && "Animating non-animatable property" );
 
           switch( mComponentIndex )
           {
             case 0:
             {
-              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorX<Vector4> >::New( *propertyOwner,
+              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorX<Vector4> >::New( propertyOwner,
                                                                                                    *animatableProperty,
                                                                                                    mAnimatorFunction,
                                                                                                    mAlphaFunction,
@@ -340,7 +366,7 @@ private:
             }
             case 1:
             {
-              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorY<Vector4> >::New( *propertyOwner,
+              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorY<Vector4> >::New( propertyOwner,
                                                                                                    *animatableProperty,
                                                                                                    mAnimatorFunction,
                                                                                                    mAlphaFunction,
@@ -349,7 +375,7 @@ private:
             }
             case 2:
             {
-              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorZ<Vector4> >::New( *propertyOwner,
+              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorZ<Vector4> >::New( propertyOwner,
                                                                                                    *animatableProperty,
                                                                                                    mAnimatorFunction,
                                                                                                    mAlphaFunction,
@@ -358,7 +384,7 @@ private:
             }
             case 3:
             {
-              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorW<Vector4> >::New( *propertyOwner,
+              mAnimator = SceneGraph::Animator< float, PropertyComponentAccessorW<Vector4> >::New( propertyOwner,
                                                                                                    *animatableProperty,
                                                                                                    mAnimatorFunction,
                                                                                                    mAlphaFunction,
@@ -371,36 +397,14 @@ private:
               break;
             }
           }
-          if( mAnimator != nullptr )
-          {
-            resetter = SceneGraph::AnimatorResetter::New( *propertyOwner, *baseProperty, *mAnimator );
-          }
+          resetterRequired = ( mAnimator != nullptr );
         }
       }
     }
-
-    DALI_ASSERT_DEBUG( mAnimator != NULL );
-
-    // Add the new SceneGraph::Animator to its correspondent SceneGraph::Animation via message
-    const SceneGraph::Animation* animation = mParent->GetSceneObject();
-    DALI_ASSERT_DEBUG( NULL != animation );
-    AddAnimatorMessage( mParent->GetEventThreadServices(), *animation, *mAnimator );
-
-    // Add the new SceneGraph::PropertyResetter to the update manager via message
-    if( resetter != nullptr )
-    {
-      AddResetterMessage( mParent->GetEventThreadServices().GetUpdateManager(), resetter );
-    }
+    return resetterRequired;
   }
-
-protected:
-
-  SceneGraph::AnimatorBase* mAnimator;
-
-  Internal::AnimatorFunctionBase* mAnimatorFunction;  ///< Owned by the animator connector until an Scenegraph::Animator is created
 };
 
-
 } // namespace Internal
 
 } // namespace Dali
index 7e4f6a2..756cc9f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,14 +29,14 @@ namespace Internal
 {
 
 Constrainer::Constrainer()
-:Object()
+:Object( nullptr ) // we don't have our own scene object
 {
 }
 
 Constrainer::~Constrainer()
 {
   //Remove all the constraints created by the object
-  size_t tag = reinterpret_cast<size_t>( this );
+  uint32_t tag = static_cast<uint32_t>( reinterpret_cast<uintptr_t>( this ) ); // taking 32bits of this as tag
   const ObjectIter end = mObservedObjects.End();
   for( ObjectIter iter = mObservedObjects.Begin(); iter != end; ++iter )
   {
@@ -64,7 +64,7 @@ void Constrainer::ObjectDestroyed( Object& object )
 
 void Constrainer::Remove( Dali::Handle& target )
 {
-  size_t tag = reinterpret_cast<size_t>( this );
+  uint32_t tag = static_cast<uint32_t>( reinterpret_cast<uintptr_t>( this ) ); // taking 32bits of this as tag
   Object& object = GetImplementation(target);
   const ObjectIter end = mObservedObjects.End();
   for( ObjectIter iter = mObservedObjects.Begin(); iter != end; ++iter )
index 81982a7..52ad22e 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_CONSTRAINER_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -50,78 +50,6 @@ public:
    */
   virtual ~Constrainer();
 
-public: // Object methods
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const{return 0;}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const{}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName( Property::Index index ) const{return 0;}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex( const std::string& name ) const{return  Property::INVALID_INDEX;}
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable( Property::Index index ) const{return false;}
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const{return false;}
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const{return false;}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType( Property::Index index ) const{return Property::NONE;}
-
-  /**
-   * @copydoc Dali::Internal::Object::SetDefaultProperty()
-   */
-  virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue ){}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultProperty()
-   */
-  virtual Property::Value GetDefaultProperty( Property::Index index ) const{return Property::Value();}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue()
-   */
-  virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const{return Property::Value();}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const{return 0;}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const{return 0;}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
-   */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const{return 0;}
-
 public: // Object::Observer methods
 
   /**
index c702014..c70b251 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,8 +36,26 @@ namespace Dali
 namespace Internal
 {
 
+namespace
+{
+/**
+ * Helper to add only unique entries to the propertyOwner container
+ * @param propertyOwners to add the entries to
+ * @param object to add
+ */
+inline void AddUnique( SceneGraph::PropertyOwnerContainer& propertyOwners, SceneGraph::PropertyOwner* object )
+{
+  const SceneGraph::PropertyOwnerIter iter = std::find( propertyOwners.Begin(), propertyOwners.End(), object );
+  if( iter == propertyOwners.End() )
+  {
+    // each owner should only be added once
+    propertyOwners.PushBack( object );
+  }
+}
+} // unnamed namespace
+
 ConstraintBase::ConstraintBase( Object& object, Property::Index targetPropertyIndex, SourceContainer& sources )
-: mEventThreadServices( *Stage::GetCurrent() ),
+: mEventThreadServices( EventThreadServices::Get() ),
   mTargetObject( &object ),
   mSceneGraphConstraint( NULL ),
   mSources( sources ),
@@ -51,6 +69,17 @@ ConstraintBase::ConstraintBase( Object& object, Property::Index targetPropertyIn
   ObserveObject( object );
 }
 
+ConstraintBase* ConstraintBase::Clone( Object& object )
+{
+  DALI_ASSERT_ALWAYS( !mSourceDestroyed && "An input source object has been destroyed" );
+
+  // create the type specific object
+  ConstraintBase* clone = DoClone( object );
+  clone->SetRemoveAction( mRemoveAction );
+  clone->SetTag( mTag );
+  return clone;
+}
+
 ConstraintBase::~ConstraintBase()
 {
   StopObservation();
@@ -106,14 +135,11 @@ void ConstraintBase::RemoveInternal()
     // Guard against constraint sending messages during core destruction
     if( Stage::IsInstalled() )
     {
-      const SceneGraph::PropertyOwner* propertyOwner = mTargetObject ? mTargetObject->GetSceneObject() : NULL;
-
-      if ( propertyOwner &&
-           mSceneGraphConstraint )
+      if( mTargetObject && mSceneGraphConstraint )
       {
+        const SceneGraph::PropertyOwner& propertyOwner =  mTargetObject->GetSceneObject();
         // Remove from scene-graph
-        RemoveConstraintMessage( GetEventThreadServices(), *propertyOwner, *(mSceneGraphConstraint) );
-
+        RemoveConstraintMessage( GetEventThreadServices(), propertyOwner, *(mSceneGraphConstraint) );
         // mSceneGraphConstraint will be deleted in update-thread, remove dangling pointer
         mSceneGraphConstraint = NULL;
       }
@@ -146,12 +172,12 @@ ConstraintBase::RemoveAction ConstraintBase::GetRemoveAction() const
   return mRemoveAction;
 }
 
-void ConstraintBase::SetTag(const unsigned int tag)
+void ConstraintBase::SetTag( uint32_t tag )
 {
   mTag = tag;
 }
 
-unsigned int ConstraintBase::GetTag() const
+uint32_t ConstraintBase::GetTag() const
 {
   return mTag;
 }
@@ -173,12 +199,11 @@ void ConstraintBase::SceneObjectRemoved( Object& object )
     // An input property owning source has been deleted, need to tell the scene-graph-constraint owner to remove it
     if ( &object != mTargetObject )
     {
-      const SceneGraph::PropertyOwner* propertyOwner = mTargetObject ? mTargetObject->GetSceneObject() : NULL;
-
-      if( propertyOwner )
+      if( mTargetObject )
       {
+        const SceneGraph::PropertyOwner& propertyOwner = mTargetObject->GetSceneObject();
         // Remove from scene-graph
-        RemoveConstraintMessage( GetEventThreadServices(), *propertyOwner, *(mSceneGraphConstraint) );
+        RemoveConstraintMessage( GetEventThreadServices(), propertyOwner, *(mSceneGraphConstraint) );
       }
     }
 
@@ -229,6 +254,58 @@ void ConstraintBase::StopObservation()
   mObservedObjects.Clear();
 }
 
+PropertyInputImpl* ConstraintBase::AddInputProperty( Source& source, SceneGraph::PropertyOwnerContainer& propertyOwners, int32_t& componentIndex )
+{
+  PropertyInputImpl* inputProperty = nullptr;
+
+  if ( OBJECT_PROPERTY == source.sourceType )
+  {
+    DALI_ASSERT_ALWAYS( source.object->IsPropertyAConstraintInput( source.propertyIndex ) );
+
+    SceneGraph::PropertyOwner& owner = const_cast< SceneGraph::PropertyOwner& >( source.object->GetSceneObject() );
+
+    AddUnique( propertyOwners, &owner );
+    inputProperty = const_cast< PropertyInputImpl* >( source.object->GetSceneObjectInputProperty( source.propertyIndex ) );
+    componentIndex = source.object->GetPropertyComponentIndex( source.propertyIndex );
+
+    // The scene-object property should exist, when the property owner exists
+    DALI_ASSERT_ALWAYS( inputProperty && "Constraint source property does not exist" );
+  }
+  else if ( LOCAL_PROPERTY == source.sourceType )
+  {
+    DALI_ASSERT_ALWAYS( mTargetObject->IsPropertyAConstraintInput( source.propertyIndex ) );
+
+    inputProperty = const_cast< PropertyInputImpl* >( mTargetObject->GetSceneObjectInputProperty( source.propertyIndex ) );
+    componentIndex = mTargetObject->GetPropertyComponentIndex( source.propertyIndex );
+
+    // The target scene-object should provide this property
+    DALI_ASSERT_ALWAYS( inputProperty && "Constraint source property does not exist" );
+  }
+  else
+  {
+    DALI_ASSERT_ALWAYS( PARENT_PROPERTY == source.sourceType && "Constraint source property type is invalid" );
+
+    Object* objectParent = dynamic_cast< Actor& >( *mTargetObject ).GetParent();
+
+    // This will not exist, if the target object is off-stage
+    if ( objectParent )
+    {
+      DALI_ASSERT_ALWAYS( objectParent->IsPropertyAConstraintInput( source.propertyIndex ) );
+
+      SceneGraph::PropertyOwner& owner = const_cast< SceneGraph::PropertyOwner& >( objectParent->GetSceneObject() );
+
+      AddUnique( propertyOwners, &owner );
+      inputProperty = const_cast< PropertyInputImpl* >( objectParent->GetSceneObjectInputProperty( source.propertyIndex ) );
+      componentIndex = objectParent->GetPropertyComponentIndex( source.propertyIndex );
+
+      // The scene-object property should exist, when the property owner exists
+      DALI_ASSERT_ALWAYS( inputProperty && "Constraint source property does not exist" );
+    }
+  }
+  return inputProperty;
+}
+
+
 } // namespace Internal
 
 } // namespace Dali
index 5b006ed..e120ce7 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ACTIVE_CONSTRAINT_BASE_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // INTERNAL INCLUDES
-#include <dali/internal/common/owner-pointer.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/object/base-object.h>
+#include <dali/internal/common/owner-pointer.h>
 #include <dali/internal/event/animation/constraint-source-impl.h>
+#include <dali/internal/update/animation/scene-graph-constraint-base.h>
 
 namespace Dali
 {
@@ -67,7 +68,7 @@ public:
    * @param[in]  object  The object to clone this constraint for
    * @return A new constraint.
    */
-  virtual ConstraintBase* Clone( Object& object ) = 0;
+  ConstraintBase* Clone( Object& object );
 
   /**
    * Virtual destructor.
@@ -127,12 +128,12 @@ public:
   /**
    * @copydoc Dali::Constraint::SetTag()
    */
-  void SetTag(const unsigned int tag);
+  void SetTag( uint32_t tag );
 
   /**
    * @copydoc Dali::Constraint::GetTag()
    */
-  unsigned int GetTag() const;
+  uint32_t GetTag() const;
 
 private: // Object::Observer methods
 
@@ -166,13 +167,30 @@ private:
   // To be implemented in derived classes
 
   /**
-   * Create and connect a constraint for a scene-object.
+   * Clone the actual constraint
+   *
+   * @param object to clone to
+   * @return pointer to the clone
+   */
+  virtual ConstraintBase* DoClone( Object& object ) = 0;
+
+  /**
+   * Connect the constraint
    */
   virtual void ConnectConstraint() = 0;
 
 protected:
 
   /**
+   * Helper to Add an input property to the container of property owners
+   * @param source constraint[in] source used to determine the type and locate the property on the object
+   * @param propertyOwners[out] reference to the container to add
+   * @param componentIndex[out] component index
+   * @return pointer to input property if it was found, nullptr otherwise
+   */
+  PropertyInputImpl* AddInputProperty( Source& source, SceneGraph::PropertyOwnerContainer& propertyOwners, int32_t& componentIndex );
+
+  /**
    * Get the event thread services object - used for sending messages to the scene graph
    * Assert if called from the wrong thread.
    * This is intentionally inline for performance reasons.
@@ -206,7 +224,7 @@ protected:
   ObjectContainer mObservedObjects; // We don't observe the same object twice
   Property::Index mTargetPropertyIndex;
   RemoveAction mRemoveAction;
-  unsigned int mTag;
+  uint32_t mTag;
   bool mApplied:1; ///< Whether the constraint has been applied
   bool mSourceDestroyed:1; ///< Is set to true if any of our input source objects are destroyed
 };
index 0fc820d..e5007f9 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_ACTIVE_CONSTRAINT_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,21 +43,6 @@ namespace Internal
 {
 
 /**
- * Helper to add only unique entries to the propertyOwner container
- * @param propertyOwners to add the entries to
- * @param object to add
- */
-inline void AddUnique( SceneGraph::PropertyOwnerContainer& propertyOwners, SceneGraph::PropertyOwner* object )
-{
-  const SceneGraph::PropertyOwnerIter iter = std::find( propertyOwners.Begin(), propertyOwners.End(), object );
-  if( iter == propertyOwners.End() )
-  {
-    // each owner should only be added once
-    propertyOwners.PushBack( object );
-  }
-}
-
-/**
  * Connects a constraint which takes another property as an input.
  */
 template < typename PropertyType >
@@ -65,10 +50,7 @@ class Constraint : public ConstraintBase
 {
 public:
 
-  typedef SceneGraph::Constraint< PropertyType, PropertyAccessor<PropertyType> > SceneGraphConstraint;
-  typedef const SceneGraph::AnimatableProperty<PropertyType>* ScenePropertyPtr;
-  typedef typename PropertyConstraintPtr<PropertyType>::Type ConstraintFunctionPtr;
-  typedef const SceneGraph::TransformManagerPropertyHandler<PropertyType> TransformManagerProperty;
+  using ConstraintFunctionPtr = typename PropertyConstraintPtr<PropertyType>::Type;
 
   /**
    * Construct a new constraint.
@@ -83,42 +65,31 @@ public:
                               SourceContainer& sources,
                               ConstraintFunctionPtr func )
   {
-    return new Constraint< PropertyType >( object, targetIndex, sources, func );
+    return new Constraint( object, targetIndex, sources, func );
   }
 
   /**
-   * @copydoc ConstraintBase::Clone()
+   * Virtual destructor.
    */
-  virtual ConstraintBase* Clone( Object& object )
+  virtual ~Constraint()
   {
-    DALI_ASSERT_ALWAYS( !mSourceDestroyed && "An input source object has been destroyed" );
-
-    ConstraintBase* clone( NULL );
-
-    ConstraintFunctionPtr funcPtr( mUserFunction->Clone() );
-
-    clone = new Constraint< PropertyType >( object,
-                                            mTargetIndex,
-                                            mSources,
-                                            funcPtr );
-
-    clone->SetRemoveAction(mRemoveAction);
-    clone->SetTag( mTag );
-
-    return clone;
+    // This is not responsible for removing constraints.
   }
 
+private:
 
   /**
-   * Virtual destructor.
+   * @copydoc ConstraintBase::DoClone()
    */
-  virtual ~Constraint()
+  ConstraintBase* DoClone( Object& object ) override final
   {
-    // This is not responsible for removing constraints.
+    ConstraintFunctionPtr funcPtr( mUserFunction->Clone() );
+    return new Constraint( object,
+                            mTargetPropertyIndex,
+                            mSources,
+                            funcPtr );
   }
 
-private:
-
   /**
    * Private constructor; see also Constraint::New().
    */
@@ -127,77 +98,63 @@ private:
               SourceContainer& sources,
               ConstraintFunctionPtr& func )
   : ConstraintBase( object, targetIndex, sources ),
-    mTargetIndex( targetIndex ),
     mUserFunction( func )
   {
   }
 
   // Undefined
-  Constraint( const Constraint& );
+  Constraint() = delete;
+  Constraint( const Constraint& ) = delete;
+  Constraint& operator=( const Constraint& rhs ) = delete;
 
-  // Undefined
-  Constraint& operator=( const Constraint& rhs );
 
   /**
-   * Create and connect a constraint and property resetter for a scene-graph property
+   * @copydoc ConstraintBase::ConnectConstraint()
    */
-  void ConnectConstraint()
+  void ConnectConstraint() override final
   {
     // Should not come here if target object has been destroyed
-    DALI_ASSERT_DEBUG( NULL != mTargetObject );
+    DALI_ASSERT_DEBUG( nullptr != mTargetObject );
 
     // Guard against double connections
-    DALI_ASSERT_DEBUG( NULL == mSceneGraphConstraint );
+    DALI_ASSERT_DEBUG( nullptr == mSceneGraphConstraint );
 
-    // Short-circuit until the target scene-object exists
-    SceneGraph::PropertyOwner* targetObject = const_cast< SceneGraph::PropertyOwner* >( mTargetObject->GetSceneObject() );
-    if ( NULL == targetObject )
-    {
-      return;
-    }
+    SceneGraph::PropertyOwner& targetObject = const_cast< SceneGraph::PropertyOwner& >( mTargetObject->GetSceneObject() );
 
     // Build a container of property-owners, providing the scene-graph properties
     SceneGraph::PropertyOwnerContainer propertyOwners;
-    propertyOwners.PushBack( targetObject );
+    propertyOwners.PushBack( &targetObject );
 
     // Build the constraint function; this requires a scene-graph property from each source
     ConstraintFunctionPtr func( ConnectConstraintFunction( propertyOwners ) );
 
     if ( func )
     {
-      // Create the SceneGraphConstraint and PropertyResetter, and connect them to the scene-graph
-
-      const SceneGraph::PropertyBase* targetProperty = mTargetObject->GetSceneObjectAnimatableProperty( mTargetIndex );
       OwnerPointer<SceneGraph::PropertyResetterBase> resetter;
-
-      // The targetProperty should exist, when targetObject exists
-      DALI_ASSERT_ALWAYS( NULL != targetProperty && "Constraint target property does not exist" );
-
+      // Create the SceneGraphConstraint and PropertyResetter, and connect them to the scene-graph
+      const SceneGraph::PropertyBase* targetProperty = mTargetObject->GetSceneObjectAnimatableProperty( mTargetPropertyIndex );
+      DALI_ASSERT_ALWAYS( targetProperty && "Constraint target property does not exist" );
       if( targetProperty->IsTransformManagerProperty() )  //It is a property managed by the transform manager
       {
         // Connect the constraint
-        mSceneGraphConstraint =
-          SceneGraph::Constraint<PropertyType, TransformManagerPropertyAccessor<PropertyType> >::New( *targetProperty,
-                                                                                                      propertyOwners,
-                                                                                                      func,
-                                                                                                      mRemoveAction );
+        mSceneGraphConstraint = SceneGraph::Constraint< PropertyType, TransformManagerPropertyAccessor<PropertyType> >::New( *targetProperty,
+                                                                                                                             propertyOwners,
+                                                                                                                             func,
+                                                                                                                             mRemoveAction );
         // Don't create a resetter for transform manager property, it's less efficient
       }
       else  //SceneGraph property
       {
         // Connect the constraint
-        mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty,
-                                                           propertyOwners,
-                                                           func,
-                                                           mRemoveAction );
-        // Connect the resetter
-        resetter = SceneGraph::ConstraintResetter::New( *targetObject, *targetProperty, *mSceneGraphConstraint );
-
+        mSceneGraphConstraint = SceneGraph::Constraint< PropertyType, PropertyAccessor<PropertyType> >::New( *targetProperty,
+                                                                                                             propertyOwners,
+                                                                                                             func,
+                                                                                                             mRemoveAction );
+        resetter = SceneGraph::ConstraintResetter::New( targetObject, *targetProperty, *mSceneGraphConstraint );
       }
       OwnerPointer< SceneGraph::ConstraintBase > transferOwnership( const_cast< SceneGraph::ConstraintBase* >( mSceneGraphConstraint ) );
-      ApplyConstraintMessage( GetEventThreadServices(), *targetObject, transferOwnership );
-
-      if( resetter != nullptr )
+      ApplyConstraintMessage( GetEventThreadServices(), targetObject, transferOwnership );
+      if( resetter )
       {
         AddResetterMessage( GetEventThreadServices().GetUpdateManager(), resetter );
       }
@@ -208,82 +165,27 @@ private:
    * Helper for ConnectConstraint. Creates a connected constraint-function.
    * Also populates the property-owner container, for each input connected to the constraint-function.
    * @param[out] propertyOwners The container of property-owners providing the scene-graph properties.
-   * @return A connected constraint-function, or NULL if the scene-graph properties are not available.
+   * @return A connected constraint-function, or nullptr if the scene-graph properties are not available.
    */
   PropertyConstraint<PropertyType>* ConnectConstraintFunction( SceneGraph::PropertyOwnerContainer& propertyOwners )
   {
     PropertyConstraint<PropertyType>* func = mUserFunction->Clone();
 
-    for ( SourceIter iter = mSources.begin(); mSources.end() != iter; ++iter )
+    for ( auto&& source : mSources )
     {
-      Source& source = *iter;
+      int32_t componentIndex = Property::INVALID_COMPONENT_INDEX;
+      PropertyInputImpl* inputProperty = AddInputProperty( source, propertyOwners, componentIndex );
 
-      PropertyInputImpl* inputProperty( NULL );
-      int componentIndex( Property::INVALID_COMPONENT_INDEX );
-
-      if ( OBJECT_PROPERTY == source.sourceType )
-      {
-        DALI_ASSERT_ALWAYS( source.object->IsPropertyAConstraintInput( source.propertyIndex ) );
-
-        SceneGraph::PropertyOwner* owner = const_cast< SceneGraph::PropertyOwner* >( source.object->GetSceneObject() );
-
-        // The property owner will not exist, if the target object is off-stage
-        if( NULL != owner )
-        {
-          AddUnique( propertyOwners, owner );
-          inputProperty = const_cast< PropertyInputImpl* >( source.object->GetSceneObjectInputProperty( source.propertyIndex ) );
-          componentIndex = source.object->GetPropertyComponentIndex( source.propertyIndex );
-
-          // The scene-object property should exist, when the property owner exists
-          DALI_ASSERT_ALWAYS( NULL != inputProperty && "Constraint source property does not exist" );
-        }
-      }
-      else if ( LOCAL_PROPERTY == source.sourceType )
-      {
-        DALI_ASSERT_ALWAYS( mTargetObject->IsPropertyAConstraintInput( source.propertyIndex ) );
-
-        inputProperty = const_cast< PropertyInputImpl* >( mTargetObject->GetSceneObjectInputProperty( source.propertyIndex ) );
-        componentIndex = mTargetObject->GetPropertyComponentIndex( source.propertyIndex );
-
-        // The target scene-object should provide this property
-        DALI_ASSERT_ALWAYS( NULL != inputProperty && "Constraint source property does not exist" );
-      }
-      else
-      {
-        DALI_ASSERT_ALWAYS( PARENT_PROPERTY == source.sourceType && "Constraint source property type is invalid" );
-
-        Object* objectParent = dynamic_cast< Actor& >( *mTargetObject ).GetParent();
-
-        // This will not exist, if the target object is off-stage
-        if ( NULL != objectParent )
-        {
-          DALI_ASSERT_ALWAYS( objectParent->IsPropertyAConstraintInput( source.propertyIndex ) );
-
-          SceneGraph::PropertyOwner* owner = const_cast< SceneGraph::PropertyOwner* >( objectParent->GetSceneObject() );
-
-          // The property owner will not exist, if the parent object is off-stage
-          if ( NULL != owner )
-          {
-            AddUnique( propertyOwners, owner );
-            inputProperty = const_cast< PropertyInputImpl* >( objectParent->GetSceneObjectInputProperty( source.propertyIndex ) );
-            componentIndex = objectParent->GetPropertyComponentIndex( source.propertyIndex );
-
-            // The scene-object property should exist, when the property owner exists
-            DALI_ASSERT_ALWAYS( NULL != inputProperty && "Constraint source property does not exist" );
-          }
-        }
-      }
-
-      if ( NULL == inputProperty )
+      if ( nullptr == inputProperty )
       {
         delete func;
-        func = NULL;
+        func = nullptr;
 
         // Exit if a scene-graph object is not available from one of the sources
         break;
       }
 
-      func->SetInput( ( iter - mSources.begin() ), componentIndex, *inputProperty );
+      func->AddInput( inputProperty, componentIndex );
     }
 
     return func;
@@ -291,20 +193,19 @@ private:
 
 protected:
 
-  Property::Index mTargetIndex;
-
   ConstraintFunctionPtr mUserFunction;
+
 };
 
 /**
- * Variant which allows float components to be animated individually.
+ * Variant which allows float components to be constrained individually.
  */
 template <>
 class Constraint<float> : public ConstraintBase
 {
 public:
 
-  typedef typename PropertyConstraintPtr<float>::Type ConstraintFunctionPtr;
+  using ConstraintFunctionPtr = typename PropertyConstraintPtr<float>::Type;
 
   /**
    * Construct a new constraint.
@@ -319,29 +220,7 @@ public:
                               SourceContainer& sources,
                               ConstraintFunctionPtr func )
   {
-    return new Constraint< float >( object, targetIndex, sources, func );
-  }
-
-  /**
-   * @copydoc ConstraintBase::Clone()
-   */
-  virtual ConstraintBase* Clone( Object& object )
-  {
-    DALI_ASSERT_ALWAYS( !mSourceDestroyed && "An input source object has been destroyed" );
-
-    ConstraintBase* clone( NULL );
-
-    ConstraintFunctionPtr funcPtr( mUserFunction->Clone() );
-
-    clone = new Constraint< float >( object,
-                                     mTargetIndex,
-                                     mSources,
-                                     funcPtr );
-
-    clone->SetRemoveAction(mRemoveAction);
-    clone->SetTag( mTag );
-
-    return clone;
+    return new Constraint( object, targetIndex, sources, func );
   }
 
   /**
@@ -355,6 +234,18 @@ public:
 private:
 
   /**
+   * @copydoc ConstraintBase::DoClone()
+   */
+  virtual ConstraintBase* DoClone( Object& object ) override final
+  {
+    ConstraintFunctionPtr funcPtr( mUserFunction->Clone() );
+    return new Constraint( object,
+                           mTargetPropertyIndex,
+                           mSources,
+                           funcPtr );
+  }
+
+  /**
    * Private constructor; see also Constraint::New().
    */
   Constraint( Object& object,
@@ -362,38 +253,30 @@ private:
               SourceContainer& sources,
               ConstraintFunctionPtr& func )
   : ConstraintBase( object, targetIndex, sources ),
-    mTargetIndex( targetIndex ),
     mUserFunction( func )
   {
   }
 
   // Undefined
-  Constraint( const Constraint& );
-
-  // Undefined
-  Constraint& operator=( const Constraint& rhs );
+  Constraint() = delete;
+  Constraint( const Constraint& ) = delete;
+  Constraint& operator=( const Constraint& rhs ) = delete;
 
   /**
-   * Create and connect a constraint for a scene-object.
+   * @copydoc ConstraintBase::ConnectConstraint()
    */
-  void ConnectConstraint()
+  void ConnectConstraint() override final
   {
-    // Should not come here if target-object has been destroyed
-    DALI_ASSERT_DEBUG( NULL != mTargetObject );
-
+    // Should not come here if target object has been destroyed
+    DALI_ASSERT_DEBUG( nullptr != mTargetObject );
     // Guard against double connections
-    DALI_ASSERT_DEBUG( NULL == mSceneGraphConstraint );
+    DALI_ASSERT_DEBUG( nullptr == mSceneGraphConstraint );
 
-    // Short-circuit until the target scene-object exists
-    SceneGraph::PropertyOwner* targetObject = const_cast< SceneGraph::PropertyOwner* >( mTargetObject->GetSceneObject() );
-    if ( NULL == targetObject )
-    {
-      return;
-    }
+    SceneGraph::PropertyOwner& targetObject = const_cast< SceneGraph::PropertyOwner& >( mTargetObject->GetSceneObject() );
 
     // Build a container of property-owners, providing the scene-graph properties
     SceneGraph::PropertyOwnerContainer propertyOwners;
-    propertyOwners.PushBack( targetObject );
+    propertyOwners.PushBack( &targetObject );
 
     // Build the constraint function; this requires a scene-graph property from each source
     ConstraintFunctionPtr func( ConnectConstraintFunction( propertyOwners ) );
@@ -401,47 +284,34 @@ private:
     if ( func )
     {
       // Create the SceneGraphConstraint, and connect to the scene-graph
-
-      const SceneGraph::PropertyBase* targetProperty = mTargetObject->GetSceneObjectAnimatableProperty( mTargetIndex );
-      OwnerPointer<SceneGraph::PropertyResetterBase> resetter;
-
+      bool resetterRequired = false;
+      const SceneGraph::PropertyBase* targetProperty = mTargetObject->GetSceneObjectAnimatableProperty( mTargetPropertyIndex );
       // The targetProperty should exist, when targetObject exists
-      DALI_ASSERT_ALWAYS( NULL != targetProperty && "Constraint target property does not exist" );
-
-      const int componentIndex = mTargetObject->GetPropertyComponentIndex( mTargetIndex );
-
+      DALI_ASSERT_ALWAYS( nullptr != targetProperty && "Constraint target property does not exist" );
+      const int32_t componentIndex = mTargetObject->GetPropertyComponentIndex( mTargetPropertyIndex );
       if ( Property::INVALID_COMPONENT_INDEX == componentIndex )
       {
         // Not a Vector2, Vector3 or Vector4 component, expecting float type
         DALI_ASSERT_DEBUG( PropertyTypes::Get< float >() == targetProperty->GetType() );
 
-        typedef SceneGraph::Constraint< float, PropertyAccessor<float> > SceneGraphConstraint;
-
-        mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
-        resetter = SceneGraph::ConstraintResetter::New( *targetObject, *targetProperty, *mSceneGraphConstraint );
+        mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyAccessor<float> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
+        resetterRequired = true;
       }
       else
       {
         // Expecting Vector2, Vector3 or Vector4 type
-
         if ( PropertyTypes::Get< Vector2 >() == targetProperty->GetType() )
         {
           // Constrain float component of Vector2 property
-
           if ( 0 == componentIndex )
           {
-            typedef SceneGraph::Constraint< float, PropertyComponentAccessorX<Vector2> > SceneGraphConstraint;
-            mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+            mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyComponentAccessorX<Vector2> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
           }
           else if ( 1 == componentIndex )
           {
-            typedef SceneGraph::Constraint< float, PropertyComponentAccessorY<Vector2> > SceneGraphConstraint;
-            mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
-          }
-          if( mSceneGraphConstraint )
-          {
-            resetter = SceneGraph::ConstraintResetter::New( *targetObject, *targetProperty, *mSceneGraphConstraint );
+            mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyComponentAccessorY<Vector2> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
           }
+          resetterRequired = (mSceneGraphConstraint != nullptr);
         }
         else if ( PropertyTypes::Get< Vector3 >() == targetProperty->GetType() )
         {
@@ -450,18 +320,24 @@ private:
           {
             if ( 0 == componentIndex )
             {
-              typedef SceneGraph::Constraint< float, TransformManagerPropertyComponentAccessor<Vector3,0> > SceneGraphConstraint;
-              mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+              mSceneGraphConstraint = SceneGraph::Constraint< float, TransformManagerPropertyComponentAccessor<Vector3,0> >::New( *targetProperty,
+                                                                                                                                  propertyOwners,
+                                                                                                                                  func,
+                                                                                                                                  mRemoveAction );
             }
             else if ( 1 == componentIndex )
             {
-              typedef SceneGraph::Constraint< float, TransformManagerPropertyComponentAccessor<Vector3,1> > SceneGraphConstraint;
-              mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+              mSceneGraphConstraint = SceneGraph::Constraint< float, TransformManagerPropertyComponentAccessor<Vector3,1> >::New( *targetProperty,
+                                                                                                                                  propertyOwners,
+                                                                                                                                  func,
+                                                                                                                                  mRemoveAction );
             }
             else if ( 2 == componentIndex )
             {
-              typedef SceneGraph::Constraint< float, TransformManagerPropertyComponentAccessor<Vector3,2> > SceneGraphConstraint;
-              mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+              mSceneGraphConstraint = SceneGraph::Constraint< float, TransformManagerPropertyComponentAccessor<Vector3,2> >::New( *targetProperty,
+                                                                                                                                  propertyOwners,
+                                                                                                                                  func,
+                                                                                                                                  mRemoveAction );
             }
             // Do not create a resetter for transform manager property
           }
@@ -469,65 +345,51 @@ private:
           {
             if ( 0 == componentIndex )
             {
-              typedef SceneGraph::Constraint< float, PropertyComponentAccessorX<Vector3> > SceneGraphConstraint;
-              mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+              mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyComponentAccessorX<Vector3> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
             }
             else if ( 1 == componentIndex )
             {
-              typedef SceneGraph::Constraint< float, PropertyComponentAccessorY<Vector3> > SceneGraphConstraint;
-              mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+              mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyComponentAccessorY<Vector3> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
             }
             else if ( 2 == componentIndex )
             {
-              typedef SceneGraph::Constraint< float, PropertyComponentAccessorZ<Vector3> > SceneGraphConstraint;
-              mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
-            }
-            if( mSceneGraphConstraint )
-            {
-              resetter = SceneGraph::ConstraintResetter::New( *targetObject, *targetProperty, *mSceneGraphConstraint );
+              mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyComponentAccessorZ<Vector3> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
             }
+            resetterRequired = (mSceneGraphConstraint != nullptr);
           }
         }
         else if ( PropertyTypes::Get< Vector4 >() == targetProperty->GetType() )
         {
           // Constrain float component of Vector4 property
-
           if ( 0 == componentIndex )
           {
-            typedef SceneGraph::Constraint< float, PropertyComponentAccessorX<Vector4> > SceneGraphConstraint;
-            mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+            mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyComponentAccessorX<Vector4> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
           }
           else if ( 1 == componentIndex )
           {
-            typedef SceneGraph::Constraint< float, PropertyComponentAccessorY<Vector4> > SceneGraphConstraint;
-            mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+            mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyComponentAccessorY<Vector4> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
           }
           else if ( 2 == componentIndex )
           {
-            typedef SceneGraph::Constraint< float, PropertyComponentAccessorZ<Vector4> > SceneGraphConstraint;
-            mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+            mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyComponentAccessorZ<Vector4> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
           }
           else if ( 3 == componentIndex )
           {
-            typedef SceneGraph::Constraint< float, PropertyComponentAccessorW<Vector4> > SceneGraphConstraint;
-            mSceneGraphConstraint = SceneGraphConstraint::New( *targetProperty, propertyOwners, func, mRemoveAction );
+            mSceneGraphConstraint = SceneGraph::Constraint< float, PropertyComponentAccessorW<Vector4> >::New( *targetProperty, propertyOwners, func, mRemoveAction );
           }
 
-          if( mSceneGraphConstraint )
-          {
-            resetter = SceneGraph::ConstraintResetter::New( *targetObject, *targetProperty, *mSceneGraphConstraint );
-          }
+          resetterRequired = (mSceneGraphConstraint != nullptr);
         }
       }
-
       if( mSceneGraphConstraint )
       {
         OwnerPointer< SceneGraph::ConstraintBase > transferOwnership( const_cast< SceneGraph::ConstraintBase* >( mSceneGraphConstraint ) );
-        ApplyConstraintMessage( GetEventThreadServices(), *targetObject, transferOwnership );
-      }
-      if( resetter != nullptr )
-      {
-        AddResetterMessage( GetEventThreadServices().GetUpdateManager(), resetter );
+        ApplyConstraintMessage( GetEventThreadServices(), targetObject, transferOwnership );
+        if( resetterRequired )
+        {
+          OwnerPointer<SceneGraph::PropertyResetterBase> resetter = SceneGraph::ConstraintResetter::New( targetObject, *targetProperty, *mSceneGraphConstraint );
+          AddResetterMessage( GetEventThreadServices().GetUpdateManager(), resetter );
+        }
       }
     }
   }
@@ -536,82 +398,27 @@ private:
    * Helper for ConnectConstraint. Creates a connected constraint-function.
    * Also populates the property-owner container, for each input connected to the constraint-function.
    * @param[out] propertyOwners The container of property-owners providing the scene-graph properties.
-   * @return A connected constraint-function, or NULL if the scene-graph properties are not available.
+   * @return A connected constraint-function, or nullptr if the scene-graph properties are not available.
    */
   PropertyConstraint<float>* ConnectConstraintFunction( SceneGraph::PropertyOwnerContainer& propertyOwners )
   {
     PropertyConstraint<float>* func = mUserFunction->Clone();
 
-    for ( SourceIter iter = mSources.begin(); mSources.end() != iter; ++iter )
+    for ( auto&& source : mSources )
     {
-      Source& source = *iter;
-
-      PropertyInputImpl* inputProperty( NULL );
-      int componentIndex( Property::INVALID_COMPONENT_INDEX );
-
-      if ( OBJECT_PROPERTY == source.sourceType )
-      {
-        DALI_ASSERT_ALWAYS( source.object->IsPropertyAConstraintInput( source.propertyIndex ) );
-
-        SceneGraph::PropertyOwner* owner = const_cast< SceneGraph::PropertyOwner* >( source.object->GetSceneObject() );
-
-        // The property owner will not exist, if the target object is off-stage
-        if( NULL != owner )
-        {
-          AddUnique( propertyOwners, owner );
-          inputProperty = const_cast< PropertyInputImpl* >( source.object->GetSceneObjectInputProperty( source.propertyIndex ) );
-          componentIndex = source.object->GetPropertyComponentIndex( source.propertyIndex );
-
-          // The scene-object property should exist, when the property owner exists
-          DALI_ASSERT_ALWAYS( NULL != inputProperty && "Constraint source property does not exist" );
-        }
-      }
-      else if ( LOCAL_PROPERTY == source.sourceType )
-      {
-        DALI_ASSERT_ALWAYS( mTargetObject->IsPropertyAConstraintInput( source.propertyIndex ) );
-
-        inputProperty = const_cast< PropertyInputImpl* >( mTargetObject->GetSceneObjectInputProperty( source.propertyIndex ) );
-        componentIndex = mTargetObject->GetPropertyComponentIndex( source.propertyIndex );
+      int32_t componentIndex = Property::INVALID_COMPONENT_INDEX;
+      PropertyInputImpl* inputProperty = AddInputProperty( source, propertyOwners, componentIndex );
 
-        // The target scene-object should provide this property
-        DALI_ASSERT_ALWAYS( NULL != inputProperty && "Constraint source property does not exist" );
-      }
-      else
-      {
-        DALI_ASSERT_ALWAYS( PARENT_PROPERTY == source.sourceType && "Constraint source property type is invalid" );
-
-        Object* objectParent = dynamic_cast< Actor& >( *mTargetObject ).GetParent();
-
-        // This will not exist, if the target object is off-stage
-        if ( NULL != objectParent )
-        {
-          DALI_ASSERT_ALWAYS( objectParent->IsPropertyAConstraintInput( source.propertyIndex ) );
-
-          SceneGraph::PropertyOwner* owner = const_cast< SceneGraph::PropertyOwner* >( objectParent->GetSceneObject() );
-
-          // The property owner will not exist, if the parent object is off-stage
-          if ( NULL != owner )
-          {
-            AddUnique( propertyOwners, owner );
-            inputProperty = const_cast< PropertyInputImpl* >( objectParent->GetSceneObjectInputProperty( source.propertyIndex ) );
-            componentIndex = objectParent->GetPropertyComponentIndex( source.propertyIndex );
-
-            // The scene-object property should exist, when the property owner exists
-            DALI_ASSERT_ALWAYS( NULL != inputProperty && "Constraint source property does not exist" );
-          }
-        }
-      }
-
-      if ( NULL == inputProperty )
+      if ( nullptr == inputProperty )
       {
         delete func;
-        func = NULL;
+        func = nullptr;
 
         // Exit if a scene-graph object is not available from one of the sources
         break;
       }
 
-      func->SetInput( ( iter - mSources.begin() ), componentIndex, *inputProperty );
+      func->AddInput( inputProperty, componentIndex );
     }
 
     return func;
@@ -619,9 +426,8 @@ private:
 
 protected:
 
-  Property::Index mTargetIndex;
-
   ConstraintFunctionPtr mUserFunction;
+
 };
 
 } // namespace Internal
index a111c17..ac1bd93 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -82,7 +82,7 @@ void KeyFrames::CreateKeyFramesSpec(Property::Type type)
     }
     default:
     {
-      DALI_ABORT( "Type not animateable" );
+      DALI_ABORT( "Property type is not animatable" );
       break;
     }
   }
@@ -164,7 +164,7 @@ Property::Value KeyFrames::GetLastKeyFrameValue() const
 {
   Property::Value value;
 
-  unsigned int noOfKeyFrames = mKeyFrames->GetNumberOfKeyFrames();
+  std::size_t noOfKeyFrames = mKeyFrames->GetNumberOfKeyFrames();
   if( noOfKeyFrames )
   {
     mKeyFrames->GetKeyFrameAsValue( noOfKeyFrames - 1, value );
index 7146a2a..cfdc0da 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_KEY_FRAMES_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -119,14 +119,14 @@ public:
 
   KeyFrameSpec() {}
 
-  virtual unsigned int GetNumberOfKeyFrames() const = 0;
+  virtual std::size_t GetNumberOfKeyFrames() const = 0;
 
   /**
    * Get the key frame value as a Property::Value.
    * @param[in] index The index of the key frame to fetch
    * @param[out] value The value of the given key frame
    */
-  virtual void GetKeyFrameAsValue( unsigned int index, Property::Value& value ) = 0;
+  virtual void GetKeyFrameAsValue( std::size_t index, Property::Value& value ) = 0;
 
 protected:
 
@@ -220,7 +220,7 @@ public:
    * Get the number of key frames
    * @return The size of the progress value vector
    */
-  virtual unsigned int GetNumberOfKeyFrames() const
+  virtual std::size_t GetNumberOfKeyFrames() const
   {
     return mPVs.size();
   }
@@ -241,7 +241,7 @@ public:
   /**
    * @copydoc KeyFrameSpec::GetKeyFrameAsValue()
    */
-  virtual void GetKeyFrameAsValue( unsigned int index, Property::Value& value )
+  virtual void GetKeyFrameAsValue( std::size_t index, Property::Value& value )
   {
     value = mPVs[index].mValue;
   }
index 41f6248..0efb00e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
-#include <dali/internal/event/common/property-helper.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/object/property-array.h>
+#include <dali/public-api/object/type-registry.h>
+#include <dali/internal/event/common/property-helper.h>
 
 
 namespace Dali
@@ -41,7 +42,14 @@ namespace
 DALI_PROPERTY_TABLE_BEGIN
 DALI_PROPERTY( "value",        ARRAY,     true,    false,       false,        Dali::LinearConstrainer::Property::VALUE )
 DALI_PROPERTY( "progress",     ARRAY,     true,    false,       false,        Dali::LinearConstrainer::Property::PROGRESS )
-DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX )
+DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX, LinearConstrainerDefaultProperties )
+
+BaseHandle Create()
+{
+  return Dali::LinearConstrainer::New();
+}
+
+TypeRegistration mType( typeid( Dali::LinearConstrainer ), typeid( Dali::Handle ), Create, LinearConstrainerDefaultProperties );
 
 } //Unnamed namespace
 
@@ -59,72 +67,18 @@ LinearConstrainer::~LinearConstrainer()
 {
 }
 
-unsigned int LinearConstrainer::GetDefaultPropertyCount() const
-{
-  return DEFAULT_PROPERTY_COUNT;
-}
-
-void LinearConstrainer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  indices.Reserve( DEFAULT_PROPERTY_COUNT );
-
-  for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    indices.PushBack( i );
-  }
-}
-
-const char* LinearConstrainer::GetDefaultPropertyName(Property::Index index) const
-{
-  if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].name;
-  }
-
-  // index out of range
-  return NULL;
-}
-
-Property::Index LinearConstrainer::GetDefaultPropertyIndex(const std::string& name) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
-    if( 0 == strcmp( name.c_str(), property->name ) )
-    {
-      index = i;
-      break;
-    }
-  }
-  return index;
-}
-
-Property::Type LinearConstrainer::GetDefaultPropertyType(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].type;
-  }
-
-  // index out of range
-  return Property::NONE;
-}
-
 Property::Value LinearConstrainer::GetDefaultProperty( Property::Index index ) const
 {
   if( index == Dali::LinearConstrainer::Property::VALUE )
   {
     Property::Value value( Property::ARRAY );
     Property::Array* array = value.GetArray();
-    size_t count( mValue.Size() );
+    uint32_t count = static_cast<uint32_t>( mValue.Size() );
 
     if( array )
     {
       array->Reserve( count );
-      for( size_t i( 0 ); i != count; ++i )
+      for( uint32_t i( 0 ); i != count; ++i )
       {
         array->PushBack( mValue[i] );
       }
@@ -135,12 +89,12 @@ Property::Value LinearConstrainer::GetDefaultProperty( Property::Index index ) c
   {
     Property::Value value( Property::ARRAY );
     Property::Array* array = value.GetArray();
-    size_t count( mProgress.Size() );
+    uint32_t count = static_cast<uint32_t>( mProgress.Size() );
 
     if( array )
     {
       array->Reserve( count );
-      for( size_t i( 0 ); i != count; ++i )
+      for( uint32_t i( 0 ); i != count; ++i )
       {
         array->PushBack( mProgress[i] );
       }
@@ -161,12 +115,12 @@ void LinearConstrainer::SetDefaultProperty( Property::Index index, const Propert
   const Property::Array* array = propertyValue.GetArray();
   if( array )
   {
-    size_t propertyArrayCount = array->Count();
+    uint32_t propertyArrayCount = static_cast<uint32_t>( array->Count() );
     if( index == Dali::LinearConstrainer::Property::VALUE  )
     {
       mValue.Clear(); // remove old values
       mValue.Resize( propertyArrayCount );
-      for( size_t i(0); i != propertyArrayCount; ++i )
+      for( uint32_t i(0); i != propertyArrayCount; ++i )
       {
         array->GetElementAt( i ).Get( mValue[ i ] );
       }
@@ -175,7 +129,7 @@ void LinearConstrainer::SetDefaultProperty( Property::Index index, const Propert
     {
       mProgress.Clear(); // remove old values
       mProgress.Resize( propertyArrayCount );
-      for( size_t i(0); i != propertyArrayCount; ++i )
+      for( uint32_t i(0); i != propertyArrayCount; ++i )
       {
         array->GetElementAt( i ).Get( mProgress[ i ] );
       }
@@ -183,46 +137,15 @@ void LinearConstrainer::SetDefaultProperty( Property::Index index, const Propert
   }
 }
 
-bool LinearConstrainer::IsDefaultPropertyWritable(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].writable;
-  }
-
-  return false;
-}
-
-bool LinearConstrainer::IsDefaultPropertyAnimatable(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].animatable;
-  }
-
-  return false;
-}
-
-bool LinearConstrainer::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].constraintInput;
-  }
-
-  return false;
-}
-
 void LinearConstrainer::Apply( Property target, Property source, const Vector2& range, const Vector2& wrap)
 {
   Dali::Constraint constraint = Dali::Constraint::New<float>( target.object, target.propertyIndex, LinearConstraintFunctor( mValue, mProgress, range, wrap ) );
   constraint.AddSource( Dali::Source(source.object, source.propertyIndex ) );
 
-  constraint.SetTag( reinterpret_cast<size_t>( this ) );
+  constraint.SetTag( static_cast<uint32_t>( reinterpret_cast<uintptr_t>( this ) ) ); // taking 32bits of this as tag
   constraint.SetRemoveAction( Dali::Constraint::Discard );
   constraint.Apply();
 
-
   //Start observing the object
   Observe( target.object );
 }
index 22cec38..892ce4e 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_LINEAR_CONSTRAINER_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ struct LinearConstraintFunctor
   void operator()( float& value,
                    const PropertyInputContainer& inputs)
   {
-    size_t valueCount(  mValue.Size() );
+    uint32_t valueCount = static_cast<uint32_t>(  mValue.Size() );
     if( valueCount == 0 )
     {
       //No values.
@@ -84,29 +84,29 @@ struct LinearConstraintFunctor
       float t = (( inputWrapped - mRange.x ) / ( mRange.y-mRange.x ));
 
       //Find min and max values and local t between them
-      size_t min(0);
-      size_t max(0);
+      uint32_t min(0);
+      uint32_t max(0);
       float tLocal(0.0f);
       if( mProgress.Size() < valueCount )
       {
-        float step = 1.0f / (valueCount-1.0f);
-        float tLocation = t/step;
-        if( tLocation < 0)
+        float step = 1.0f / (static_cast<float>( valueCount ) - 1.0f);
+        float tLocation = t / step;
+        if( tLocation < 0 )
         {
           min = 0;
           max = 1;
         }
-        else if( tLocation >= valueCount-1 )
+        else if( tLocation >= static_cast<float>( valueCount-1 ) )
         {
           min = max = valueCount-1;
         }
         else
         {
-          min = static_cast<size_t>(tLocation);
+          min = static_cast<uint32_t>(tLocation);
           max = min+1;
         }
 
-        tLocal = (t - min*step) / step;
+        tLocal = (t - static_cast<float>(min)*step) / step;
       }
       else
       {
@@ -164,46 +164,6 @@ protected:
 private:
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
-
-  /**
    * @copydoc Dali::Internal::Object::SetDefaultProperty()
    */
   virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
index b2d5497..de2766a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
-#include <dali/internal/event/common/property-helper.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/object/property-array.h>
+#include <dali/public-api/object/type-registry.h>
+#include <dali/internal/event/common/property-helper.h>
 
 namespace Dali
 {
@@ -41,7 +42,14 @@ DALI_PROPERTY_TABLE_BEGIN
 DALI_PROPERTY( "forward",       VECTOR3,   true,    false,       false,        Dali::PathConstrainer::Property::FORWARD )
 DALI_PROPERTY( "points",         ARRAY,    true,    false,       false,        Dali::PathConstrainer::Property::POINTS )
 DALI_PROPERTY( "controlPoints",  ARRAY,    true,    false,       false,        Dali::PathConstrainer::Property::CONTROL_POINTS )
-DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX )
+DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX, PathConstrainerDefaultProperties )
+
+BaseHandle Create()
+{
+  return Dali::PathConstrainer::New();
+}
+
+TypeRegistration mType( typeid( Dali::PathConstrainer ), typeid( Dali::Handle ), Create, PathConstrainerDefaultProperties );
 
 } //Unnamed namespace
 
@@ -60,60 +68,6 @@ PathConstrainer::~PathConstrainer()
 {
 }
 
-unsigned int PathConstrainer::GetDefaultPropertyCount() const
-{
-  return DEFAULT_PROPERTY_COUNT;
-}
-
-void PathConstrainer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  indices.Reserve( DEFAULT_PROPERTY_COUNT );
-
-  for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    indices.PushBack( i );
-  }
-}
-
-const char* PathConstrainer::GetDefaultPropertyName(Property::Index index) const
-{
-  if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].name;
-  }
-
-  // index out of range
-  return NULL;
-}
-
-Property::Index PathConstrainer::GetDefaultPropertyIndex(const std::string& name) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
-    if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
-    {
-      index = i;
-      break;
-    }
-  }
-  return index;
-}
-
-Property::Type PathConstrainer::GetDefaultPropertyType(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].type;
-  }
-
-  // index out of range
-  return Property::NONE;
-}
-
 Property::Value PathConstrainer::GetDefaultProperty( Property::Index index ) const
 {
   if( index == Dali::PathConstrainer::Property::FORWARD )
@@ -127,7 +81,7 @@ Property::Value PathConstrainer::GetDefaultProperty( Property::Index index ) con
       Property::Value value( Property::ARRAY );
       Property::Array* array = value.GetArray();
       const Dali::Vector<Vector3>& point = mPath->GetPoints();
-      Property::Array::SizeType pointCount = point.Size();
+      Property::Array::SizeType pointCount = static_cast<Property::Array::SizeType>( point.Size() );
 
       if( array )
       {
@@ -144,7 +98,7 @@ Property::Value PathConstrainer::GetDefaultProperty( Property::Index index ) con
       Property::Value value( Property::ARRAY );
       Property::Array* array = value.GetArray();
       const Dali::Vector<Vector3>& point = mPath->GetControlPoints();
-      Property::Array::SizeType pointCount = point.Size();
+      Property::Array::SizeType pointCount = static_cast<Property::Array::SizeType>( point.Size() );
 
       if( array )
       {
@@ -202,36 +156,6 @@ void PathConstrainer::SetDefaultProperty( Property::Index index, const Property:
   }
 }
 
-bool PathConstrainer::IsDefaultPropertyWritable(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].writable;
-  }
-
-  return false;
-}
-
-bool PathConstrainer::IsDefaultPropertyAnimatable(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].animatable;
-  }
-
-  return false;
-}
-
-bool PathConstrainer::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].constraintInput;
-  }
-
-  return false;
-}
-
 void PathConstrainer::Apply( Property target, Property source, const Vector2& range, const Vector2& wrap)
 {
   Dali::Property::Type propertyType = target.object.GetPropertyType( target.propertyIndex);
@@ -241,7 +165,7 @@ void PathConstrainer::Apply( Property target, Property source, const Vector2& ra
     Dali::Constraint constraint = Dali::Constraint::New<Vector3>( target.object, target.propertyIndex, PathConstraintFunctor( mPath, range, wrap ) );
     constraint.AddSource( Dali::Source(source.object, source.propertyIndex ) );
 
-    constraint.SetTag( reinterpret_cast<size_t>( this ) );
+    constraint.SetTag( static_cast<uint32_t>( reinterpret_cast<uintptr_t>( this ) ) ); // taking 32bits of this as tag
     constraint.SetRemoveAction( Dali::Constraint::Discard );
     constraint.Apply();
   }
@@ -251,7 +175,7 @@ void PathConstrainer::Apply( Property target, Property source, const Vector2& ra
     Dali::Constraint constraint = Dali::Constraint::New<Quaternion>( target.object, target.propertyIndex, PathConstraintFunctor( mPath, range, mForward, wrap) );
     constraint.AddSource( Dali::Source(source.object, source.propertyIndex ) );
 
-    constraint.SetTag( reinterpret_cast<size_t>( this ) );
+    constraint.SetTag( static_cast<uint32_t>( reinterpret_cast<uintptr_t>( this ) ) ); // taking 32bits of this as tag
     constraint.SetRemoveAction( Dali::Constraint::Discard );
     constraint.Apply();
   }
index 5cbf034..c1cd898 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_PATH_CONSTRAINER_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -136,46 +136,6 @@ protected:
 private:
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
-
-  /**
    * @copydoc Dali::Internal::Object::SetDefaultProperty()
    */
   virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
index 865c4fa..ad659dc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,9 +22,9 @@
 #include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
-#include <dali/internal/event/common/property-helper.h>
 #include <dali/public-api/object/property-array.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/internal/event/common/property-helper.h>
 
 namespace Dali
 {
@@ -41,7 +41,7 @@ namespace
 DALI_PROPERTY_TABLE_BEGIN
 DALI_PROPERTY( "points",         ARRAY, true, false, false,   Dali::Path::Property::POINTS         )
 DALI_PROPERTY( "controlPoints",  ARRAY, true, false, false,   Dali::Path::Property::CONTROL_POINTS )
-DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX )
+DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX, PathDefaultProperties )
 
 /**
  * These coefficient arise from the cubic polynomial equations for
@@ -67,7 +67,7 @@ Dali::BaseHandle Create()
   return Dali::Path::New();
 }
 
-Dali::TypeRegistration mType( typeid(Dali::Path), typeid(Dali::Handle), Create );
+TypeRegistration mType( typeid(Dali::Path), typeid(Dali::Handle), Create, PathDefaultProperties );
 
 inline bool PathIsComplete(const Dali::Vector<Vector3>& point, const Dali::Vector<Vector3>& controlPoint)
 {
@@ -82,7 +82,7 @@ Path* Path::New()
 }
 
 Path::Path()
-: Object()
+: Object( nullptr ) // we don't have our own scene object
 {
 }
 
@@ -99,60 +99,6 @@ Path* Path::Clone(const Path& path)
   return clone;
 }
 
-unsigned int Path::GetDefaultPropertyCount() const
-{
-  return DEFAULT_PROPERTY_COUNT;
-}
-
-void Path::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  indices.Reserve( DEFAULT_PROPERTY_COUNT );
-
-  for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    indices.PushBack( i );
-  }
-}
-
-const char* Path::GetDefaultPropertyName(Property::Index index) const
-{
-  if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].name;
-  }
-
-  // index out of range
-  return NULL;
-}
-
-Property::Index Path::GetDefaultPropertyIndex(const std::string& name) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
-    if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
-    {
-      index = i;
-      break;
-    }
-  }
-  return index;
-}
-
-Property::Type Path::GetDefaultPropertyType(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].type;
-  }
-
-  // index out of range
-  return Property::NONE;
-}
-
 Property::Value Path::GetDefaultProperty( Property::Index index ) const
 {
   if( index == Dali::Path::Property::POINTS )
@@ -191,11 +137,6 @@ Property::Value Path::GetDefaultProperty( Property::Index index ) const
   return Property::Value();
 }
 
-Property::Value Path::GetDefaultPropertyCurrentValue( Property::Index index ) const
-{
-  return GetDefaultProperty( index ); // Event-side only properties
-}
-
 void Path::SetDefaultProperty(Property::Index index, const Property::Value& propertyValue)
 {
   const Property::Array* array = propertyValue.GetArray();
@@ -225,36 +166,6 @@ void Path::SetDefaultProperty(Property::Index index, const Property::Value& prop
   }
 }
 
-bool Path::IsDefaultPropertyWritable(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].writable;
-  }
-
-  return false;
-}
-
-bool Path::IsDefaultPropertyAnimatable(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].animatable;
-  }
-
-  return false;
-}
-
-bool Path::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].constraintInput;
-  }
-
-  return false;
-}
-
 void Path::AddPoint(const Vector3& point )
 {
   mPoint.PushBack( point );
@@ -265,20 +176,20 @@ void Path::AddControlPoint(const Vector3& point )
   mControlPoint.PushBack( point );
 }
 
-unsigned int Path::GetNumberOfSegments() const
+uint32_t Path::GetNumberOfSegments() const
 {
-  return (mPoint.Size()>1)?mPoint.Size()-1:0;
+  return static_cast<uint32_t>( (mPoint.Size()>1) ? mPoint.Size()-1 : 0 );
 }
 
 void Path::GenerateControlPoints( float curvature )
 {
-  unsigned int numSegments = GetNumberOfSegments();
+  uint32_t numSegments = GetNumberOfSegments();
   DALI_ASSERT_ALWAYS( numSegments > 0 && "Need at least 1 segment to generate control points" ); // need at least 1 segment
 
   mControlPoint.Resize( numSegments * 2);
 
   //Generate two control points for each segment
-  for( unsigned int i(0); i<numSegments; ++i )
+  for( uint32_t i(0); i<numSegments; ++i )
   {
     //Segment end-points
     Vector3 p1 = mPoint[i];
@@ -329,10 +240,10 @@ void Path::GenerateControlPoints( float curvature )
   }
 }
 
-void Path::FindSegmentAndProgress( float t, unsigned int& segment, float& tLocal ) const
+void Path::FindSegmentAndProgress( float t, uint32_t& segment, float& tLocal ) const
 {
   //Find segment and local progress
-  unsigned int numSegs = GetNumberOfSegments();
+  uint32_t numSegs = GetNumberOfSegments();
 
   if( t <= 0.0f || numSegs == 0 )
   {
@@ -346,10 +257,10 @@ void Path::FindSegmentAndProgress( float t, unsigned int& segment, float& tLocal
   }
   else
   {
-    segment = t * numSegs;
-    float segLength = 1.0f / numSegs;
+    segment = static_cast<uint32_t>( t * static_cast<float>( numSegs ) );
+    float segLength = 1.0f / static_cast<float>( numSegs );
     float segStart  = static_cast<float>( segment ) * segLength;
-    tLocal = (t - segStart) * numSegs;
+    tLocal = (t - segStart) * static_cast<float>( numSegs );
   }
 }
 
@@ -367,7 +278,7 @@ bool Path::SampleAt( float t, Vector3& position, Vector3& tangent ) const
 
   if( PathIsComplete(mPoint, mControlPoint) )
   {
-    unsigned int segment;
+    uint32_t segment;
     float tLocal;
     FindSegmentAndProgress( t, segment, tLocal );
 
@@ -436,7 +347,7 @@ bool Path::SamplePosition( float t, Vector3& position ) const
 
   if( PathIsComplete(mPoint, mControlPoint) )
   {
-    unsigned int segment;
+    uint32_t segment;
     float tLocal;
     FindSegmentAndProgress( t, segment, tLocal );
 
@@ -488,7 +399,7 @@ bool Path::SampleTangent( float t, Vector3& tangent ) const
 
   if( PathIsComplete(mPoint, mControlPoint) )
   {
-    unsigned int segment;
+    uint32_t segment;
     float tLocal;
     FindSegmentAndProgress( t, segment, tLocal );
 
@@ -535,23 +446,23 @@ bool Path::SampleTangent( float t, Vector3& tangent ) const
   return done;
 }
 
-Vector3& Path::GetPoint( size_t index )
+Vector3& Path::GetPoint( uint32_t index )
 {
   DALI_ASSERT_ALWAYS( index < mPoint.Size() && "Path: Point index out of bounds" );
 
   return mPoint[index];
 }
 
-Vector3& Path::GetControlPoint( size_t index )
+Vector3& Path::GetControlPoint( uint32_t index )
 {
   DALI_ASSERT_ALWAYS( index < mControlPoint.Size() && "Path: Control Point index out of bounds" );
 
   return mControlPoint[index];
 }
 
-size_t Path::GetPointCount() const
+uint32_t Path::GetPointCount() const
 {
-  return mPoint.Size();
+  return static_cast<uint32_t>( mPoint.Size() );
 }
 
 void Path::ClearPoints()
index c12883b..f70644d 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_PATH_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -57,60 +57,6 @@ protected:
   virtual ~Path();
 
 private:
-  /**
-   * @copydoc Dali::Internal::Object::Observer::SceneObjectAdded()
-   */
-  virtual void SceneObjectAdded(Object& object){}
-
-  /**
-   * @copydoc Dali::Internal::Object::Observer::SceneObjectAdded()
-   */
-  virtual void SceneObjectRemoved(Object& object){}
-
-  /**
-   * @copydoc Dali::Internal::Object::Observer::ObjectDestroyed()
-   */
-  virtual void ObjectDestroyed(Object& object){}
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
 
   /**
    * @copydoc Dali::Internal::Object::SetDefaultProperty()
@@ -122,26 +68,6 @@ private:
    */
   virtual Property::Value GetDefaultProperty( Property::Index index ) const;
 
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue()
-   */
-  virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const{ return NULL; }
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const{ return NULL; }
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
-   */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const{ return NULL; }
-
 public:
 
   /**
@@ -200,17 +126,17 @@ public:
   /**
    * @copydoc Dali::Path::GetPoint
    */
-  Vector3& GetPoint( size_t index );
+  Vector3& GetPoint( uint32_t index );
 
   /**
    * @copydoc Dali::Path::GetControlPoint
    */
-  Vector3& GetControlPoint( size_t index );
+  Vector3& GetControlPoint( uint32_t index );
 
   /**
    * @copydoc Dali::Path::GetPointCount
    */
-  size_t GetPointCount() const;
+  uint32_t GetPointCount() const;
 
   /**
    * Clears the points of the path
@@ -271,12 +197,12 @@ private:
    * @param[out] tLocal Local progress in the segment
    *
    */
-  void FindSegmentAndProgress( float t, unsigned int& segment, float& tLocal ) const;
+  void FindSegmentAndProgress( float t, uint32_t& segment, float& tLocal ) const;
 
   /**
    * Helper function to calculate to number of segments in the path
    */
-  unsigned int GetNumberOfSegments() const;
+  uint32_t GetNumberOfSegments() const;
 
   Dali::Vector<Vector3> mPoint;            ///< Interpolation points
   Dali::Vector<Vector3> mControlPoint;     ///< Control points
index 6907985..b837131 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_PROGRESS_VALUE_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 #include <dali/public-api/math/quaternion.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector3.h>
+#include <dali/public-api/math/vector4.h>
 
 namespace Dali
 {
@@ -82,14 +83,9 @@ inline void Interpolate (bool& result, bool a, bool b, float progress)
   result = progress < 0.5f ? a : b;
 }
 
-inline void Interpolate (int& result, int a, int b, float progress)
+inline void Interpolate (int32_t& result, int a, int b, float progress)
 {
-  result = static_cast<int>(a + (b - a) * progress + 0.5f);
-}
-
-inline void Interpolate (unsigned int& result, unsigned int a, unsigned int b, float progress)
-{
-  result = static_cast<unsigned int>(a + (b - a) * progress + 0.5f);
+  result = static_cast<int>(static_cast<float>( a ) + static_cast<float>(b - a) * progress + 0.5f);
 }
 
 inline void Interpolate (float& result, float a, float b, float progress)
@@ -119,22 +115,13 @@ inline void Interpolate (Vector4& result, const Vector4& a, const Vector4& b, fl
  * Restrictions: f(0)=p1   f(1)=p2   f'(0)=(p2-p0)*0.5   f'(1)=(p3-p1)*0.5
  */
 
-inline void CubicInterpolate( int& result, int p0, int p1, int p2, int p3, float progress )
+inline void CubicInterpolate( int32_t& result, int32_t p0, int32_t p1, int32_t p2, int32_t p3, float progress )
 {
-  float a3 = p3*0.5f - p2*1.5f + p1*1.5f - p0*0.5f;
-  float a2 = p0 - p1*2.5f + p2*2.0f - p3*0.5f;
-  float a1 = (p2-p0)*0.5f;
-
-  result = static_cast<int>( a3*progress*progress*progress + a2*progress*progress + a1*progress + p1 + 0.5f );
-}
-
-inline void CubicInterpolate( unsigned int& result, unsigned int p0, unsigned int p1, unsigned int p2, unsigned int p3, float progress )
-{
-  float a3 = p3*0.5f - p2*1.5f + p1*1.5f - p0*0.5f;
-  float a2 = p0 - p1*2.5f + p2*2.0f - p3*0.5f;
-  float a1 = (p2-p0)*0.5f;
+  float a3 = static_cast<float>( p3 ) * 0.5f - static_cast<float>( p2 ) * 1.5f + static_cast<float>( p1 ) * 1.5f - static_cast<float>( p0 ) * 0.5f;
+  float a2 = static_cast<float>( p0 ) - static_cast<float>( p1 ) * 2.5f + static_cast<float>( p2 ) * 2.0f - static_cast<float>( p3 ) * 0.5f;
+  float a1 = static_cast<float>( p2 - p0 ) * 0.5f;
 
-  result = static_cast<unsigned int>( a3*progress*progress*progress + a2*progress*progress + a1*progress + p1 + 0.5f );
+  result = static_cast<int>( a3*progress*progress*progress + a2*progress*progress + a1*progress + static_cast<float>( p1 ) + 0.5f );
 }
 
 inline void CubicInterpolate( float& result, float p0, float p1, float  p2, float  p3, float progress )
index 196c229..dce4bc2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_PROPERTY_CONSTRAINT_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,23 +40,19 @@ class PropertyConstraint
 {
 public:
 
-  typedef std::vector < PropertyInputAccessor > InputContainer;
-  typedef typename InputContainer::iterator InputContainerIter;
-  typedef typename InputContainer::const_iterator InputContainerConstIter;
-
-  typedef std::vector< PropertyInputIndexer< PropertyInputAccessor > > InputIndexerContainer;
-
-  typedef Dali::Constraint::Function< PropertyType > ConstraintFunction;
+  using ConstraintFunction = Dali::Constraint::Function< PropertyType >;
+  using InputContainer = std::vector < PropertyInputAccessor >;
+  using InputIndexerContainer = std::vector< PropertyInputIndexer< PropertyInputAccessor > >;
 
   /**
    * Create a property constraint.
    *
    * @param[in]  func  A constraint function. Ownership of this callback-function is passed to this object.
    */
-  PropertyConstraint( Dali::Constraint::Function< PropertyType >* func )
-  : mInputsInitialized( false ),
-    mFunction( func ),
-    mInputs()
+  PropertyConstraint( ConstraintFunction* func )
+  : mFunction( func ),
+    mInputs(),
+    mInputsInitialized( false )
   {
   }
 
@@ -65,11 +61,11 @@ public:
    * @param [in]  func    A constraint function. Ownership of this callback-function is passed to this object.
    * @param [in]  inputs  Property inputs.
    */
-  PropertyConstraint( Dali::Constraint::Function< PropertyType >* func,
+  PropertyConstraint( ConstraintFunction* func,
                       const InputContainer& inputs )
-  : mInputsInitialized( false ),
-    mFunction( func ),
-    mInputs( inputs )
+  : mFunction( func ),
+    mInputs( inputs ),
+    mInputsInitialized( false )
   {
   }
 
@@ -95,32 +91,27 @@ public:
 
   /**
    * Set the input for one of the property constraint parameters.
-   * @param [in] index The parameter index.
    * @param [in] input The interface for receiving a property value.
+   * @param [in] componentIndex Component index.
    */
-  void SetInput( unsigned int index, int componentIndex, const PropertyInputImpl& input )
+  void AddInput( const PropertyInputImpl* input, int32_t componentIndex )
   {
-    if ( index >= mInputs.size() )
-    {
-      mInputs.push_back( PropertyInputAccessor() );
-    }
-
-    mInputs[ index ].SetInput( input, componentIndex );
+    mInputs.push_back( PropertyInputAccessor{ input, componentIndex } );
   }
 
   /**
    * Retrieve the input for one of the property constraint parameters.
    * @param [in] index The parameter index.
-   * @return The property input, or NULL if no input exists with this index.
+   * @return The property input, or nullptr if no input exists with this index.
    */
-  const PropertyInputImpl* GetInput( unsigned int index ) const
+  const PropertyInputImpl* GetInput( uint32_t index ) const
   {
     if ( index < mInputs.size() )
     {
       return mInputs[ index ].GetInput();
     }
 
-    return NULL;
+    return nullptr;
   }
 
   /**
@@ -132,9 +123,9 @@ public:
     if ( !mInputsInitialized )
     {
       // Check whether the inputs are initialized yet
-      unsigned int index( 0u );
+      uint32_t index( 0u );
       for ( const PropertyInputImpl* input = GetInput( index );
-            NULL != input;
+            nullptr != input;
             input = GetInput( ++index ) )
       {
         if ( !input->InputInitialized() )
@@ -156,9 +147,9 @@ public:
    */
   bool InputsChanged()
   {
-    unsigned int index( 0u );
+    uint32_t index( 0u );
     for ( const PropertyInputImpl* input = GetInput( index );
-          NULL != input;
+          nullptr != input;
           input = GetInput( ++index ) )
     {
       if ( input->InputChanged() )
@@ -178,40 +169,38 @@ public:
    */
   void Apply( BufferIndex bufferIndex, PropertyType& current )
   {
-    InputIndexerContainer mInputIndices;
-    PropertyInputContainer mIndices;
-    const unsigned int noOfInputs = mInputs.size();
+    InputIndexerContainer inputIndices;
+    PropertyInputContainer indices;
+    const uint32_t noOfInputs = static_cast<uint32_t>( mInputs.size() );
 
-    mInputIndices.reserve( noOfInputs );
-    mIndices.Reserve( noOfInputs );
+    inputIndices.reserve( noOfInputs );
+    indices.Reserve( noOfInputs );
 
-    const InputContainerConstIter endIter = mInputs.end();
-    unsigned int index = 0;
-    for ( InputContainerConstIter iter = mInputs.begin(); iter != endIter; ++iter, ++index )
+    const auto&& endIter = mInputs.end();
+    uint32_t index = 0;
+    for ( auto&& iter = mInputs.begin(); iter != endIter; ++iter, ++index )
     {
-      DALI_ASSERT_DEBUG( NULL != iter->GetInput() );
-      mInputIndices.push_back( PropertyInputIndexer< PropertyInputAccessor >( bufferIndex, &*iter ) );
-      mIndices.PushBack( &mInputIndices[ index ] );
+      DALI_ASSERT_DEBUG( nullptr != iter->GetInput() );
+      inputIndices.push_back( PropertyInputIndexer< PropertyInputAccessor >( bufferIndex, &*iter ) );
+      indices.PushBack( &inputIndices[ index ] );
     }
 
-    CallbackBase::Execute< PropertyType&, const PropertyInputContainer& >( *mFunction, current, mIndices );
+    CallbackBase::Execute< PropertyType&, const PropertyInputContainer& >( *mFunction, current, indices );
   }
 
 private:
 
   // Undefined
-  PropertyConstraint( const PropertyConstraint& );
-
-  // Undefined
-  PropertyConstraint& operator=( const PropertyConstraint& rhs );
+  PropertyConstraint() = delete;
+  PropertyConstraint( const PropertyConstraint& ) = delete;
+  PropertyConstraint& operator=( const PropertyConstraint& rhs ) = delete;
 
 private:
 
-  bool mInputsInitialized;
-
   ConstraintFunction* mFunction;
-
   InputContainer mInputs;
+  bool mInputsInitialized;
+
 };
 
 } // namespace Internal
index aca460b..a972f00 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_PROPERTY_INPUT_ACCESSOR_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ public:
    * Create the PropertyInputAccessor.
    */
   PropertyInputAccessor()
-  : mInput( NULL ),
+  : mInput( nullptr ),
     mComponentIndex( -1 )
   {
   }
@@ -44,7 +44,7 @@ public:
   /**
    * Create the PropertyInputAccessor.
    */
-  PropertyInputAccessor( const PropertyInputImpl* input, int componentIndex )
+  PropertyInputAccessor( const PropertyInputImpl* input, int32_t componentIndex )
   : mInput( input ),
     mComponentIndex( componentIndex )
   {
@@ -75,7 +75,7 @@ public:
   /**
    * Set the property input.
    */
-  void SetInput( const PropertyInputImpl& input, int componentIndex )
+  void SetInput( const PropertyInputImpl& input, int32_t componentIndex )
   {
     mInput = &input;
     mComponentIndex = componentIndex;
@@ -220,7 +220,8 @@ public:
 public:
 
   const PropertyInputImpl* mInput;
-  int mComponentIndex;
+  int32_t mComponentIndex;
+
 };
 
 } // namespace Internal
index 94a03e6..0421c13 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_PROPERTY_INPUT_INDEXER_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -159,7 +159,7 @@ public:
 
 public:
 
-  unsigned int mBufferIndex;
+  BufferIndex mBufferIndex;
   const AccessorType* mInput;
 };
 
diff --git a/dali/internal/event/common/demangler-unix.cpp b/dali/internal/event/common/demangler-unix.cpp
new file mode 100644 (file)
index 0000000..7db8066
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL HEADER
+#include <string_view>
+
+// FILE HEADER
+#include <dali/internal/event/common/demangler.h>
+
+namespace
+{
+// Extracts the number from the src view and update the view.
+size_t ExtractNumber(std::string_view& src)
+{
+  auto   IsDigit = [](char c) { return (c >= '0' && c <= '9'); };
+  size_t number  = 0;
+
+  for(auto i = 0u; i < src.size(); ++i)
+  {
+    char c = src[i];
+    if(!IsDigit(c))
+    {
+      //update the src view.
+      src.remove_prefix(i);
+      break;
+    }
+    else
+    {
+      number = 10 * number + (c - '0');
+    }
+  }
+
+  return number;
+}
+
+/**
+ * @brief Demangle a nested typeid name into its component parts and return
+ * the last component.
+ * A nested type name is one containing namespaces and class names only.
+ *   eg ExtractDemangleNestedName(typeid(Dali::Actor).name());
+ * @param[in] typeIdName The type id name string to demangle.
+ * @returns the last component "Actor" or an empty string_view
+ */
+std::string_view ExtractDemangleNestedName(std::string_view mangledName)
+{
+  if(mangledName.empty())
+  {
+    return {};
+  }
+
+  // classes nested inside a namespace starts with 'N' and ends with 'E'
+  // so trim those
+  if(mangledName.front() == 'N' && mangledName.back() == 'E')
+  {
+    mangledName.remove_prefix(1);
+    mangledName.remove_suffix(1);
+  }
+
+  std::string_view result;
+  while(!mangledName.empty())
+  {
+    auto length = ExtractNumber(mangledName);
+    result      = {mangledName.data(), length};
+    mangledName.remove_prefix(length);
+  }
+
+  return result;
+}
+
+} // namespace
+
+namespace Dali
+{
+namespace Internal
+{
+std::string DemangleClassName(const char* typeIdName)
+{
+  return std::string(ExtractDemangleNestedName(typeIdName));
+}
+
+} // namespace Internal
+
+} // namespace Dali
similarity index 58%
rename from dali/internal/common/text-vertex-2d.h
rename to dali/internal/event/common/demangler-windows.cpp
index 54d5242..5d0f24b 100644 (file)
@@ -1,8 +1,5 @@
-#ifndef __DALI_INTERNAL_TEXT_VERTEX_2D_H__
-#define __DALI_INTERNAL_TEXT_VERTEX_2D_H__
-
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+// FILE HEADER
+#include <dali/internal/event/common/demangler.h>
+
 namespace Dali
 {
-
 namespace Internal
 {
-
-/**
- * A 2D vertex with position, texture coordinate
- * and texture coordinate for distance field drop shadow adjustment
- */
-struct TextVertex2D
+std::string DemangleClassName(const char* typeIdName)
 {
-  float mX;
-  float mY;
-  float mU;
-  float mV;
-  float mU1;
-  float mV1;
-};
+  std::string name  = typeIdName;
+  int         index = name.find_last_of(' ');
 
-} // namespace Internal
+  if(0 <= index)
+  {
+    name = name.substr(index + 1, name.size() - index);
+  }
 
-} // namespace Dali
+  index = name.find_last_of(':');
+
+  if(0 <= index)
+  {
+    name = name.substr(index + 1, name.size() - index);
+  }
 
-#endif // __DALI_INTERNAL_TEXT_VERTEX_2D_H__
+  return name;
+}
 
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/event/common/demangler.cpp b/dali/internal/event/common/demangler.cpp
deleted file mode 100644 (file)
index 5a2caed..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-//
-// gcc and clang minimal demangling
-// Both follow Itanium C++ ABI
-//
-// We only decode namespaces and class typeid names for simplicity as its all we need.
-//
-// From http://mentorembedded.github.io/cxx-abi/abi.html#mangling-structure
-//
-// <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E
-//     ::= N [<CV-qualifiers>] <template-prefix> <template-args> E
-//
-// <prefix> ::= <prefix> <unqualified-name>
-//     ::= <template-prefix> <template-args>
-//          ::= <template-param>
-//          ::= <decltype>
-//     ::= # empty
-//     ::= <substitution>
-//          ::= <prefix> <data-member-prefix>
-//
-// <template-prefix> ::= <prefix> <template unqualified-name>
-//                   ::= <template-param>
-//                   ::= <substitution>
-// <unqualified-name> ::= <operator-name>
-//                    ::= <ctor-dtor-name>
-//                    ::= <source-name>
-//                    ::= <unnamed-type-name>
-//
-// <source-name> ::= <positive length number> <identifier>
-// <number> ::= [n] <non-negative decimal integer>
-// <identifier> ::= <unqualified source code identifier>
-//
-// So for example
-//
-// Dali::Internal::Actor would be
-//
-//   N4Dali8Internal5ActorE
-//
-
-// CLASS HEADER
-#include <dali/internal/event/common/demangler.h>
-
-namespace
-{
-
-// true if character represent a digit
-inline bool IsDigit(char c)
-{
-  return (c >= '0' && c <= '9');
-}
-
-// Gets the number of characters (number is in string)
-//   start The start position to look for a number
-//   result The number as an integer
-//   returns the number of characters used to define the number ie '12' is 2
-size_t GetNumberOfCharacters(const std::string& s, const size_t& start, int& result)
-{
-  size_t size = s.size();
-
-  size_t i = start;
-
-  int number = 0;
-
-  for( ; i < size; ++i )
-  {
-    char c = s.at(i);
-    if( !IsDigit( c ) )
-    {
-      break;
-    }
-    else
-    {
-      number = 10 * number + (c - '0');
-    }
-  }
-
-  if( i - start )
-  {
-    result = number;
-  }
-
-  return i - start;
-}
-
-} // anon namespace
-
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-#if defined(__clang__) || defined(__GNUC__)
-
-// Demangle class name mangled according to the Itanium C++ ABI
-// Returns demangled names ie "N4Dali8Internal5ActorE" is ["Dali","Internal","Actor"]
-std::vector<std::string> DemangleNestedNames(const char *typeIdName)
-{
-  std::vector<std::string> ret;
-
-  const std::string mangledName(typeIdName);
-
-
-  size_t size = mangledName.size();
-
-  if( size >= 2 )
-  {
-    int number = 0;
-    size_t start = 0;
-
-    // If the class isnt nested in a namespace then it just starts with the
-    // number of characters
-    if(mangledName[0] == 'N' && mangledName[size-1]  == 'E')
-    {
-      start = 1;
-    }
-
-    while( size_t chars = GetNumberOfCharacters(mangledName, start, number) )
-    {
-      ret.push_back( mangledName.substr( start + chars, number ) );
-
-      start += chars + number;
-    }
-  }
-
-  return ret;
-}
-
-#else
-# error Unsupported Compiler
-#endif
-
-
-const std::string DemangleClassName(const char *typeIdName)
-{
-  std::string name;
-  std::vector<std::string> names = DemangleNestedNames(typeIdName);
-
-  if( names.size() )
-  {
-    name = names[ names.size() - 1 ];
-  }
-
-  return name;
-}
-
-} // namespace Internal
-
-} // namespace Dali
index 9794099..7d3b3fc 100644 (file)
@@ -31,20 +31,11 @@ namespace Internal
 {
 
 /**
- * Demangle a nested typeid name into its component parts.
- * A nested type name is one containing namespaces and class names only.
- *   eg DemangleNestedNames(typeid(Dali::Actor).name());
- * @param[in] typeIdName The type id name string to demangle.
- * @returns the demangled list of names ie ["Dali","Actor"] or an empty list
- */
-std::vector<std::string> DemangleNestedNames(const char *typeIdName);
-
-/**
  * Demangle a nested typeid name to its class name.
  * @param[in] typeIdName The type id name string to demangle.
  * @returns the class name ie "Actor" or an empty string
  */
-const std::string DemangleClassName(const char *typeIdName);
+std::string DemangleClassName(const char *typeIdName);
 
 }
 
index 2f1ae09..aa9e334 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  */
 
-#include "event-thread-services.h"
+// CLASS HEADER
+#include <dali/internal/event/common/event-thread-services.h>
 
+// INTERNAL INCLUDES
 #include <dali/internal/event/common/thread-local-storage.h>
 
 namespace Dali
@@ -23,6 +25,11 @@ namespace Dali
 namespace Internal
 {
 
+EventThreadServices& EventThreadServices::Get()
+{
+  return ThreadLocalStorage::Get().GetEventThreadServices();
+}
+
 bool EventThreadServices::IsCoreRunning()
 {
   return ThreadLocalStorage::Created();
index c21c835..b6db047 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_EVENT_THREAD_SERVICES_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -58,6 +58,12 @@ public:
   { }
 
   /**
+   * Get the EventThreadServices
+   * @return reference to the EventThreadServices
+   */
+  static EventThreadServices& Get();
+
+  /**
    * @brief Registers the object as created with the Object registry.
    *
    * @param[in] object to register
@@ -93,7 +99,7 @@ public:
    * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
    * @return A pointer to the first char allocated for the message.
    */
-  virtual unsigned int* ReserveMessageSlot( std::size_t size, bool updateScene = true ) = 0;
+  virtual uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene = true ) = 0;
 
   /**
    * @return the current event-buffer index.
diff --git a/dali/internal/event/common/object-impl-helper.h b/dali/internal/event/common/object-impl-helper.h
deleted file mode 100644 (file)
index 44ac750..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-#ifndef DALI_INTERNAL_OBJECT_IMPL_HELPER_H
-#define DALI_INTERNAL_OBJECT_IMPL_HELPER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDEs
-#include <cstring>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/object/property.h> // Dali::Property
-#include <dali/public-api/object/property-index-ranges.h> // DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX
-#include <dali/internal/event/common/property-helper.h> // Dali::Internal::PropertyDetails
-#include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/update/common/animatable-property.h>
-#include <dali/internal/update/common/property-owner-messages.h>
-#include <dali/internal/update/manager/update-manager.h>
-
-namespace Dali
-{
-namespace Internal
-{
-class PropertyMetadata;
-class AnimatablePropertyMetadata;
-class CustomPropertyMetadata;
-class PropertyInputImpl;
-
-namespace SceneGraph
-{
-
-class PropertyBase;
-class PropertyOwner;
-
-
-} // namespace SceneGraph
-
-// Typedefs to allow object methods to be passed via parameter
-typedef AnimatablePropertyMetadata* (Object::*FindAnimatablePropertyMethod)( Property::Index index ) const;
-typedef CustomPropertyMetadata* (Object::*FindCustomPropertyMethod)( Property::Index index ) const;
-
-
-/**
- * Helper template class to be used by class that implement Object
- *
- * Example:
- *<pre>
- * typename ObjectImplHelper<DEFAULT_PROPERTY_COUNT, DEFAULT_PROPERTY_DETAILS> MyObjectImpl;
- *
- * MyObjectImpl::GetDefaultPropertyCount();
- * </pre>
- */
-template<int DEFAULT_PROPERTY_COUNT>
-struct ObjectImplHelper
-{
-  const PropertyDetails* DEFAULT_PROPERTY_DETAILS;
-  const int DEFAULT_PROPERTY_START_INDEX;
-
-  unsigned int GetDefaultPropertyCount() const
-  {
-    return DEFAULT_PROPERTY_COUNT;
-  }
-
-  void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-  {
-    indices.Reserve( DEFAULT_PROPERTY_COUNT );
-
-    for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-    {
-      indices.PushBack( DEFAULT_PROPERTY_START_INDEX + i );
-    }
-  }
-
-  const char* GetDefaultPropertyName( Property::Index index ) const
-  {
-    const char* name = NULL;
-
-    if( index >= DEFAULT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_START_INDEX + DEFAULT_PROPERTY_MAX_COUNT )
-    {
-      name = DEFAULT_PROPERTY_DETAILS[index - DEFAULT_PROPERTY_START_INDEX].name;
-    }
-
-    return name;
-  }
-
-  Property::Index GetDefaultPropertyIndex( const std::string& name ) const
-  {
-    Property::Index index = Property::INVALID_INDEX;
-
-    // Look for name in default properties
-    for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-    {
-      const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
-      if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
-      {
-        index = i;
-        break;
-      }
-    }
-
-    return index;
-  }
-
-  bool IsDefaultPropertyWritable( Property::Index index ) const
-  {
-    bool isWritable = false;
-
-    if( index >= DEFAULT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_START_INDEX + DEFAULT_PROPERTY_MAX_COUNT )
-    {
-      isWritable = DEFAULT_PROPERTY_DETAILS[index - DEFAULT_PROPERTY_START_INDEX].writable;
-    }
-
-    return isWritable;
-  }
-
-  bool IsDefaultPropertyAnimatable( Property::Index index ) const
-  {
-    bool isAnimatable = false;
-
-    if( index >= DEFAULT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_START_INDEX + DEFAULT_PROPERTY_MAX_COUNT )
-    {
-      isAnimatable =  DEFAULT_PROPERTY_DETAILS[index - DEFAULT_PROPERTY_START_INDEX].animatable;
-    }
-
-    return isAnimatable;
-  }
-
-  bool IsDefaultPropertyAConstraintInput( Property::Index index ) const
-  {
-    bool isConstraintInput = false;
-
-    if( index >= DEFAULT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_START_INDEX + DEFAULT_PROPERTY_MAX_COUNT )
-    {
-      isConstraintInput = DEFAULT_PROPERTY_DETAILS[index - DEFAULT_PROPERTY_START_INDEX].constraintInput;
-    }
-
-    return isConstraintInput;
-  }
-
-  Property::Type GetDefaultPropertyType( Property::Index index ) const
-  {
-    Property::Type type = Property::NONE;
-
-    if( index >= DEFAULT_PROPERTY_START_INDEX && index < DEFAULT_PROPERTY_START_INDEX + DEFAULT_PROPERTY_MAX_COUNT )
-    {
-      type =  DEFAULT_PROPERTY_DETAILS[index - DEFAULT_PROPERTY_START_INDEX].type;
-    }
-
-    return type;
-  }
-
-  // Get the (animatable) scene graph property. (All registered scene graph properties are animatable)
-  const SceneGraph::PropertyBase* GetRegisteredSceneGraphProperty(
-    const Object* object,
-    FindAnimatablePropertyMethod findAnimatablePropertyMethod,
-    FindCustomPropertyMethod findCustomPropertyMethod,
-    Property::Index index ) const
-  {
-    const SceneGraph::PropertyBase* property = NULL;
-    if ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX && index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )
-    {
-      AnimatablePropertyMetadata* animatable = (object->*findAnimatablePropertyMethod)( index );
-      DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
-      property = animatable->GetSceneGraphProperty();
-    }
-    else if ( ( index > CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
-              ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
-    {
-      CustomPropertyMetadata* custom = (object->*findCustomPropertyMethod)( index );
-      DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
-      property = custom->GetSceneGraphProperty();
-    }
-    return property;
-  }
-
-  void SetSceneGraphProperty( EventThreadServices& eventThreadServices,
-                              const Object* object,
-                              Property::Index index,
-                              const PropertyMetadata& entry,
-                              const Property::Value& value ) const
-  {
-    const SceneGraph::PropertyOwner* sceneObject = object->GetSceneObject();
-
-    switch ( entry.GetType() )
-    {
-      case Property::BOOLEAN:
-      {
-        const SceneGraph::AnimatableProperty<bool>* property = dynamic_cast< const SceneGraph::AnimatableProperty<bool>* >( entry.GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        // property is being used in a separate thread; queue a message to set the property
-        SceneGraph::AnimatablePropertyMessage<bool>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<bool>::Bake, value.Get<bool>() );
-
-        break;
-      }
-
-      case Property::FLOAT:
-      {
-        const SceneGraph::AnimatableProperty<float>* property = dynamic_cast< const SceneGraph::AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        // property is being used in a separate thread; queue a message to set the property
-        SceneGraph::AnimatablePropertyMessage<float>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<float>::Bake, value.Get<float>() );
-
-        break;
-      }
-
-      case Property::INTEGER:
-      {
-        const SceneGraph::AnimatableProperty<int>* property = dynamic_cast< const SceneGraph::AnimatableProperty<int>* >( entry.GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        // property is being used in a separate thread; queue a message to set the property
-        SceneGraph::AnimatablePropertyMessage<int>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<int>::Bake, value.Get<int>() );
-
-        break;
-      }
-
-      case Property::VECTOR2:
-      {
-        const SceneGraph::AnimatableProperty<Vector2>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Vector2>* >( entry.GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        // property is being used in a separate thread; queue a message to set the property
-        SceneGraph::AnimatablePropertyMessage<Vector2>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<Vector2>::Bake, value.Get<Vector2>() );
-
-        break;
-      }
-
-      case Property::VECTOR3:
-      {
-        const SceneGraph::AnimatableProperty<Vector3>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Vector3>* >( entry.GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        // property is being used in a separate thread; queue a message to set the property
-        SceneGraph::AnimatablePropertyMessage<Vector3>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<Vector3>::Bake, value.Get<Vector3>() );
-
-        break;
-      }
-
-      case Property::VECTOR4:
-      {
-        const SceneGraph::AnimatableProperty<Vector4>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Vector4>* >( entry.GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        // property is being used in a separate thread; queue a message to set the property
-        SceneGraph::AnimatablePropertyMessage<Vector4>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<Vector4>::Bake, value.Get<Vector4>() );
-
-        break;
-      }
-
-      case Property::ROTATION:
-      {
-        const SceneGraph::AnimatableProperty<Quaternion>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Quaternion>* >( entry.GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        // property is being used in a separate thread; queue a message to set the property
-        SceneGraph::AnimatablePropertyMessage<Quaternion>::Send( eventThreadServices, sceneObject, property,&SceneGraph::AnimatableProperty<Quaternion>::Bake,  value.Get<Quaternion>() );
-
-        break;
-      }
-
-      case Property::MATRIX:
-      {
-        const SceneGraph::AnimatableProperty<Matrix>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Matrix>* >( entry.GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        // property is being used in a separate thread; queue a message to set the property
-        SceneGraph::AnimatablePropertyMessage<Matrix>::Send( eventThreadServices, sceneObject, property,&SceneGraph::AnimatableProperty<Matrix>::Bake,  value.Get<Matrix>() );
-
-        break;
-      }
-
-      case Property::MATRIX3:
-      {
-        const SceneGraph::AnimatableProperty<Matrix3>* property = dynamic_cast< const SceneGraph::AnimatableProperty<Matrix3>* >( entry.GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
-
-        // property is being used in a separate thread; queue a message to set the property
-        SceneGraph::AnimatablePropertyMessage<Matrix3>::Send( eventThreadServices, sceneObject, property, &SceneGraph::AnimatableProperty<Matrix3>::Bake,  value.Get<Matrix3>() );
-
-        break;
-      }
-
-      default:
-      {
-        // ignore non-scene-graph types
-      }
-    }
-  }
-};
-
-
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_OBJECT_IMPL_HELPER_H
index 1663e61..0c9bd99 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/devel-api/object/handle-devel.h>
 #include <dali/internal/update/animation/scene-graph-constraint-base.h>
 #include <dali/internal/update/common/animatable-property.h>
+#include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/common/property-owner-messages.h>
 #include <dali/internal/update/common/uniform-map.h>
 #include <dali/internal/event/animation/constraint-impl.h>
-#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/property-helper.h>
 #include <dali/internal/event/common/property-notification-impl.h>
+#include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/common/type-registry-impl.h>
 
 using Dali::Internal::SceneGraph::AnimatableProperty;
@@ -44,23 +46,19 @@ namespace Internal
 
 namespace // unnamed namespace
 {
-const int SUPPORTED_CAPABILITIES = Dali::Handle::DYNAMIC_PROPERTIES;  // Object provides this capability
-typedef Dali::Vector<Object::Observer*>::Iterator ObserverIter;
-typedef Dali::Vector<Object::Observer*>::ConstIterator ConstObserverIter;
+const int32_t SUPPORTED_CAPABILITIES = Dali::Handle::DYNAMIC_PROPERTIES;  // Object provides this capability
 
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_OBJECT" );
 #endif
 
+constexpr Property::Index MAX_PER_CLASS_PROPERTY_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX;
 
 } // unnamed namespace
 
-Object::Object()
-: mEventThreadServices( *Stage::GetCurrent() ),
-  mTypeInfo( NULL ),
-  mConstraints( NULL ),
-  mPropertyNotifications( NULL )
+IntrusivePtr<Object> Object::New()
 {
+  return new Object( nullptr ); // no scene object by default
 }
 
 void Object::AddObserver(Observer& observer)
@@ -75,8 +73,8 @@ void Object::AddObserver(Observer& observer)
 void Object::RemoveObserver(Observer& observer)
 {
   // Find the observer...
-  const ConstObserverIter endIter =  mObservers.End();
-  for( ObserverIter iter = mObservers.Begin(); iter != endIter; ++iter)
+  const auto endIter =  mObservers.End();
+  for( auto iter = mObservers.Begin(); iter != endIter; ++iter)
   {
     if( (*iter) == &observer)
     {
@@ -87,70 +85,23 @@ void Object::RemoveObserver(Observer& observer)
   DALI_ASSERT_DEBUG(endIter != mObservers.End());
 }
 
-void Object::OnSceneObjectAdd()
-{
-  // Notification for observers
-  for( ConstObserverIter iter = mObservers.Begin(),  endIter =  mObservers.End(); iter != endIter; ++iter)
-  {
-    (*iter)->SceneObjectAdded(*this);
-  }
-
-  // enable property notifications in scene graph
-  EnablePropertyNotifications();
-}
-
-void Object::OnSceneObjectRemove()
-{
-  // Notification for observers
-  for( ConstObserverIter iter = mObservers.Begin(), endIter = mObservers.End(); iter != endIter; ++iter )
-  {
-    (*iter)->SceneObjectRemoved(*this);
-  }
-
-  // disable property notifications in scene graph
-  DisablePropertyNotifications();
-}
-
-int Object::GetPropertyComponentIndex( Property::Index index ) const
-{
-  int componentIndex = Property::INVALID_COMPONENT_INDEX;
-
-  const TypeInfo* typeInfo( GetTypeInfo() );
-  if ( typeInfo )
-  {
-    componentIndex = typeInfo->GetComponentIndex(index);
-  }
-
-  // For animatable property, check whether it is registered already and register it if not yet.
-  if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) && ( NULL == RegisterAnimatableProperty(index) ) )
-  {
-    componentIndex = Property::INVALID_COMPONENT_INDEX;
-  }
-
-  return componentIndex;
-}
-
 bool Object::Supports( Capability capability ) const
 {
   return (capability & SUPPORTED_CAPABILITIES);
 }
 
-unsigned int Object::GetPropertyCount() const
+uint32_t Object::GetPropertyCount() const
 {
-  unsigned int count = GetDefaultPropertyCount();
-
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Default Properties: %d\n", count );
-
+  uint32_t count = 0u;
   const TypeInfo* typeInfo( GetTypeInfo() );
   if ( typeInfo )
   {
-    unsigned int manual( typeInfo->GetPropertyCount() );
-    count += manual;
+    count = typeInfo->GetPropertyCount();
 
-    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Manual Properties:  %d\n", manual );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Registered Properties:  %d\n", count );
   }
 
-  unsigned int custom( mCustomProperties.Count() );
+  uint32_t custom = static_cast<uint32_t>( mCustomProperties.Count() );
   count += custom;
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Custom Properties:  %d\n", custom );
 
@@ -163,66 +114,42 @@ std::string Object::GetPropertyName( Property::Index index ) const
 {
   DALI_ASSERT_ALWAYS( index > Property::INVALID_INDEX && "Property index out of bounds" );
 
-  if ( index < DEFAULT_PROPERTY_MAX_COUNT )
-  {
-    std::string string;
-
-    const char * propertyName = GetDefaultPropertyName( index );
-    if( propertyName )
-    {
-      string = propertyName;
-    }
-    return string;
-  }
-
-  if ( ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
-    || ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) ) )
+  // is this a per class or per instance property
+  if ( index < MAX_PER_CLASS_PROPERTY_INDEX )
   {
     const TypeInfo* typeInfo( GetTypeInfo() );
     if ( typeInfo )
     {
       return typeInfo->GetPropertyName( index );
     }
-    else
+  }
+  else // child property or custom property
+  {
+    CustomPropertyMetadata* custom = FindCustomProperty( index );
+    if( custom )
     {
-      DALI_ASSERT_ALWAYS( ! "Property index is invalid" );
+      return custom->name;
     }
   }
 
-  CustomPropertyMetadata* custom = FindCustomProperty( index );
-  if( custom )
-  {
-    return custom->name;
-  }
-  return "";
+  DALI_LOG_ERROR( "Property index %d not found\n", index );
+  return std::string();
 }
 
-Property::Index Object::GetPropertyIndex(const std::string& name) const
+Property::Index Object::GetPropertyIndex( const std::string& name ) const
 {
-  Property::Index index = GetDefaultPropertyIndex( name );
+  Property::Index index = Property::INVALID_INDEX;
 
-  if(index == Property::INVALID_INDEX)
+  const TypeInfo* typeInfo( GetTypeInfo() );
+  if ( typeInfo )
   {
-    const TypeInfo* typeInfo( GetTypeInfo() );
-    if ( typeInfo )
-    {
-      index = typeInfo->GetPropertyIndex( name );
-      if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
-      {
-        // check whether the animatable property is registered already, if not then register one.
-        if ( NULL == RegisterAnimatableProperty(index) )
-        {
-          index = Property::INVALID_INDEX;
-        }
-      }
-    }
+    index = typeInfo->GetPropertyIndex( name );
   }
-
   if( (index == Property::INVALID_INDEX)&&( mCustomProperties.Count() > 0 ) )
   {
     Property::Index count = PROPERTY_CUSTOM_START_INDEX;
-    const PropertyMetadataLookup::ConstIterator end = mCustomProperties.End();
-    for( PropertyMetadataLookup::ConstIterator iter = mCustomProperties.Begin(); iter != end; ++iter, ++count )
+    const auto end = mCustomProperties.End();
+    for( auto iter = mCustomProperties.Begin(); iter != end; ++iter, ++count )
     {
       CustomPropertyMetadata* custom = static_cast<CustomPropertyMetadata*>(*iter);
       if ( custom->name == name )
@@ -251,8 +178,8 @@ Property::Index Object::GetPropertyIndex( Property::Index key ) const
   if( mCustomProperties.Count() > 0 )
   {
     Property::Index count = PROPERTY_CUSTOM_START_INDEX;
-    const PropertyMetadataLookup::ConstIterator end = mCustomProperties.End();
-    for( PropertyMetadataLookup::ConstIterator iter = mCustomProperties.Begin(); iter != end; ++iter, ++count )
+    const auto end = mCustomProperties.End();
+    for( auto iter = mCustomProperties.Begin(); iter != end; ++iter, ++count )
     {
       CustomPropertyMetadata* custom = static_cast<CustomPropertyMetadata*>(*iter);
       if( custom->key == key )
@@ -294,26 +221,14 @@ bool Object::IsPropertyWritable( Property::Index index ) const
 
   bool writable = false;
 
-  if ( index < DEFAULT_PROPERTY_MAX_COUNT )
-  {
-    writable = IsDefaultPropertyWritable( index );
-  }
-  else if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
+  // is this a per class or per instance property
+  if ( index < MAX_PER_CLASS_PROPERTY_INDEX )
   {
     const TypeInfo* typeInfo( GetTypeInfo() );
     if ( typeInfo )
     {
       writable = typeInfo->IsPropertyWritable( index );
     }
-    else
-    {
-      DALI_ASSERT_ALWAYS( ! "Invalid property index" );
-    }
-  }
-  else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
-  {
-    // Type Registry scene-graph properties are writable.
-    writable = true;
   }
   else
   {
@@ -333,19 +248,14 @@ bool Object::IsPropertyAnimatable( Property::Index index ) const
 
   bool animatable = false;
 
-  if ( index < DEFAULT_PROPERTY_MAX_COUNT )
-  {
-    animatable = IsDefaultPropertyAnimatable( index );
-  }
-  else if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
-  {
-    // Type Registry event-thread only properties are not animatable.
-    animatable = false;
-  }
-  else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  // is this a per class or per instance property
+  if ( index < MAX_PER_CLASS_PROPERTY_INDEX )
   {
-    // Type Registry scene-graph properties are animatable.
-    animatable = true;
+    const TypeInfo* typeInfo( GetTypeInfo() );
+    if ( typeInfo )
+    {
+      animatable = typeInfo->IsPropertyAnimatable( index );
+    }
   }
   else
   {
@@ -365,19 +275,14 @@ bool Object::IsPropertyAConstraintInput( Property::Index index ) const
 
   bool isConstraintInput = false;
 
-  if ( index < DEFAULT_PROPERTY_MAX_COUNT )
-  {
-    isConstraintInput = IsDefaultPropertyAConstraintInput( index );
-  }
-  else if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
-  {
-    // Type Registry event-thread only properties cannot be used as an input to a constraint.
-    isConstraintInput = false;
-  }
-  else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  // is this a per class or per instance property
+  if ( index < MAX_PER_CLASS_PROPERTY_INDEX )
   {
-    // scene graph properties can be used as input to a constraint.
-    isConstraintInput = true;
+    const TypeInfo* typeInfo( GetTypeInfo() );
+    if ( typeInfo )
+    {
+      isConstraintInput = typeInfo->IsPropertyAConstraintInput( index );
+    }
   }
   else
   {
@@ -396,23 +301,14 @@ Property::Type Object::GetPropertyType( Property::Index index ) const
 {
   DALI_ASSERT_ALWAYS(index > Property::INVALID_INDEX && "Property index is out of bounds" );
 
-  if ( index < DEFAULT_PROPERTY_MAX_COUNT )
-  {
-    return GetDefaultPropertyType( index );
-  }
-
-  if ( ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
-    || ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) ) )
+  // is this a per class or per instance property
+  if ( index < MAX_PER_CLASS_PROPERTY_INDEX )
   {
     const TypeInfo* typeInfo( GetTypeInfo() );
     if ( typeInfo )
     {
       return typeInfo->GetPropertyType( index );
     }
-    else
-    {
-      DALI_ASSERT_ALWAYS( ! "Cannot find property index" );
-    }
   }
 
   CustomPropertyMetadata* custom = FindCustomProperty( index );
@@ -424,11 +320,6 @@ Property::Type Object::GetPropertyType( Property::Index index ) const
   return Property::NONE;
 }
 
-DevelHandle::PropertySetSignalType& Object::PropertySetSignal()
-{
-  return mPropertySetSignal;
-}
-
 void Object::SetProperty( Property::Index index, const Property::Value& propertyValue )
 {
   DALI_ASSERT_ALWAYS(index > Property::INVALID_INDEX && "Property index is out of bounds" );
@@ -448,17 +339,19 @@ void Object::SetProperty( Property::Index index, const Property::Value& property
     }
     else
     {
-      DALI_LOG_ERROR("Cannot find property index\n");
+      // cannot register this property as there is no setter for it.
+      // event side properties must have a setter for now so need to be registered
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
       propertySet = false;
     }
   }
   else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
   {
     // check whether the animatable property is registered already, if not then register one.
-    AnimatablePropertyMetadata* animatableProperty = RegisterAnimatableProperty( index );
-    if(!animatableProperty)
+    AnimatablePropertyMetadata* animatableProperty = GetSceneAnimatableProperty( index, &propertyValue );
+    if( !animatableProperty )
     {
-      DALI_LOG_ERROR("Cannot find property index\n");
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
       propertySet = false;
     }
     else
@@ -520,7 +413,7 @@ void Object::SetProperty( Property::Index index, const Property::Value& property
     }
     else
     {
-      DALI_LOG_ERROR("Invalid property index\n");
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
       propertySet = false;
     }
   }
@@ -535,7 +428,7 @@ void Object::SetProperty( Property::Index index, const Property::Value& property
   }
 }
 
-Property::Value Object::GetProperty(Property::Index index) const
+Property::Value Object::GetProperty( Property::Index index ) const
 {
   DALI_ASSERT_ALWAYS( index > Property::INVALID_INDEX && "Property index is out of bounds" );
 
@@ -554,21 +447,22 @@ Property::Value Object::GetProperty(Property::Index index) const
     }
     else
     {
-      DALI_LOG_ERROR("Cannot find property index\n");
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   }
   else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
   {
     // check whether the animatable property is registered already, if not then register one.
-    AnimatablePropertyMetadata* animatableProperty = RegisterAnimatableProperty( index );
-    if(!animatableProperty)
+         // this is needed because property value may have been set as full property and get as a property component
+    AnimatablePropertyMetadata* animatableProperty = GetSceneAnimatableProperty( index, nullptr );
+    if( animatableProperty )
     {
-      DALI_LOG_ERROR("Cannot find property index\n");
+      // get the cached animatable property value
+      value = animatableProperty->GetPropertyValue();
     }
     else
     {
-      // get the cached animatable property value
-      value = animatableProperty->GetPropertyValue();
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   }
   else if(mCustomProperties.Count() > 0)
@@ -581,7 +475,7 @@ Property::Value Object::GetProperty(Property::Index index) const
     }
     else
     {
-      DALI_LOG_ERROR("Invalid property index\n");
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   } // if custom
 
@@ -607,21 +501,22 @@ Property::Value Object::GetCurrentProperty( Property::Index index ) const
     }
     else
     {
-      DALI_LOG_ERROR("Cannot find property index\n");
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   }
   else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
   {
     // check whether the animatable property is registered already, if not then register one.
-    AnimatablePropertyMetadata* animatableProperty = RegisterAnimatableProperty( index );
-    if(!animatableProperty)
+         // this is needed because property value may have been set as full property and get as a property component
+    AnimatablePropertyMetadata* animatableProperty = GetSceneAnimatableProperty( index, nullptr );
+    if( animatableProperty )
     {
-      DALI_LOG_ERROR("Cannot find property index\n");
+      // get the animatable property value
+      value = GetCurrentPropertyValue( *animatableProperty );
     }
     else
     {
-      // get the animatable property value
-      value = GetCurrentPropertyValue( animatableProperty );
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   }
   else if(mCustomProperties.Count() > 0)
@@ -630,11 +525,11 @@ Property::Value Object::GetCurrentProperty( Property::Index index ) const
     if(custom)
     {
       // get the custom property value
-      value = GetCurrentPropertyValue( custom );
+      value = GetCurrentPropertyValue( *custom );
     }
     else
     {
-      DALI_LOG_ERROR("Invalid property index\n");
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   } // if custom
 
@@ -645,9 +540,6 @@ void Object::GetPropertyIndices( Property::IndexContainer& indices ) const
 {
   indices.Clear();
 
-  // Default Properties
-  GetDefaultPropertyIndices( indices );
-
   // Manual Properties
   const TypeInfo* typeInfo( GetTypeInfo() );
   if ( typeInfo )
@@ -660,9 +552,9 @@ void Object::GetPropertyIndices( Property::IndexContainer& indices ) const
   {
     indices.Reserve( indices.Size() + mCustomProperties.Count() );
 
-    PropertyMetadataLookup::ConstIterator iter = mCustomProperties.Begin();
-    const PropertyMetadataLookup::ConstIterator endIter = mCustomProperties.End();
-    int i=0;
+    auto iter = mCustomProperties.Begin();
+    const auto endIter = mCustomProperties.End();
+    int32_t i = 0;
     for ( ; iter != endIter; ++iter, ++i )
     {
       CustomPropertyMetadata* custom = static_cast<CustomPropertyMetadata*>( *iter );
@@ -679,119 +571,6 @@ void Object::GetPropertyIndices( Property::IndexContainer& indices ) const
   }
 }
 
-bool Object::DoesCustomPropertyExist( Property::Index index )
-{
-  auto metadata = FindCustomProperty( index );
-  return metadata != nullptr;
-}
-
-Property::Index Object::RegisterSceneGraphProperty(const std::string& name, Property::Index key, Property::Index index, const Property::Value& propertyValue) const
-{
-  // Create a new property
-  Dali::Internal::OwnerPointer<PropertyBase> newProperty;
-
-  switch ( propertyValue.GetType() )
-  {
-    case Property::BOOLEAN:
-    {
-      newProperty = new AnimatableProperty<bool>( propertyValue.Get<bool>() );
-      break;
-    }
-
-    case Property::INTEGER:
-    {
-      newProperty = new AnimatableProperty<int>( propertyValue.Get<int>() );
-      break;
-    }
-
-    case Property::FLOAT:
-    {
-      newProperty = new AnimatableProperty<float>( propertyValue.Get<float>() );
-      break;
-    }
-
-    case Property::VECTOR2:
-    {
-      newProperty = new AnimatableProperty<Vector2>( propertyValue.Get<Vector2>() );
-      break;
-    }
-
-    case Property::VECTOR3:
-    {
-      newProperty = new AnimatableProperty<Vector3>( propertyValue.Get<Vector3>() );
-      break;
-    }
-
-    case Property::VECTOR4:
-    {
-      newProperty = new AnimatableProperty<Vector4>( propertyValue.Get<Vector4>() );
-      break;
-    }
-
-    case Property::MATRIX:
-    {
-      newProperty = new AnimatableProperty<Matrix>( propertyValue.Get<Matrix>() );
-      break;
-    }
-
-    case Property::MATRIX3:
-    {
-      newProperty = new AnimatableProperty<Matrix3>( propertyValue.Get<Matrix3>() );
-      break;
-    }
-
-    case Property::ROTATION:
-    {
-      newProperty = new AnimatableProperty<Quaternion>( propertyValue.Get<Quaternion>() );
-      break;
-    }
-
-    case Property::RECTANGLE:
-    case Property::STRING:
-    case Property::ARRAY:
-    case Property::MAP:
-    case Property::EXTENTS:
-    case Property::NONE:
-    {
-      DALI_ASSERT_ALWAYS( !"PropertyType is not animatable" );
-      break;
-    }
-  }
-
-  // get the scene property owner from derived class
-  const SceneGraph::PropertyOwner* scenePropertyOwner = GetPropertyOwner();
-  // we can only pass properties to scene graph side if there is a scene object
-  if( scenePropertyOwner )
-  {
-    // keep a local pointer to the property as the OwnerPointer will pass its copy to the message
-    const PropertyBase* property = newProperty.Get();
-    if(index >= PROPERTY_CUSTOM_START_INDEX)
-    {
-      DALI_ASSERT_ALWAYS( index <= PROPERTY_CUSTOM_MAX_INDEX && "Too many custom properties have been registered" );
-
-      mCustomProperties.PushBack( new CustomPropertyMetadata( name, key, propertyValue, property ) );
-    }
-    else
-    {
-      mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, propertyValue, property ) );
-    }
-
-    // queue a message to add the property
-    InstallCustomPropertyMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), *scenePropertyOwner, newProperty ); // Message takes ownership
-
-    // notify the derived class (optional) method in case it needs to do some more work on the new property
-    // note! have to use the local pointer as OwnerPointer now points to NULL as it handed over its ownership
-    NotifyScenePropertyInstalled( *property, name, index );
-
-    return index;
-  }
-  else
-  {
-    // property was orphaned and killed so return invalid index
-    return Property::INVALID_INDEX;
-  }
-}
-
 Property::Index Object::RegisterProperty( const std::string& name, const Property::Value& propertyValue )
 {
   return RegisterProperty( name, Property::INVALID_KEY, propertyValue, Property::ANIMATABLE );
@@ -827,16 +606,15 @@ Property::Index Object::RegisterProperty( const std::string& name, Property::Ind
   else
   {
     // Otherwise register the property
-
     if( Property::ANIMATABLE == accessMode )
     {
-      index = RegisterSceneGraphProperty( name, key, PROPERTY_CUSTOM_START_INDEX + mCustomProperties.Count(), propertyValue );
+      index = RegisterSceneGraphProperty( name, key, PROPERTY_CUSTOM_START_INDEX + static_cast<Property::Index>( mCustomProperties.Count() ), propertyValue );
       AddUniformMapping( index, name );
     }
     else
     {
       // Add entry to the property lookup
-      index = PROPERTY_CUSTOM_START_INDEX + mCustomProperties.Count();
+      index = PROPERTY_CUSTOM_START_INDEX + static_cast<Property::Index>( mCustomProperties.Count() );
 
       CustomPropertyMetadata* customProperty = new CustomPropertyMetadata( name, propertyValue, accessMode );
 
@@ -863,9 +641,15 @@ Property::Index Object::RegisterProperty( const std::string& name, Property::Ind
   return index;
 }
 
-Dali::PropertyNotification Object::AddPropertyNotification(Property::Index index,
-                                                                int componentIndex,
-                                                                const Dali::PropertyCondition& condition)
+bool Object::DoesCustomPropertyExist( Property::Index index )
+{
+  auto metadata = FindCustomProperty( index );
+  return metadata != nullptr;
+}
+
+Dali::PropertyNotification Object::AddPropertyNotification( Property::Index index,
+                                                            int32_t componentIndex,
+                                                            const Dali::PropertyCondition& condition)
 {
   if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
   {
@@ -876,7 +660,7 @@ Dali::PropertyNotification Object::AddPropertyNotification(Property::Index index
     else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
     {
       // check whether the animatable property is registered already, if not then register one.
-      AnimatablePropertyMetadata* animatable = RegisterAnimatableProperty( index );
+      AnimatablePropertyMetadata* animatable = GetSceneAnimatableProperty( index, nullptr );
       DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
     }
     else if ( mCustomProperties.Count() > 0 )
@@ -906,7 +690,7 @@ void Object::RemovePropertyNotification(Dali::PropertyNotification propertyNotif
 {
   if( mPropertyNotifications )
   {
-    PropertyNotificationContainerIter iter = mPropertyNotifications->begin();
+    auto iter = mPropertyNotifications->begin();
     while(iter != mPropertyNotifications->end() )
     {
       if(*iter == propertyNotification)
@@ -926,7 +710,7 @@ void Object::RemovePropertyNotifications()
 {
   if( mPropertyNotifications )
   {
-    PropertyNotificationContainerIter iter = mPropertyNotifications->begin();
+    auto iter = mPropertyNotifications->begin();
     while(iter != mPropertyNotifications->end() )
     {
       // As we can't ensure all references are removed, we can just disable
@@ -947,7 +731,7 @@ void Object::NotifyPropertyAnimation( Animation& animation, Property::Index inde
   }
   else
   {
-    PropertyMetadata* propertyMetadata = NULL;
+    PropertyMetadata* propertyMetadata = nullptr;
     if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
     {
       propertyMetadata = FindAnimatableProperty( index );
@@ -983,101 +767,544 @@ void Object::NotifyPropertyAnimation( Animation& animation, Property::Index inde
   }
 }
 
-void Object::EnablePropertyNotifications()
-{
-  if( mPropertyNotifications )
-  {
-    PropertyNotificationContainerIter iter = mPropertyNotifications->begin();
-    PropertyNotificationContainerIter endIter = mPropertyNotifications->end();
-
-    for( ; iter != endIter; ++iter )
-    {
-      GetImplementation(*iter).Enable();
-    }
-  }
-}
-
-void Object::DisablePropertyNotifications()
-{
-  if( mPropertyNotifications )
-  {
-    PropertyNotificationContainerIter iter = mPropertyNotifications->begin();
-    PropertyNotificationContainerIter endIter = mPropertyNotifications->end();
-
-    for( ; iter != endIter; ++iter )
-    {
-      GetImplementation(*iter).Disable();
-    }
-  }
-}
-
 void Object::AddUniformMapping( Property::Index propertyIndex, const std::string& uniformName ) const
 {
   // Get the address of the property if it's a scene property
   const PropertyInputImpl* propertyPtr = GetSceneObjectInputProperty( propertyIndex );
 
   // Check instead for newly registered properties
-  if( propertyPtr == NULL )
+  if( propertyPtr == nullptr )
   {
     PropertyMetadata* animatable = FindAnimatableProperty( propertyIndex );
-    if( animatable != NULL )
+    if( animatable )
     {
       propertyPtr = animatable->GetSceneGraphProperty();
     }
   }
 
-  if( propertyPtr == NULL )
+  if( propertyPtr == nullptr )
   {
     PropertyMetadata* custom = FindCustomProperty( propertyIndex );
-    if( custom != NULL )
+    if( custom )
     {
       propertyPtr = custom->GetSceneGraphProperty();
     }
   }
 
-  if( propertyPtr != NULL )
+  if( propertyPtr )
   {
-    const SceneGraph::PropertyOwner* sceneObject = GetPropertyOwner();
+    const SceneGraph::PropertyOwner& sceneObject = GetSceneObject();
 
-    if( sceneObject != NULL )
-    {
-      OwnerPointer< SceneGraph::UniformPropertyMapping > map = new SceneGraph::UniformPropertyMapping( uniformName, propertyPtr );
-      // Message takes ownership of Uniform map (and will delete it after copy)
-      AddUniformMapMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), *sceneObject, map );
-    }
-    else
-    {
-      DALI_ASSERT_ALWAYS(0 && "MESH_REWORK - Need to store property whilst off-stage" );
-    }
+    OwnerPointer< SceneGraph::UniformPropertyMapping > map = new SceneGraph::UniformPropertyMapping( uniformName, propertyPtr );
+    // Message takes ownership of Uniform map (and will delete it after copy)
+    AddUniformMapMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), sceneObject, map );
   }
 }
 
-void Object::RemoveUniformMapping( const std::string& uniformName )
+void Object::RemoveUniformMapping( const std::string& uniformName ) const
 {
-  const SceneGraph::PropertyOwner* sceneObject = GetSceneObject();
-  RemoveUniformMapMessage( GetEventThreadServices(), *sceneObject, uniformName);
+  const SceneGraph::PropertyOwner& sceneObject = GetSceneObject();
+  RemoveUniformMapMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), sceneObject, uniformName);
 }
 
-Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata* entry ) const
+void Object::ApplyConstraint( ConstraintBase& constraint )
 {
-  Property::Value value;
-
-  DALI_ASSERT_ALWAYS( entry && "Invalid property metadata" );
-
-  if( !entry->IsAnimatable() )
+  if( !mConstraints )
   {
-    value = entry->GetPropertyValue();
+    mConstraints = new ConstraintContainer;
   }
-  else
-  {
-    BufferIndex bufferIndex( GetEventThreadServices().GetEventBufferIndex() );
+  mConstraints->push_back( Dali::Constraint( &constraint ) );
+}
 
-    switch ( entry->GetType() )
-    {
-      case Property::BOOLEAN:
-      {
-        const AnimatableProperty<bool>* property = static_cast< const AnimatableProperty<bool>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
+void Object::RemoveConstraint( ConstraintBase& constraint )
+{
+  // nullptr if the Constraint sources are destroyed before Constraint::Apply()
+  if( mConstraints )
+  {
+    ConstraintIter it( std::find( mConstraints->begin(), mConstraints->end(), Dali::Constraint( &constraint ) ) );
+    if( it != mConstraints->end() )
+    {
+      mConstraints->erase( it );
+    }
+  }
+}
+
+void Object::RemoveConstraints()
+{
+  // guard against constraint sending messages during core destruction
+  if( mConstraints && Stage::IsInstalled() )
+  {
+    for ( auto&& item : *mConstraints )
+    {
+      GetImplementation( item ).RemoveInternal();
+    }
+
+    delete mConstraints;
+    mConstraints = nullptr;
+  }
+}
+
+void Object::RemoveConstraints( uint32_t tag )
+{
+  // guard against constraint sending messages during core destruction
+  if( mConstraints && Stage::IsInstalled() )
+  {
+    auto iter( mConstraints->begin() );
+    while(iter != mConstraints->end() )
+    {
+      ConstraintBase& constraint = GetImplementation( *iter );
+      if( constraint.GetTag() == tag )
+      {
+        GetImplementation( *iter ).RemoveInternal();
+        iter = mConstraints->erase( iter );
+      }
+      else
+      {
+        ++iter;
+      }
+    }
+
+    if ( mConstraints->empty() )
+    {
+      delete mConstraints;
+      mConstraints = nullptr;
+    }
+  }
+}
+
+void Object::SetTypeInfo( const TypeInfo* typeInfo )
+{
+  mTypeInfo = typeInfo;
+}
+
+const SceneGraph::PropertyOwner& Object::GetSceneObject() const
+{
+  if( !mUpdateObject )
+  {
+    auto sceneObject = SceneGraph::PropertyOwner::New();
+    OwnerPointer< SceneGraph::PropertyOwner > transferOwnership( sceneObject );
+    mUpdateObject = sceneObject;
+    AddObjectMessage( const_cast<EventThreadServices&>( GetEventThreadServices() ).GetUpdateManager(), transferOwnership );
+  }
+  DALI_ASSERT_DEBUG( mUpdateObject && "there must always be a scene object" );
+  return *mUpdateObject;
+}
+
+const PropertyBase* Object::GetSceneObjectAnimatableProperty( Property::Index index ) const
+{
+  const SceneGraph::PropertyBase* property = nullptr;
+  if ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX && index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )
+  {
+    AnimatablePropertyMetadata* animatable = GetSceneAnimatableProperty( index, nullptr );
+    DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
+
+    property = animatable->GetSceneGraphProperty();
+  }
+  else if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
+            ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
+  {
+    CustomPropertyMetadata* custom = FindCustomProperty( index );
+    DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
+
+    property = custom->GetSceneGraphProperty();
+  }
+  return property;
+}
+
+const PropertyInputImpl* Object::GetSceneObjectInputProperty( Property::Index index ) const
+{
+  // reuse animatable version as they are inputs as well
+  return GetSceneObjectAnimatableProperty( index );
+}
+
+int32_t Object::GetPropertyComponentIndex( Property::Index index ) const
+{
+  int32_t componentIndex = Property::INVALID_COMPONENT_INDEX;
+
+  if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  {
+    // check whether the animatable property is registered already, if not then register one.
+    AnimatablePropertyMetadata* animatableProperty = GetSceneAnimatableProperty( index, nullptr );
+    if( animatableProperty )
+    {
+      componentIndex = animatableProperty->componentIndex;
+    }
+  }
+  if( Property::INVALID_COMPONENT_INDEX == componentIndex )
+  {
+    const TypeInfo* typeInfo( GetTypeInfo() );
+    if ( typeInfo )
+    {
+      componentIndex = typeInfo->GetComponentIndex(index);
+    }
+  }
+
+  return componentIndex;
+}
+
+DevelHandle::PropertySetSignalType& Object::PropertySetSignal()
+{
+  return mPropertySetSignal;
+}
+
+Object::Object( const SceneGraph::PropertyOwner* sceneObject )
+: mEventThreadServices( EventThreadServices::Get() ),
+  mUpdateObject( sceneObject ),
+  mTypeInfo( nullptr ),
+  mConstraints( nullptr ),
+  mPropertyNotifications( nullptr )
+{
+}
+
+Object::~Object()
+{
+  // Notification for observers
+  for( auto&& item : mObservers )
+  {
+    item->ObjectDestroyed( *this );
+  }
+  delete mConstraints;
+  delete mPropertyNotifications;
+
+  // Guard to allow handle destruction after Core has been destroyed
+  if( Stage::IsInstalled() )
+  {
+    if( nullptr != mUpdateObject )
+    {
+      RemoveObjectMessage( GetEventThreadServices().GetUpdateManager(), mUpdateObject );
+    }
+  }
+}
+
+void Object::OnSceneObjectAdd()
+{
+  // Notification for observers
+  for( auto&& item : mObservers )
+  {
+    item->SceneObjectAdded(*this);
+  }
+
+  // enable property notifications in scene graph
+  EnablePropertyNotifications();
+}
+
+void Object::OnSceneObjectRemove()
+{
+  // Notification for observers
+  for( auto&& item : mObservers )
+  {
+    item->SceneObjectRemoved(*this);
+  }
+
+  // disable property notifications in scene graph
+  DisablePropertyNotifications();
+}
+
+const TypeInfo* Object::GetTypeInfo() const
+{
+  if ( !mTypeInfo )
+  {
+    // This uses a dynamic_cast so can be quite expensive so we only really want to do it once
+    // especially as the type-info does not change during the life-time of an application
+
+    TypeRegistry::TypeInfoPointer typeInfoHandle = TypeRegistry::Get()->GetTypeInfo( this );
+    if ( typeInfoHandle )
+    {
+      mTypeInfo = typeInfoHandle.Get(); // just a raw pointer to use, ownership is kept
+    }
+  }
+
+  return mTypeInfo;
+}
+
+CustomPropertyMetadata* Object::FindCustomProperty( Property::Index index ) const
+{
+  CustomPropertyMetadata* property = nullptr;
+  if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  {
+    for ( std::size_t arrayIndex = 0; arrayIndex < mCustomProperties.Count(); arrayIndex++ )
+    {
+      CustomPropertyMetadata* custom = static_cast<CustomPropertyMetadata*>( mCustomProperties[ arrayIndex ] );
+      if( custom->childPropertyIndex == index )
+      {
+        property = custom;
+      }
+    }
+  }
+  else
+  {
+    int32_t arrayIndex = index - PROPERTY_CUSTOM_START_INDEX;
+    if( arrayIndex >= 0 )
+    {
+      if( arrayIndex < static_cast<int32_t>( mCustomProperties.Count() ) ) // we can only access the first 2 billion custom properties
+      {
+        property = static_cast<CustomPropertyMetadata*>(mCustomProperties[ arrayIndex ]);
+      }
+    }
+  }
+  return property;
+}
+
+AnimatablePropertyMetadata* Object::FindAnimatableProperty( Property::Index index ) const
+{
+  for( auto&& entry : mAnimatableProperties )
+  {
+    AnimatablePropertyMetadata* property = static_cast<AnimatablePropertyMetadata*>( entry );
+    if( property->index == index )
+    {
+      return property;
+    }
+  }
+  return nullptr;
+}
+
+Property::Index Object::RegisterSceneGraphProperty( const std::string& name, Property::Index key, Property::Index index, const Property::Value& propertyValue ) const
+{
+  // Create a new property
+  Dali::Internal::OwnerPointer<PropertyBase> newProperty;
+
+  switch ( propertyValue.GetType() )
+  {
+    case Property::BOOLEAN:
+    {
+      newProperty = new AnimatableProperty<bool>( propertyValue.Get<bool>() );
+      break;
+    }
+
+    case Property::INTEGER:
+    {
+      newProperty = new AnimatableProperty<int32_t>( propertyValue.Get<int32_t>() );
+      break;
+    }
+
+    case Property::FLOAT:
+    {
+      newProperty = new AnimatableProperty<float>( propertyValue.Get<float>() );
+      break;
+    }
+
+    case Property::VECTOR2:
+    {
+      newProperty = new AnimatableProperty<Vector2>( propertyValue.Get<Vector2>() );
+      break;
+    }
+
+    case Property::VECTOR3:
+    {
+      newProperty = new AnimatableProperty<Vector3>( propertyValue.Get<Vector3>() );
+      break;
+    }
+
+    case Property::VECTOR4:
+    {
+      newProperty = new AnimatableProperty<Vector4>( propertyValue.Get<Vector4>() );
+      break;
+    }
+
+    case Property::MATRIX:
+    {
+      newProperty = new AnimatableProperty<Matrix>( propertyValue.Get<Matrix>() );
+      break;
+    }
+
+    case Property::MATRIX3:
+    {
+      newProperty = new AnimatableProperty<Matrix3>( propertyValue.Get<Matrix3>() );
+      break;
+    }
+
+    case Property::ROTATION:
+    {
+      newProperty = new AnimatableProperty<Quaternion>( propertyValue.Get<Quaternion>() );
+      break;
+    }
+
+    case Property::RECTANGLE:
+    case Property::STRING:
+    case Property::ARRAY:
+    case Property::MAP:
+    case Property::EXTENTS:
+    case Property::NONE:
+    {
+      DALI_ASSERT_ALWAYS( !"Property type is not animatable" );
+      break;
+    }
+  }
+
+  // get the scene property owner
+  const SceneGraph::PropertyOwner& scenePropertyOwner = GetSceneObject();
+  // keep a local pointer to the property as the OwnerPointer will pass its copy to the message
+  const PropertyBase* property = newProperty.Get();
+  if(index >= PROPERTY_CUSTOM_START_INDEX)
+  {
+    DALI_ASSERT_ALWAYS( index <= PROPERTY_CUSTOM_MAX_INDEX && "Too many custom properties have been registered" );
+
+    mCustomProperties.PushBack( new CustomPropertyMetadata( name, key, propertyValue, property ) );
+  }
+  else
+  {
+    mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, propertyValue, property ) );
+  }
+
+  // queue a message to add the property
+  InstallCustomPropertyMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), scenePropertyOwner, newProperty ); // Message takes ownership
+
+  return index;
+}
+
+void Object::RegisterAnimatableProperty( const TypeInfo& typeInfo,
+                                          Property::Index index,
+                                          const Property::Value* value ) const
+{
+  // If the property is not a component of a base property, register the whole property itself.
+  const std::string& propertyName = typeInfo.GetPropertyName( index );
+  Property::Value initialValue;
+  if( value )
+  {
+    initialValue = *value;
+  }
+  else
+  {
+    initialValue = typeInfo.GetPropertyDefaultValue( index ); // recurses type hierarchy
+    if( Property::NONE == initialValue.GetType() )
+    {
+      initialValue = Property::Value( typeInfo.GetPropertyType( index ) ); // recurses type hierarchy
+    }
+  }
+  RegisterSceneGraphProperty( propertyName, Property::INVALID_KEY, index, initialValue );
+  AddUniformMapping( index, propertyName );
+}
+
+AnimatablePropertyMetadata* Object::GetSceneAnimatableProperty( Property::Index index, const Property::Value* value ) const
+{
+  // property range already checked by calling methods
+  // check whether the animatable property is registered already, if not then register one.
+  AnimatablePropertyMetadata* animatableProperty = FindAnimatableProperty( index );
+  if( !animatableProperty )
+  {
+    const TypeInfo* typeInfo( GetTypeInfo() );
+    if( typeInfo )
+    {
+      Property::Index basePropertyIndex = typeInfo->GetBasePropertyIndex( index );
+      if( basePropertyIndex == Property::INVALID_INDEX )
+      {
+        // If the property is not a component of a base property, register the whole property itself.
+        RegisterAnimatableProperty( *typeInfo, index, value );
+      }
+      else
+      {
+        // Since the property is a component of a base property, check whether the base property is registered.
+        animatableProperty = FindAnimatableProperty( basePropertyIndex );
+        if( !animatableProperty )
+        {
+          // If the base property is not registered yet, register the base property first.
+          RegisterAnimatableProperty( *typeInfo, basePropertyIndex, value );
+          animatableProperty = static_cast<AnimatablePropertyMetadata*>(mAnimatableProperties[mAnimatableProperties.Size()-1]);
+        }
+
+        // Create the metadata for the property component.
+        mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, typeInfo->GetComponentIndex(index), animatableProperty->value, animatableProperty->GetSceneGraphProperty() ) );
+      }
+
+      // The metadata has just been added and therefore should be in the end of the vector.
+      animatableProperty = static_cast<AnimatablePropertyMetadata*>(mAnimatableProperties[mAnimatableProperties.Size()-1]);
+    }
+  }
+
+  return animatableProperty;
+}
+
+void Object::ResolveChildProperties()
+{
+  // Resolve index for the child property
+  Object* parent = GetParentObject();
+  if( parent )
+  {
+    const TypeInfo* parentTypeInfo( parent->GetTypeInfo() );
+    if( parentTypeInfo )
+    {
+      // Go through each custom property
+      for( auto&& entry : mCustomProperties )
+      {
+        CustomPropertyMetadata* customProperty = static_cast<CustomPropertyMetadata*>( entry );
+
+        if( customProperty->name.empty() )
+        {
+          if( customProperty->childPropertyIndex != Property::INVALID_INDEX )
+          {
+            // Resolve name for any child property with no name
+            customProperty->name = parentTypeInfo->GetChildPropertyName( customProperty->childPropertyIndex );
+          }
+        }
+        else
+        {
+          Property::Index childPropertyIndex = parentTypeInfo->GetChildPropertyIndex( customProperty->name );
+          if( childPropertyIndex != Property::INVALID_INDEX )
+          {
+            // Resolve index for any property with a name that matches the parent's child property name
+            customProperty->childPropertyIndex = childPropertyIndex;
+          }
+        }
+      }
+    }
+  }
+}
+
+void Object::SetDefaultProperty( Property::Index index, const Property::Value& property )
+{
+  // do nothing
+}
+
+Property::Value Object::GetDefaultProperty(Property::Index index) const
+{
+  return Property::Value();
+}
+
+Property::Value Object::GetDefaultPropertyCurrentValue( Property::Index index ) const
+{
+  return GetDefaultProperty( index );
+}
+
+void Object::EnablePropertyNotifications()
+{
+  if( mPropertyNotifications )
+  {
+    for( auto&& element : *mPropertyNotifications )
+    {
+      GetImplementation( element ).Enable();
+    }
+  }
+}
+
+void Object::DisablePropertyNotifications()
+{
+  if( mPropertyNotifications )
+  {
+    for( auto&& element : *mPropertyNotifications )
+    {
+      GetImplementation( element ).Disable();
+    }
+  }
+}
+
+Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata& entry ) const
+{
+  Property::Value value;
+
+  if( !entry.IsAnimatable() )
+  {
+    value = entry.GetPropertyValue();
+  }
+  else
+  {
+    BufferIndex bufferIndex( GetEventThreadServices().GetEventBufferIndex() );
+
+    switch ( entry.GetType() )
+    {
+      case Property::BOOLEAN:
+      {
+        const AnimatableProperty<bool>* property = static_cast< const AnimatableProperty<bool>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( property );
 
         value = (*property)[ bufferIndex ];
         break;
@@ -1085,8 +1312,8 @@ Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata* entry )
 
       case Property::INTEGER:
       {
-        const AnimatableProperty<int>* property = static_cast< const AnimatableProperty<int>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
+        const AnimatableProperty<int32_t>* property = static_cast< const AnimatableProperty<int32_t>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( property );
 
         value = (*property)[ bufferIndex ];
         break;
@@ -1094,8 +1321,8 @@ Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata* entry )
 
       case Property::FLOAT:
       {
-        const AnimatableProperty<float>* property = static_cast< const AnimatableProperty<float>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
+        const AnimatableProperty<float>* property = static_cast< const AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( property );
 
         value = (*property)[ bufferIndex ];
         break;
@@ -1103,14 +1330,14 @@ Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata* entry )
 
       case Property::VECTOR2:
       {
-        const AnimatableProperty<Vector2>* property = static_cast< const AnimatableProperty<Vector2>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
+        const AnimatableProperty<Vector2>* property = static_cast< const AnimatableProperty<Vector2>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( property );
 
-        if(entry->componentIndex == 0)
+        if(entry.componentIndex == 0)
         {
           value = (*property)[ bufferIndex ].x;
         }
-        else if(entry->componentIndex == 1)
+        else if(entry.componentIndex == 1)
         {
           value = (*property)[ bufferIndex ].y;
         }
@@ -1123,18 +1350,18 @@ Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata* entry )
 
       case Property::VECTOR3:
       {
-        const AnimatableProperty<Vector3>* property = static_cast< const AnimatableProperty<Vector3>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
+        const AnimatableProperty<Vector3>* property = static_cast< const AnimatableProperty<Vector3>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( property );
 
-        if(entry->componentIndex == 0)
+        if(entry.componentIndex == 0)
         {
           value = (*property)[ bufferIndex ].x;
         }
-        else if(entry->componentIndex == 1)
+        else if(entry.componentIndex == 1)
         {
           value = (*property)[ bufferIndex ].y;
         }
-        else if(entry->componentIndex == 2)
+        else if(entry.componentIndex == 2)
         {
           value = (*property)[ bufferIndex ].z;
         }
@@ -1147,22 +1374,22 @@ Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata* entry )
 
       case Property::VECTOR4:
       {
-        const AnimatableProperty<Vector4>* property = static_cast< const AnimatableProperty<Vector4>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
+        const AnimatableProperty<Vector4>* property = static_cast< const AnimatableProperty<Vector4>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( property );
 
-        if(entry->componentIndex == 0)
+        if(entry.componentIndex == 0)
         {
           value = (*property)[ bufferIndex ].x;
         }
-        else if(entry->componentIndex == 1)
+        else if(entry.componentIndex == 1)
         {
           value = (*property)[ bufferIndex ].y;
         }
-        else if(entry->componentIndex == 2)
+        else if(entry.componentIndex == 2)
         {
           value = (*property)[ bufferIndex ].z;
         }
-        else if(entry->componentIndex == 3)
+        else if(entry.componentIndex == 3)
         {
           value = (*property)[ bufferIndex ].w;
         }
@@ -1175,8 +1402,8 @@ Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata* entry )
 
       case Property::MATRIX:
       {
-        const AnimatableProperty<Matrix>* property = static_cast< const AnimatableProperty<Matrix>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
+        const AnimatableProperty<Matrix>* property = static_cast< const AnimatableProperty<Matrix>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( property );
 
         value = (*property)[ bufferIndex ];
         break;
@@ -1184,8 +1411,8 @@ Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata* entry )
 
       case Property::MATRIX3:
       {
-        const AnimatableProperty<Matrix3>* property = static_cast< const AnimatableProperty<Matrix3>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
+        const AnimatableProperty<Matrix3>* property = static_cast< const AnimatableProperty<Matrix3>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( property );
 
         value = (*property)[ bufferIndex ];
         break;
@@ -1193,8 +1420,8 @@ Property::Value Object::GetCurrentPropertyValue( const PropertyMetadata* entry )
 
       case Property::ROTATION:
       {
-        const AnimatableProperty<Quaternion>* property = static_cast< const AnimatableProperty<Quaternion>* >( entry->GetSceneGraphProperty() );
-        DALI_ASSERT_DEBUG( NULL != property );
+        const AnimatableProperty<Quaternion>* property = static_cast< const AnimatableProperty<Quaternion>* >( entry.GetSceneGraphProperty() );
+        DALI_ASSERT_DEBUG( property );
 
         value = (*property)[ bufferIndex ];
         break;
@@ -1217,7 +1444,7 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
     case Property::BOOLEAN:
     {
       const AnimatableProperty<bool>* property = dynamic_cast< const AnimatableProperty<bool>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      DALI_ASSERT_DEBUG( property );
 
       // property is being used in a separate thread; queue a message to set the property
       BakeMessage<bool>( GetEventThreadServices(), *property, value.Get<bool>() );
@@ -1226,18 +1453,18 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
 
     case Property::INTEGER:
     {
-      const AnimatableProperty<int>* property = dynamic_cast< const AnimatableProperty<int>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      const AnimatableProperty<int32_t>* property = dynamic_cast< const AnimatableProperty<int32_t>* >( entry.GetSceneGraphProperty() );
+      DALI_ASSERT_DEBUG( property );
 
       // property is being used in a separate thread; queue a message to set the property
-      BakeMessage<int>( GetEventThreadServices(), *property, value.Get<int>() );
+      BakeMessage<int32_t>( GetEventThreadServices(), *property, value.Get<int32_t>() );
       break;
     }
 
     case Property::FLOAT:
     {
       const AnimatableProperty<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      DALI_ASSERT_DEBUG( property );
 
       // property is being used in a separate thread; queue a message to set the property
       BakeMessage<float>( GetEventThreadServices(), *property, value.Get<float>() );
@@ -1247,7 +1474,7 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
     case Property::VECTOR2:
     {
       const AnimatableProperty<Vector2>* property = dynamic_cast< const AnimatableProperty<Vector2>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      DALI_ASSERT_DEBUG( property );
 
       // property is being used in a separate thread; queue a message to set the property
       if(entry.componentIndex == 0)
@@ -1268,7 +1495,7 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
     case Property::VECTOR3:
     {
       const AnimatableProperty<Vector3>* property = dynamic_cast< const AnimatableProperty<Vector3>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      DALI_ASSERT_DEBUG( property );
 
       // property is being used in a separate thread; queue a message to set the property
       if(entry.componentIndex == 0)
@@ -1294,7 +1521,7 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
     case Property::VECTOR4:
     {
       const AnimatableProperty<Vector4>* property = dynamic_cast< const AnimatableProperty<Vector4>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      DALI_ASSERT_DEBUG( property );
 
       // property is being used in a separate thread; queue a message to set the property
       if(entry.componentIndex == 0)
@@ -1323,7 +1550,7 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
     case Property::ROTATION:
     {
       const AnimatableProperty<Quaternion>* property = dynamic_cast< const AnimatableProperty<Quaternion>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      DALI_ASSERT_DEBUG( property );
 
       // property is being used in a separate thread; queue a message to set the property
       BakeMessage<Quaternion>( GetEventThreadServices(), *property, value.Get<Quaternion>() );
@@ -1333,7 +1560,7 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
     case Property::MATRIX:
     {
       const AnimatableProperty<Matrix>* property = dynamic_cast< const AnimatableProperty<Matrix>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      DALI_ASSERT_DEBUG( property );
 
       // property is being used in a separate thread; queue a message to set the property
       BakeMessage<Matrix>( GetEventThreadServices(), *property, value.Get<Matrix>() );
@@ -1343,7 +1570,7 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
     case Property::MATRIX3:
     {
       const AnimatableProperty<Matrix3>* property = dynamic_cast< const AnimatableProperty<Matrix3>* >( entry.GetSceneGraphProperty() );
-      DALI_ASSERT_DEBUG( NULL != property );
+      DALI_ASSERT_DEBUG( property );
 
       // property is being used in a separate thread; queue a message to set the property
       BakeMessage<Matrix3>( GetEventThreadServices(), *property, value.Get<Matrix3>() );
@@ -1357,241 +1584,6 @@ void Object::SetSceneGraphProperty( Property::Index index, const PropertyMetadat
   }
 }
 
-const TypeInfo* Object::GetTypeInfo() const
-{
-  if ( !mTypeInfo )
-  {
-    // This uses a dynamic_cast so can be quite expensive so we only really want to do it once
-    // especially as the type-info does not change during the life-time of an application
-
-    Dali::TypeInfo typeInfoHandle = TypeRegistry::Get()->GetTypeInfo( this );
-    if ( typeInfoHandle )
-    {
-      mTypeInfo = &GetImplementation( typeInfoHandle );
-    }
-  }
-
-  return mTypeInfo;
-}
-
-void Object::ApplyConstraint( ConstraintBase& constraint )
-{
-  if( !mConstraints )
-  {
-    mConstraints = new ConstraintContainer;
-  }
-  mConstraints->push_back( Dali::Constraint( &constraint ) );
-}
-
-void Object::RemoveConstraint( ConstraintBase& constraint )
-{
-  // NULL if the Constraint sources are destroyed before Constraint::Apply()
-  if( mConstraints )
-  {
-    ConstraintIter it( std::find( mConstraints->begin(), mConstraints->end(), Dali::Constraint( &constraint ) ) );
-    if( it != mConstraints->end() )
-    {
-      mConstraints->erase( it );
-    }
-  }
-}
-
-void Object::RemoveConstraints()
-{
-  // guard against constraint sending messages during core destruction
-  if( mConstraints && Stage::IsInstalled() )
-  {
-    // If we have nothing in the scene-graph, just clear constraint containers
-    const SceneGraph::PropertyOwner* propertyOwner = GetSceneObject();
-    if ( NULL != propertyOwner )
-    {
-      const ConstraintConstIter endIter = mConstraints->end();
-      for ( ConstraintIter iter = mConstraints->begin(); endIter != iter; ++iter )
-      {
-        GetImplementation( *iter ).RemoveInternal();
-      }
-    }
-
-    delete mConstraints;
-    mConstraints = NULL;
-  }
-}
-
-void Object::RemoveConstraints( unsigned int tag )
-{
-  // guard against constraint sending messages during core destruction
-  if( mConstraints && Stage::IsInstalled() )
-  {
-    ConstraintIter iter( mConstraints->begin() );
-    while(iter != mConstraints->end() )
-    {
-      ConstraintBase& constraint = GetImplementation( *iter );
-      if( constraint.GetTag() == tag )
-      {
-        GetImplementation( *iter ).RemoveInternal();
-        iter = mConstraints->erase( iter );
-      }
-      else
-      {
-        ++iter;
-      }
-    }
-
-    if ( mConstraints->empty() )
-    {
-      delete mConstraints;
-      mConstraints = NULL;
-    }
-  }
-}
-
-void Object::SetTypeInfo( const TypeInfo* typeInfo )
-{
-  mTypeInfo = typeInfo;
-}
-
-Object::~Object()
-{
-  // Notification for observers
-  for( ConstObserverIter iter = mObservers.Begin(), endIter =  mObservers.End(); iter != endIter; ++iter)
-  {
-    (*iter)->ObjectDestroyed(*this);
-  }
-
-  delete mConstraints;
-  delete mPropertyNotifications;
-}
-
-CustomPropertyMetadata* Object::FindCustomProperty( Property::Index index ) const
-{
-  CustomPropertyMetadata* property( NULL );
-  if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX ) )
-  {
-    for ( std::size_t arrayIndex = 0; arrayIndex < mCustomProperties.Count(); arrayIndex++ )
-    {
-      CustomPropertyMetadata* custom = static_cast<CustomPropertyMetadata*>( mCustomProperties[ arrayIndex ] );
-      if( custom->childPropertyIndex == index )
-      {
-        property = custom;
-      }
-    }
-  }
-  else
-  {
-    int arrayIndex = index - PROPERTY_CUSTOM_START_INDEX;
-    if( arrayIndex >= 0 )
-    {
-      if( arrayIndex < static_cast<int>( mCustomProperties.Count() ) ) // we can only access the first 2 billion custom properties
-      {
-        property = static_cast<CustomPropertyMetadata*>(mCustomProperties[ arrayIndex ]);
-      }
-    }
-  }
-  return property;
-}
-
-AnimatablePropertyMetadata* Object::FindAnimatableProperty( Property::Index index ) const
-{
-  const PropertyMetadataLookup::SizeType count = mAnimatableProperties.Count();
-  for ( PropertyMetadataLookup::SizeType arrayIndex = 0; arrayIndex < count; ++arrayIndex )
-  {
-    AnimatablePropertyMetadata* property = static_cast<AnimatablePropertyMetadata*>( mAnimatableProperties[ arrayIndex ] );
-    if( property->index == index )
-    {
-      return property;
-    }
-  }
-  return NULL;
-}
-
-AnimatablePropertyMetadata* Object::RegisterAnimatableProperty(Property::Index index) const
-{
-  DALI_ASSERT_ALWAYS( (( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ))
-                      && "Property index is out of bounds" );
-
-  // check whether the animatable property is registered already, if not then register one.
-  AnimatablePropertyMetadata* animatableProperty = FindAnimatableProperty( index );
-  if( !animatableProperty )
-  {
-    const TypeInfo* typeInfo( GetTypeInfo() );
-    if( typeInfo )
-    {
-      Property::Index basePropertyIndex = typeInfo->GetBasePropertyIndex(index);
-      if( basePropertyIndex == Property::INVALID_INDEX )
-      {
-        // If the property is not a component of a base property, register the whole property itself.
-        const  std::string& propertyName = typeInfo->GetPropertyName(index);
-        RegisterSceneGraphProperty(propertyName, Property::INVALID_KEY, index, typeInfo->GetPropertyDefaultValue(index));
-        AddUniformMapping( index, propertyName );
-      }
-      else
-      {
-        // Since the property is a component of a base property, check whether the base property is registered.
-        animatableProperty = FindAnimatableProperty( basePropertyIndex );
-        if( !animatableProperty )
-        {
-          // If the base property is not registered yet, register the base property first.
-          const  std::string& basePropertyName = typeInfo->GetPropertyName(basePropertyIndex);
-
-          if( Property::INVALID_INDEX != RegisterSceneGraphProperty( basePropertyName, Property::INVALID_KEY, basePropertyIndex, typeInfo->GetPropertyDefaultValue( basePropertyIndex ) ) )
-          {
-            animatableProperty = static_cast<AnimatablePropertyMetadata*>(mAnimatableProperties[mAnimatableProperties.Size()-1]);
-            AddUniformMapping( basePropertyIndex, basePropertyName );
-          }
-        }
-
-        if(animatableProperty)
-        {
-          // Create the metadata for the property component.
-          mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, typeInfo->GetComponentIndex(index), animatableProperty->value, animatableProperty->GetSceneGraphProperty() ) );
-        }
-      }
-
-      // The metadata has just been added and therefore should be in the end of the vector.
-      animatableProperty = static_cast<AnimatablePropertyMetadata*>(mAnimatableProperties[mAnimatableProperties.Size()-1]);
-    }
-  }
-
-  return animatableProperty;
-}
-
-void Object::ResolveChildProperties()
-{
-  // Resolve index for the child property
-  Object* parent = GetParentObject();
-  if( parent )
-  {
-    const TypeInfo* parentTypeInfo( parent->GetTypeInfo() );
-    if( parentTypeInfo )
-    {
-      // Go through each custom property
-      const PropertyMetadataLookup::SizeType count = mCustomProperties.Count();
-      for ( PropertyMetadataLookup::SizeType arrayIndex = 0; arrayIndex < count; ++arrayIndex )
-      {
-        CustomPropertyMetadata* customProperty = static_cast<CustomPropertyMetadata*>( mCustomProperties[ arrayIndex ] );
-
-        if( customProperty->name == "" )
-        {
-          if( customProperty->childPropertyIndex != Property::INVALID_INDEX )
-          {
-            // Resolve name for any child property with no name
-            customProperty->name = parentTypeInfo->GetChildPropertyName( customProperty->childPropertyIndex );
-          }
-        }
-        else
-        {
-          Property::Index childPropertyIndex = parentTypeInfo->GetChildPropertyIndex( customProperty->name );
-          if( childPropertyIndex != Property::INVALID_INDEX )
-          {
-            // Resolve index for any property with a name that matches the parent's child property name
-            customProperty->childPropertyIndex = childPropertyIndex;
-          }
-        }
-      }
-    }
-  }
-}
-
 } // namespace Internal
 
 } // namespace Dali
index 7658482..2b8ab6e 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_OBJECT_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/dali-vector.h>
@@ -56,10 +59,9 @@ class PropertyBase;
 class PropertyOwner;
 }
 
-typedef std::vector< Dali::Constraint >     ConstraintContainer;
-typedef ConstraintContainer::iterator       ConstraintIter;
-typedef ConstraintContainer::const_iterator ConstraintConstIter;
-
+using ConstraintContainer = std::vector< Dali::Constraint >;
+using ConstraintIter = ConstraintContainer::iterator;
+using ConstraintConstIter = ConstraintContainer::const_iterator;
 
 /**
  * A base class for objects which optionally provide properties.
@@ -69,19 +71,15 @@ typedef ConstraintContainer::const_iterator ConstraintConstIter;
  * An object for a property-owning object in the scene-graph.
  * This provides an interface for observing the addition/removal of scene-objects.
  *
- * The concrete derived class is responsible for:
- *   1) Adding & removing an object from the scene-graph. The OnSceneObjectAdd() and OnSceneObjectRemove()
- *      methods should be called by the derived class, to trigger observer callbacks.
- *   3) Implementing the GetSceneObject() methods, used to access the scene-object.
- *   4) Providing access to properties stored by the scene-graph object. These should match the properties
- *      reported by the base Dali::Internal::Object methods.
- *
+ * The derived class should either:
+ *   a) Create their own scene-graph object and pass it to Object constructor.
+ *   b) pass nullptr to Object constructor, in this case Object will create default scene object for property handling
  */
 class Object : public Dali::BaseObject
 {
 public:
 
-  typedef Dali::Handle::Capability Capability;
+  using Capability = Dali::Handle::Capability;
 
   class Observer
   {
@@ -114,114 +112,116 @@ public:
   };
 
   /**
-   * Constructor.
+   * Creates a new object
+   *
+   * @return an smart pointer to the object
    */
-  Object();
+  static IntrusivePtr<Object> New();
 
   /**
    * Add an observer to the object.
    * @param[in] observer The observer to add.
    */
-  virtual void AddObserver( Observer& observer );
+  void AddObserver( Observer& observer );
 
   /**
    * Remove an observer from the object
    * @pre The observer has already been added.
    * @param[in] observer The observer to remove.
    */
-  virtual void RemoveObserver( Observer& observer );
+  void RemoveObserver( Observer& observer );
 
   /**
    * @copydoc Dali::Handle::Supports()
    */
-  virtual bool Supports( Capability capability ) const;
+  bool Supports( Capability capability ) const;
 
   /**
    * @copydoc Dali::Handle::GetPropertyCount()
    */
-  virtual unsigned int GetPropertyCount() const;
+  uint32_t GetPropertyCount() const;
 
   /**
    * @copydoc Dali::Handle::GetPropertyName()
    */
-  virtual std::string GetPropertyName( Property::Index index ) const;
+  std::string GetPropertyName( Property::Index index ) const;
 
   /**
    * @copydoc Dali::Handle::GetPropertyIndex()
    */
-  virtual Property::Index GetPropertyIndex( const std::string& name ) const;
+  Property::Index GetPropertyIndex( const std::string& name ) const;
 
   /**
    * @copydoc Dali::Handle::GetPropertyIndex()
    */
-  virtual Property::Index GetPropertyIndex( Property::Index key ) const;
+  Property::Index GetPropertyIndex( Property::Index key ) const;
 
   /**
    * @copydoc Dali::Handle::GetPropertyIndex()
    */
-  virtual Property::Index GetPropertyIndex( Property::Key key ) const;
+  Property::Index GetPropertyIndex( Property::Key key ) const;
 
   /**
    * @copydoc Dali::Handle::IsPropertyWritable()
    */
-  virtual bool IsPropertyWritable( Property::Index index ) const;
+  bool IsPropertyWritable( Property::Index index ) const;
 
   /**
    * @copydoc Dali::Handle::IsPropertyAnimatable()
    */
-  virtual bool IsPropertyAnimatable( Property::Index index ) const;
+  bool IsPropertyAnimatable( Property::Index index ) const;
 
   /**
    * @copydoc Dali::Handle::IsPropertyAConstraintInput()
    */
-  virtual bool IsPropertyAConstraintInput( Property::Index index ) const;
+  bool IsPropertyAConstraintInput( Property::Index index ) const;
 
   /**
    * @copydoc Dali::Handle::GetPropertyType()
    */
-  virtual Property::Type GetPropertyType( Property::Index index ) const;
+  Property::Type GetPropertyType( Property::Index index ) const;
 
   /**
    * @copydoc Dali::Handle::SetProperty()
    */
-  virtual void SetProperty( Property::Index index, const Property::Value& propertyValue );
+  void SetProperty( Property::Index index, const Property::Value& propertyValue );
 
   /**
    * @copydoc Dali::Handle::GetProperty()
    */
-  virtual Property::Value GetProperty( Property::Index index ) const;
+  Property::Value GetProperty( Property::Index index ) const;
 
   /**
    * @brief Retrieves the latest value of the property on the scene-graph.
    * @param[in]  index  The index of the property required.
    * @return The latest value of the property on the scene-graph.
    */
-  virtual Property::Value GetCurrentProperty( Property::Index index ) const;
+  Property::Value GetCurrentProperty( Property::Index index ) const;
 
   /**
    * @copydoc Dali::Handle::GetPropertyIndices()
    */
-  virtual void GetPropertyIndices( Property::IndexContainer& indices ) const;
+  void GetPropertyIndices( Property::IndexContainer& indices ) const;
 
   /**
    * @copydoc Dali::Handle::RegisterProperty()
    */
-  virtual Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue );
+  Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue );
 
   /**
    * @copydoc Dali::Handle::RegisterProperty()
    */
-  virtual Property::Index RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue );
+  Property::Index RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue );
 
   /**
    * @copydoc Dali::Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
    */
-  virtual Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode );
+  Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode );
 
   /**
    * @brief Implementing method for this override
    */
-  virtual Property::Index RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue, Property::AccessMode accessMode );
+  Property::Index RegisterProperty( const std::string& name, Property::Index key, const Property::Value& propertyValue, Property::AccessMode accessMode );
 
   /**
    * @brief returns true if the custom property exists on this object.
@@ -239,19 +239,19 @@ public:
   /**
    * @copydoc Dali::Handle::AddPropertyNotification()
    */
-  virtual Dali::PropertyNotification AddPropertyNotification( Property::Index index,
-                                                              int componentIndex,
-                                                              const Dali::PropertyCondition& condition );
+  Dali::PropertyNotification AddPropertyNotification( Property::Index index,
+                                                      int32_t componentIndex,
+                                                      const Dali::PropertyCondition& condition );
 
   /**
    * @copydoc Dali::Handle::RemovePropertyNotification()
    */
-  virtual void RemovePropertyNotification( Dali::PropertyNotification propertyNotification );
+  void RemovePropertyNotification( Dali::PropertyNotification propertyNotification );
 
   /**
    * @copydoc Dali::Handle::RemovePropertyNotifications()
    */
-  virtual void RemovePropertyNotifications();
+  void RemovePropertyNotifications();
 
   /**
    * Notifies that a property is being animated.
@@ -265,14 +265,17 @@ public:
   /******************************** Uniform Mappings ********************************/
 
   /**
-   * @copydoc Dali::Handle::AddUniformMapping()
+   * Adds uniform mapping for given property
+   * @param propertyIndex index of the property
+   * @param uniformName name of the uniform (same as property name)
    */
   void AddUniformMapping( Property::Index propertyIndex, const std::string& uniformName ) const;
 
   /**
-   * @copydoc Dali::Handle::RemoveUniformMapping( )
+   * Removes uniform mapping for given property
+   * @param uniformName name of the uniform (same as property name)
    */
-  void RemoveUniformMapping( const std::string& uniformName );
+  void RemoveUniformMapping( const std::string& uniformName ) const;
 
   /******************************** Constraints ********************************/
 
@@ -294,9 +297,9 @@ public:
   void RemoveConstraints();
 
   /**
-   * Remove all constraints from a Object with a matching tag
+   * @copydoc Dali::Handle::RemoveConstraints( uint32_t )
    */
-  void RemoveConstraints( unsigned int tag );
+  void RemoveConstraints( uint32_t tag );
 
   /**
    * Called by TypeInfo to set the type-info that this object-impl is created by.
@@ -307,18 +310,18 @@ public:
   /**
    * @return the index from which custom properties start
    */
-  unsigned int CustomPropertyStartIndex()
+  uint32_t CustomPropertyStartIndex()
   {
     return PROPERTY_CUSTOM_START_INDEX;
   }
 
-  /********************  To be overridden by deriving classes ********************/
-
   /**
    * Retrieve the scene-graph object added by this object.
-   * @return A pointer to the object, or NULL if no object has been added to the scene-graph.
+   * @return reference to the scene-graph object, it will always exist
    */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const = 0;
+  const SceneGraph::PropertyOwner& GetSceneObject() const;
+
+  /********************  Can be overridden by deriving classes ********************/
 
   /**
    * Retrieve an animatable property owned by the scene-graph object.
@@ -326,7 +329,7 @@ public:
    * @param[in] index The index of the property.
    * @return A dereferenceable pointer to a property, or NULL if a scene-object does not exist with this property.
    */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const = 0;
+  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
 
   /**
    * Retrieve a constraint input-property owned by the scene-graph object.
@@ -334,7 +337,7 @@ public:
    * @param[in] index The index of the property.
    * @return A dereferenceable pointer to an input property, or NULL if a scene-object does not exist with this property.
    */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const = 0;
+  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
 
   /**
    * Query whether the property is a component of a scene-graph property.
@@ -342,7 +345,7 @@ public:
    * @param[in] index The index of the property.
    * @return The index or Property::INVALID_COMPONENT_INDEX.
    */
-  virtual int GetPropertyComponentIndex( Property::Index index ) const;
+  virtual int32_t GetPropertyComponentIndex( Property::Index index ) const;
 
   /**
    * @copydoc Dali::Handle::PropertySetSignal()
@@ -352,6 +355,13 @@ public:
 protected:
 
   /**
+   * Constructor. Protected so use New to construct an instance of this class
+   *
+   * @param sceneObject the scene graph property owner
+   */
+  Object( const SceneGraph::PropertyOwner* sceneObject );
+
+  /**
    * A reference counted object may only be deleted by calling Unreference()
    */
   virtual ~Object();
@@ -372,7 +382,7 @@ protected:
   virtual Object* GetParentObject() const
   {
     // By default the Object does not have a parent
-    return NULL;
+    return nullptr;
   };
 
   /**
@@ -412,14 +422,23 @@ protected:
    * @param [in] value The value of the property.
    * @return The index of the registered property or Property::INVALID_INDEX if registration failed.
    */
-  Property::Index RegisterSceneGraphProperty(const std::string& name, Property::Index key, Property::Index index, const Property::Value& propertyValue) const;
+  Property::Index RegisterSceneGraphProperty( const std::string& name, Property::Index key, Property::Index index, const Property::Value& propertyValue ) const;
+
+  /**
+   * Registers animatable scene property
+   * @param typeInfo to check the default value
+   * @param index of the property to register
+   * @param value initial value or nullptr
+   */
+  void RegisterAnimatableProperty( const TypeInfo& typeInfo, Property::Index index, const Property::Value* value ) const;
 
   /**
-   * Check whether the animatable property is registered already, if not then register one.
+   * Check whether the animatable property is registered already, if not then register on.
    * @param [in] index The index of the property
-   * @return pointer to the property.
+   * @param [in] value optional value for the property
+   * @return pointer to the property metadata
    */
-  AnimatablePropertyMetadata* RegisterAnimatableProperty(Property::Index index) const;
+  AnimatablePropertyMetadata* GetSceneAnimatableProperty( Property::Index index, const Property::Value* value ) const;
 
   /**
    * Resolve the index and name of child properties if any.
@@ -429,82 +448,26 @@ protected:
 private: // Default property extensions for derived classes
 
   /**
-   * Query how many default properties the derived class supports.
-   * @return The number of default properties.
-   */
-  virtual unsigned int GetDefaultPropertyCount() const = 0;
-
-  /**
-   * Retrieve all the indices that are associated with the default properties supported by the derived class.
-   * @return A container of default property indices.
-   * @note The deriving class must not modify the existing elements in the container.
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const = 0;
-
-  /**
-   * Query how many default properties the derived class supports.
-   * @return The number of default properties.
-   */
-  virtual const char* GetDefaultPropertyName( Property::Index index ) const = 0;
-
-  /**
-   * Query the index of a default property.
-   * @param [in] name The name of the property.
-   * @return The index of the property, or Property::INVALID_INDEX if no default property exists with the given name.
-   */
-  virtual Property::Index GetDefaultPropertyIndex( const std::string& name ) const = 0;
-
-  /**
-   * Query whether a default property is writable.
-   * @param [in] index The index of the property.
-   * @return True if the property is animatable.
-   */
-  virtual bool IsDefaultPropertyWritable( Property::Index index ) const = 0;
-
-  /**
-   * Query whether a default property is animatable.
-   * This determines whether the property can be the target of an animation or constraint.
-   * @param [in] index The index of the property.
-   * @return True if the property is animatable.
-   */
-  virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const = 0;
-
-  /**
-   * @brief Query whether a default property can be used as an input to a constraint.
-   *
-   * @param [in] index The index of the property.
-   * @return True if the property can be used as an input to a constraint.
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const = 0;
-
-  /**
-   * Query the type of a default property.
-   * @param [in] index The index of the property.
-   * @return The type of the property.
-   */
-  virtual Property::Type GetDefaultPropertyType( Property::Index index ) const = 0;
-
-  /**
    * Set the value of a default property.
    * @pre The property types match i.e. propertyValue.GetType() is equal to GetPropertyType(index).
    * @param [in] index The index of the property.
    * @param [in] propertyValue The new value of the property.
    */
-  virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue ) = 0;
+  virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue );
 
   /**
    * Retrieve a default property value.
    * @param [in] index The index of the property.
    * @return The property value.
    */
-  virtual Property::Value GetDefaultProperty( Property::Index index ) const = 0;
+  virtual Property::Value GetDefaultProperty( Property::Index index ) const;
 
   /**
    * Retrieve the latest scene-graph value of a default property.
    * @param[in] index The index of the property.
    * @return The latest scene-graph value of a default property.
    */
-  virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const = 0;
+  virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
 
   /**
    * Notifies that a default property is being animated so the deriving class should update the cached value.
@@ -516,34 +479,12 @@ private: // Default property extensions for derived classes
   virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type propertyChangeType )
   { }
 
-  /**
-   * @todo this is virtual so that for now actor can override it,
-   * it needs to be removed and only have GetSceneObject but that requires changing actor and constraint logic
-   * Retrieve the scene-graph object added by this object.
-   * @return A pointer to the object, or NULL if no object has been added to the scene-graph.
-   */
-  virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const
-  {
-    return GetSceneObject();
-  }
-
-  /**
-   * Notify derived class of installation of a new scene-object property.
-   * This method is called after the message is to sent to install the property
-   * @param [in] newProperty A newly allocated scene-object property. Ownership is obviously not passed.
-   * @param [in] name The name allocated to this custom property.
-   * @param [in] index The index allocated to this custom property.
-   */
-  virtual void NotifyScenePropertyInstalled( const SceneGraph::PropertyBase& newProperty, const std::string& name, unsigned int index ) const
-  { }
-
 private:
 
-  // Not implemented
-  Object(const Object& rhs);
-
-  // Not implemented
-  Object& operator=(const Object& rhs);
+  // no default, copy or assignment
+  Object() = delete;
+  Object(const Object& rhs) = delete;
+  Object& operator=(const Object& rhs) = delete;
 
   /**
    * Enable property notifications in scene graph
@@ -560,7 +501,7 @@ private:
    * @param[in] entry An entry from the property lookup container.
    * @return The latest value of the property.
    */
-  Property::Value GetCurrentPropertyValue( const PropertyMetadata* entry ) const;
+  Property::Value GetCurrentPropertyValue( const PropertyMetadata& entry ) const;
 
   /**
    * Set the value of scene graph property.
@@ -598,25 +539,31 @@ protected:
   }
 
 private:
+
   EventThreadServices& mEventThreadServices;
 
-private:
+protected:
 
-  typedef OwnerContainer<PropertyMetadata*> PropertyMetadataLookup;
-  mutable PropertyMetadataLookup mCustomProperties; ///< Used for accessing custom Node properties
-  mutable PropertyMetadataLookup mAnimatableProperties; ///< Used for accessing animatable Node properties
-  mutable TypeInfo const *  mTypeInfo; ///< The type-info for this object, mutable so it can be lazy initialized from const method if it is required
+  // mutable because it's lazy initialised and GetSceneObject has to be const so it can be called from const methods
+  // const to prevent accidentally calling setters directly from event thread
+  // protected to allow fast access from derived classes that have their own scene object (no function call overhead)
+  mutable const SceneGraph::PropertyOwner* mUpdateObject; ///< Reference to object to hold the scene graph properties
+
+private:
 
   Dali::Vector<Observer*> mObservers;
+  mutable OwnerContainer<PropertyMetadata*> mCustomProperties; ///< Used for accessing custom Node properties
+  mutable OwnerContainer<PropertyMetadata*> mAnimatableProperties; ///< Used for accessing animatable Node properties
+  mutable const TypeInfo* mTypeInfo; ///< The type-info for this object, mutable so it can be lazy initialized from const method if it is required
 
   ConstraintContainer* mConstraints;               ///< Container of owned -constraints.
 
-  typedef std::vector< Dali::PropertyNotification >     PropertyNotificationContainer;
-  typedef PropertyNotificationContainer::iterator       PropertyNotificationContainerIter;
-  typedef PropertyNotificationContainer::const_iterator PropertyNotificationContainerConstIter;
+  using PropertyNotificationContainer = std::vector< Dali::PropertyNotification >;
   PropertyNotificationContainer* mPropertyNotifications; ///< Container of owned property notifications.
   DevelHandle::PropertySetSignalType mPropertySetSignal;
+
 };
+
 } // namespace Internal
 
 // Helpers for public-api forwarding methods
index b7b3d23..ffdd632 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -133,7 +133,7 @@ bool ProjectFull( const Vector4& position,
 
   if( !EqualsZero( p.w ) )
   {
-    float div = 1.0 / p.w;
+    float div = 1.0f / p.w;
 
     windowPos = Vector4( (1 + p.x * div) * viewportWidth  / 2 + viewportX,
                          (1 - p.y * div) * viewportHeight / 2 + viewportY,
index 1417b72..18421af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/rendering/property-buffer.h>
-#include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/update/manager/update-manager.h>
 
 
@@ -51,9 +50,9 @@ struct PropertyImplementationTypeAlignment
   enum { VALUE = offsetof( TestStructure, data ) };
 };
 
-unsigned int GetPropertyImplementationAlignment( Property::Type& propertyType )
+uint32_t GetPropertyImplementationAlignment( Property::Type& propertyType )
 {
-  unsigned int alignment = 0u;
+  uint32_t alignment = 0u;
 
   switch( propertyType )
   {
@@ -132,27 +131,27 @@ PropertyBufferPtr PropertyBuffer::New( Dali::Property::Map& format )
   return propertyBuffer;
 }
 
-void PropertyBuffer::SetData( const void* data, std::size_t size )
+void PropertyBuffer::SetData( const void* data, uint32_t size )
 {
   mSize = size; // size is the number of elements
 
-  unsigned int bufferSize = mBufferFormatSize * mSize;
+  uint32_t bufferSize = mBufferFormatSize * mSize;
 
   // create a new DALi vector to store the buffer data
   // the heap allocated vector will end up being owned by SceneGraph::PropertyBuffer
-  OwnerPointer< Vector<char> > bufferCopy = new Dali::Vector<char>();
+  OwnerPointer< Vector<uint8_t> > bufferCopy = new Dali::Vector<uint8_t>();
   bufferCopy->Resize( bufferSize );
 
   // copy the data
-  const char* source = static_cast<const char*>( data );
-  char *destination = &((*bufferCopy)[0]);
+  const uint8_t* source = static_cast<const uint8_t*>( data );
+  uint8_t* destination = &((*bufferCopy)[0]);
   std::copy( source, source + bufferSize, destination );
 
   // Ownership of the bufferCopy is passed to the message ( uses an owner pointer )
   SceneGraph::SetPropertyBufferDataMessage( mEventThreadServices, *mRenderObject, bufferCopy, mSize );
 }
 
-std::size_t PropertyBuffer::GetSize() const
+uint32_t PropertyBuffer::GetSize() const
 {
   return mSize;
 }
@@ -171,7 +170,7 @@ PropertyBuffer::~PropertyBuffer()
 }
 
 PropertyBuffer::PropertyBuffer()
-: mEventThreadServices( *Stage::GetCurrent() ),
+: mEventThreadServices( EventThreadServices::Get() ),
   mRenderObject( NULL ),
   mBufferFormatSize( 0 ),
   mSize( 0 )
@@ -184,16 +183,16 @@ void PropertyBuffer::Initialize( Dali::Property::Map& formatMap )
   OwnerPointer< SceneGraph::PropertyBuffer > transferOwnership( mRenderObject );
   SceneGraph::AddPropertyBuffer( mEventThreadServices.GetUpdateManager(), transferOwnership );
 
-  size_t numComponents = formatMap.Count();
+  uint32_t numComponents = static_cast<uint32_t>( formatMap.Count() );
 
   // Create the format
   OwnerPointer< SceneGraph::PropertyBuffer::Format> format = new SceneGraph::PropertyBuffer::Format();
   format->components.resize( numComponents );
 
-  unsigned int currentAlignment = 0u;
-  unsigned int maxAlignmentRequired = 0u;
+  uint32_t currentAlignment = 0u;
+  uint32_t maxAlignmentRequired = 0u;
 
-  for( size_t i = 0u; i < numComponents; ++i )
+  for( uint32_t i = 0u; i < numComponents; ++i )
   {
     KeyValuePair component = formatMap.GetKeyValue( i );
 
@@ -215,11 +214,11 @@ void PropertyBuffer::Initialize( Dali::Property::Map& formatMap )
     {
       DALI_ABORT( "Property::Type not supported in PropertyBuffer" );
     }
-    unsigned int elementSize = GetPropertyImplementationSize( type );
-    unsigned int elementAlignment = GetPropertyImplementationAlignment( type );
+    uint32_t elementSize = GetPropertyImplementationSize( type );
+    uint32_t elementAlignment = GetPropertyImplementationAlignment( type );
 
     // check if current alignment is compatible with new member
-    if( unsigned int offset = currentAlignment % elementAlignment )
+    if( uint32_t offset = currentAlignment % elementAlignment )
     {
       // Not compatible, realign
       currentAlignment = currentAlignment + elementSize - offset;
@@ -244,7 +243,7 @@ void PropertyBuffer::Initialize( Dali::Property::Map& formatMap )
   // Check the alignment for the maxAlignment required to calculate the size of the format
   if( maxAlignmentRequired != 0 )
   {
-    if( unsigned int offset = currentAlignment % maxAlignmentRequired )
+    if( uint32_t offset = currentAlignment % maxAlignmentRequired )
     {
       // Not compatible, realign
       currentAlignment = currentAlignment + maxAlignmentRequired - offset;
@@ -260,9 +259,9 @@ void PropertyBuffer::Initialize( Dali::Property::Map& formatMap )
   SceneGraph::SetPropertyBufferFormatMessage( mEventThreadServices, *mRenderObject, format );
 }
 
-unsigned int GetPropertyImplementationSize( Property::Type& propertyType )
+uint32_t GetPropertyImplementationSize( Property::Type& propertyType )
 {
-  unsigned int size = 0u;
+  uint32_t size = 0u;
 
   switch( propertyType )
   {
index 6bcf199..8fdb910 100644 (file)
@@ -51,12 +51,12 @@ public:
   /**
    * @copydoc PropertBuffer::SetData()
    */
-  void SetData( const void* data, std::size_t size );
+  void SetData( const void* data, uint32_t size );
 
   /**
    * @copydoc PropertBuffer::GetSize()
    */
-  std::size_t GetSize() const;
+  uint32_t GetSize() const;
 
 public: // Default property extensions from Object
 
@@ -91,8 +91,8 @@ private: // unimplemented methods
 private: // data
   EventThreadServices& mEventThreadServices;    ///<Used to send messages to the render thread via update thread
   SceneGraph::PropertyBuffer* mRenderObject;        ///<Render side object
-  unsigned int mBufferFormatSize;
-  unsigned int mSize; ///< Number of elements in the buffer
+  uint32_t mBufferFormatSize;
+  uint32_t mSize; ///< Number of elements in the buffer
 };
 
 /**
@@ -113,7 +113,7 @@ template<> struct PropertyImplementationType< Property::MATRIX > { typedef Matri
 template<> struct PropertyImplementationType< Property::RECTANGLE > { typedef Rect<int> Type; };
 template<> struct PropertyImplementationType< Property::ROTATION > { typedef Quaternion Type; };
 
-unsigned int GetPropertyImplementationSize( Property::Type& propertyType );
+uint32_t GetPropertyImplementationSize( Property::Type& propertyType );
 
 } // namespace Internal
 
index 4a39ab4..21d9110 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ namespace Dali
 namespace Internal
 {
 
-bool CompareTokens( const char * first, const char * second, size_t& size )
+bool CompareTokens( const char * first, const char * second, uint32_t& size )
 {
   size = 0;
   while( ( *first != '\0' ) && ( *second != '\0' ) && ( *first != ',') && ( *second != ',') )
@@ -43,12 +43,12 @@ bool CompareTokens( const char * first, const char * second, size_t& size )
 
     if( ( 'A' <= ca ) && ( ca <= 'Z') )
     {
-      ca = ca + ( 'a' - 'A' );
+      ca = static_cast<char>( ca + ( 'a' - 'A' ) ); // don't expect overflow
     }
 
     if( ( 'A' <= cb ) && ( cb <= 'Z') )
     {
-      cb = cb + ( 'a' - 'A' );
+      cb = static_cast<char>( cb + ( 'a' - 'A' ) ); // don't expect overflow
     }
 
     if( ca != cb )
index e66a524..74484ba 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_PROPERTY_HELPER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint>
+
 // INTERNAL INCLUDES
 #include <dali/integration-api/bitmap.h>
 #include <dali/devel-api/scripting/enum-helper.h>
+#include <dali/internal/event/object/default-property-metadata.h>
 
 namespace Dali
 {
@@ -29,28 +33,14 @@ namespace Internal
 {
 
 /**
- * @brief Structure for setting up default properties and their details.
- */
-struct PropertyDetails
-{
-  const char* name;             ///< The name of the property.
-  Property::Type type;          ///< The property type.
-  bool writable:1;              ///< Whether the property is writable
-  bool animatable:1;            ///< Whether the property is animatable.
-  bool constraintInput:1;       ///< Whether the property can be used as an input to a constraint.
-#ifdef DEBUG_ENABLED
-  Property::Index enumIndex;    ///< Used to check the index is correct within a debug build.
-#endif
-};
-
-/**
- * These macros are used to define a table of property details per Actor object.
+ * These macros are used to define a table of property details per object.
  * The index property is only compiled in for DEBUG_ENABLED builds and allows checking the table index VS the property enum index.
  * DALI_PROPERTY_TABLE_END Forces a run-time check that will happen once.
+ * the macros define an instance of PropertyMetadata with the name that is passed to DALI_PROPERTY_TABLE_END
  */
-#define DALI_PROPERTY_TABLE_BEGIN const Internal::PropertyDetails DEFAULT_PROPERTY_DETAILS[] = {
+#define DALI_PROPERTY_TABLE_BEGIN const Dali::PropertyDetails DEFAULT_PROPERTY_DETAILS[] = {
 #ifdef DEBUG_ENABLED
-#define DALI_PROPERTY_TABLE_END( startIndex )   }; const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( Internal::PropertyDetails ); \
+#define DALI_PROPERTY_TABLE_END( startIndex, constantName )   }; const Property::Index DEFAULT_PROPERTY_COUNT = static_cast<Property::Index>( sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( Dali::PropertyDetails ) ); \
   struct PROPERTY_CHECK \
   { \
     PROPERTY_CHECK() \
@@ -66,15 +56,13 @@ struct PropertyDetails
       } \
     } \
   }; \
+  constexpr Dali::DefaultPropertyMetadata constantName{ DEFAULT_PROPERTY_DETAILS, DEFAULT_PROPERTY_COUNT }; \
   static PROPERTY_CHECK PROPERTY_CHECK_INSTANCE;
 #else
-#define DALI_PROPERTY_TABLE_END( startIndex )   }; const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( Internal::PropertyDetails );
-#endif
-#ifdef DEBUG_ENABLED
-#define DALI_PROPERTY( text, type, writable, animatable, constraint, index ) { text, Dali::Property::type, writable, animatable, constraint, index },
-#else
-#define DALI_PROPERTY( text, type, writable, animatable, constraint, index ) { text, Dali::Property::type, writable, animatable, constraint },
+#define DALI_PROPERTY_TABLE_END( startIndex, constantName )   }; const Property::Index DEFAULT_PROPERTY_COUNT = static_cast<Property::Index>( sizeof( DEFAULT_PROPERTY_DETAILS ) / sizeof( Dali::PropertyDetails ) );\
+  constexpr Dali::DefaultPropertyMetadata constantName{ DEFAULT_PROPERTY_DETAILS, DEFAULT_PROPERTY_COUNT };
 #endif
+#define DALI_PROPERTY( text, type, writable, animatable, constraint, index ) { text, index, Dali::Property::type, writable, animatable, constraint },
 
 /**
  * @brief Case insensitive string comparison.
@@ -88,7 +76,7 @@ struct PropertyDetails
  *
  * @return true if strings are the same
  */
-bool CompareTokens( const char * first, const char * second, size_t& size );
+bool CompareTokens( const char * first, const char * second, uint32_t& size );
 
 
 /**
index 2305245..3647a10 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@ void PropertyMetadata::SetPropertyValue( const Property::Value& propertyValue )
 
     case Property::RECTANGLE:
     {
-      Rect<int> convertedValue;
+      Rect<int32_t> convertedValue;
       if( propertyValue.Get( convertedValue ) )
       {
         value = convertedValue;
@@ -126,7 +126,7 @@ void PropertyMetadata::SetPropertyValue( const Property::Value& propertyValue )
 
     case Property::INTEGER:
     {
-      int convertedValue;
+      int32_t convertedValue;
       if( propertyValue.Get( convertedValue ) )
       {
         value = convertedValue;
index b845eaa..3a158ab 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_PROPERTY_METADATA_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -148,7 +148,7 @@ protected:
    * @param[in] baseValueRef            A reference to the metadata of the base animatable property
    * @param[in] propertyComponentIndex  The component index of the property
    */
-  PropertyMetadata( const SceneGraph::PropertyBase* sceneGraphProperty, bool writable, Property::Value& baseValueRef, int propertyComponentIndex )
+  PropertyMetadata( const SceneGraph::PropertyBase* sceneGraphProperty, bool writable, Property::Value& baseValueRef, int32_t propertyComponentIndex )
   : value( baseValueRef ),
     componentIndex( propertyComponentIndex ),
     mStoredValue(),
@@ -168,20 +168,20 @@ public: // Data
   /**
    * @brief The value of this property used to read/write by the event thread.
    *
-   * If a component index, then refers to the value in the PropertyMetatdata of the base property
+   * If this PropertyMetadata is for property component, then refers to the value in the PropertyMetadata of the base property
    * to ensure the components are kept in sync with the overall value on the event thread.
-   * Otherwise, this just refers to the storedValue.
+   * Otherwise, this refers to mStoredValue.
    */
   Property::Value& value;
 
   /**
    * @brief The index of the property component.
    */
-  int componentIndex;
+  int32_t componentIndex;
 
 private:
 
-  Property::Value mStoredValue;                         ///< The stored property value used to read/write by the event thread
+  Property::Value mStoredValue;                         ///< The cached property value used to read/write by the event thread
   const SceneGraph::PropertyBase* mSceneGraphProperty;  ///< A pointer to a scene-graph property; should not be modified from actor-thread
   bool mWritable:1;                                     ///< Whether the property is writable
 };
index f119eda..586051a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,21 +46,13 @@ PropertyNotificationPtr PropertyNotification::New(Property& target,
 
   UpdateManager& updateManager = tls.GetUpdateManager();
 
-  StagePtr stage = Stage::GetCurrent();
-  if( stage )
-  {
-    PropertyNotificationManager& propertyNotificationManager = stage->GetPropertyNotificationManager();
-    PropertyNotificationPtr propertyNotification = new PropertyNotification(updateManager,
-                                                                            propertyNotificationManager,
-                                                                            target,
-                                                                            componentIndex,
-                                                                            condition);
-    return propertyNotification;
-  }
-  else
-  {
-    return NULL;
-  }
+  PropertyNotificationManager& propertyNotificationManager = tls.GetPropertyNotificationManager();
+  PropertyNotificationPtr propertyNotification = new PropertyNotification(updateManager,
+                                                                          propertyNotificationManager,
+                                                                          target,
+                                                                          componentIndex,
+                                                                          condition);
+  return propertyNotification;
 }
 
 PropertyNotification::PropertyNotification( UpdateManager& updateManager,
@@ -109,13 +101,8 @@ PropertyNotification::PropertyNotification( UpdateManager& updateManager,
       }
     }
 
-    // Check if target scene-object already present, and if so create our notification
-    // scene-object
-    const SceneGraph::PropertyOwner* object = mObject->GetSceneObject();
-    if (object)
-    {
-      CreateSceneObject();
-    }
+    // all objects always have scene object
+    CreateSceneObject();
   }
 
   // Connect to the property notification manager
diff --git a/dali/internal/event/common/scene-impl.cpp b/dali/internal/event/common/scene-impl.cpp
new file mode 100644 (file)
index 0000000..6593613
--- /dev/null
@@ -0,0 +1,330 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/event/common/scene-impl.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/event/actors/layer-impl.h>
+#include <dali/internal/event/actors/layer-list.h>
+#include <dali/internal/event/actors/camera-actor-impl.h>
+#include <dali/internal/event/common/thread-local-storage.h>
+#include <dali/internal/event/render-tasks/render-task-list-impl.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
+#include <dali/internal/event/common/object-registry-impl.h>
+#include <dali/internal/update/nodes/node.h>
+#include <dali/internal/update/manager/update-manager.h>
+#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/internal/event/rendering/frame-buffer-impl.h>
+#include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
+
+using Dali::Internal::SceneGraph::Node;
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace
+{
+
+const Vector4 DEFAULT_BACKGROUND_COLOR(0.0f, 0.0f, 0.0f, 1.0f); // Default background color
+
+} //Unnamed namespace
+
+ScenePtr Scene::New( const Size& size )
+{
+  ScenePtr scene = new Scene( size );
+
+  // Second-phase construction
+  scene->Initialize();
+
+  return scene;
+}
+
+Scene::Scene( const Size& size )
+: mSurface( nullptr ),
+  mSize( size ),
+  mSurfaceSize( Vector2::ZERO ),
+  mDpi( Vector2::ZERO ),
+  mDepthTreeDirty( false ),
+  mEventProcessor( *this, ThreadLocalStorage::GetInternal()->GetGestureEventProcessor() )
+{
+}
+
+Scene::~Scene()
+{
+  if( mDefaultCamera )
+  {
+    // its enough to release the handle so the object is released
+    // don't need to remove it from root actor as root actor will delete the object
+    mDefaultCamera.Reset();
+  }
+
+  if( mRootLayer )
+  {
+    // we are closing down so just delete the root, no point emit disconnect
+    // signals or send messages to update
+    mRootLayer.Reset();
+  }
+
+  if( mRenderTaskList )
+  {
+    mRenderTaskList.Reset();
+  }
+
+  if( ThreadLocalStorage::Created() )
+  {
+    ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
+    tls->RemoveScene( this );
+  }
+}
+
+void Scene::Initialize()
+{
+  ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
+
+  DALI_ASSERT_ALWAYS( tls && "Attempt to create scene before core exists!" );
+
+  tls->AddScene( this );
+
+  SceneGraph::UpdateManager& updateManager = tls->GetUpdateManager();
+
+  // Create the ordered list of layers
+  mLayerList = LayerList::New( updateManager );
+
+  // The scene owns the default layer
+  mRootLayer = Layer::NewRoot( *mLayerList, updateManager );
+  mRootLayer->SetName("RootLayer");
+  mRootLayer->SetScene( *this );
+
+  // The root layer needs to have a fixed resize policy (as opposed to the default USE_NATURAL_SIZE).
+  // This stops actors parented to the stage having their relayout requests propagating
+  // up to the root layer, and down through other children unnecessarily.
+  mRootLayer->SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
+
+  // Create the default camera actor first; this is needed by the RenderTaskList
+  // The default camera attributes and position is such that children of the default layer,
+  // can be positioned at (0,0) and be at the top-left of the viewport.
+  mDefaultCamera = CameraActor::New( mSize );
+  mDefaultCamera->SetParentOrigin(ParentOrigin::CENTER);
+  Add(*(mDefaultCamera.Get()));
+
+  // Create the list of render-tasks
+  mRenderTaskList = RenderTaskList::New();
+
+  // Create the default render-task
+  mRenderTaskList->CreateTask( mRootLayer.Get(), mDefaultCamera.Get() );
+}
+
+void Scene::Add(Actor& actor)
+{
+  mRootLayer->Add( actor );
+}
+
+void Scene::Remove(Actor& actor)
+{
+  mRootLayer->Remove( actor );
+}
+
+Size Scene::GetSize() const
+{
+  return mSize;
+}
+
+void Scene::SetDpi(Vector2 dpi)
+{
+  mDpi = dpi;
+}
+
+Vector2 Scene::GetDpi() const
+{
+  return mDpi;
+}
+
+RenderTaskList& Scene::GetRenderTaskList() const
+{
+  return *mRenderTaskList;
+}
+
+Dali::Layer Scene::GetRootLayer() const
+{
+  return Dali::Layer( mRootLayer.Get() );
+}
+
+LayerList& Scene::GetLayerList() const
+{
+  return *mLayerList;
+}
+
+uint32_t Scene::GetLayerCount() const
+{
+  return mLayerList->GetLayerCount();
+}
+
+Dali::Layer Scene::GetLayer( uint32_t depth ) const
+{
+  return Dali::Layer(mLayerList->GetLayer( depth ));
+}
+
+CameraActor& Scene::GetDefaultCameraActor()
+{
+  return *mDefaultCamera;
+}
+
+Actor& Scene::GetDefaultRootActor()
+{
+  return *mRootLayer;
+}
+
+void Scene::SetSurface( Integration::RenderSurface& surface )
+{
+  mSurface = &surface;
+  if ( mSurface )
+  {
+    mSurfaceSize.width = static_cast<float>( mSurface->GetPositionSize().width );
+    mSurfaceSize.height = static_cast<float>( mSurface->GetPositionSize().height );
+
+    mSize.width = mSurfaceSize.width;
+    mSize.height = mSurfaceSize.height;
+
+    // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
+    mDefaultCamera->SetPerspectiveProjection( mSurfaceSize );
+
+    mRootLayer->SetSize( mSize.width, mSize.height );
+
+    ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
+    SceneGraph::UpdateManager& updateManager = tls->GetUpdateManager();
+    SetDefaultSurfaceRectMessage( updateManager, Rect<int32_t>( 0, 0, static_cast<int32_t>( mSurfaceSize.width ), static_cast<int32_t>( mSurfaceSize.height ) ) ); // truncated
+
+    RenderTaskPtr defaultRenderTask = mRenderTaskList->GetTask( 0u );
+
+    // if single render task to screen then set its viewport parameters
+    if( 1 == mRenderTaskList->GetTaskCount() )
+    {
+      if( !defaultRenderTask->GetTargetFrameBuffer() )
+      {
+        defaultRenderTask->SetViewport( Viewport( 0, 0, static_cast<int32_t>( mSurfaceSize.width ), static_cast<int32_t>( mSurfaceSize.height ) ) ); // truncated
+      }
+    }
+
+    mFrameBuffer = nullptr;
+    //@todo prepare for multi window, maybe new enum Attachment::SWAPCHAIN or Attachment::SURFACE rather than NONE
+    //Dali::Internal::FrameBuffer::New( surface, Dali::FrameBuffer::Attachment::NONE );
+    defaultRenderTask->SetFrameBuffer( mFrameBuffer );
+  }
+}
+
+Integration::RenderSurface* Scene::GetSurface() const
+{
+  return mSurface;
+}
+
+void Scene::RequestRebuildDepthTree()
+{
+  mDepthTreeDirty = true;
+}
+
+void Scene::QueueEvent( const Integration::Event& event )
+{
+  mEventProcessor.QueueEvent( event );
+}
+
+void Scene::ProcessEvents()
+{
+  mEventProcessor.ProcessEvents();
+}
+
+void Scene::RebuildDepthTree()
+{
+  // If the depth tree needs rebuilding, do it in this frame only.
+  if( mDepthTreeDirty )
+  {
+    ActorPtr actor( mRootLayer.Get() );
+    actor->RebuildDepthTree();
+    mDepthTreeDirty = false;
+  }
+}
+
+void Scene::SetBackgroundColor(Vector4 color)
+{
+  if( mSurface )
+  {
+    mSurface->SetBackgroundColor( color );
+
+    //@todo: find better way of doing it
+    mRenderTaskList->GetTasks()[0]->SetClearEnabled( true );
+    mRenderTaskList->GetTasks()[0]->SetClearColor( color );
+  }
+}
+
+Vector4 Scene::GetBackgroundColor() const
+{
+  return mSurface ? mSurface->GetBackgroundColor() : DEFAULT_BACKGROUND_COLOR;
+}
+
+void Scene::EmitKeyEventSignal(const KeyEvent& event)
+{
+  mKeyEventSignal.Emit( event );
+}
+
+void Scene::EmitEventProcessingFinishedSignal()
+{
+  mEventProcessingFinishedSignal.Emit();
+}
+
+void Scene::EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchData& touch )
+{
+  mTouchedSignal.Emit( touchEvent );
+  mTouchSignal.Emit( touch );
+}
+
+void Scene::EmitWheelEventSignal(const WheelEvent& event)
+{
+  mWheelEventSignal.Emit( event );
+}
+
+Integration::Scene::KeyEventSignalType& Scene::KeyEventSignal()
+{
+  return mKeyEventSignal;
+}
+
+Integration::Scene::EventProcessingFinishedSignalType& Scene::EventProcessingFinishedSignal()
+{
+  return mEventProcessingFinishedSignal;
+}
+
+Scene::TouchedSignalType& Scene::TouchedSignal()
+{
+  return mTouchedSignal;
+}
+
+Integration::Scene::TouchSignalType& Scene::TouchSignal()
+{
+  return mTouchSignal;
+}
+
+Integration::Scene::WheelEventSignalType& Scene::WheelEventSignal()
+{
+  return mWheelEventSignal;
+}
+
+} // Internal
+
+} // Dali
diff --git a/dali/internal/event/common/scene-impl.h b/dali/internal/event/common/scene-impl.h
new file mode 100644 (file)
index 0000000..634bcbd
--- /dev/null
@@ -0,0 +1,313 @@
+#ifndef DALI_INTERNAL_SCENE_H
+#define DALI_INTERNAL_SCENE_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/scene.h>
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/integration-api/render-surface.h>
+#include <dali/internal/common/owner-pointer.h>
+#include <dali/internal/event/actors/layer-impl.h>
+#include <dali/internal/event/events/event-processor.h>
+#include <dali/internal/event/render-tasks/render-task-defaults.h>
+
+namespace Dali
+{
+
+namespace Integration
+{
+
+class Event;
+
+}
+
+namespace Internal
+{
+
+class EventProcessor;
+class Layer;
+class LayerList;
+class CameraActor;
+class RenderTaskList;
+class FrameBuffer;
+
+using FrameBufferPtr = IntrusivePtr<FrameBuffer>;
+using ScenePtr = IntrusivePtr<Scene>;
+
+/**
+ * @brief Scene creates a "world" that can be bound to a surface for rendering.
+ */
+class Scene : public BaseObject, public RenderTaskDefaults
+{
+
+public:
+  /**
+   * @copydoc Dali::Integration::Scene::New
+   */
+  static ScenePtr New( const Size& size );
+
+  /**
+   * virtual destructor
+   */
+  virtual ~Scene();
+
+  /**
+   * @copydoc Dali::Integration::Scene::Add
+   */
+  void Add(Actor& actor);
+
+  /**
+   * @copydoc Dali::Integration::Scene::Remove
+   */
+  void Remove(Actor& actor);
+
+  /**
+   * @copydoc Dali::Integration::Scene::GetSize
+   */
+  Size GetSize() const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::SetDpi
+   */
+  void SetDpi( Vector2 dpi );
+
+  /**
+   * @copydoc Dali::Integration::Scene::GetDpi
+   */
+  Vector2 GetDpi() const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::GetRenderTaskList
+   */
+  RenderTaskList& GetRenderTaskList() const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::GetRootLayer
+   */
+  Dali::Layer GetRootLayer() const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::GetLayerCount
+   */
+  uint32_t GetLayerCount() const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::GetLayer
+   */
+  Dali::Layer GetLayer(uint32_t depth) const;
+
+  /**
+   * @copydoc Dali::Integration::Scene::SetSurface
+   */
+  void SetSurface( Integration::RenderSurface& surface );
+
+  /**
+   * Retrieve the render surface the scene is binded to.
+   * @return The render surface.
+   */
+  Integration::RenderSurface* GetSurface() const;
+
+  /**
+   * Retrieve the ordered list of on-scene layers.
+   * @return The layer-list.
+   */
+  LayerList& GetLayerList() const;
+
+  /**
+   * Request that the depth tree is rebuilt
+   */
+  void RequestRebuildDepthTree();
+
+  /**
+   * This function is called when an event is queued.
+   * @param[in] event A event to queue.
+   */
+  void QueueEvent( const Integration::Event& event );
+
+  /**
+   * This function is called by Core when events are processed.
+   */
+  void ProcessEvents();
+
+  /**
+   * Rebuilds the depth tree at the end of the event frame if
+   * it was requested this frame.
+   */
+  void RebuildDepthTree();
+
+  /**
+   * @brief Sets the background color of the render surface.
+   * @param[in] color The new background color
+   */
+  void SetBackgroundColor(Vector4 color);
+
+  /**
+   * @brief Gets the background color of the render surface.
+   * @return The background color
+   */
+  Vector4 GetBackgroundColor() const;
+
+  /**
+   * Used by the EventProcessor to emit key event signals.
+   * @param[in] event The key event.
+   */
+  void EmitKeyEventSignal(const KeyEvent& event);
+
+  /**
+   * Emits the event processing finished signal.
+   *
+   * @see Dali::Scene::SignalEventProcessingFinished()
+   */
+  void EmitEventProcessingFinishedSignal();
+
+  /**
+   * Emits the touched signal.
+   * @param[in] touchEvent The touch event details (Old API).
+   * @param[in] touch The touch event details.
+   */
+  void EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchData& touch );
+
+  /**
+   * Used by the EventProcessor to emit wheel event signals.
+   * @param[in] event The wheel event.
+   */
+  void EmitWheelEventSignal( const WheelEvent& event );
+
+  /**
+   * @copydoc Integration::Scene::KeyEventSignal()
+   */
+  Integration::Scene::KeyEventSignalType& KeyEventSignal();
+
+  /**
+   * @copydoc Integration::Scene::SignalEventProcessingFinished()
+   */
+  Integration::Scene::EventProcessingFinishedSignalType& EventProcessingFinishedSignal();
+
+  // The touched signal, to support Stage touched signal, will be removed when deprecated in public Stage API
+  using TouchedSignalType = Signal< void (const TouchEvent&) >;
+
+  /**
+   * Touched signal to support deprecated stage touched signal.
+   */
+  TouchedSignalType& TouchedSignal();
+
+  /**
+    * @copydoc Integration::Scene::TouchSignal()
+    */
+  Integration::Scene::TouchSignalType& TouchSignal();
+
+  /**
+   * @copydoc Integration::Scene::sWheelEventSignal()
+   */
+  Integration::Scene::WheelEventSignalType& WheelEventSignal();
+
+public:
+
+  /**
+   * From RenderTaskDefaults; retrieve the default root actor.
+   * @return The default root actor.
+   */
+  virtual Actor& GetDefaultRootActor();
+
+  /**
+   * From RenderTaskDefaults; retrieve the default camera actor.
+   * @return The default camera actor.
+   */
+  virtual CameraActor& GetDefaultCameraActor();
+
+private:
+
+  // Constructor
+  Scene( const Size& size );
+
+  /**
+   * Second-phase constructor.
+   */
+  void Initialize();
+
+  // Undefined
+  Scene(const Scene&) = delete;
+
+  // Undefined
+  Scene& operator=(const Scene& rhs) = delete;
+
+private:
+  Integration::RenderSurface* mSurface;
+
+  // The scene-size may be different with the surface-size
+  Size mSize;
+  Size mSurfaceSize;
+
+  Vector2 mDpi;
+
+  LayerPtr mRootLayer;
+
+  // Ordered list of currently on-stage layers
+  OwnerPointer<LayerList> mLayerList;
+
+  IntrusivePtr<CameraActor> mDefaultCamera;
+
+  // The list of render-tasks
+  IntrusivePtr<RenderTaskList> mRenderTaskList;
+
+  // The frame buffer
+  FrameBufferPtr mFrameBuffer;
+
+  bool mDepthTreeDirty:1;  ///< True if the depth tree needs recalculating
+
+  EventProcessor mEventProcessor;
+
+  // The key event signal
+  Integration::Scene::KeyEventSignalType mKeyEventSignal;
+
+  // The event processing finished signal
+  Integration::Scene::EventProcessingFinishedSignalType mEventProcessingFinishedSignal;
+
+  // The touch signal
+  Integration::Scene::TouchSignalType mTouchSignal;
+
+  // The touched signal
+  TouchedSignalType mTouchedSignal;
+
+  // The wheel event signal
+  Integration::Scene::WheelEventSignalType mWheelEventSignal;
+};
+
+} // Internal
+
+// Get impl of handle
+inline Internal::Scene& GetImplementation(Dali::Integration::Scene& scene)
+{
+  DALI_ASSERT_ALWAYS( scene && "Scene handle is empty" );
+  Dali::RefObject& object = scene.GetBaseObject();
+  return static_cast<Internal::Scene&>(object);
+}
+
+inline const Internal::Scene& GetImplementation(const Dali::Integration::Scene& scene)
+{
+  DALI_ASSERT_ALWAYS( scene && "Scene handle is empty" );
+  const Dali::RefObject& object = scene.GetBaseObject();
+  return static_cast<const Internal::Scene&>(object);
+}
+
+} // Dali
+
+#endif // DALI_INTERNAL_SCENE_H
index 00d2864..1d56cc8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
-#include <dali/integration-api/system-overlay.h>
 #include <dali/internal/event/actors/layer-impl.h>
 #include <dali/internal/event/actors/layer-list.h>
 #include <dali/internal/event/actors/camera-actor-impl.h>
-#include <dali/internal/event/common/system-overlay-impl.h>
 #include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/internal/event/common/property-notification-manager.h>
 #include <dali/internal/event/render-tasks/render-task-list-impl.h>
+#include <dali/internal/event/update/frame-callback-interface-impl.h>
 #include <dali/internal/update/nodes/node.h>
+#include <dali/internal/update/manager/scene-graph-frame-callback.h>
 #include <dali/internal/event/common/object-registry-impl.h>
 #include <dali/integration-api/platform-abstraction.h>
 #include <dali/public-api/common/constants.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/events/touch-data.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
@@ -59,8 +60,6 @@ namespace Internal
 namespace
 {
 
-const float DEFAULT_STEREO_BASE( 65.0f );
-
 // Signals
 
 const char* const SIGNAL_KEY_EVENT =                 "keyEvent";
@@ -87,60 +86,20 @@ SignalConnectorType signalConnector9( mType, SIGNAL_TOUCH,                     &
 
 } // unnamed namespace
 
-StagePtr Stage::New( AnimationPlaylist& playlist,
-                     PropertyNotificationManager& propertyNotificationManager,
-                     SceneGraph::UpdateManager& updateManager,
-                     NotificationManager& notificationManager,
-                     Integration::RenderController& renderController )
+StagePtr Stage::New( SceneGraph::UpdateManager& updateManager )
 {
-  return StagePtr( new Stage( playlist, propertyNotificationManager, updateManager, notificationManager, renderController ) );
-}
-
-void Stage::Initialize( bool renderToFbo )
-{
-  mRenderToFbo = renderToFbo;
-  mObjectRegistry = ObjectRegistry::New();
-
-  // Create the ordered list of layers
-  mLayerList = LayerList::New( mUpdateManager, false/*not system-level*/ );
-
-  // The stage owns the default layer
-  mRootLayer = Layer::NewRoot( *mLayerList, mUpdateManager, false/*not system-level*/ );
-  mRootLayer->SetName("RootLayer");
-  // The root layer needs to have a fixed resize policy (as opposed to the default USE_NATURAL_SIZE).
-  // This stops actors parented to the stage having their relayout requests propagating
-  // up to the root layer, and down through other children unnecessarily.
-  mRootLayer->SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-
-  // Create the default camera actor first; this is needed by the RenderTaskList
-  CreateDefaultCameraActor();
-
-  // Create the list of render-tasks
-  mRenderTaskList = RenderTaskList::New( *this, *this, false/*not system-level*/ );
-
-  // Create the default render-task
-  Dali::RenderTask defaultRenderTask = mRenderTaskList->CreateTask();
+  return StagePtr( new Stage( updateManager ) );
 }
 
-void Stage::Uninitialize()
+void Stage::Initialize( Scene& scene )
 {
-  // Remove actors added to SystemOverlay
-  delete mSystemOverlay;
-  mSystemOverlay = NULL;
-
-  if( mDefaultCamera )
-  {
-    // its enough to release the handle so the object is released
-    // don't need to remove it from root actor as root actor will delete the object
-    mDefaultCamera.Reset();
-  }
-
-  if( mRootLayer )
-  {
-    // we are closing down so just delete the root, no point emit disconnect
-    // signals or send messages to update
-    mRootLayer.Reset();
-  }
+  mScene = &scene;
+  mScene->SetBackgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR );
+  mScene->EventProcessingFinishedSignal().Connect( this, &Stage::OnEventProcessingFinished );
+  mScene->KeyEventSignal().Connect( this, &Stage::OnKeyEvent );
+  mScene->TouchedSignal().Connect( this, &Stage::OnTouchedEvent );
+  mScene->TouchSignal().Connect( this, &Stage::OnTouchEvent );
+  mScene->WheelEventSignal().Connect( this, &Stage::OnWheelEvent );
 }
 
 StagePtr Stage::GetCurrent()
@@ -162,385 +121,100 @@ bool Stage::IsInstalled()
 
 ObjectRegistry& Stage::GetObjectRegistry()
 {
-  return *mObjectRegistry;
-}
-
-void Stage::RegisterObject( Dali::BaseObject* object )
-{
-  mObjectRegistry->RegisterObject( object );
-}
-
-void Stage::UnregisterObject( Dali::BaseObject* object )
-{
-  mObjectRegistry->UnregisterObject( object );
+  return ThreadLocalStorage::Get().GetObjectRegistry();
 }
 
 Layer& Stage::GetRootActor()
 {
-  return *mRootLayer;
-}
-
-AnimationPlaylist& Stage::GetAnimationPlaylist()
-{
-  return mAnimationPlaylist;
-}
-
-PropertyNotificationManager& Stage::GetPropertyNotificationManager()
-{
-  return mPropertyNotificationManager;
+  Dali::Layer rootLayer = GetRootLayer();
+  return GetImplementation( rootLayer );
 }
 
 void Stage::Add( Actor& actor )
 {
-  mRootLayer->Add( actor );
+  mScene->Add( actor );
 }
 
 void Stage::Remove( Actor& actor )
 {
-  mRootLayer->Remove( actor );
-}
-
-void Stage::SurfaceResized( float width, float height )
-{
-  if( ( fabs( width - mSurfaceSize.width ) > Math::MACHINE_EPSILON_1000 ) || ( fabs( height - mSurfaceSize.height ) > Math::MACHINE_EPSILON_1000 ) )
-  {
-    mSurfaceSize.width = width;
-    mSurfaceSize.height = height;
-
-    // Internally we want to report the actual size of the stage.
-    mSize.width = width;
-    mSize.height = height - mTopMargin;
-
-    // Calculates the aspect ratio, near and far clipping planes, field of view and camera Z position.
-    mDefaultCamera->SetPerspectiveProjection( mSurfaceSize );
-
-    // Adjust the camera height to allow for top-margin
-    SetDefaultCameraPosition();
-
-    mRootLayer->SetSize( mSize.width, mSize.height );
-
-    // Repeat for SystemOverlay actors
-    if( mSystemOverlay )
-    {
-      // Note that the SystemOverlay has a separate camera, configured for the full surface-size.
-      // This will remain unaffected by changes in SetDefaultCameraPosition()
-      mSystemOverlay->GetImpl()->SetSize( width, height );
-    }
-
-    SetDefaultSurfaceRectMessage( mUpdateManager, Rect<int>( 0, 0, width, height ) );
-
-    // if single render task to screen then set its viewport parameters
-    if( 1 == mRenderTaskList->GetTaskCount() )
-    {
-      Dali::RenderTask defaultRenderTask = mRenderTaskList->GetTask( 0u );
-
-      if(!defaultRenderTask.GetTargetFrameBuffer())
-      {
-        defaultRenderTask.SetViewport( Viewport(0, 0, width, height) );
-      }
-    }
-
-    if( mRenderToFbo )
-    {
-      Dali::FrameBuffer frameBuffer = Dali::FrameBuffer::New( width, height, Dali::FrameBuffer::Attachment::NONE );
-      Dali::Texture texture = Dali::Texture::New( Dali::TextureType::TEXTURE_2D, Dali::Pixel::RGB888, width, height );
-      frameBuffer.AttachColorTexture( texture );
-
-      Dali::RenderTask defaultRenderTask = mRenderTaskList->GetTask( 0u );
-      defaultRenderTask.SetFrameBuffer( frameBuffer );
-    }
-  }
+  mScene->Remove( actor );
 }
 
 Vector2 Stage::GetSize() const
 {
-  return mSize;
-}
-
-void Stage::SetTopMargin( unsigned int margin )
-{
-  if (mTopMargin == margin)
-  {
-    return;
-  }
-  mTopMargin = margin;
-
-  mSize.width = mSurfaceSize.width;
-  mSize.height = mSurfaceSize.height - mTopMargin;
-
-  // Adjust the camera height to allow for top-margin
-  SetDefaultCameraPosition();
-
-  mRootLayer->SetSize( mSize.width, mSize.height );
+  return mScene->GetSize();
 }
 
 RenderTaskList& Stage::GetRenderTaskList() const
 {
-  return *mRenderTaskList;
-}
-
-void Stage::CreateDefaultCameraActor()
-{
-  // The default camera attributes and position is such that
-  // children of the default layer, can be positioned at (0,0) and
-  // be at the top-left of the viewport.
-  mDefaultCamera = CameraActor::New( Size::ZERO );
-  mDefaultCamera->SetParentOrigin(ParentOrigin::CENTER);
-  Add(*(mDefaultCamera.Get()));
-}
-
-void Stage::SetDefaultCameraPosition()
-{
-  mDefaultCamera->SetY( -(static_cast<float>(mTopMargin) * 0.5f) );
+  return mScene->GetRenderTaskList();
 }
 
 Actor& Stage::GetDefaultRootActor()
 {
-  return *mRootLayer;
+  return mScene->GetDefaultRootActor();
 }
 
 CameraActor& Stage::GetDefaultCameraActor()
 {
-  return *mDefaultCamera;
+  return mScene->GetDefaultCameraActor();
 }
 
-unsigned int Stage::GetLayerCount() const
+uint32_t Stage::GetLayerCount() const
 {
-  return mLayerList->GetLayerCount();
+  return mScene->GetLayerCount();
 }
 
-Dali::Layer Stage::GetLayer( unsigned int depth ) const
+Dali::Layer Stage::GetLayer( uint32_t depth ) const
 {
-  return Dali::Layer(mLayerList->GetLayer( depth ));
+  return mScene->GetLayer( depth );
 }
 
 Dali::Layer Stage::GetRootLayer() const
 {
-  return Dali::Layer( mRootLayer.Get() );
+  return mScene->GetRootLayer();
 }
 
 LayerList& Stage::GetLayerList()
 {
-  return *mLayerList;
+  return mScene->GetLayerList();
 }
 
-Integration::SystemOverlay& Stage::GetSystemOverlay()
+void Stage::SetBackgroundColor(Vector4 color)
 {
-  // Lazily create system-level if requested
-  if( !mSystemOverlay )
-  {
-    mSystemOverlay = new Integration::SystemOverlay( SystemOverlay::New( *this ) );
-    DALI_ASSERT_ALWAYS( NULL != mSystemOverlay && "Failed to create system overlay" );
-
-    mSystemOverlay->GetImpl()->SetSize( mSize.width, mSize.height );
-  }
-
-  return *mSystemOverlay;
+  mScene->SetBackgroundColor( color );
 }
 
-SystemOverlay* Stage::GetSystemOverlayInternal()
+Vector4 Stage::GetBackgroundColor() const
 {
-  SystemOverlay* overlay( NULL );
-
-  if( mSystemOverlay )
-  {
-    overlay = mSystemOverlay->GetImpl();
-  }
-
-  return overlay;
+  return mScene->GetBackgroundColor();
 }
 
-void Stage::SetViewMode( ViewMode viewMode )
+Vector2 Stage::GetDpi() const
 {
-  if( mViewMode != viewMode )
-  {
-    DALI_LOG_INFO( Debug::Filter::gActor, Debug::Concise, "View mode changed from %d to %d\n", mViewMode, viewMode);
-
-    if( mViewMode == MONO )
-    {
-      mDefaultCamera->SetOrientation( Dali::ANGLE_180, Vector3::YAXIS );
-      mRenderTaskList->GetTask(0).SetSourceActor( Dali::Actor() );
-
-      //Create camera and RenderTask for left eye
-      mLeftCamera = CameraActor::New( Size::ZERO );
-      mLeftCamera->SetParentOrigin( ParentOrigin::CENTER );
-      mDefaultCamera->Add( *mLeftCamera.Get() );
-      mLeftRenderTask = mRenderTaskList->CreateTask();
-      mLeftRenderTask.SetCameraActor( Dali::CameraActor( mLeftCamera.Get() ) );
-      mLeftCamera->SetType( Dali::Camera::FREE_LOOK );
-
-      //Create camera and RenderTask for right eye
-      mRightCamera = CameraActor::New( Size::ZERO );
-      mRightCamera->SetParentOrigin( ParentOrigin::CENTER );
-      mDefaultCamera->Add( *mRightCamera.Get() );
-      mRightRenderTask = mRenderTaskList->CreateTask();
-      mRightRenderTask.SetClearColor( Vector4( 1.0f,0.0f,0.0f,1.0f));
-
-      mRightRenderTask.SetCameraActor( Dali::CameraActor( mRightCamera.Get() ) );
-      mRightCamera->SetType( Dali::Camera::FREE_LOOK );
-    }
-
-    // save new mode
-    mViewMode = viewMode;
-
-    switch( viewMode )
-    {
-      case MONO:
-      {
-        // delete extra stereoscopic render tasks and cameras
-        mRenderTaskList->RemoveTask( mLeftRenderTask );
-        mDefaultCamera->Remove( *mLeftCamera.Get() );
-        mLeftRenderTask.Reset();
-        mLeftCamera.Reset();
-        mRenderTaskList->RemoveTask( mRightRenderTask );
-        mDefaultCamera->Remove( *mRightCamera.Get() );
-        mRightRenderTask.Reset();
-        mRightCamera.Reset();
-        mDefaultCamera->SetOrientation( Dali::ANGLE_0, Vector3::YAXIS );
-        mDefaultCamera->SetType( Dali::Camera::LOOK_AT_TARGET );
-        mRenderTaskList->GetTask(0).SetSourceActor( Dali::Layer(mRootLayer.Get()) );
-
-        break;
-      }
-      case STEREO_HORIZONTAL:
-      {
-        //Stereo mode with horizontal split is for landscape mode. That's the reason for the cameras being rotated
-        //Top camera renders the scene as seen from the right eye and bottom camera as seen from left.
-
-        //Calculate separation in pixels along vertical axis ( mStereoBase is defined in millimetres )
-        const float stereoBase( ( (mStereoBase / 25.4f) * GetDpi().y ) * 0.5f );
-
-        //Calculate aspect ratio
-        float aspect = mSize.width / (mSize.height * 0.5f);
-
-        mLeftCamera->SetPerspectiveProjection( mSize, Vector2( 0.0f,stereoBase) );
-        mLeftCamera->SetAspectRatio( aspect );
-
-        mLeftCamera->SetOrientation( -Dali::ANGLE_90, Vector3::ZAXIS );
-        mLeftCamera->SetPosition( Vector3( stereoBase, 0.0f, 0.0f ) );
-        mLeftRenderTask.SetViewport( Viewport(0, mSize.height * 0.5f, mSize.width, mSize.height * 0.5f) );
-
-        mRightCamera->SetPerspectiveProjection( mSize, Vector2( 0.0,  -stereoBase) );
-        mRightCamera->SetAspectRatio( aspect );
-        mRightCamera->SetOrientation( -Dali::ANGLE_90, Vector3::ZAXIS );
-        mRightCamera->SetPosition( Vector3(-stereoBase, 0.0f, 0.0f ) );
-        mRightRenderTask.SetViewport( Viewport(0, 0, mSize.width, mSize.height * 0.5f ) );
-
-        break;
-      }
-      case STEREO_VERTICAL:
-      {
-        //Calculate separation in pixels along horizontal axis
-        const float stereoBase( ( (mStereoBase / 25.4f) * GetDpi().x ) * 0.5f );
-
-        //Recalculate fov based on viewport size
-        const float fov = 2.0f * std::atan(  mSize.y / (2.0f * std::max( mSize.x*0.5f, mSize.y )) );
-
-        mLeftCamera->SetPerspectiveProjection( Size( mSize.x * 0.5f, mSize.y ), Vector2(stereoBase,0.0f) );
-        mLeftCamera->SetFieldOfView( fov );
-        mLeftCamera->SetOrientation( Dali::ANGLE_0, Vector3::ZAXIS );
-        mLeftCamera->SetPosition( Vector3( stereoBase, 0.0f, 0.0f ) );
-        mLeftRenderTask.SetViewport( Viewport(0, 0, mSize.width * 0.5f, mSize.height ) );
-
-        mRightCamera->SetPerspectiveProjection( Size( mSize.x * 0.5f, mSize.y ), Vector2(-stereoBase,0.0f) );
-        mRightCamera->SetFieldOfView( fov );
-        mRightCamera->SetOrientation( Dali::ANGLE_0, Vector3::ZAXIS );
-        mRightCamera->SetPosition( Vector3( -stereoBase, 0.0f, 0.0f ) );
-        mRightRenderTask.SetViewport( Viewport(mSize.width * 0.5f, 0, mSize.width * 0.5f, mSize.height ) );
-
-        break;
-      }
-      case STEREO_INTERLACED:
-      {
-        break;
-      }
-    }
-  }
+  return mScene->GetDpi();
 }
 
-ViewMode Stage::GetViewMode() const
+void Stage::KeepRendering( float durationSeconds )
 {
-  return mViewMode;
+  // Send message to keep rendering
+  KeepRenderingMessage( mUpdateManager, durationSeconds );
 }
 
-void Stage::SetStereoBase( float stereoBase )
+void Stage::SetRenderingBehavior( DevelStage::Rendering renderingBehavior )
 {
-  if( ! Equals( mStereoBase, stereoBase ) )
+  if( mRenderingBehavior != renderingBehavior )
   {
-    DALI_LOG_INFO( Debug::Filter::gActor, Debug::Concise, "old( %.2f) new(%.2f)\n", mStereoBase, stereoBase );
-    mStereoBase = stereoBase;
-
-    switch( mViewMode  )
-    {
-      case STEREO_HORIZONTAL:
-      {
-        stereoBase = mStereoBase / 25.4f * GetDpi().y * 0.5f;
-        float aspect = mSize.width / (mSize.height * 0.5f);
-
-        mLeftCamera->SetPerspectiveProjection( mSize, Vector2( 0.0, stereoBase) );
-        mLeftCamera->SetAspectRatio( aspect );
-        mLeftCamera->SetPosition( Vector3( stereoBase, 0.0f, 0.0f ) );
-
-        mRightCamera->SetPerspectiveProjection( mSize, Vector2( 0.0, -stereoBase) );
-        mRightCamera->SetAspectRatio( aspect );
-        mRightCamera->SetPosition( Vector3(-stereoBase, 0.0f, 0.0f ) );
-
-        break;
-      }
-      case STEREO_VERTICAL:
-      {
-        stereoBase = mStereoBase / 25.4f * GetDpi().x * 0.5f;
-        const float fov = 2.0f * std::atan(  mSize.y / (2.0f * std::max( mSize.x*0.5f, mSize.y )) );
-
-        mLeftCamera->SetPerspectiveProjection( Size( mSize.x * 0.5f, mSize.y ), Vector2(stereoBase,0.0f) );
-        mLeftCamera->SetFieldOfView( fov );
-        mLeftCamera->SetPosition( Vector3( stereoBase, 0.0f, 0.0f ) );
-
-        mRightCamera->SetPerspectiveProjection( Size( mSize.x * 0.5f, mSize.y ), Vector2(-stereoBase,0.0f) );
-        mRightCamera->SetFieldOfView( fov );
-        mRightCamera->SetPosition( Vector3(-stereoBase, 0.0f, 0.0f ) );
-
-        break;
-      }
-      default:
-        break;
-    }
-  }
-}
-
-float Stage::GetStereoBase() const
-{
-  return mStereoBase;
-}
-
-void Stage::SetBackgroundColor(Vector4 color)
-{
-  // Cache for public GetBackgroundColor()
-  mBackgroundColor = color;
+    // Send message to change the rendering behavior
+    SetRenderingBehaviorMessage( mUpdateManager, renderingBehavior );
 
-  // Send message to change color in next frame
-  SetBackgroundColorMessage( mUpdateManager, color );
-}
-
-Vector4 Stage::GetBackgroundColor() const
-{
-  return mBackgroundColor;
-}
-
-Vector2 Stage::GetDpi() const
-{
-  return mDpi;
-}
-
-void Stage::SetDpi(Vector2 dpi)
-{
-  mDpi = dpi;
+    mRenderingBehavior = renderingBehavior;
+  }
 }
 
-void Stage::KeepRendering( float durationSeconds )
+DevelStage::Rendering Stage::GetRenderingBehavior() const
 {
-  // Send message to keep rendering
-  KeepRenderingMessage( mUpdateManager, durationSeconds );
+  return mRenderingBehavior;
 }
 
 bool Stage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
@@ -593,6 +267,35 @@ bool Stage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   return connected;
 }
 
+void Stage::OnEventProcessingFinished()
+{
+  EmitEventProcessingFinishedSignal();
+}
+
+void Stage::OnKeyEvent( const Dali::KeyEvent& event )
+{
+  bool consumed = EmitKeyEventGeneratedSignal( event );
+  if( !consumed )
+  {
+    EmitKeyEventSignal( event );
+  }
+}
+
+void Stage::OnTouchedEvent( const Dali::TouchEvent& touchEvent )
+{
+  mTouchedSignal.Emit( touchEvent );
+}
+
+void Stage::OnTouchEvent( const Dali::TouchData& touch )
+{
+  mTouchSignal.Emit( touch );
+}
+
+void Stage::OnWheelEvent( const Dali::WheelEvent& event )
+{
+  EmitWheelEventSignal( event );
+}
+
 void Stage::EmitKeyEventSignal(const KeyEvent& event)
 {
   // Emit the key event signal when no actor in the stage has gained the key input focus
@@ -618,7 +321,7 @@ void Stage::EmitTouchedSignal( const TouchEvent& touchEvent, const Dali::TouchDa
   mTouchSignal.Emit( touch );
 }
 
-void Stage::EmitWheelEventSignal(const WheelEvent& event)
+void Stage::EmitWheelEventSignal( const WheelEvent& event )
 {
   // Emit the wheel event signal when no actor in the stage has gained the wheel input focus
 
@@ -640,6 +343,22 @@ Dali::DevelStage::KeyEventGeneratedSignalType& Stage::KeyEventGeneratedSignal()
   return mKeyEventGeneratedSignal;
 }
 
+void Stage::AddFrameCallback( FrameCallbackInterface& frameCallback, Actor& rootActor )
+{
+  DALI_ASSERT_ALWAYS( ( ! FrameCallbackInterface::Impl::Get( frameCallback ).IsConnectedToSceneGraph() )
+                      && "FrameCallbackInterface implementation already added" );
+
+  // Create scene-graph object and transfer to UpdateManager
+  OwnerPointer< SceneGraph::FrameCallback > transferOwnership( SceneGraph::FrameCallback::New( frameCallback ) );
+  AddFrameCallbackMessage( mUpdateManager, transferOwnership, rootActor.GetNode() );
+}
+
+void Stage::RemoveFrameCallback( FrameCallbackInterface& frameCallback )
+{
+  FrameCallbackInterface::Impl::Get( frameCallback ).Invalidate();
+  RemoveFrameCallbackMessage( mUpdateManager, frameCallback );
+}
+
 Dali::Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSignal()
 {
   return mEventProcessingFinishedSignal;
@@ -676,46 +395,8 @@ Dali::Stage::SceneCreatedSignalType& Stage::SceneCreatedSignal()
   return mSceneCreatedSignal;
 }
 
-void Stage::RequestRebuildDepthTree()
-{
-  DALI_LOG_INFO(gLogFilter, Debug::General, "RequestRebuildDepthTree()\n");
-  mDepthTreeDirty = true;
-}
-
-void Stage::RebuildDepthTree()
-{
-  // If the depth tree needs rebuilding, do it in this frame only.
-  if( mDepthTreeDirty )
-  {
-    DALI_LOG_INFO(gLogFilter, Debug::Concise, "RebuildDepthTree() dirty:T\n");
-
-    ActorPtr actor( mRootLayer.Get() );
-    actor->RebuildDepthTree();
-    mDepthTreeDirty = false;
-  }
-}
-
-
-Stage::Stage( AnimationPlaylist& playlist,
-              PropertyNotificationManager& propertyNotificationManager,
-              SceneGraph::UpdateManager& updateManager,
-              NotificationManager& notificationManager,
-              Integration::RenderController& renderController )
-: mAnimationPlaylist( playlist ),
-  mPropertyNotificationManager( propertyNotificationManager ),
-  mUpdateManager( updateManager ),
-  mNotificationManager( notificationManager ),
-  mRenderController( renderController ),
-  mSize( Vector2::ZERO ),
-  mSurfaceSize( Vector2::ZERO ),
-  mBackgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
-  mViewMode( MONO ),
-  mStereoBase( DEFAULT_STEREO_BASE ),
-  mTopMargin( 0 ),
-  mDpi( Vector2::ZERO ),
-  mRightRenderTask(),
-  mLeftRenderTask(),
-  mSystemOverlay( NULL ),
+Stage::Stage( SceneGraph::UpdateManager& updateManager )
+: mUpdateManager( updateManager ),
   mKeyEventSignal(),
   mKeyEventGeneratedSignal(),
   mEventProcessingFinishedSignal(),
@@ -725,49 +406,12 @@ Stage::Stage( AnimationPlaylist& playlist,
   mContextLostSignal(),
   mContextRegainedSignal(),
   mSceneCreatedSignal(),
-  mDepthTreeDirty( false ),
-  mForceNextUpdate( false ),
-  mRenderToFbo( false )
+  mRenderingBehavior( DevelStage::Rendering::IF_REQUIRED )
 {
 }
 
-SceneGraph::UpdateManager& Stage::GetUpdateManager()
-{
-  return mUpdateManager;
-}
-
-Integration::RenderController& Stage::GetRenderController()
-{
-  return mRenderController;
-}
-
-unsigned int* Stage::ReserveMessageSlot( std::size_t size, bool updateScene )
-{
-  return mUpdateManager.ReserveMessageSlot( size, updateScene );
-}
-
-BufferIndex Stage::GetEventBufferIndex() const
-{
-  return mUpdateManager.GetEventBufferIndex();
-}
-
-void Stage::ForceNextUpdate()
-{
-  mForceNextUpdate = true;
-}
-
-bool Stage::IsNextUpdateForced()
-{
-  bool nextUpdateForced = mForceNextUpdate;
-  mForceNextUpdate = false;
-  return nextUpdateForced;
-}
-
 Stage::~Stage()
 {
-  delete mSystemOverlay;
-
-  mObjectRegistry.Reset();
 }
 
 } // namespace Internal
index 718c387..af8b7c2 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_STAGE_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/common/stage.h>
-#include <dali/devel-api/common/stage-devel.h>
+#include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/base-object.h>
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector3.h>
+#include <dali/public-api/math/vector4.h>
+#include <dali/devel-api/common/stage-devel.h>
 #include <dali/internal/common/owner-pointer.h>
 #include <dali/internal/event/actors/layer-impl.h>
 #include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/event/common/stage-def.h>
 #include <dali/internal/event/render-tasks/render-task-defaults.h>
 #include <dali/internal/update/manager/update-manager.h>
-#include <dali/public-api/common/view-mode.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/public-api/math/vector3.h>
-#include <dali/public-api/math/vector4.h>
-#include <dali/public-api/render-tasks/render-task.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
 {
@@ -43,7 +42,6 @@ struct Vector2;
 
 namespace Integration
 {
-class SystemOverlay;
 class RenderController;
 }
 
@@ -59,41 +57,28 @@ class AnimationPlaylist;
 class PropertyNotificationManager;
 class Layer;
 class LayerList;
-class SystemOverlay;
 class CameraActor;
 class RenderTaskList;
+class Scene;
 
 /**
  * Implementation of Stage
  */
-class Stage : public BaseObject, public RenderTaskDefaults, public EventThreadServices
+class Stage : public BaseObject, public RenderTaskDefaults, public ConnectionTracker
 {
 public:
 
   /**
    * Create the stage
-   * @param[in] playlist for animations
-   * @param[in] propertyNotificationManager
    * @param[in] updateManager
-   * @param[in] notificationManager
-   * @param[in] renderController
    */
-  static StagePtr New( AnimationPlaylist& playlist,
-                       PropertyNotificationManager& propertyNotificationManager,
-                       SceneGraph::UpdateManager& updateManager,
-                       NotificationManager& notificationManager,
-                       Integration::RenderController& renderController );
+  static StagePtr New( SceneGraph::UpdateManager& updateManager );
 
   /**
    * Initialize the stage.
-   * @param[in] renderToFbo Whether to render into a Frame Buffer Object.
+   * @param[in] scene The default scene (for main window).
    */
-  void Initialize( bool renderToFbo );
-
-  /**
-   * Uninitialize the stage.
-   */
-  void Uninitialize();
+  void Initialize( Scene& scene );
 
   /**
    * @copydoc Dali::Stage::GetCurrent()
@@ -117,18 +102,6 @@ public:
    */
   Layer& GetRootActor();
 
-  /**
-   * Returns the animation playlist.
-   * @return reference to the animation playlist.
-   */
-  AnimationPlaylist& GetAnimationPlaylist();
-
-  /**
-   * Returns the property notification manager.
-   * @return reference to the property notification manager.
-   */
-  PropertyNotificationManager& GetPropertyNotificationManager();
-
   // Root actor accessors
 
   /**
@@ -142,22 +115,6 @@ public:
   void Remove( Actor& actor );
 
   /**
-   * Used to calculate the size of the stage and indirectly, the root actor.
-   * @param [in] width  The new surface width.
-   * @param [in] height The new surface height.
-   */
-  void SurfaceResized( float width, float height );
-
-  /**
-   * Sets the top margin size.
-   * Available stage size is reduced by this size.
-   * The stage is located below the size at the top of the display
-   * initial size is zero before it is assigned
-   * @param[in] margin margin size
-   */
-  void SetTopMargin( unsigned int margin );
-
-  /**
    * Returns the size of the Stage in pixels as a Vector.
    * The x component will be the width of the Stage in pixels
    * The y component will be the height of the Stage in pixels
@@ -171,16 +128,6 @@ public:
   RenderTaskList& GetRenderTaskList() const;
 
   /**
-   * Create a default camera actor
-   */
-  void CreateDefaultCameraActor();
-
-  /**
-   * Set position of default camera for current stage size
-   */
-  void SetDefaultCameraPosition();
-
-  /**
    * From RenderTaskDefaults; retrieve the default root actor.
    * @return The default root actor.
    */
@@ -197,12 +144,12 @@ public:
   /**
    * @copydoc Dali::Stage::GetLayerCount()
    */
-  unsigned int GetLayerCount() const;
+  uint32_t GetLayerCount() const;
 
   /**
    * @copydoc Dali::Stage::GetLayer()
    */
-  Dali::Layer GetLayer( unsigned int depth ) const;
+  Dali::Layer GetLayer( uint32_t depth ) const;
 
   /**
    * @copydoc Dali::Stage::GetRootLayer()
@@ -215,94 +162,62 @@ public:
    */
   LayerList& GetLayerList();
 
-  // System-level overlay actors
-
-  /**
-   * @copydoc Dali::Integration::Core::GetSystemOverlay()
-   */
-  Integration::SystemOverlay& GetSystemOverlay();
-
-  /**
-   * Retrieve the internal implementation of the SystemOverlay.
-   * @return The implementation, or NULL if this has never been requested from Integration API.
-   */
-  SystemOverlay* GetSystemOverlayInternal();
-
-  // Stereoscopy
+  // Misc
 
   /**
-   * @copydoc Dali::Integration::Core::SetViewMode()
+   * @copydoc Dali::Stage::SetBackgroundColor
    */
-  void SetViewMode( ViewMode viewMode );
+  void SetBackgroundColor(Vector4 color);
 
   /**
-   * @copydoc Dali::Integration::Core::GetViewMode()
+   * @copydoc Dali::Stage::GetBackgroundColor
    */
-  ViewMode GetViewMode() const;
+  Vector4 GetBackgroundColor() const;
 
   /**
-   * @copydoc Dali::Integration::Core::SetStereoBase()
+   * @copydoc Dali::Stage::GetDpi
    */
-  void SetStereoBase( float stereoBase );
+  Vector2 GetDpi() const;
 
   /**
-   * @copydoc Dali::Integration::Core::GetStereoBase()
+   * @copydoc Dali::Stage::KeepRendering()
    */
-  float GetStereoBase() const;
-
-  // Keyboard stuff
+  void KeepRendering( float durationSeconds );
 
   /**
-   * As one virtual keyboard per stage, the stage will hold a pointer to the Actor currently
-   * set to receive keyboard input.
-   * @param[in] actor to receive keyboard input
+   * @copydoc Dali::DevelStage::SetRenderingBehavior()
    */
-  void SetKeyboardFocusActor( Actor* actor );
+  void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
 
   /**
-   * Get the actor that is currently set to receive keyboard inputs
-   * @return Pointer to the actor set to receive keyboard inputs.
+   * @copydoc Dali::DevelStage::GetRenderingBehavior()
    */
-  Actor* GetKeyboardFocusActor() const;
+  DevelStage::Rendering GetRenderingBehavior() const;
 
   /**
-   * Removes the given actor from keyboard focus so it will no longer receive key events from keyboard.
-   * @param [in] actor which should be removed from focus.
+   * Callback for Internal::Scene EventProcessingFinished signal
    */
-  void RemoveActorFromKeyFocus( Actor* actor );
-
-  // Misc
+  void OnEventProcessingFinished();
 
   /**
-   * @copydoc Dali::Stage::SetBackgroundColor
+   * Callback for Internal::Scene KeyEventSignal signal
    */
-  void SetBackgroundColor(Vector4 color);
+  void OnKeyEvent( const Dali::KeyEvent& event );
 
   /**
-   * @copydoc Dali::Stage::GetBackgroundColor
+   * Callback for Internal::Scene TouchedEventSignal signal
    */
-  Vector4 GetBackgroundColor() const;
+  void OnTouchedEvent( const Dali::TouchEvent& touch );
 
   /**
-   * @copydoc Dali::Stage::GetDpi
+   * Callback for Internal::Scene TouchSignal signal
    */
-  Vector2 GetDpi() const;
+  void OnTouchEvent( const Dali::TouchData& touch );
 
   /**
-   * Sets horizontal and vertical pixels per inch value that is used by the display
-   * @param[in] dpi Horizontal and vertical dpi value
+   * Callback for Internal::Scene WheelEventSignal signal
    */
-  void SetDpi( Vector2 dpi );
-
-  NotificationManager& GetNotificationManager()
-  {
-    return mNotificationManager;
-  }
-
-  /**
-   * @copydoc Dali::Stage::KeepRendering()
-   */
-  void KeepRendering( float durationSeconds );
+  void OnWheelEvent( const Dali::WheelEvent& event );
 
   /**
    * Used by the EventProcessor to emit key event signals.
@@ -388,6 +303,16 @@ public:
   Dali::DevelStage::KeyEventGeneratedSignalType& KeyEventGeneratedSignal();
 
   /**
+   * @copydoc Dali::DevelStage::AddFrameCallback()
+   */
+  void AddFrameCallback( FrameCallbackInterface& frameCallback, Actor& rootActor );
+
+  /**
+   * @copydoc Dali::DevelStage::RemoveFrameCallback()
+   */
+  void RemoveFrameCallback( FrameCallbackInterface& frameCallback );
+
+  /**
    * Connects a callback function with the object's signals.
    * @param[in] object The object providing the signal.
    * @param[in] tracker Used to disconnect the signal.
@@ -398,69 +323,12 @@ public:
    */
   static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
 
-public: // Implementation of EventThreadServices
-
-  /**
-   * @copydoc EventThreadServices::RegisterObject
-   */
-  virtual void RegisterObject( BaseObject* object);
-
-  /**
-   * @copydoc EventThreadServices::UnregisterObject
-   */
-  virtual void UnregisterObject( BaseObject* object);
-
-  /**
-   * @copydoc EventThreadServices::GetUpdateManager
-   */
-  virtual SceneGraph::UpdateManager& GetUpdateManager();
-
-  /**
-   * @copydoc EventThreadServices::GetRenderController
-   */
-  virtual Integration::RenderController& GetRenderController();
-
-  /**
-   * @copydoc EventThreadServices::ReserveMessageSlot
-   */
-  virtual unsigned int* ReserveMessageSlot( std::size_t size, bool updateScene );
-
-  /**
-   * @copydoc EventThreadServices::GetEventBufferIndex
-   */
-  virtual BufferIndex GetEventBufferIndex() const;
-
-  /**
-   * @copydoc EventThreadServices::ForceNextUpdate
-   */
-  virtual void ForceNextUpdate();
-
-  /**
-   * @copydoc EventThreadServices::IsNextUpdateForced
-   */
-  virtual bool IsNextUpdateForced();
-
-  /**
-   * Request that the depth tree is rebuilt
-   */
-  void RequestRebuildDepthTree();
-
-  /**
-   * Rebuilds the depth tree at the end of the event frame if
-   * it was requested this frame.
-   */
-  void RebuildDepthTree();
-
 private:
 
   /**
    * Protected constructor; see also Stage::New()
    */
-  Stage( AnimationPlaylist& playlist,
-         PropertyNotificationManager& propertyNotificationManager,
-         SceneGraph::UpdateManager& updateManager,
-         NotificationManager& notificationManager,
-         Integration::RenderController& renderController );
+  Stage( SceneGraph::UpdateManager& updateManager );
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
@@ -469,49 +337,9 @@ private:
 
 private:
 
-  // For 'Fire and forget' animation support
-  AnimationPlaylist& mAnimationPlaylist;
-
-  PropertyNotificationManager& mPropertyNotificationManager;
-
   SceneGraph::UpdateManager& mUpdateManager;
 
-  NotificationManager& mNotificationManager;
-
-  Integration::RenderController& mRenderController;
-
-  // The stage-size may be less than surface-size (reduced by top-margin)
-  Vector2 mSize;
-  Vector2 mSurfaceSize;
-
-  // Cached for public GetBackgroundColor()
-  Vector4 mBackgroundColor;
-
-  LayerPtr mRootLayer;
-
-  // Ordered list of currently on-stage layers
-  OwnerPointer<LayerList> mLayerList;
-
-  IntrusivePtr<CameraActor> mDefaultCamera;
-
-  ViewMode mViewMode;
-  float mStereoBase;
-
-  unsigned int mTopMargin;
-  Vector2 mDpi;
-
-  // The object registry
-  ObjectRegistryPtr mObjectRegistry;
-
-  // The list of render-tasks
-  IntrusivePtr<RenderTaskList> mRenderTaskList;
-
-  Dali::RenderTask mRightRenderTask;
-  IntrusivePtr<CameraActor> mRightCamera;
-  Dali::RenderTask mLeftRenderTask;
-  IntrusivePtr<CameraActor> mLeftCamera;
-
-  Integration::SystemOverlay* mSystemOverlay; ///< SystemOverlay stage access
+  IntrusivePtr<Scene> mScene;
 
   // The key event signal
   Dali::Stage::KeyEventSignalType                 mKeyEventSignal;
@@ -532,9 +360,7 @@ private:
 
   Dali::Stage::SceneCreatedSignalType mSceneCreatedSignal;
 
-  bool mDepthTreeDirty:1;  ///< True if the depth tree needs recalculating
-  bool mForceNextUpdate:1; ///< True if the next rendering is really required.
-  bool mRenderToFbo:1;     ///< Whether to render to a Frame Buffer Object.
+  DevelStage::Rendering mRenderingBehavior; ///< The rendering behavior
 };
 
 } // namespace Internal
diff --git a/dali/internal/event/common/system-overlay-impl.cpp b/dali/internal/event/common/system-overlay-impl.cpp
deleted file mode 100644 (file)
index 8003cbd..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/common/system-overlay-impl.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/constants.h>
-#include <dali/internal/event/actors/camera-actor-impl.h>
-#include <dali/internal/event/actors/layer-impl.h>
-#include <dali/internal/event/actors/layer-list.h>
-#include <dali/internal/event/common/event-thread-services.h>
-#include <dali/internal/event/render-tasks/render-task-list-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-SystemOverlay* SystemOverlay::New( EventThreadServices& eventThreadServices )
-{
-  SystemOverlay* overlay = new SystemOverlay( eventThreadServices );
-
-  overlay->Initialize();
-
-  return overlay;
-}
-
-SystemOverlay::~SystemOverlay()
-{
-  if ( mRootLayer )
-  {
-    // we are closing down so just delete the root, no point emit disconnect
-    // signals or send messages to update
-    mRootLayer.Reset();
-  }
-}
-
-void SystemOverlay::Add( Actor& actor )
-{
-  CreateRootLayer();
-
-  mRootLayer->Add( actor );
-}
-
-void SystemOverlay::Remove( Actor& actor )
-{
-  if ( mRootLayer )
-  {
-    mRootLayer->Remove( actor );
-  }
-}
-
-RenderTaskList& SystemOverlay::GetOverlayRenderTasks()
-{
-  if ( !mOverlayRenderTaskList )
-  {
-    mOverlayRenderTaskList = RenderTaskList::New( mEventThreadServices, *this, true/*system-overlay*/ );
-  }
-
-  return *mOverlayRenderTaskList;
-}
-
-void SystemOverlay::SetSize( float width, float height )
-{
-  mSize = Vector2( width, height );
-
-  if ( mRootLayer )
-  {
-    mRootLayer->SetSize( mSize.width, mSize.height );
-  }
-
-  if ( mDefaultCameraActor )
-  {
-    // Sets the default perspective projection for the given size.
-    mDefaultCameraActor->SetPerspectiveProjection( mSize );
-  }
-}
-
-LayerList& SystemOverlay::GetLayerList()
-{
-  return *mLayerList;
-}
-
-Actor& SystemOverlay::GetDefaultRootActor()
-{
-  CreateRootLayer();
-
-  return *mRootLayer;
-}
-
-CameraActor& SystemOverlay::GetDefaultCameraActor()
-{
-  CreateDefaultCameraActor();
-
-  return *mDefaultCameraActor;
-}
-
-SystemOverlay::SystemOverlay( EventThreadServices& eventThreadServices )
-: mEventThreadServices( eventThreadServices )
-{
-}
-
-void SystemOverlay::Initialize()
-{
-  // Create the ordered list of layers
-  mLayerList = LayerList::New( mEventThreadServices.GetUpdateManager(), true/*system layers*/ );
-}
-
-void SystemOverlay::CreateRootLayer()
-{
-  // Lazy initialization; SystemOverlay may never be used
-  if ( !mRootLayer )
-  {
-    mRootLayer = Layer::NewRoot( *mLayerList, mEventThreadServices.GetUpdateManager(), true/*system layer*/ );
-    mRootLayer->SetName("SystemOverlayRoot");
-    mRootLayer->SetSize( mSize.width, mSize.height );
-  }
-}
-
-void SystemOverlay::CreateDefaultCameraActor()
-{
-  // Lazy initialization; SystemOverlay may never be used
-  if ( !mDefaultCameraActor )
-  {
-    // Creates a default camera with a default perspective projection.
-    mDefaultCameraActor = CameraActor::New( mSize );
-    mDefaultCameraActor->SetParentOrigin( ParentOrigin::CENTER );
-
-    Add( *mDefaultCameraActor );
-  }
-}
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/event/common/system-overlay-impl.h b/dali/internal/event/common/system-overlay-impl.h
deleted file mode 100644 (file)
index eeb9a54..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-#ifndef __DALI_INTERNAL_SYSTEM_OVERLAY_H__
-#define __DALI_INTERNAL_SYSTEM_OVERLAY_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/public-api/math/vector2.h>
-#include <dali/integration-api/system-overlay.h>
-#include <dali/internal/common/owner-pointer.h>
-#include <dali/internal/event/actors/actor-declarations.h>
-#include <dali/internal/event/render-tasks/render-task-defaults.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-class LayerList;
-class RenderTaskList;
-class EventThreadServices;
-
-/**
- * Implementation of Dali::Integration::SystemOverlay
- */
-class SystemOverlay : public RenderTaskDefaults
-{
-public:
-
-  /**
-   * Create the SystemOverlay; This should only be done once for each Dali core.
-   * @param[in] eventThreadServices to send messaged to scene graph.
-   * @return The newly allocated SystemOverlay.
-   */
-  static SystemOverlay* New( EventThreadServices& eventThreadServices );
-
-  /**
-   * Non-virtual destructor; not intended as a base class.
-   */
-  ~SystemOverlay();
-
-  /**
-   * @copydoc Dali::Integration::SystemOverlay::Add()
-   */
-  void Add( Actor& actor );
-
-  /**
-   * @copydoc Dali::Integration::SystemOverlay::Remove()
-   */
-  void Remove( Actor& actor );
-
-  /**
-   * @copydoc Dali::Integration::SystemOverlay::GetOverlayRenderTasks()
-   */
-  RenderTaskList& GetOverlayRenderTasks();
-
-  /**
-   * Forwarded from Stage::SetSize().
-   * @param[in] width  The new width.
-   * @param[in] height The new height.
-   */
-  void SetSize( float width, float height );
-
-  /**
-   * Retrieve the ordered list of system layers.
-   * @return The layer-list.
-   */
-  LayerList& GetLayerList();
-
-  /**
-   * From RenderTaskDefaults.
-   * Retrieve the default SystemOverlay root actor.
-   * @note This is different to the root actor provided by Dali::Stage.
-   */
-  virtual Actor& GetDefaultRootActor();
-
-  /**
-   * From RenderTaskDefaults.
-   * Retrieve the default SystemOverlay camera actor.
-   * @note This is different to the default camera actor provided by Dali::Stage.
-   */
-  virtual CameraActor& GetDefaultCameraActor();
-
-private:
-
-  /**
-   * Protected constructor; see also SystemOverlay::New().
-   * @param[in] eventThreadServices to send messaged to the scene graph.
-   */
-  SystemOverlay( EventThreadServices& eventThreadServices );
-
-  /**
-   * Second-phase construction.
-   */
-  void Initialize();
-
-  /**
-   * Lazy initialization of the SystemOverlay root actor.
-   */
-  void CreateRootLayer();
-
-  /**
-   * Lazy initialization of the default camera actor.
-   */
-  void CreateDefaultCameraActor();
-
-private:
-
-  EventThreadServices& mEventThreadServices;
-
-  Vector2 mSize;
-
-  IntrusivePtr<RenderTaskList> mOverlayRenderTaskList;
-
-  LayerPtr mRootLayer;
-
-  CameraActorPtr mDefaultCameraActor;
-
-  // Ordered list of currently on-stage layers
-  OwnerPointer<LayerList> mLayerList;
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_SYSTEM_OVERLAY_H__
index 559b833..1eab332 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/internal/common/core-impl.h>
 #include <dali/public-api/common/dali-common.h>
+#include <dali/internal/event/common/event-thread-services.h>
 
 namespace Dali
 {
@@ -103,6 +104,36 @@ RelayoutController& ThreadLocalStorage::GetRelayoutController()
   return mCore->GetRelayoutController();
 }
 
+ObjectRegistry& ThreadLocalStorage::GetObjectRegistry()
+{
+  return mCore->GetObjectRegistry();
+}
+
+EventThreadServices& ThreadLocalStorage::GetEventThreadServices()
+{
+  return mCore->GetEventThreadServices();
+}
+
+PropertyNotificationManager& ThreadLocalStorage::GetPropertyNotificationManager()
+{
+  return mCore->GetPropertyNotificationManager();
+}
+
+AnimationPlaylist& ThreadLocalStorage::GetAnimationPlaylist()
+{
+  return mCore->GetAnimationPlaylist();
+}
+
+void ThreadLocalStorage::AddScene( Scene* scene )
+{
+  mCore->AddScene( scene );
+}
+
+void ThreadLocalStorage::RemoveScene( Scene* scene )
+{
+  mCore->RemoveScene( scene );
+}
+
 } // namespace Internal
 
 } // namespace Dali
index 95b6c30..0e6e400 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/event/common/stage-def.h>
+#include <dali/internal/event/common/scene-impl.h>
 
 namespace Dali
 {
@@ -39,6 +40,8 @@ class NotificationManager;
 class ShaderFactory;
 class GestureEventProcessor;
 class RelayoutController;
+class ObjectRegistry;
+class EventThreadServices;
 
 namespace SceneGraph
 {
@@ -131,6 +134,44 @@ public:
    */
   RelayoutController& GetRelayoutController();
 
+  /**
+   * Returns the Object registry.
+   * @return A reference to the Object registry
+   */
+  ObjectRegistry& GetObjectRegistry();
+
+  /**
+   * @brief Gets the event thread services.
+   * @return A reference to the event thread services
+   */
+  EventThreadServices& GetEventThreadServices();
+
+  /**
+   * @brief Gets the property notification manager.
+   * @return A reference to the property notification manager
+   */
+  PropertyNotificationManager& GetPropertyNotificationManager();
+
+  /**
+   * @brief Gets the animation play list.
+   * @return A reference to the animation play list
+   */
+  AnimationPlaylist& GetAnimationPlaylist();
+
+  /**
+   * Add a Scene to the Core.
+   * This is only used by the Scene to add itself to the core when the Scene is created.
+   * @param[in] scene The Scene.
+   */
+  void AddScene( Scene* scene );
+
+  /**
+   * Remove a Scene from the Core.
+   * This is only used by the Scene to remove itself from the core when the Scene is destroyed.
+   * @param[in] scene The Scene.
+   */
+  void RemoveScene( Scene* scene );
+
 private:
 
   Core* mCore;                                              ///< reference to core
index 2b41f54..bbb43da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 using std::find_if;
 
+namespace Dali
+{
+
+namespace Internal
+{
+
 namespace
 {
 
@@ -80,7 +86,7 @@ private:
 template <typename T>
 struct PropertyComponentFinder
 {
-  PropertyComponentFinder( Dali::Property::Index basePropertyIndex, const int find )
+  PropertyComponentFinder( Property::Index basePropertyIndex, const int find )
   : mBasePropertyIndex( basePropertyIndex ),
     mFind( find )
   {
@@ -93,27 +99,78 @@ struct PropertyComponentFinder
 
 private:
 
-  Dali::Property::Index mBasePropertyIndex;
+  Property::Index mBasePropertyIndex;
   const int mFind;
 };
 
-} // namespace anon
-
-namespace Dali
+/**
+ * Helper function to find the right default property with given index and return the desired detail of it
+ */
+template< typename Parameter, typename Member >
+inline bool GetDefaultPropertyField( const Dali::PropertyDetails* propertyTable, Property::Index count, Property::Index index, Member member, Parameter& parameter )
 {
+  bool found = false;
+  // is index inside this table (bigger than first index but smaller than first + count)
+  if( ( index >= propertyTable->enumIndex ) && ( index < ( propertyTable->enumIndex + count ) ) )
+  {
+    // return the match. we're assuming here that there is no gaps between the indices in a table
+    parameter = propertyTable[ index - propertyTable->enumIndex ].*member;
+    found = true;
+  }
+  // should never really get here
+  return found;
+}
 
-namespace Internal
+// static pointer value to mark that a base class address has not been resolved
+// 0x01 is not a valid pointer but used here to differentiate from nullptr
+// unfortunately it cannot be constexpr as C++ does not allow them to be initialised with reinterpret_cast
+Internal::TypeInfo* const UNRESOLVED = reinterpret_cast<Internal::TypeInfo*>( 0x1 );
+
+/**
+ * Helper function to resolve and return the pointer to the base type info
+ * Not a member function to avoid having to #include additional headers and to make sure this gets inlined inside this cpp
+ * @param[in/out] baseType pointer to resolve and set
+ * @param[in] typeRegistry reference to the type registry
+ * @param[in] baseTypeName string name of the base type
+ * @return true is base type exists
+ */
+inline bool GetBaseType( Internal::TypeInfo*& baseType, TypeRegistry& typeRegistry, const std::string& baseTypeName )
 {
+  // if greater than unresolved means we have a base type, null means no base
+  bool baseExists = ( baseType > UNRESOLVED );
+  // base only needs to be resolved once
+  if( UNRESOLVED == baseType )
+  {
+    TypeRegistry::TypeInfoPointer base = typeRegistry.GetTypeInfo( baseTypeName );
+    if( base )
+    {
+      baseType = base.Get(); // dont pass ownership, just return raw pointer
+      baseExists = true;
+    }
+    else
+    {
+      // no type info found so assuming no base as all type registration is done in startup for now
+      baseType = nullptr;
+    }
+  }
+  return baseExists;
+}
+
+} // unnamed namespace
 
-TypeInfo::TypeInfo(const std::string &name, const std::string &baseTypeName, Dali::TypeInfo::CreateFunction creator)
-  : mTypeName(name), mBaseTypeName(baseTypeName), mCSharpType(false), mCreate(creator)
+TypeInfo::TypeInfo( const std::string &name, const std::string &baseTypeName, Dali::TypeInfo::CreateFunction creator,
+                    const Dali::PropertyDetails* defaultProperties, Property::Index defaultPropertyCount )
+: mTypeRegistry( *TypeRegistry::Get() ), mBaseType( UNRESOLVED ),
+  mTypeName( name ), mBaseTypeName( baseTypeName ), mCreate( creator ), mDefaultProperties( defaultProperties ),
+  mDefaultPropertyCount( defaultPropertyCount ), mCSharpType( false )
 {
   DALI_ASSERT_ALWAYS(!name.empty() && "Type info construction must have a name");
   DALI_ASSERT_ALWAYS(!baseTypeName.empty() && "Type info construction must have a base type name");
 }
 
 TypeInfo::TypeInfo(const std::string &name, const std::string &baseTypeName, Dali::CSharpTypeInfo::CreateFunction creator)
-  : mTypeName(name), mBaseTypeName(baseTypeName), mCSharpType(true), mCSharpCreate(creator)
+: mTypeRegistry( *TypeRegistry::Get() ), mBaseType( UNRESOLVED ),
+  mTypeName( name ), mBaseTypeName( baseTypeName ), mCSharpCreate( creator ), mCSharpType( true )
 {
   DALI_ASSERT_ALWAYS(!name.empty() && "Type info construction must have a name");
   DALI_ASSERT_ALWAYS(!baseTypeName.empty() && "Type info construction must have a base type name");
@@ -154,7 +211,7 @@ BaseHandle TypeInfo::CreateInstance() const
   return ret;
 }
 
-  bool TypeInfo::DoActionTo(BaseObject *object, const std::string &actionName, const Property::Map &properties)
+bool TypeInfo::DoActionTo(BaseObject *object, const std::string &actionName, const Property::Map &properties)
 {
   bool done = false;
 
@@ -164,22 +221,13 @@ BaseHandle TypeInfo::CreateInstance() const
   {
     done = (iter->second)(object, actionName, properties);
   }
-  else
-  {
-    DALI_LOG_WARNING("Type '%s' cannot do action '%s'\n", mTypeName.c_str(), actionName.c_str());
-  }
 
-  if(!done)
+  if( !done )
   {
-    Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
-    while( base )
+    if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
     {
-      done = GetImplementation(base).DoActionTo(object, actionName, properties);
-      if( done )
-      {
-        break;
-      }
-      base =  Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
+      // call base type recursively
+      done = mBaseType->DoActionTo( object, actionName, properties );
     }
   }
 
@@ -198,6 +246,15 @@ bool TypeInfo::ConnectSignal( BaseObject* object, ConnectionTrackerInterface* co
     connected = (iter->second)( object, connectionTracker, signalName, functor );
   }
 
+  if( !connected )
+  {
+    if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
+    {
+      // call base type recursively
+      connected = mBaseType->ConnectSignal( object, connectionTracker, signalName, functor );
+    }
+  }
+
   return connected;
 }
 
@@ -216,92 +273,68 @@ Dali::TypeInfo::CreateFunction TypeInfo::GetCreator() const
   return mCreate;
 }
 
-size_t TypeInfo::GetActionCount() const
+uint32_t TypeInfo::GetActionCount() const
 {
-  size_t count = mActions.size();
+  uint32_t count = static_cast<uint32_t>( mActions.size() );
 
-  Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
-  while( base )
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    count += GetImplementation(base).mActions.size();
-    base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
+    // call base type recursively
+    count += mBaseType->GetActionCount();
   }
 
   return count;
 }
 
-std::string TypeInfo::GetActionName(size_t index) const
+std::string TypeInfo::GetActionName( uint32_t index ) const
 {
   std::string name;
+  const uint32_t count = static_cast<uint32_t>( mActions.size() );
 
-  if( index < mActions.size() )
+  if( index < count )
   {
     name = mActions[index].first;
   }
   else
   {
-    size_t count = mActions.size();
-
-    Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
-    while( base )
+    if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
     {
-      size_t baseCount = GetImplementation(base).mActions.size();
-
-      if( index < count + baseCount )
-      {
-        name = GetImplementation(base).mActions[ index - count ].first;
-        break;
-      }
-
-      count += baseCount;
-
-      base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
+      // call base type recursively
+      return mBaseType->GetActionName( index - count );
     }
   }
 
   return name;
 }
 
-size_t TypeInfo::GetSignalCount() const
+uint32_t TypeInfo::GetSignalCount() const
 {
-  size_t count = mSignalConnectors.size();
+  uint32_t count = static_cast<uint32_t>( mSignalConnectors.size() );
 
-  Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
-  while( base )
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    count += GetImplementation(base).mSignalConnectors.size();
-    base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
+    // call base type recursively
+    count += mBaseType->GetSignalCount();
   }
 
   return count;
 }
 
-std::string TypeInfo::GetSignalName(size_t index) const
+std::string TypeInfo::GetSignalName( uint32_t index ) const
 {
   std::string name;
+  const uint32_t count = static_cast<uint32_t>( mSignalConnectors.size() );
 
-  if( index < mSignalConnectors.size() )
+  if( index < count )
   {
     name = mSignalConnectors[index].first;
   }
   else
   {
-    size_t count = mSignalConnectors.size();
-
-    Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
-    while( base )
+    if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
     {
-      size_t baseCount = GetImplementation(base).mSignalConnectors.size();
-
-      if( index < count + baseCount )
-      {
-        name = GetImplementation(base).mSignalConnectors[ index - count ].first;
-        break;
-      }
-
-      count += baseCount;
-
-      base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
+      // call base type recursively
+      return mBaseType->GetSignalName( index - count );
     }
   }
 
@@ -310,11 +343,20 @@ std::string TypeInfo::GetSignalName(size_t index) const
 
 void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
 {
-  Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-  if ( base )
+  // Default Properties
+  if( mDefaultProperties )
   {
-    const TypeInfo& baseImpl( GetImplementation( base ) );
-    baseImpl.GetPropertyIndices( indices );
+    indices.Reserve( indices.Size() + mDefaultPropertyCount );
+    for( Property::Index index = 0; index < mDefaultPropertyCount; ++index )
+    {
+      indices.PushBack( mDefaultProperties[ index ].enumIndex );
+    }
+  }
+
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
+  {
+    // call base type recursively
+    mBaseType->GetPropertyIndices( indices );
   }
 
   AppendProperties( indices, mRegisteredProperties );
@@ -322,11 +364,10 @@ void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
 
 void TypeInfo::GetChildPropertyIndices( Property::IndexContainer& indices ) const
 {
-  Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-  if ( base )
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    const TypeInfo& baseImpl( GetImplementation( base ) );
-    baseImpl.GetChildPropertyIndices( indices );
+    // call base type recursively
+    mBaseType->GetChildPropertyIndices( indices );
   }
 
   AppendProperties( indices, mRegisteredChildProperties );
@@ -349,23 +390,55 @@ void TypeInfo::AppendProperties( Dali::Property::IndexContainer& indices,
   }
 }
 
-const std::string& TypeInfo::GetPropertyName( Property::Index index ) const
+const std::string& TypeInfo::GetRegisteredPropertyName( Property::Index index ) const
 {
   RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
                                                           PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
-
   if ( iter != mRegisteredProperties.end() )
   {
     return iter->second.name;
   }
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
+  {
+    // call base type recursively
+    return mBaseType->GetRegisteredPropertyName( index );
+  }
+  static std::string empty;
+  return empty;
+}
 
-  Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-  if ( base )
+std::string TypeInfo::GetPropertyName( Property::Index index ) const
+{
+  std::string propertyName;
+  // default or custom
+  if ( mDefaultProperties && ( index < DEFAULT_PROPERTY_MAX_COUNT ) )
   {
-    return GetImplementation(base).GetPropertyName( index );
+    const char* name = nullptr;
+    if( GetDefaultPropertyField( mDefaultProperties, mDefaultPropertyCount,index, &Dali::PropertyDetails::name, name ) )
+    {
+      propertyName = name;
+    }
+  }
+  else
+  {
+    RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
+                                                            PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+    if ( iter != mRegisteredProperties.end() )
+    {
+      return iter->second.name;
+    }
+  }
+  // if not our property, go to parent
+  if( propertyName.empty() )
+  {
+    if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
+    {
+      // call base type recursively
+      return mBaseType->GetPropertyName( index );
+    }
   }
 
-  DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
+  return propertyName;
 }
 
 void TypeInfo::AddActionFunction( const std::string &actionName, Dali::TypeInfo::ActionFunction function )
@@ -494,7 +567,7 @@ void TypeInfo::AddAnimatableProperty( const std::string& name, Property::Index i
   }
 }
 
-void TypeInfo::AddAnimatablePropertyComponent( const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex )
+void TypeInfo::AddAnimatablePropertyComponent( const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex )
 {
   Property::Type type = GetPropertyType( baseIndex );
   DALI_ASSERT_ALWAYS( ( type == Property::VECTOR2 || type == Property::VECTOR3 || type == Property::VECTOR4 ) && "Base property does not support component" );
@@ -534,16 +607,14 @@ void TypeInfo::AddChildProperty( const std::string& name, Property::Index index,
   }
 }
 
-size_t TypeInfo::GetPropertyCount() const
+uint32_t TypeInfo::GetPropertyCount() const
 {
-  size_t count( mRegisteredProperties.size() );
+  uint32_t count = mDefaultPropertyCount + static_cast<uint32_t>( mRegisteredProperties.size() );
 
-  Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-  while ( base )
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    const TypeInfo& baseImpl( GetImplementation(base) );
-    count += baseImpl.mRegisteredProperties.size();
-    base = TypeRegistry::Get()->GetTypeInfo( baseImpl.mBaseTypeName );
+    // call base type recursively
+    count += mBaseType->GetPropertyCount();
   }
 
   return count;
@@ -552,21 +623,34 @@ size_t TypeInfo::GetPropertyCount() const
 Property::Index TypeInfo::GetPropertyIndex( const std::string& name ) const
 {
   Property::Index index = Property::INVALID_INDEX;
+  bool found = false;
 
-  // Slow but should not be done that often
-  RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
-                                                          PropertyNameFinder< RegisteredPropertyPair >( name ) );
-
-  if ( iter != mRegisteredProperties.end() )
+  // check default properties
+  if( mDefaultProperties )
   {
-    index = iter->first;
+    for( Property::Index tableIndex = 0; tableIndex < mDefaultPropertyCount; ++tableIndex )
+    {
+      if( 0 == name.compare( mDefaultProperties[ tableIndex ].name ) )
+      {
+        index = mDefaultProperties[ tableIndex ].enumIndex;
+        found = true;
+        break;
+      }
+    }
   }
-  else
+  if( !found )
   {
-    Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-    if ( base )
+    // Slow but should not be done that often
+    RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
+                                                            PropertyNameFinder< RegisteredPropertyPair >( name ) );
+    if ( iter != mRegisteredProperties.end() )
     {
-      index = GetImplementation(base).GetPropertyIndex( name );
+      index = iter->first;
+    }
+    else if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
+    {
+      // call base type recursively
+      index = mBaseType->GetPropertyIndex( name );
     }
   }
 
@@ -584,19 +668,16 @@ Property::Index TypeInfo::GetBasePropertyIndex( Property::Index index ) const
   {
     basePropertyIndex = iter->second.basePropertyIndex;
   }
-  else
+  else if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-    if ( base )
-    {
-      basePropertyIndex = GetImplementation(base).GetBasePropertyIndex( index );
-    }
+    // call base type recursively
+    basePropertyIndex = mBaseType->GetBasePropertyIndex( index );
   }
 
   return basePropertyIndex;
 }
 
-int TypeInfo::GetComponentIndex( Property::Index index ) const
+int32_t TypeInfo::GetComponentIndex( Property::Index index ) const
 {
   int componentIndex = Property::INVALID_COMPONENT_INDEX;
 
@@ -607,13 +688,10 @@ int TypeInfo::GetComponentIndex( Property::Index index ) const
   {
     componentIndex = iter->second.componentIndex;
   }
-  else
+  else if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-    if ( base )
-    {
-      componentIndex = GetImplementation(base).GetComponentIndex( index );
-    }
+    // call base type recursively
+    componentIndex = mBaseType->GetComponentIndex( index );
   }
 
   return componentIndex;
@@ -631,13 +709,10 @@ Property::Index TypeInfo::GetChildPropertyIndex( const std::string& name ) const
   {
     index = iter->first;
   }
-  else
+  else if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-    if ( base )
-    {
-      index = GetImplementation(base).GetChildPropertyIndex( name );
-    }
+    // call base type recursively
+    index = mBaseType->GetChildPropertyIndex( name );
   }
 
   return index;
@@ -653,16 +728,16 @@ const std::string& TypeInfo::GetChildPropertyName( Property::Index index ) const
     return iter->second.name;
   }
 
-  Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-  if ( base )
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    return GetImplementation(base).GetChildPropertyName( index );
+    // call base type recursively
+    return mBaseType->GetChildPropertyName( index );
   }
 
-  DALI_LOG_WARNING("Cannot find property index");
+  DALI_LOG_ERROR( "Property index %d not found\n", index );
 
-  static std::string emptyString;
-  return emptyString;
+  static std::string empty;
+  return empty;
 }
 
 Property::Type TypeInfo::GetChildPropertyType( Property::Index index ) const
@@ -676,17 +751,14 @@ Property::Type TypeInfo::GetChildPropertyType( Property::Index index ) const
   {
     type = iter->second.type;
   }
+  else if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
+  {
+    // call base type recursively
+    type = mBaseType->GetChildPropertyType( index );
+  }
   else
   {
-    Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-    if ( base )
-    {
-      type = GetImplementation(base).GetChildPropertyType( index );
-    }
-    else
-    {
-      DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
-    }
+    DALI_LOG_ERROR( "Property index %d not found\n", index );
   }
 
   return type;
@@ -694,67 +766,167 @@ Property::Type TypeInfo::GetChildPropertyType( Property::Index index ) const
 
 bool TypeInfo::IsPropertyWritable( Property::Index index ) const
 {
-  bool writable( false );
+  bool writable = false;
+  bool found = false;
 
-  RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
-                                                          PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+  // default property?
+  if ( ( index < DEFAULT_PROPERTY_MAX_COUNT ) && mDefaultProperties )
+  {
+    found = GetDefaultPropertyField( mDefaultProperties, mDefaultPropertyCount,index, &Dali::PropertyDetails::writable, writable );
+  }
+  else if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  {
+    writable = true; // animatable property is writable
+    found = true;
+  }
+  else
+  {
+    RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
+                                                            PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+    if ( iter != mRegisteredProperties.end() )
+    {
+      writable = iter->second.setFunc ? true : false;
+      found = true;
+    }
+  }
 
-  if ( iter != mRegisteredProperties.end() )
+  // if not found, continue to base
+  if( !found )
   {
-    if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+    if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
     {
-      writable = true; // animatable property is writable
+      // call base type recursively
+      writable = mBaseType->IsPropertyWritable( index );
     }
     else
     {
-      writable = iter->second.setFunc ? true : false;
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   }
-  else
+
+  return writable;
+}
+
+bool TypeInfo::IsPropertyAnimatable( Property::Index index ) const
+{
+  bool animatable = false;
+  bool found = false;
+
+  // default property?
+  if ( ( index < DEFAULT_PROPERTY_MAX_COUNT ) && mDefaultProperties )
   {
-    Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-    if ( base )
+    found = GetDefaultPropertyField( mDefaultProperties, mDefaultPropertyCount,index, &Dali::PropertyDetails::animatable, animatable );
+  }
+  else if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
+  {
+    // Type Registry event-thread only properties are not animatable.
+    animatable = false;
+    found = true;
+  }
+  else if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  {
+    animatable = true;
+    found = true;
+  }
+
+  // if not found, continue to base
+  if( !found )
+  {
+    if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
     {
-      writable = GetImplementation(base).IsPropertyWritable( index );
+      // call base type recursively
+      animatable = mBaseType->IsPropertyAnimatable( index );
     }
     else
     {
-      DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   }
 
-  return writable;
+  return animatable;
 }
 
-Property::Type TypeInfo::GetPropertyType( Property::Index index ) const
+bool TypeInfo::IsPropertyAConstraintInput( Property::Index index ) const
 {
-  Property::Type type( Property::NONE );
+  bool constraintInput = false;
+  bool found = false;
 
-  RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
-                                                          PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+  // default property?
+  if ( ( index < DEFAULT_PROPERTY_MAX_COUNT ) && mDefaultProperties )
+  {
+    found = GetDefaultPropertyField( mDefaultProperties, mDefaultPropertyCount,index, &Dali::PropertyDetails::constraintInput, constraintInput );
+  }
+  else if ( ( index >= PROPERTY_REGISTRATION_START_INDEX ) && ( index <= PROPERTY_REGISTRATION_MAX_INDEX ) )
+  {
+    // Type Registry event-thread only properties cannot be used as constraint input
+    constraintInput = false;
+    found = true;
+  }
+  else if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+  {
+    constraintInput = true;
+    found = true;
+  }
 
-  if ( iter != mRegisteredProperties.end() )
+  // if not found, continue to base
+  if( !found )
   {
-    if( iter->second.componentIndex == Property::INVALID_COMPONENT_INDEX )
+    if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
     {
-      type = iter->second.type;
+      // call base type recursively
+      constraintInput = mBaseType->IsPropertyAConstraintInput( index );
     }
     else
     {
-      // If component index is set, then we should return FLOAT
-      type = Property::FLOAT;
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   }
+
+  return constraintInput;
+}
+
+
+Property::Type TypeInfo::GetPropertyType( Property::Index index ) const
+{
+  Property::Type type( Property::NONE );
+  bool found = false;
+
+  // default property?
+  if ( ( index < DEFAULT_PROPERTY_MAX_COUNT ) && mDefaultProperties )
+  {
+    found = GetDefaultPropertyField( mDefaultProperties, mDefaultPropertyCount,index, &Dali::PropertyDetails::type, type );
+  }
   else
   {
-    Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-    if ( base )
+    RegisteredPropertyContainer::const_iterator iter = find_if( mRegisteredProperties.begin(), mRegisteredProperties.end(),
+                                                            PairFinder< Property::Index, RegisteredPropertyPair >( index ) );
+
+    if ( iter != mRegisteredProperties.end() )
+    {
+      if( iter->second.componentIndex == Property::INVALID_COMPONENT_INDEX )
+      {
+        type = iter->second.type;
+        found = true;
+      }
+      else
+      {
+        // If component index is set, then we should return FLOAT
+        type = Property::FLOAT;
+        found = true;
+      }
+    }
+  }
+
+  if( !found )
+  {
+    if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
     {
-      type = GetImplementation(base).GetPropertyType( index );
+      // call base type recursively
+      type = mBaseType->GetPropertyType( index );
     }
     else
     {
-      DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
+      DALI_LOG_ERROR( "Property index %d not found\n", index );
     }
   }
 
@@ -765,14 +937,17 @@ Property::Value TypeInfo::GetPropertyDefaultValue( Property::Index index ) const
 {
   PropertyDefaultValueContainer::const_iterator iter = find_if( mPropertyDefaultValues.begin(), mPropertyDefaultValues.end(),
                                                     PairFinder< Property::Index, PropertyDefaultValuePair >( index ) );
-  if( iter !=  mPropertyDefaultValues.end() )
+  if( iter != mPropertyDefaultValues.end() )
   {
     return iter->second;
   }
-  else
+  // we didn't have a value so ask base
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    return Property::Value( GetPropertyType( index ) );
+    // call base type recursively
+    return mBaseType->GetPropertyDefaultValue( index );
   }
+  return Property::Value(); // return none
 }
 
 void TypeInfo::SetProperty( BaseObject *object, Property::Index index, const Property::Value& value ) const
@@ -796,17 +971,14 @@ void TypeInfo::SetProperty( BaseObject *object, Property::Index index, const Pro
       }
     }
   }
+  else if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
+  {
+    // call base type recursively
+    mBaseType->SetProperty( object, index, value );
+  }
   else
   {
-    Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-    if ( base )
-    {
-      GetImplementation(base).SetProperty( object, index, value );
-    }
-    else
-    {
-      DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
-    }
+    DALI_LOG_ERROR( "Property index %d not found\n", index );
   }
 }
 
@@ -828,17 +1000,14 @@ void TypeInfo::SetProperty( BaseObject *object, const std::string& name, const P
       iter->second.setFunc( object, iter->first, value );
     }
   }
+  else if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
+  {
+    // call base type recursively
+    mBaseType->SetProperty( object, name, value );
+  }
   else
   {
-    Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-    if ( base )
-    {
-      GetImplementation(base).SetProperty( object, name, value );
-    }
-    else
-    {
-      DALI_ASSERT_ALWAYS( ! "Cannot find property name" );
-    }
+    DALI_LOG_ERROR( "Property %s not found", name.c_str() );
   }
 }
 
@@ -865,13 +1034,14 @@ Property::Value TypeInfo::GetProperty( const BaseObject *object, Property::Index
     }
   }
 
-  Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-  if ( base )
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    return GetImplementation( base ).GetProperty( object, index );
+    // call base type recursively
+    return mBaseType->GetProperty( object, index );
   }
 
-  DALI_ASSERT_ALWAYS( ! "Cannot find property index" ); // use the same assert as Object
+  DALI_LOG_ERROR( "Property index %d not found\n", index );
+  return Property::Value();
 }
 
 Property::Value TypeInfo::GetProperty( const BaseObject *object, const std::string& name ) const
@@ -898,13 +1068,14 @@ Property::Value TypeInfo::GetProperty( const BaseObject *object, const std::stri
     }
   }
 
-  Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
-  if ( base )
+  if( GetBaseType( mBaseType, mTypeRegistry, mBaseTypeName ) )
   {
-    return GetImplementation( base ).GetProperty( object, name );
+    // call base type recursively
+    return mBaseType->GetProperty( object, name );
   }
 
-  DALI_ASSERT_ALWAYS( ! "Cannot find property name" );
+  DALI_LOG_ERROR( "Property %s not found", name.c_str() );
+  return Property::Value();
 }
 
 } // namespace Internal
index 3587ede..f691c4d 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_TYPE_INFO_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/type-info.h>
+#include <dali/public-api/object/property.h>
 #include <dali/devel-api/object/csharp-type-info.h>
+#include <dali/internal/event/object/default-property-metadata.h>
 
 namespace Dali
 {
 
 namespace Internal
 {
+class PropertyDetails;
+class TypeRegistry;
 
 /**
  * A TypeInfo class to support registered type creation, and introspection of available
@@ -43,13 +47,15 @@ namespace Internal
 class TypeInfo : public BaseObject
 {
 public:
+
   /**
    * Create TypeInfo
    * @param [name] the registered name
    * @param [baseName] the base type registered name
    * @param [creator] the creator function for this type
    */
-  TypeInfo(const std::string& name, const std::string& baseName, Dali::TypeInfo::CreateFunction creator);
+  TypeInfo( const std::string& name, const std::string& baseName, Dali::TypeInfo::CreateFunction creator,
+            const Dali::PropertyDetails* defaultProperties, Property::Index defaultPropertyCount );
 
   /**
    * Create TypeInfo for a csharp object
@@ -57,12 +63,12 @@ public:
    * @param [baseName] the base type registered name
    * @param [creator] the creator function for this type
    */
-  TypeInfo(const std::string& name, const std::string& baseName, Dali::CSharpTypeInfo::CreateFunction creator);
+  TypeInfo( const std::string& name, const std::string& baseName, Dali::CSharpTypeInfo::CreateFunction creator );
 
   /**
-   *
+   * Destructor
    */
-  ~TypeInfo();
+  virtual ~TypeInfo();
 
   /**
    * @copydoc Dali::TypeInfo::GetName
@@ -87,32 +93,27 @@ public:
   /**
    * @copydoc Dali::TypeInfo::GetActionCount
    */
-  size_t GetActionCount() const;
+  uint32_t GetActionCount() const;
 
   /**
    * @copydoc Dali::TypeInfo::GetActionName
    */
-  std::string GetActionName(size_t index) const;
+  std::string GetActionName( uint32_t index ) const;
 
   /**
    * @copydoc Dali::TypeInfo::GetSignalCount
    */
-  size_t GetSignalCount() const;
+  uint32_t GetSignalCount() const;
 
   /**
    * @copydoc Dali::TypeInfo::GetSignalName
    */
-  std::string GetSignalName(size_t index) const;
+  std::string GetSignalName( uint32_t index ) const;
 
   /**
    * @copydoc Dali::TypeInfo::GetPropertyCount
    */
-  size_t GetPropertyCount() const;
-
-  /**
-   * @copydoc Dali::TypeInfo::GetPropertyName
-   */
-  std::string GetPropertyName(size_t index) const;
+  uint32_t GetPropertyCount() const;
 
   /**
    * Adds the property indices to the container specified.
@@ -122,8 +123,17 @@ public:
 
   /**
    * @copydoc Dali::TypeInfo::GetPropertyName() const
+   * this API exists to keep the old public API, which cannot be changed
    */
-  const std::string& GetPropertyName( Property::Index index ) const;
+  const std::string& GetRegisteredPropertyName( Property::Index index ) const;
+
+  /**
+   * Returns the property name for given index
+   *
+   * @param index of the property
+   * @return name or empty string
+   */
+  std::string GetPropertyName( Property::Index index ) const;
 
   /*
    * Add an action function
@@ -142,7 +152,7 @@ public:
    * @param[in] name The name of the property.
    * @param[in] index The index of the property.
    * @param[in] type The Property::Type.
-   * @param[in] setFunc The function to call to set the property (Can be NULL).
+   * @param[in] setFunc The function to call to set the property (Can be nullptr).
    * @param[in] getFunc The function to call to retrieve the value of the property.
    */
   void AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::TypeInfo::SetPropertyFunction setFunc, Dali::TypeInfo::GetPropertyFunction getFunc );
@@ -152,7 +162,7 @@ public:
    * @param[in] name The name of the property.
    * @param[in] index The index of the property.
    * @param[in] type The Property::Type.
-   * @param[in] setFunc The function to call to set the property (Can be NULL).
+   * @param[in] setFunc The function to call to set the property (Can be nullptr).
    * @param[in] getFunc The function to call to retrieve the value of the property.
    */
   void AddProperty( const std::string& name, Property::Index index, Property::Type type, Dali::CSharpTypeInfo::SetPropertyFunction setFunc, Dali::CSharpTypeInfo::GetPropertyFunction getFunc);
@@ -181,7 +191,7 @@ public:
    * @param[in] baseIndex The index of the base animatable property
    * @param[in] component The index The index of the component.
    */
-  void AddAnimatablePropertyComponent( const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex );
+  void AddAnimatablePropertyComponent( const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex );
 
   /**
    * Adds a child property to the type.
@@ -230,16 +240,27 @@ public:
    * @param[in] index The index of the property.
    * @return The component index associated with that property index.
    */
-  int GetComponentIndex( Property::Index index ) const;
+  int32_t GetComponentIndex( Property::Index index ) const;
 
   /**
-   * Checks if there is a setter for the property. If there is then it is writable.
    * @param[in] index The property index.
    * @return True, if writable, false otherwise.
    */
   bool IsPropertyWritable( Property::Index index ) const;
 
   /**
+   * @param[in] index The property index.
+   * @return True, if animatable, false otherwise.
+   */
+  bool IsPropertyAnimatable( Property::Index index ) const;
+
+  /**
+   * @param[in] index The property index.
+   * @return True, if a constraint input, false otherwise.
+   */
+  bool IsPropertyAConstraintInput( Property::Index index ) const;
+
+  /**
    * Retrieve the Property::Type of the property at the given index.
    * @param[in] index The property index.
    * @return The Property::Type at that index.
@@ -316,20 +337,10 @@ private:
 
   struct RegisteredProperty
   {
-    RegisteredProperty()
-    : type( Property::NONE ),
-      setFunc( NULL ),
-      getFunc( NULL ),
-      name(),
-      basePropertyIndex(Property::INVALID_INDEX),
-      componentIndex(Property::INVALID_COMPONENT_INDEX)
-    {
-    }
-
-    RegisteredProperty( Property::Type propType, const std::string& propName, Property::Index basePropertyIndex, int componentIndex )
+    RegisteredProperty( Property::Type propType, const std::string& propName, Property::Index basePropertyIndex, int32_t componentIndex )
         : type( propType ),
-          setFunc( NULL ),
-          getFunc( NULL ),
+          setFunc( nullptr ),
+          getFunc( nullptr ),
           name( propName ),
           basePropertyIndex(basePropertyIndex),
           componentIndex(componentIndex)
@@ -357,21 +368,20 @@ private:
     {
     }
 
-
-    Property::Type type;
+    Property::Type type = Property::NONE;
     union
     {
-      Dali::TypeInfo::SetPropertyFunction setFunc;
-      Dali::CSharpTypeInfo::SetPropertyFunction cSharpSetFunc;
+      Dali::TypeInfo::SetPropertyFunction setFunc = nullptr;
+      Dali::CSharpTypeInfo::SetPropertyFunction cSharpSetFunc; // only one field can be initialized but this will have same value anyways
     };
     union
     {
-      Dali::TypeInfo::GetPropertyFunction getFunc;
-      Dali::CSharpTypeInfo::GetPropertyFunction cSharpGetFunc;
+      Dali::TypeInfo::GetPropertyFunction getFunc = nullptr;
+      Dali::CSharpTypeInfo::GetPropertyFunction cSharpGetFunc; // only one field can be initialized but this will have same value anyways
     };
     std::string name;
-    Property::Index basePropertyIndex;
-    int componentIndex;
+    Property::Index basePropertyIndex = Property::INVALID_INDEX;
+    int32_t componentIndex = Property::INVALID_COMPONENT_INDEX;
   };
 
   typedef std::pair<std::string, Dali::TypeInfo::SignalConnectorFunction > ConnectionPair;
@@ -384,7 +394,6 @@ private:
   typedef std::vector< RegisteredPropertyPair > RegisteredPropertyContainer;
   typedef std::vector< PropertyDefaultValuePair > PropertyDefaultValueContainer;
 
-
   /**
    * Append properties from registeredProperties onto indices.
    * @param[in,out] indices The vector to append indices onto
@@ -395,19 +404,23 @@ private:
 
 private:
 
+  TypeRegistry& mTypeRegistry;
+  mutable Internal::TypeInfo* mBaseType; // allow changing from const methods, initialised inside constructor
   std::string mTypeName;
   std::string mBaseTypeName;
-  bool        mCSharpType:1;    ///< Whether this type info is for a CSharp control (instead of C++)
   union
   {
-    Dali::TypeInfo::CreateFunction mCreate;
-    Dali::CSharpTypeInfo::CreateFunction mCSharpCreate;
+    Dali::TypeInfo::CreateFunction mCreate = nullptr;
+    Dali::CSharpTypeInfo::CreateFunction mCSharpCreate; // only one field can be initialized but this will have same value anyways
   };
   ActionContainer mActions;
   ConnectorContainer mSignalConnectors;
   RegisteredPropertyContainer mRegisteredProperties;
   RegisteredPropertyContainer mRegisteredChildProperties;
   PropertyDefaultValueContainer mPropertyDefaultValues;
+  const Dali::PropertyDetails* mDefaultProperties = nullptr;
+  Property::Index mDefaultPropertyCount = 0;
+  bool mCSharpType = false;    ///< Whether this type info is for a CSharp control (instead of C++)
 };
 
 } // namespace Internal
index 66b9fcb..595f544 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -61,49 +61,47 @@ TypeRegistry::~TypeRegistry()
   mRegistryLut.clear();
 }
 
-Dali::TypeInfo TypeRegistry::GetTypeInfo( const std::string& uniqueTypeName )
+TypeRegistry::TypeInfoPointer TypeRegistry::GetTypeInfo( const std::string& uniqueTypeName )
 {
   for( auto&& iter : mRegistryLut )
   {
     // Note! mRegistryLut contains Dali::TypeInfo handles, so cannot call GetTypeName()
     // as it calls us back resulting in infinite loop (GetTypeName is in BaseHandle part)
-    if( GetImplementation( iter ).GetName() == uniqueTypeName )
+    if( iter->GetName() == uniqueTypeName )
     {
       return iter;
     }
   }
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Cannot find requested type '%s'\n", uniqueTypeName.c_str() );
 
-  return Dali::TypeInfo();
+  return TypeRegistry::TypeInfoPointer();
 }
 
-Dali::TypeInfo TypeRegistry::GetTypeInfo( const std::type_info& registerType )
+TypeRegistry::TypeInfoPointer TypeRegistry::GetTypeInfo( const std::type_info& registerType )
 {
   std::string typeName = DemangleClassName( registerType.name() );
 
   return GetTypeInfo( typeName );
 }
 
-size_t TypeRegistry::GetTypeNameCount() const
+uint32_t TypeRegistry::GetTypeNameCount() const
 {
-  return mRegistryLut.size();
+  return static_cast<uint32_t>( mRegistryLut.size() );
 }
 
-
-std::string TypeRegistry::GetTypeName( size_t index ) const
+std::string TypeRegistry::GetTypeName( uint32_t index ) const
 {
   std::string name;
 
   if( index < mRegistryLut.size() )
   {
-    name = GetImplementation( mRegistryLut[ index ] ).GetName();
+    name = mRegistryLut[ index ]->GetName();
   }
 
   return name;
 }
 
-
-bool TypeRegistry::Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
+std::string TypeRegistry::Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
                              Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit )
 {
   std::string uniqueTypeName  = DemangleClassName( theTypeInfo.name() );
@@ -111,23 +109,33 @@ bool TypeRegistry::Register( const std::type_info& theTypeInfo, const std::type_
   return Register( uniqueTypeName, baseTypeInfo, createInstance, callCreateOnInit );
 }
 
-bool TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_info& baseTypeInfo,
-                             Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit )
+std::string TypeRegistry::Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
+                             Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit,
+                             const Dali::PropertyDetails* defaultProperties, Property::Index defaultPropertyCount )
+{
+  std::string uniqueTypeName  = DemangleClassName( theTypeInfo.name() );
+
+  return Register( uniqueTypeName, baseTypeInfo, createInstance, callCreateOnInit, defaultProperties, defaultPropertyCount );
+}
+
+std::string TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_info& baseTypeInfo,
+                             Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit,
+                             const Dali::PropertyDetails* defaultProperties, Property::Index defaultPropertyCount )
 {
   std::string baseTypeName = DemangleClassName( baseTypeInfo.name() );
 
   // check for duplicates using uniqueTypeName
   for( auto&& iter : mRegistryLut )
   {
-    if( GetImplementation( iter ).GetName() == uniqueTypeName )
+    if( iter->GetName() == uniqueTypeName )
     {
       DALI_LOG_WARNING( "Duplicate name in TypeRegistry for '%s'\n", + uniqueTypeName.c_str() );
       DALI_ASSERT_ALWAYS( !"Duplicate type name in Type Registration" );
-      return false;
+      return uniqueTypeName; // never actually happening due to the assert
     }
   }
 
-  mRegistryLut.push_back( Dali::TypeInfo( new Internal::TypeInfo( uniqueTypeName, baseTypeName, createInstance ) ) );
+  mRegistryLut.push_back( TypeRegistry::TypeInfoPointer( new Internal::TypeInfo( uniqueTypeName, baseTypeName, createInstance, defaultProperties, defaultPropertyCount ) ) );
   DALI_LOG_INFO( gLogFilter, Debug::Concise, "Type Registration %s(%s)\n", uniqueTypeName.c_str(), baseTypeName.c_str() );
 
   if( callCreateOnInit )
@@ -135,10 +143,10 @@ bool TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_
     mInitFunctions.push_back(createInstance);
   }
 
-  return true;
+  return uniqueTypeName;
 }
 
-bool TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_info& baseTypeInfo,
+void TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_info& baseTypeInfo,
     Dali::CSharpTypeInfo::CreateFunction createInstance )
 {
   std::string baseTypeName = DemangleClassName( baseTypeInfo.name() );
@@ -146,18 +154,16 @@ bool TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_
   // check for duplicates using uniqueTypeName
   for( auto&& iter : mRegistryLut )
   {
-    if( GetImplementation( iter ).GetName() == uniqueTypeName )
+    if( iter->GetName() == uniqueTypeName )
     {
       DALI_LOG_WARNING( "Duplicate name in TypeRegistry for '%s'\n", + uniqueTypeName.c_str() );
       DALI_ASSERT_ALWAYS( !"Duplicate type name in Type Registration" );
-      return false;
+      return; // never actually happening due to the assert
     }
   }
 
-  mRegistryLut.push_back( Dali::TypeInfo( new Internal::TypeInfo( uniqueTypeName, baseTypeName, createInstance ) ) );
+  mRegistryLut.push_back( TypeRegistry::TypeInfoPointer( new Internal::TypeInfo( uniqueTypeName, baseTypeName, createInstance ) ) );
   DALI_LOG_INFO( gLogFilter, Debug::Concise, "Type Registration %s(%s)\n", uniqueTypeName.c_str(), baseTypeName.c_str() );
-
-  return true;
 }
 
 void TypeRegistry::CallInitFunctions(void) const
@@ -177,10 +183,9 @@ void TypeRegistry::RegisterSignal( TypeRegistration& typeRegistration, const std
 {
   for( auto&& iter : mRegistryLut )
   {
-    auto&& impl = GetImplementation( iter );
-    if( impl.GetName() == typeRegistration.RegisteredName() )
+    if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      impl.AddConnectorFunction( name, func );
+      iter->AddConnectorFunction( name, func );
       break;
     }
   }
@@ -190,10 +195,9 @@ bool TypeRegistry::RegisterAction( TypeRegistration& typeRegistration, const std
 {
   for( auto&& iter : mRegistryLut )
   {
-    auto&& impl = GetImplementation( iter );
-    if( impl.GetName() == typeRegistration.RegisteredName() )
+    if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      impl.AddActionFunction( name, f );
+      iter->AddActionFunction( name, f );
       return true;
     }
   }
@@ -204,10 +208,9 @@ bool TypeRegistry::RegisterProperty( TypeRegistration& typeRegistration, const s
 {
   for( auto&& iter : mRegistryLut )
   {
-    auto&& impl = GetImplementation( iter );
-    if( impl.GetName() == typeRegistration.RegisteredName() )
+    if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      impl.AddProperty( name, index, type, setFunc, getFunc );
+      iter->AddProperty( name, index, type, setFunc, getFunc );
       return true;
     }
   }
@@ -219,10 +222,9 @@ bool TypeRegistry::RegisterProperty( const std::string& objectName, const std::s
 {
   for( auto&& iter : mRegistryLut )
   {
-    auto&& impl = GetImplementation( iter );
-    if( impl.GetName() == objectName )
+    if( iter->GetName() == objectName )
     {
-      impl.AddProperty( name, index, type, setFunc, getFunc );
+      iter->AddProperty( name, index, type, setFunc, getFunc );
       return true;
     }
   }
@@ -235,10 +237,9 @@ bool TypeRegistry::RegisterAnimatableProperty( TypeRegistration& typeRegistratio
 {
   for( auto&& iter : mRegistryLut )
   {
-    auto&& impl = GetImplementation( iter );
-    if( impl.GetName() == typeRegistration.RegisteredName() )
+    if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      impl.AddAnimatableProperty( name, index, type );
+      iter->AddAnimatableProperty( name, index, type );
       return true;
     }
   }
@@ -250,10 +251,9 @@ bool TypeRegistry::RegisterAnimatableProperty( TypeRegistration& typeRegistratio
 {
   for( auto&& iter : mRegistryLut )
   {
-    auto&& impl = GetImplementation( iter );
-    if( impl.GetName() == typeRegistration.RegisteredName() )
+    if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      impl.AddAnimatableProperty( name, index, value );
+      iter->AddAnimatableProperty( name, index, value );
       return true;
     }
   }
@@ -265,10 +265,9 @@ bool TypeRegistry::RegisterAnimatablePropertyComponent( TypeRegistration& typeRe
 {
   for( auto&& iter : mRegistryLut )
   {
-    auto&& impl = GetImplementation( iter );
-    if( impl.GetName() == typeRegistration.RegisteredName() )
+    if( iter->GetName() == typeRegistration.RegisteredName() )
     {
-      impl.AddAnimatablePropertyComponent( name, index, baseIndex, componentIndex );
+      iter->AddAnimatablePropertyComponent( name, index, baseIndex, componentIndex );
       return true;
     }
   }
@@ -280,10 +279,9 @@ bool TypeRegistry::RegisterChildProperty( const std::string& registeredType, con
 {
   for( auto&& iter : mRegistryLut )
   {
-    auto&& impl = GetImplementation( iter );
-    if( impl.GetName() == registeredType )
+    if( iter->GetName() == registeredType )
     {
-      impl.AddChildProperty( name, index, type );
+      iter->AddChildProperty( name, index, type );
       return true;
     }
   }
@@ -300,17 +298,14 @@ bool TypeRegistry::DoActionTo( BaseObject * const object, const std::string& act
 {
   bool done = false;
 
-  Dali::TypeInfo type = GetTypeInfo( object );
+  auto&& type = GetTypeInfo( object );
+
+  // DoActionTo recurses through base classes
+  done = type->DoActionTo( object, actionName, properties );
 
-  while( type )
+  if( !done )
   {
-    auto&& impl = GetImplementation( type );
-    if( impl.DoActionTo( object, actionName, properties ) )
-    {
-      done = true;
-      break;
-    }
-    type = GetTypeInfo( impl.GetBaseName() );
+    DALI_LOG_WARNING("Type '%s' cannot do action '%s'\n", type->GetName().c_str(), actionName.c_str());
   }
 
   return done;
@@ -320,21 +315,14 @@ bool TypeRegistry::ConnectSignal( BaseObject* object, ConnectionTrackerInterface
 {
   bool connected( false );
 
-  Dali::TypeInfo type = GetTypeInfo( object );
+  auto&& type = GetTypeInfo( object );
 
-  while( type )
-  {
-    auto&& impl = GetImplementation( type );
-    connected = impl.ConnectSignal( object, connectionTracker, signalName, functor );
-    if( connected )
-    {
-      break;
-    }
-    type = GetTypeInfo( impl.GetBaseName() );
-  }
+  // Connect iterates through base classes
+  connected = type->ConnectSignal( object, connectionTracker, signalName, functor );
 
   if( !connected )
   {
+    DALI_LOG_WARNING("Type '%s' signal '%s' connection failed \n", type->GetName().c_str(), signalName.c_str());
     // Ownership of functor was not passed to Dali::CallbackBase, so clean-up now
     delete functor;
   }
@@ -342,17 +330,23 @@ bool TypeRegistry::ConnectSignal( BaseObject* object, ConnectionTrackerInterface
   return connected;
 }
 
-Dali::TypeInfo TypeRegistry::GetTypeInfo(const Dali::BaseObject * const pBaseObject)
+TypeRegistry::TypeInfoPointer TypeRegistry::GetTypeInfo(const Dali::BaseObject * const pBaseObject)
 {
-  Dali::TypeInfo type;
+  TypeInfoPointer type;
 
   // test for custom actor which has another indirection to get to the type hiearchy we're after
   const Dali::Internal::CustomActor * const pCustom = dynamic_cast<const Dali::Internal::CustomActor*>(pBaseObject);
 
-  if(pCustom)
+  if( pCustom )
   {
     const Dali::CustomActorImpl& custom = pCustom->GetImplementation();
     type = GetTypeInfo( typeid( custom ) );
+    if( !type )
+    {
+      // the most derived type is a descendant of custom actor but has not registered itself
+      // so we'll just treat it as a custom actor for now so it "inherits" all of actors properties, actions and signals
+      type = GetTypeInfo( typeid( Dali::Internal::CustomActor ) );
+    }
   }
   else
   {
index e097c76..f1f6eec 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_TYPE_REGISTRY_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/internal/event/common/type-info-impl.h>
+#include <dali/internal/event/object/default-property-metadata.h>
 
 namespace Dali
 {
@@ -31,8 +32,7 @@ namespace Dali
 namespace Internal
 {
 
-////////////////////////////////////////////////////////////////////////////////
-class TypeRegistry;
+class PropertyDetails;
 
 /*
 * @copydoc Dali::TypeRegistry
@@ -40,64 +40,84 @@ class TypeRegistry;
 class TypeRegistry : public Dali::BaseObject
 {
 public:
+
+  // using intrusive pointer instead of handles internally as they are considerably cheaper
+  using TypeInfoPointer = IntrusivePtr<Dali::Internal::TypeInfo>;
+
   /**
    * Get the TypeRegistry
    */
   static TypeRegistry *Get();
 
-  /*
+  /**
    * @copydoc Dali::TypeRegistry::GetTypeInfo
    */
-  Dali::TypeInfo GetTypeInfo( const std::string &uniqueTypeName );
+  TypeInfoPointer GetTypeInfo( const std::string &uniqueTypeName );
 
-  /*
+  /**
    * @copydoc Dali::TypeRegistry::GetTypeInfo
    */
-  Dali::TypeInfo GetTypeInfo( const std::type_info& registerType );
+  TypeInfoPointer GetTypeInfo( const std::type_info& registerType );
 
-  /*
+  /**
    * @copydoc Dali::TypeRegistry::GetTypeNameCount
    */
-  size_t GetTypeNameCount() const;
+  uint32_t GetTypeNameCount() const;
 
-  /*
+  /**
    * @copydoc Dali::TypeRegistry::GetTypeName
    */
-  std::string GetTypeName(size_t index) const;
+  std::string GetTypeName( uint32_t index ) const;
 
-  /*
-   * Register a creation function under a unique name.
+  /**
+   * Register a type
+   *
    * @param [in] theTypeInfo Type info for the type to be registered
    * @param [in] baseTypeInfo Type info for its base class
    * @param [in] createInstance Instance creation function
-   * @param [in] callCreateOnInit If true call createInstance on dali initialisation
-   * @return true if the name could be registered.
+   * @param [in] callCreateOnInit If true call createInstance on DALi initialisation
+   * @return the name of the registered type.
    */
-  bool Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
-                 Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit );
+  std::string Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
+                        Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit );
 
-  /*
-   * Register a creation function under a unique name.
-   * @param [in] name The name type to be registered (must be unique)
+  /**
+   * Register a type
+   *
+   * @param [in] theTypeInfo Type info for the type to be registered
    * @param [in] baseTypeInfo Type info for its base class
    * @param [in] createInstance Instance creation function
-   * @param [in] callCreateOnInit If true call createInstance on dali initialisation
-   * @return true if the name could be registered.
+   * @param [in] callCreateOnInit If true call createInstance on DALi initialisation
+   * @param [in] defaultProperties the table of default property metadata
+   * @param [in] defaultPropertyCount count of default properties
+   * @return the name of the registered type.
    */
-  bool Register( const std::string& name, const std::type_info& baseTypeInfo,
-                 Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit  );
+  std::string Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
+                        Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit,
+                        const Dali::PropertyDetails* defaultProperties, Property::Index defaultPropertyCount );
 
-  /*
-   * Register a creation function under a unique name (used by C# Custom controls).
-   * @param [in] name The name type to be registered (must be unique)
+  /**
+   * Register a type
+   *
+   * @param [in] theTypeInfo Type info for the type to be registered
    * @param [in] baseTypeInfo Type info for its base class
    * @param [in] createInstance Instance creation function
-   * @return true if the name could be registered.
+   * @param [in] callCreateOnInit If true call createInstance on DALi initialisation
+   * @param [in] defaultProperties the table of default property metadata
+   * @param [in] defaultPropertyCount count of default properties
+   * @return the name of the registered type.
+   */
+  std::string Register( const std::string& name, const std::type_info& baseTypeInfo,
+                        Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit,
+                        const Dali::PropertyDetails* defaultProperties = nullptr, Property::Index defaultPropertyCount = 0 );
+
+  /**
+   * @copydoc CSharpTypeRegistry::TypeRegistration( const std::string&, const std::type_info&, TypeInfo::CreateFunction );
    */
-  bool Register( const std::string& name, const std::type_info& baseTypeInfo,
+  void Register( const std::string& name, const std::type_info& baseTypeInfo,
                  Dali::CSharpTypeInfo::CreateFunction createInstance );
 
-  /*
+  /**
    * Register a signal connector function to a type
    * @param [in] typeRegistration TypeRegistration object used to register the type
    * @param [in] name Signal name
@@ -105,14 +125,14 @@ public:
    */
   void RegisterSignal( TypeRegistration& typeRegistration, const std::string& name, Dali::TypeInfo::SignalConnectorFunction func );
 
-  /*
+  /**
    * Register an action function to a type
    * @param [in] registered TypeRegistration object used to register the type
    * @param [in] name Action name
    * @param [in] f Action function
    * @return true if registered
    */
-  bool RegisterAction( TypeRegistration &registered, const std::string &name, Dali::TypeInfo::ActionFunction f);
+  bool RegisterAction( TypeRegistration& registered, const std::string& name, Dali::TypeInfo::ActionFunction f );
 
   /**
    * Register an event-thread only property with a type
@@ -190,7 +210,7 @@ public:
    */
   bool RegisterChildProperty( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Type type );
 
-  /*
+  /**
    * @copydoc Dali::Internal::TypeInfo::DoActionTo
    * Walks all base types until it finds a doer.
    */
@@ -201,14 +221,14 @@ public:
    */
   bool ConnectSignal( BaseObject* object, ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functor );
 
-  /*
+  /**
    * Return the type info for a given BaseObject pointer
    * @param [in] pBaseObject Pointer to a BaseObject
    * @return TypeInfo for the BaseObject.
    */
-  Dali::TypeInfo GetTypeInfo(const Dali::BaseObject * const pBaseObject);
+  TypeInfoPointer GetTypeInfo(const Dali::BaseObject * const pBaseObject);
 
-  /*
+  /**
    * Calls any type creation functions that have been flagged as initialization functions
    */
   void CallInitFunctions(void) const;
@@ -226,7 +246,7 @@ private:
   /*
    * Mapping from type name to TypeInfo
    */
-  std::vector< Dali::TypeInfo > mRegistryLut;
+  std::vector< TypeInfoPointer > mRegistryLut;
 
   std::vector< Dali::TypeInfo::CreateFunction > mInitFunctions;
 
index ae4e5d7..13fda26 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ ShaderFactory::ShaderFactory()
 ShaderFactory::~ShaderFactory()
 {
   // Let all the cached objects destroy themselves:
-  for( int i = 0, cacheSize = mShaderBinaryCache.Size(); i < cacheSize; ++i )
+  for( std::size_t i = 0, cacheSize = mShaderBinaryCache.Size(); i < cacheSize; ++i )
   {
     if( mShaderBinaryCache[i] )
     {
@@ -86,7 +86,7 @@ ShaderDataPtr ShaderFactory::Load( const std::string& vertexSource, const std::s
   ShaderDataPtr shaderData;
 
   /// Check a cache of previously loaded shaders:
-  for( int i = 0, cacheSize = mShaderBinaryCache.Size(); i < cacheSize; ++i )
+  for( std::size_t i = 0, cacheSize = mShaderBinaryCache.Size(); i < cacheSize; ++i )
   {
     if( mShaderBinaryCache[i]->GetHashValue() == shaderHash )
     {
@@ -132,7 +132,7 @@ void ShaderFactory::SaveBinary( Internal::ShaderDataPtr shaderData )
 
   ThreadLocalStorage& tls = ThreadLocalStorage::Get();
   Integration::PlatformAbstraction& platformAbstraction = tls.GetPlatformAbstraction();
-  const bool saved = platformAbstraction.SaveShaderBinaryFile( binaryShaderFilename, &shaderData->GetBuffer()[0], shaderData->GetBufferSize() );
+  const bool saved = platformAbstraction.SaveShaderBinaryFile( binaryShaderFilename, &shaderData->GetBuffer()[0], static_cast<unsigned int>( shaderData->GetBufferSize() ) ); // don't expect buffer larger than unsigned int
 
   // Save the binary into to memory cache:
   MemoryCacheInsert( *shaderData );
index 560b48a..d19ff67 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,12 +55,13 @@ static const std::size_t INITIAL_BUFFER_SIZE = MAX_MESSAGE_SIZE * INITIAL_MIN_CA
 
 } // unnamed namespace
 
-EventProcessor::EventProcessor(Stage& stage, NotificationManager& /* notificationManager */, GestureEventProcessor& gestureEventProcessor)
-: mTouchEventProcessor(stage),
-  mHoverEventProcessor(stage),
-  mGestureEventProcessor(gestureEventProcessor),
-  mKeyEventProcessor(stage),
-  mWheelEventProcessor(stage),
+EventProcessor::EventProcessor( Scene& scene, GestureEventProcessor& gestureEventProcessor )
+: mScene( scene ),
+  mTouchEventProcessor( scene ),
+  mHoverEventProcessor( scene ),
+  mGestureEventProcessor( gestureEventProcessor ),
+  mKeyEventProcessor( scene ),
+  mWheelEventProcessor( scene ),
   mEventQueue0( INITIAL_BUFFER_SIZE ),
   mEventQueue1( INITIAL_BUFFER_SIZE ),
   mCurrentEventQueue( &mEventQueue0 )
@@ -93,7 +94,7 @@ void EventProcessor::QueueEvent( const Event& event )
       typedef Integration::TouchEvent DerivedType;
 
       // Reserve some memory inside the message queue
-      unsigned int* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
+      uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
 
       // Construct message in the message queue memory; note that delete should not be called on the return value
       new (slot) DerivedType( static_cast<const DerivedType&>(event) );
@@ -106,7 +107,7 @@ void EventProcessor::QueueEvent( const Event& event )
       typedef Integration::HoverEvent DerivedType;
 
       // Reserve some memory inside the message queue
-      unsigned int* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
+      uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
 
       // Construct message in the message queue memory; note that delete should not be called on the return value
       new (slot) DerivedType( static_cast<const DerivedType&>(event) );
@@ -119,7 +120,7 @@ void EventProcessor::QueueEvent( const Event& event )
       typedef Integration::KeyEvent DerivedType;
 
       // Reserve some memory inside the message queue
-      unsigned int* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
+      uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
 
       // Construct message in the message queue memory; note that delete should not be called on the return value
       new (slot) DerivedType( static_cast<const DerivedType&>(event) );
@@ -132,7 +133,7 @@ void EventProcessor::QueueEvent( const Event& event )
       typedef Integration::WheelEvent DerivedType;
 
       // Reserve some memory inside the message queue
-      unsigned int* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
+      uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
 
       // Construct message in the message queue memory; note that delete should not be called on the return value
       new (slot) DerivedType( static_cast<const DerivedType&>(event) );
@@ -158,7 +159,7 @@ void EventProcessor::QueueGestureEvent(const Integration::GestureEvent& event)
       typedef Integration::PinchGestureEvent DerivedType;
 
       // Reserve some memory inside the message queue
-      unsigned int* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
+      uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
 
       // Construct message in the message queue memory; note that delete should not be called on the return value
       new (slot) DerivedType( static_cast<const DerivedType&>(event) );
@@ -171,7 +172,7 @@ void EventProcessor::QueueGestureEvent(const Integration::GestureEvent& event)
       typedef Integration::PanGestureEvent DerivedType;
 
       // Reserve some memory inside the message queue
-      unsigned int* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
+      uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
 
       // Construct message in the message queue memory; note that delete should not be called on the return value
       new (slot) DerivedType( static_cast<const DerivedType&>(event) );
@@ -184,7 +185,7 @@ void EventProcessor::QueueGestureEvent(const Integration::GestureEvent& event)
       typedef Integration::TapGestureEvent DerivedType;
 
       // Reserve some memory inside the message queue
-      unsigned int* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
+      uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
 
       // Construct message in the message queue memory; note that delete should not be called on the return value
       new (slot) DerivedType( static_cast<const DerivedType&>(event) );
@@ -197,7 +198,7 @@ void EventProcessor::QueueGestureEvent(const Integration::GestureEvent& event)
       typedef Integration::LongPressGestureEvent DerivedType;
 
       // Reserve some memory inside the message queue
-      unsigned int* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
+      uint32_t* slot = mCurrentEventQueue->ReserveMessageSlot( sizeof( DerivedType ) );
 
       // Construct message in the message queue memory; note that delete should not be called on the return value
       new (slot) DerivedType( static_cast<const DerivedType&>(event) );
@@ -212,7 +213,7 @@ void EventProcessor::ProcessEvents()
   MessageBuffer* queueToProcess = mCurrentEventQueue;
 
   // Switch current queue; events can be added safely while iterating through the other queue.
-  mCurrentEventQueue = (&mEventQueue0 == mCurrentEventQueue) ? &mEventQueue1 : &mEventQueue0;
+  mCurrentEventQueue = ( &mEventQueue0 == mCurrentEventQueue ) ? &mEventQueue1 : &mEventQueue0;
 
   for( MessageBuffer::Iterator iter = queueToProcess->Begin(); iter.IsValid(); iter.Next() )
   {
@@ -246,7 +247,7 @@ void EventProcessor::ProcessEvents()
 
       case Event::Gesture:
       {
-        mGestureEventProcessor.ProcessGestureEvent( static_cast<const Integration::GestureEvent&>(*event) );
+        mGestureEventProcessor.ProcessGestureEvent( mScene, static_cast<const Integration::GestureEvent&>(*event) );
         break;
       }
 
index bc5300e..44392b1 100644 (file)
@@ -37,7 +37,7 @@ struct GestureEvent;
 namespace Internal
 {
 
-class Stage;
+class Scene;
 class GestureEventProcessor;
 class NotificationManager;
 
@@ -54,11 +54,10 @@ public:
 
   /**
    * Constructor
-   * @param[in] stage                  The stage.
-   * @param[in] notificationManager    The Notification Manager.
+   * @param[in] scene                  The scene.
    * @param[in] gestureEventProcessor  The gesture event processor.
    */
-  EventProcessor(Stage& stage, NotificationManager& notificationManager, GestureEventProcessor& gestureEventProcessor);
+  EventProcessor( Scene& scene, GestureEventProcessor& gestureEventProcessor );
 
   /**
    * Destructor
@@ -68,13 +67,13 @@ public:
 public:
 
   /**
-   * This function is called by Core when an event is queued.
+   * This function is called when an event is queued.
    * @param[in] event A event to queue.
    */
   void QueueEvent( const Integration::Event& event );
 
   /**
-   * This function is called by Core when events are processed.
+   * This function is called when events are processed.
    */
   void ProcessEvents();
 
@@ -87,6 +86,7 @@ private:
 
 private:
 
+  Scene& mScene;                                        ///< The Scene events are processed for.
   TouchEventProcessor      mTouchEventProcessor;        ///< Processes touch events.
   HoverEventProcessor      mHoverEventProcessor;        ///< Processes hover events.
   GestureEventProcessor&   mGestureEventProcessor;      ///< Processes gesture events.
index ada5dff..4c1d206 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,9 +34,10 @@ namespace Dali
 namespace Internal
 {
 
-GestureDetector::GestureDetector(Gesture::Type type)
-: mType(type),
-  mGestureEventProcessor(ThreadLocalStorage::Get().GetGestureEventProcessor())
+GestureDetector::GestureDetector(Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject )
+: Object( sceneObject ),
+  mType( type ),
+  mGestureEventProcessor( ThreadLocalStorage::Get().GetGestureEventProcessor() )
 {
 }
 
@@ -61,26 +62,26 @@ GestureDetector::~GestureDetector()
   }
 }
 
-void GestureDetector::Attach(Actor& actor)
+void GestureDetector::Attach( Actor& actor )
 {
-  if ( !IsAttached(actor) )
+  if ( !IsAttached( actor) )
   {
     // Register with EventProcessor if first actor being added
-    if ( mAttachedActors.empty() )
+    if( mAttachedActors.empty() )
     {
-      mGestureEventProcessor.AddGestureDetector(this);
+      mGestureEventProcessor.AddGestureDetector( this );
     }
 
-    mAttachedActors.push_back(&actor);
+    mAttachedActors.push_back( &actor );
 
     // We need to observe the actor's destruction
-    actor.AddObserver(*this);
+    actor.AddObserver( *this );
 
     // Add the detector to the actor (so the actor knows it requires this gesture when going through hit-test algorithm)
     actor.GetGestureData().AddGestureDetector( *this );
 
     // Notification for derived classes
-    OnActorAttach(actor);
+    OnActorAttach( actor );
   }
 }
 
@@ -196,75 +197,6 @@ void GestureDetector::ObjectDestroyed(Object& object)
   }
 }
 
-unsigned int GestureDetector::GetDefaultPropertyCount() const
-{
-  return 0;
-}
-
-void GestureDetector::GetDefaultPropertyIndices( Property::IndexContainer& ) const
-{
-}
-
-const char* GestureDetector::GetDefaultPropertyName( Property::Index index ) const
-{
-  return NULL;
-}
-
-Property::Index GestureDetector::GetDefaultPropertyIndex(const std::string& name) const
-{
-  return Property::INVALID_INDEX;
-}
-
-bool GestureDetector::IsDefaultPropertyWritable(Property::Index index) const
-{
-  return false;
-}
-
-bool GestureDetector::IsDefaultPropertyAnimatable(Property::Index index) const
-{
-  return false;
-}
-
-bool GestureDetector::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  return false;
-}
-
-Property::Type GestureDetector::GetDefaultPropertyType(Property::Index index) const
-{
-  return Property::NONE;
-}
-
-void GestureDetector::SetDefaultProperty( Property::Index index, const Property::Value& property )
-{
-  // None of our properties should be settable from Public API
-}
-
-Property::Value GestureDetector::GetDefaultProperty(Property::Index index) const
-{
-  return Property::Value();
-}
-
-Property::Value GestureDetector::GetDefaultPropertyCurrentValue( Property::Index index ) const
-{
-  return Property::Value();
-}
-
-const SceneGraph::PropertyOwner* GestureDetector::GetSceneObject() const
-{
-  return NULL;
-}
-
-const SceneGraph::PropertyBase* GestureDetector::GetSceneObjectAnimatableProperty( Property::Index index ) const
-{
-  return NULL;
-}
-
-const PropertyInputImpl* GestureDetector::GetSceneObjectInputProperty( Property::Index index ) const
-{
-  return NULL;
-}
-
 } // namespace Internal
 
 } // namespace Dali
index d136c6c..1f433f3 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_GESTURE_DETECTOR_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -114,8 +114,11 @@ protected: // Creation & Destruction
 
   /**
    * Construct a new GestureDetector.
+   * @param type the type of gesture
+   * @param pointer to the scene object, nullptr if none
+   * by default GestureDetectors don't have our own scene object
    */
-  GestureDetector(Gesture::Type mType);
+  GestureDetector(Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject  = nullptr );
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
@@ -125,10 +128,9 @@ protected: // Creation & Destruction
 private:
 
   // Undefined
-  GestureDetector(const GestureDetector&);
-
-  // Undefined
-  GestureDetector& operator=(const GestureDetector& rhs);
+  GestureDetector() = delete;
+  GestureDetector(const GestureDetector&) = delete;
+  GestureDetector& operator=(const GestureDetector& rhs) = delete;
 
   /**
    * @copydoc Dali::Internal::Object::Observer::SceneObjectAdded()
@@ -165,78 +167,6 @@ private:
    */
   virtual void OnActorDestroyed(Object& object) = 0;
 
-private: // Default property extensions from Object
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::SetDefaultProperty()
-   */
-  virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultProperty()
-   */
-  virtual Property::Value GetDefaultProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue()
-   */
-  virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
-   */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
-
 protected:
 
   Gesture::Type                 mType;                  ///< The gesture detector will detect this type of gesture.
index 0a43ae3..8379621 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -37,13 +37,12 @@ namespace Dali
 namespace Internal
 {
 
-GestureEventProcessor::GestureEventProcessor( Stage& stage, SceneGraph::UpdateManager& updateManager, Integration::GestureManager& gestureManager, Integration::RenderController& renderController )
-: mStage( stage ),
-  mGestureManager( gestureManager ),
-  mLongPressGestureProcessor( stage, gestureManager ),
-  mPanGestureProcessor( stage, gestureManager, updateManager ),
-  mPinchGestureProcessor( stage, gestureManager ),
-  mTapGestureProcessor( stage, gestureManager ),
+GestureEventProcessor::GestureEventProcessor( SceneGraph::UpdateManager& updateManager, Integration::GestureManager& gestureManager, Integration::RenderController& renderController )
+: mGestureManager( gestureManager ),
+  mLongPressGestureProcessor( gestureManager ),
+  mPanGestureProcessor( gestureManager, updateManager ),
+  mPinchGestureProcessor( gestureManager ),
+  mTapGestureProcessor( gestureManager ),
   mRenderController( renderController ),
   mUpdateRequired( false )
 {
@@ -53,7 +52,7 @@ GestureEventProcessor::~GestureEventProcessor()
 {
 }
 
-void GestureEventProcessor::ProcessGestureEvent(const Integration::GestureEvent& event)
+void GestureEventProcessor::ProcessGestureEvent( Scene& scene, const Integration::GestureEvent& event)
 {
   if( Gesture::Started == event.state || Gesture::Continuing == event.state )
   {
@@ -63,19 +62,19 @@ void GestureEventProcessor::ProcessGestureEvent(const Integration::GestureEvent&
   switch(event.gestureType)
   {
     case Gesture::LongPress:
-      mLongPressGestureProcessor.Process(static_cast<const Integration::LongPressGestureEvent&>(event));
+      mLongPressGestureProcessor.Process( scene, static_cast<const Integration::LongPressGestureEvent&>(event) );
       break;
 
     case Gesture::Pan:
-      mPanGestureProcessor.Process(static_cast<const Integration::PanGestureEvent&>(event));
+      mPanGestureProcessor.Process( scene, static_cast<const Integration::PanGestureEvent&>(event));
       break;
 
     case Gesture::Pinch:
-      mPinchGestureProcessor.Process(static_cast<const Integration::PinchGestureEvent&>(event));
+      mPinchGestureProcessor.Process( scene, static_cast<const Integration::PinchGestureEvent&>(event));
       break;
 
     case Gesture::Tap:
-      mTapGestureProcessor.Process(static_cast<const Integration::TapGestureEvent&>(event));
+      mTapGestureProcessor.Process( scene, static_cast<const Integration::TapGestureEvent&>(event));
       break;
   }
 }
@@ -235,27 +234,27 @@ void GestureEventProcessor::SetPanGesturePredictionMode(int mode)
   mPanGestureProcessor.SetPredictionMode(mode);
 }
 
-void GestureEventProcessor::SetPanGesturePredictionAmount( unsigned int amount )
+void GestureEventProcessor::SetPanGesturePredictionAmount( uint32_t amount )
 {
   mPanGestureProcessor.SetPredictionAmount(amount);
 }
 
-void GestureEventProcessor::SetPanGestureMaximumPredictionAmount( unsigned int amount )
+void GestureEventProcessor::SetPanGestureMaximumPredictionAmount( uint32_t amount )
 {
   mPanGestureProcessor.SetMaximumPredictionAmount(amount);
 }
 
-void GestureEventProcessor::SetPanGestureMinimumPredictionAmount( unsigned int amount )
+void GestureEventProcessor::SetPanGestureMinimumPredictionAmount( uint32_t amount )
 {
   mPanGestureProcessor.SetMinimumPredictionAmount(amount);
 }
 
-void GestureEventProcessor::SetPanGesturePredictionAmountAdjustment( unsigned int amount )
+void GestureEventProcessor::SetPanGesturePredictionAmountAdjustment( uint32_t amount )
 {
   mPanGestureProcessor.SetPredictionAmountAdjustment(amount);
 }
 
-void GestureEventProcessor::SetPanGestureSmoothingMode(int mode)
+void GestureEventProcessor::SetPanGestureSmoothingMode( int32_t mode )
 {
   mPanGestureProcessor.SetSmoothingMode(mode);
 }
@@ -270,7 +269,7 @@ void GestureEventProcessor::SetPanGestureUseActualTimes( bool value )
   mPanGestureProcessor.SetUseActualTimes( value );
 }
 
-void GestureEventProcessor::SetPanGestureInterpolationTimeRange( int value )
+void GestureEventProcessor::SetPanGestureInterpolationTimeRange( int32_t value )
 {
   mPanGestureProcessor.SetInterpolationTimeRange( value );
 }
@@ -300,11 +299,15 @@ void GestureEventProcessor::SetPanGestureTwoPointAccelerationBias( float value )
   mPanGestureProcessor.SetTwoPointAccelerationBias( value );
 }
 
-void GestureEventProcessor::SetPanGestureMultitapSmoothingRange( int value )
+void GestureEventProcessor::SetPanGestureMultitapSmoothingRange( int32_t value )
 {
   mPanGestureProcessor.SetMultitapSmoothingRange( value );
 }
 
+const PanGestureProcessor& GestureEventProcessor::GetPanGestureProcessor()
+{
+  return mPanGestureProcessor;
+}
 
 } // namespace Internal
 
index 75b1c48..ff5e7ef 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_GESTURE_EVENT_PROCESSOR_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -47,6 +47,7 @@ namespace Internal
 {
 
 class Stage;
+class Scene;
 
 /**
  * Gesture Event Processing:
@@ -60,12 +61,11 @@ public:
 
   /**
    * Create a gesture event processor.
-   * @param[in] stage The stage.
    * @param[in] updateManager The update manager
    * @param[in] gestureManager The gesture manager
    * @param[in] renderController The render controller
    */
-  GestureEventProcessor( Stage& stage, SceneGraph::UpdateManager& updateManager, Integration::GestureManager& gestureManager, Integration::RenderController& renderController );
+  GestureEventProcessor( SceneGraph::UpdateManager& updateManager, Integration::GestureManager& gestureManager, Integration::RenderController& renderController );
 
   /**
    * Non-virtual destructor; GestureProcessor is not a base class
@@ -78,7 +78,7 @@ public: // To be called by EventProcessor
    * This function is called by Core whenever a gesture event occurs.
    * @param[in] event The event that has occurred.
    */
-  void ProcessGestureEvent(const Integration::GestureEvent& event);
+  void ProcessGestureEvent( Scene& scene, const Integration::GestureEvent& event );
 
 public: // To be called by gesture detectors
 
@@ -133,28 +133,28 @@ public: // Called by Core
    *
    * @param[in] mode The prediction mode to use
    */
-  void SetPanGesturePredictionMode( int mode );
+  void SetPanGesturePredictionMode( int32_t mode );
 
   /**
    * @brief Sets the prediction amount of the pan gesture
    *
    * @param[in] amount The prediction amount in milliseconds
    */
-  void SetPanGesturePredictionAmount( unsigned int amount );
+  void SetPanGesturePredictionAmount( uint32_t amount );
 
   /**
    * @brief Sets the upper bound of the prediction amount for clamping
    *
    * @param[in] amount The prediction amount in milliseconds
    */
-  void SetPanGestureMaximumPredictionAmount( unsigned int amount );
+  void SetPanGestureMaximumPredictionAmount( uint32_t amount );
 
   /**
    * @brief Sets the lower bound of the prediction amount for clamping
    *
    * @param[in] amount The prediction amount in milliseconds
    */
-  void SetPanGestureMinimumPredictionAmount( unsigned int amount );
+  void SetPanGestureMinimumPredictionAmount( uint32_t amount );
 
   /**
    * @brief Sets the prediction amount to adjust when the pan velocity is changed.
@@ -165,14 +165,14 @@ public: // Called by Core
    *
    * @param[in] amount The prediction amount in milliseconds
    */
-  void SetPanGesturePredictionAmountAdjustment( unsigned int amount );
+  void SetPanGesturePredictionAmountAdjustment( uint32_t amount );
 
   /**
    * @brief Called to set how pan gestures smooth input
    *
    * @param[in] mode The smoothing mode to use
    */
-  void SetPanGestureSmoothingMode( int mode );
+  void SetPanGestureSmoothingMode( int32_t mode );
 
   /**
    * @brief Sets the prediction amount of the pan gesture
@@ -193,7 +193,7 @@ public: // Called by Core
    *
    * @param[in] value Time range in ms
    */
-  void SetPanGestureInterpolationTimeRange( int value );
+  void SetPanGestureInterpolationTimeRange( int32_t value );
 
   /**
    * @brief Sets whether to use scalar only prediction, which when enabled, ignores acceleration.
@@ -214,7 +214,7 @@ public: // Called by Core
    *
    * @param[in] value Time in past in ms
    */
-  void SetPanGestureTwoPointInterpolatePastTime( int value );
+  void SetPanGestureTwoPointInterpolatePastTime( int32_t value );
 
   /**
    * @brief Sets the two point velocity bias. This is the ratio of first and second points to use for velocity.
@@ -235,7 +235,14 @@ public: // Called by Core
    *
    * @param[in] value Time in past in ms
    */
-  void SetPanGestureMultitapSmoothingRange( int value );
+  void SetPanGestureMultitapSmoothingRange( int32_t value );
+
+public: // needed for PanGesture
+
+  /**
+   * @return the pan gesture processor
+   */
+  const PanGestureProcessor& GetPanGestureProcessor();
 
 private:
 
@@ -245,7 +252,6 @@ private:
 
 private:
 
-  Stage& mStage;
   Integration::GestureManager& mGestureManager;
 
   LongPressGestureProcessor mLongPressGestureProcessor;
index 5ad06df..153dafb 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/actors/layer-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/events/hit-test-algorithm-impl.h>
 #include <dali/internal/event/events/actor-gesture-data.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
@@ -170,13 +171,10 @@ void GestureProcessor::ProcessAndEmit( HitTestAlgorithm::Results& hitTestResults
   }
 }
 
-bool GestureProcessor::HitTest(
-  Stage&                     stage,
-  Vector2                    screenCoordinates,
-  HitTestAlgorithm::Results& hitTestResults)
+bool GestureProcessor::HitTest( Scene& scene, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults )
 {
   GestureHitTestCheck hitCheck( mType );
-  HitTestAlgorithm::HitTest( stage, screenCoordinates, hitTestResults, hitCheck );
+  HitTestAlgorithm::HitTest( scene.GetSize(), scene.GetRenderTaskList(), scene.GetLayerList(), screenCoordinates, hitTestResults, hitCheck );
   return hitTestResults.renderTask && hitTestResults.actor;
 }
 
index 8b661b3..6e7f59e 100644 (file)
@@ -76,12 +76,12 @@ protected:
 
   /**
    * Hit test the screen coordinates, and place the results in hitTestResults.
-   * @param[in] stage Stage.
+   * @param[in] scene Scene.
    * @param[in] screenCoordinates The screen coordinates to test.
    * @param[out] hitTestResults Structure to write results into.
    * @return false if the system overlay was hit or no actor was hit.
    */
-  virtual bool HitTest(Stage& stage, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults);
+  virtual bool HitTest( Scene& scene, Vector2 screenCoordinates, HitTestAlgorithm::Results& hitTestResults);
 
   /**
    * Sets the mCurrentGesturedActor and connects to the required signals.
index 56027a0..683b296 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
 #include <dali/internal/event/events/hit-test-algorithm-impl.h>
 
 // INTERNAL INCLUDES
-#include <dali/integration-api/system-overlay.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector4.h>
@@ -28,8 +27,6 @@
 #include <dali/internal/event/actors/camera-actor-impl.h>
 #include <dali/internal/event/actors/layer-impl.h>
 #include <dali/internal/event/actors/layer-list.h>
-#include <dali/internal/event/common/system-overlay-impl.h>
-#include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/common/projection.h>
 #include <dali/internal/event/images/frame-buffer-image-impl.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
@@ -56,10 +53,10 @@ struct HitActor
   {
   }
 
-  Actor *actor;                         ///< The actor hit (if actor is hit, then this is initialised).
-  Vector2 hitPosition;                  ///< Position of hit (only valid if actor valid).
-  float distance;                       ///< Distance from ray origin to hit actor.
-  int depth;                            ///< Depth index of this actor.
+  Actor *actor;        ///< The actor hit (if actor is hit, then this is initialised).
+  Vector2 hitPosition; ///< Position of hit (only valid if actor valid).
+  float distance;      ///< Distance from ray origin to hit actor.
+  int32_t depth;       ///< Depth index of this actor.
 };
 
 /**
@@ -162,8 +159,8 @@ HitActor HitTestWithinLayer( Actor& actor,
                              HitTestInterface& hitCheck,
                              bool& overlayHit,
                              bool layerIs3d,
-                             unsigned int clippingDepth,
-                             unsigned int clippingBitPlaneMask )
+                             uint32_t clippingDepth,
+                             uint32_t clippingBitPlaneMask )
 {
   HitActor hit;
 
@@ -176,7 +173,7 @@ HitActor HitTestWithinLayer( Actor& actor,
   // we increase the clipping depth if we have hit a clipping actor.
   // This is used later to ensure all nested clipped children have hit
   // all clipping actors also for them to be counted as hit.
-  unsigned int newClippingDepth = clippingDepth;
+  uint32_t newClippingDepth = clippingDepth;
   bool clippingActor = actor.GetClippingMode() != ClippingMode::DISABLED;
   if( clippingActor )
   {
@@ -234,7 +231,7 @@ HitActor HitTestWithinLayer( Actor& actor,
               // EG. a depth of 4 (10000 binary) = a mask of 1111 binary.
               // This allows us a fast way of comparing all bits are set up to this depth.
               // Note: If the current Actor has clipping, that is included in the depth mask too.
-              unsigned int clippingDepthMask = ( 1u << newClippingDepth ) - 1u;
+              uint32_t clippingDepthMask = ( 1u << newClippingDepth ) - 1u;
 
               // The two masks must be equal to be a hit, as we are already assuming a hit
               // (for non-clipping mode) then they must be not-equal to disqualify the hit.
@@ -255,7 +252,7 @@ HitActor HitTestWithinLayer( Actor& actor,
               {
                 //Get renderer with maximum depth
                 int rendererMaxDepth(actor.GetRendererAt( 0 ).Get()->GetDepthIndex());
-                for( unsigned int i(1); i < actor.GetRendererCount(); ++i )
+                for( uint32_t i(1); i < actor.GetRendererCount(); ++i )
                 {
                   int depth = actor.GetRendererAt( i ).Get()->GetDepthIndex();
                   if( depth > rendererMaxDepth )
@@ -277,7 +274,7 @@ HitActor HitTestWithinLayer( Actor& actor,
   if( actor.GetChildCount() > 0 )
   {
     childHit.distance = std::numeric_limits<float>::max();
-    childHit.depth = std::numeric_limits<int>::min();
+    childHit.depth = std::numeric_limits<int32_t>::min();
     ActorContainer& children = actor.GetChildrenInternal();
 
     // Hit test ALL children and calculate their distance.
@@ -362,10 +359,10 @@ inline bool IsActuallyHittable( Layer& layer, const Vector2& screenCoordinates,
   {
     ClippingBox box = layer.GetClippingBox();
 
-    if( screenCoordinates.x < box.x ||
-        screenCoordinates.x > box.x + box.width ||
-        screenCoordinates.y < stageSize.y - (box.y + box.height) ||
-        screenCoordinates.y > stageSize.y - box.y)
+    if( screenCoordinates.x < static_cast<float>( box.x )||
+        screenCoordinates.x > static_cast<float>( box.x + box.width )||
+        screenCoordinates.y < stageSize.y - static_cast<float>( box.y + box.height ) ||
+        screenCoordinates.y > stageSize.y - static_cast<float>( box.y ) )
     {
       // Not touchable if clipping is enabled in the layer and the screen coordinate is outside the clip region.
       hittable = false;
@@ -405,7 +402,7 @@ void GetCameraClippingPlane( RenderTask& renderTask, float& nearClippingPlane, f
  * Hit test a RenderTask
  */
 bool HitTestRenderTask( const Vector< RenderTaskList::Exclusive >& exclusives,
-                        Stage& stage,
+                        const Vector2& sceneSize,
                         LayerList& layers,
                         RenderTask& renderTask,
                         Vector2 screenCoordinates,
@@ -416,10 +413,10 @@ bool HitTestRenderTask( const Vector< RenderTaskList::Exclusive >& exclusives,
   {
     Viewport viewport;
     renderTask.GetViewport( viewport );
-    if( screenCoordinates.x < viewport.x ||
-        screenCoordinates.x > viewport.x + viewport.width ||
-        screenCoordinates.y < viewport.y ||
-        screenCoordinates.y > viewport.y + viewport.height )
+    if( screenCoordinates.x < static_cast<float>( viewport.x ) ||
+        screenCoordinates.x > static_cast<float>( viewport.x + viewport.width ) ||
+        screenCoordinates.y < static_cast<float>( viewport.y ) ||
+        screenCoordinates.y > static_cast<float>( viewport.y + viewport.height ) )
     {
       // The screen coordinate is outside the viewport of render task. The viewport clips all layers.
       return false;
@@ -435,7 +432,7 @@ bool HitTestRenderTask( const Vector< RenderTaskList::Exclusive >& exclusives,
       Dali::Layer layer( sourceActor->GetLayer() );
       if( layer )
       {
-        const unsigned int sourceActorDepth( layer.GetDepth() );
+        const uint32_t sourceActorDepth( layer.GetDepth() );
 
         CameraActor* cameraActor = renderTask.GetCameraActor();
         bool pickingPossible = cameraActor->BuildPickingRay(
@@ -452,18 +449,17 @@ bool HitTestRenderTask( const Vector< RenderTaskList::Exclusive >& exclusives,
         HitActor hit;
         bool overlayHit = false;
         bool layerConsumesHit = false;
-        const Vector2& stageSize = stage.GetSize();
 
-        for( int i = layers.GetLayerCount() - 1; i >= 0 && !( hit.actor ); --i )
+        for( int32_t i = layers.GetLayerCount() - 1; i >= 0 && !( hit.actor ); --i )
         {
           Layer* layer( layers.GetLayer( i ) );
           overlayHit = false;
 
           // Ensure layer is touchable (also checks whether ancestors are also touchable)
-          if( IsActuallyHittable( *layer, screenCoordinates, stageSize, hitCheck ) )
+          if( IsActuallyHittable( *layer, screenCoordinates, sceneSize, hitCheck ) )
           {
             // Always hit-test the source actor; otherwise test whether the layer is below the source actor in the hierarchy
-            if( sourceActorDepth == static_cast<unsigned int>( i ) )
+            if( sourceActorDepth == static_cast<uint32_t>( i ) )
             {
               // Recursively hit test the source actor & children, without crossing into other layers.
               hit = HitTestWithinLayer( *sourceActor,
@@ -507,7 +503,7 @@ bool HitTestRenderTask( const Vector< RenderTaskList::Exclusive >& exclusives,
 
         if( hit.actor )
         {
-          results.renderTask = Dali::RenderTask( &renderTask );
+          results.renderTask = RenderTaskPtr( &renderTask );
           results.actor = Dali::Actor( hit.actor );
           results.actorCoordinates = hit.hitPosition;
 
@@ -527,7 +523,7 @@ bool HitTestRenderTask( const Vector< RenderTaskList::Exclusive >& exclusives,
 /**
  * Iterate through the RenderTaskList and perform hit testing.
  *
- * @param[in] stage The stage the tests will be performed in
+ * @param[in] sceneSize The scene size the tests will be performed in
  * @param[in] layers The list of layers to test
  * @param[in] taskList The list of render tasks
  * @param[out] results Ray information calculated by the camera
@@ -535,7 +531,7 @@ bool HitTestRenderTask( const Vector< RenderTaskList::Exclusive >& exclusives,
  * @param[in] onScreen True to test on-screen, false to test off-screen
  * @return True if we have a hit, false otherwise
  */
-bool HitTestRenderTaskList( Stage& stage,
+bool HitTestRenderTaskList( const Vector2& sceneSize,
                             LayerList& layers,
                             RenderTaskList& taskList,
                             const Vector2& screenCoordinates,
@@ -549,15 +545,15 @@ bool HitTestRenderTaskList( Stage& stage,
 
   for( RenderTaskList::RenderTaskContainer::reverse_iterator iter = tasks.rbegin(); endIter != iter; ++iter )
   {
-    RenderTask& renderTask = GetImplementation( *iter );
-    bool isOffscreenRenderTask = ( iter->GetTargetFrameBuffer() || iter->GetFrameBuffer() );
+    RenderTask& renderTask = *iter->Get();
+    bool isOffscreenRenderTask = ( renderTask.GetTargetFrameBuffer() || renderTask.GetFrameBuffer() );
     if( (onScreen && isOffscreenRenderTask) || (!onScreen && !isOffscreenRenderTask) )
     {
       // Skip to next task
       continue;
     }
 
-    if( HitTestRenderTask( exclusives, stage, layers, renderTask, screenCoordinates, results, hitCheck ) )
+    if( HitTestRenderTask( exclusives, sceneSize, layers, renderTask, screenCoordinates, results, hitCheck ) )
     {
       // Return true when an actor is hit (or layer in our render-task consumes the hit)
       return true; // don't bother checking off screen tasks
@@ -570,7 +566,7 @@ bool HitTestRenderTaskList( Stage& stage,
 /**
  * Iterate through the RenderTaskList and perform hit testing for both on-screen and off-screen.
  *
- * @param[in] stage The stage the tests will be performed in
+ * @param[in] sceneSize The scene size the tests will be performed in
  * @param[in] layers The list of layers to test
  * @param[in] taskList The list of render tasks
  * @param[out] results Ray information calculated by the camera
@@ -578,7 +574,7 @@ bool HitTestRenderTaskList( Stage& stage,
  * @param[in] onScreen True to test on-screen, false to test off-screen
  * @return True if we have a hit, false otherwise
  */
-bool HitTestForEachRenderTask( Stage& stage,
+bool HitTestForEachRenderTask( const Vector2& sceneSize,
                                LayerList& layers,
                                RenderTaskList& taskList,
                                const Vector2& screenCoordinates,
@@ -589,8 +585,8 @@ bool HitTestForEachRenderTask( Stage& stage,
 
   // Check on-screen tasks before off-screen ones.
   // Hit test order should be reverse of draw order (see ProcessRenderTasks() where off-screen tasks are drawn first).
-  if( HitTestRenderTaskList( stage, layers, taskList, screenCoordinates, results, hitCheck, true  ) ||
-      HitTestRenderTaskList( stage, layers, taskList, screenCoordinates, results, hitCheck, false ) )
+  if( HitTestRenderTaskList( sceneSize, layers, taskList, screenCoordinates, results, hitCheck, true  ) ||
+      HitTestRenderTaskList( sceneSize, layers, taskList, screenCoordinates, results, hitCheck, false ) )
   {
     // Found hit.
     result = true;
@@ -605,16 +601,13 @@ HitTestInterface::~HitTestInterface()
 {
 }
 
-bool HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func )
+bool HitTest( const Vector2& sceneSize, RenderTaskList& taskList, LayerList& layerList, const Vector2& screenCoordinates, Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func )
 {
   bool wasHit( false );
-  // Hit-test the regular on-stage actors
-  RenderTaskList& taskList = stage.GetRenderTaskList();
-  LayerList& layerList = stage.GetLayerList();
-
+  // Hit-test the regular on-scene actors
   Results hitTestResults;
   HitTestFunctionWrapper hitTestFunctionWrapper( func );
-  if( HitTestForEachRenderTask( stage, layerList, taskList, screenCoordinates, hitTestResults, hitTestFunctionWrapper ) )
+  if( HitTestForEachRenderTask( sceneSize, layerList, taskList, screenCoordinates, hitTestResults, hitTestFunctionWrapper ) )
   {
     results.actor = hitTestResults.actor;
     results.actorCoordinates = hitTestResults.actorCoordinates;
@@ -623,47 +616,33 @@ bool HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgor
   return wasHit;
 }
 
-bool HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results, HitTestInterface& hitTestInterface )
+bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, const Vector2& screenCoordinates, Results& results, HitTestInterface& hitTestInterface )
 {
   bool wasHit( false );
 
-  // Hit-test the system-overlay actors first
-  SystemOverlay* systemOverlay = stage.GetSystemOverlayInternal();
-
-  if( systemOverlay )
-  {
-    RenderTaskList& overlayTaskList = systemOverlay->GetOverlayRenderTasks();
-    LayerList& overlayLayerList = systemOverlay->GetLayerList();
-
-    wasHit = HitTestForEachRenderTask( stage, overlayLayerList, overlayTaskList, screenCoordinates, results, hitTestInterface );
-  }
-
-  // Hit-test the regular on-stage actors
+  // Hit-test the regular on-scene actors
   if( !wasHit )
   {
-    RenderTaskList& taskList = stage.GetRenderTaskList();
-    LayerList& layerList = stage.GetLayerList();
-
-    wasHit = HitTestForEachRenderTask( stage, layerList, taskList, screenCoordinates, results, hitTestInterface );
+    wasHit = HitTestForEachRenderTask( sceneSize, layerList, renderTaskList, screenCoordinates, results, hitTestInterface );
   }
   return wasHit;
 }
 
-bool HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results )
+bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, const Vector2& screenCoordinates, Results& results )
 {
   ActorTouchableCheck actorTouchableCheck;
-  return HitTest( stage, screenCoordinates, results, actorTouchableCheck );
+  return HitTest( sceneSize, renderTaskList, layerList, screenCoordinates, results, actorTouchableCheck );
 }
 
-bool HitTest( Stage& stage, RenderTask& renderTask, const Vector2& screenCoordinates,
+bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, RenderTask& renderTask, const Vector2& screenCoordinates,
               Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func )
 {
   bool wasHit( false );
   Results hitTestResults;
 
-  const Vector< RenderTaskList::Exclusive >& exclusives = stage.GetRenderTaskList().GetExclusivesList();
+  const Vector< RenderTaskList::Exclusive >& exclusives = renderTaskList.GetExclusivesList();
   HitTestFunctionWrapper hitTestFunctionWrapper( func );
-  if( HitTestRenderTask( exclusives, stage, stage.GetLayerList(), renderTask, screenCoordinates, hitTestResults, hitTestFunctionWrapper ) )
+  if( HitTestRenderTask( exclusives, sceneSize, layerList, renderTask, screenCoordinates, hitTestResults, hitTestFunctionWrapper ) )
   {
     results.actor = hitTestResults.actor;
     results.actorCoordinates = hitTestResults.actorCoordinates;
index bfe9cb0..2dfb680 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_HIT_TEST_ALGORITHM_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,9 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali/public-api/actors/actor.h>
 #include <dali/devel-api/events/hit-test-algorithm.h>
-#include <dali/public-api/render-tasks/render-task.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
 {
@@ -29,6 +30,7 @@ namespace Internal
 {
 
 class Layer;
+class LayerList;
 
 /**
  * This namespace is provided for application developers to do hit test for the actors.
@@ -38,11 +40,11 @@ namespace HitTestAlgorithm
 
 struct Results
 {
-  Dali::RenderTask renderTask;       ///< The render-task displaying the actor.
-  Dali::Actor      actor;            ///< The hit actor.
-  Vector2          actorCoordinates; ///< The actor coordinates.
-  Vector4          rayOrigin;        ///< The point of origin of the ray.
-  Vector4          rayDirection;     ///< The direction vector of the ray.
+  RenderTaskPtr renderTask;       ///< The render-task displaying the actor.
+  Dali::Actor   actor;            ///< The hit actor.
+  Vector2       actorCoordinates; ///< The actor coordinates.
+  Vector4       rayOrigin;        ///< The point of origin of the ray.
+  Vector4       rayDirection;     ///< The direction vector of the ray.
 };
 
 /**
@@ -92,13 +94,26 @@ protected:
 };
 
 /**
- * @copydoc Dali::HitTestAlgorithm::HitTest(Stage stage, const Vector2& screenCoordinates, Results& results, HitTestFunction func )
+ * Hit test specific to a given scene.
+ *
+ * @param[in] sceneSize The size of the scene.
+ * @param[in] renderTaskList The render task list of the scene.
+ * @param[in] layerList The layer list of the scene.
+ * @param[in] screenCoordinates The screen coordinates.
+ * @param[out] results The results of the hit-test.
+ * @param[in] func The function to use in the hit-test algorithm.
+ * @return true if something was hit
+ *
+ * @see HitTest(Stage&, const Vector2&, Results&, HitTestInterface&)
  */
-bool HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func );
+bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, const Vector2& screenCoordinates,
+              Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func );
 
 /**
  * Given screen coordinates, this method returns the hit actor & the local coordinates relative to the actor etc.
- * @param[in] stage The stage.
+ * @param[in] sceneSize The size of the scene.
+ * @param[in] renderTaskList The render task list of the scene.
+ * @param[in] layerList The layer list of the scene.
  * @param[in] screenCoordinates The screen coordinates.
  * @param[out] results The results of the hit-test.
  * @param[in] hitTestInterface Used to determine whether the actor is hit or whether we walk down its hierarchy
@@ -106,8 +121,7 @@ bool HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgor
  *
  * <h3>Hit Test Algorithm:</h3>
  *
- * - The system overlay RenderTaskList is hit-tested first.
- * - If no hit then the regular RenderTaskList is used to hit test the on stage actors.
+ * - The regular RenderTaskList is used to hit test the on scene actors.
  * - The bulk of the hit test algorithm is described in Dali::Actor.
  * - In each RenderTask's its viewing parameters (the view and projection matrices, and the viewport)
  *   are used to build a picking ray into the scene which is used for our ray tests when hit testing
@@ -119,31 +133,36 @@ bool HitTest( Stage& stage, const Vector2& screenCoordinates, Dali::HitTestAlgor
  * @note Currently, we prefer a child hit over a parent (regardless of the distance from the
  *       camera) unless the parent is a RenderableActor but this is subject to change.
  */
-bool HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results, HitTestInterface& hitTestInterface );
+bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, const Vector2& screenCoordinates,
+              Results& results, HitTestInterface& hitTestInterface );
 
 /**
  * Default HitTest where we check if a touch is required.
  *
- * @param[in] stage The stage.
+ * @param[in] sceneSize The size of the scene.
+ * @param[in] renderTaskList The render task list of the scene.
+ * @param[in] layerList The layer list of the scene.
  * @param[in] screenCoordinates The screen coordinates.
  * @param[out] results The results of the hit-test.
  * @return true if something was hit
  *
  * @see HitTest(Stage&, const Vector2&, Results&, HitTestInterface&)
  */
-bool HitTest( Stage& stage, const Vector2& screenCoordinates, Results& results );
+bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, const Vector2& screenCoordinates, Results& results );
 
 /**
  * Hit test specific to a given RenderTask
  *
- * @param[in] stage The stage.
+ * @param[in] sceneSize The size of the scene.
+ * @param[in] renderTaskList The render task list of the scene.
+ * @param[in] layerList The layer list of the scene.
  * @param[in] renderTask The render task for hit test
  * @param[in] screenCoordinates The screen coordinates.
  * @param[out] results The results of the hit-test.
  * @param[in] func The function to use in the hit-test algorithm.
  * @return true if something was hit
  */
-bool HitTest( Stage& stage, RenderTask& renderTask, const Vector2& screenCoordinates,
+bool HitTest( const Vector2& sceneSize, RenderTaskList& renderTaskList, LayerList& layerList, RenderTask& renderTask, const Vector2& screenCoordinates,
               Dali::HitTestAlgorithm::Results& results, Dali::HitTestAlgorithm::HitTestFunction func );
 
 
index a19da0f..17cfe42 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
 #include <dali/integration-api/events/hover-event-integ.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/actors/layer-impl.h>
-#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/events/hit-test-algorithm-impl.h>
 #include <dali/internal/event/events/multi-point-event-util.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
@@ -146,12 +146,8 @@ struct ActorHoverableCheck : public HitTestAlgorithm::HitTestInterface
 
 } // unnamed namespace
 
-HoverEventProcessor::HoverEventProcessor( Stage& stage )
-: mStage( stage ),
-  mLastPrimaryHitActor(),
-  mLastConsumedActor(),
-  mHoverStartConsumedActor(),
-  mLastRenderTask()
+HoverEventProcessor::HoverEventProcessor( Scene& scene )
+: mScene( scene )
 {
   DALI_LOG_TRACE_METHOD( gLogFilter );
 }
@@ -164,10 +160,8 @@ HoverEventProcessor::~HoverEventProcessor()
 void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& event )
 {
   DALI_LOG_TRACE_METHOD( gLogFilter );
-
   DALI_ASSERT_ALWAYS( !event.points.empty() && "Empty HoverEvent sent from Integration\n" );
 
-  Stage& stage = mStage;
   TouchPoint::State state = static_cast< TouchPoint::State >( event.points[0].GetState() );
 
   PRINT_HIERARCHY(gLogFilter);
@@ -229,13 +223,13 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
   DALI_LOG_INFO( gLogFilter, Debug::Concise, "\n" );
   DALI_LOG_INFO( gLogFilter, Debug::General, "Point(s): %d\n", event.GetPointCount() );
 
-  Dali::RenderTask currentRenderTask;
+  RenderTaskPtr currentRenderTask;
 
   for ( Integration::PointContainerConstIterator iter = event.points.begin(), beginIter = event.points.begin(), endIter = event.points.end(); iter != endIter; ++iter )
   {
     HitTestAlgorithm::Results hitTestResults;
     ActorHoverableCheck actorHoverableCheck;
-    HitTestAlgorithm::HitTest( stage, iter->GetScreenPosition(), hitTestResults, actorHoverableCheck );
+    HitTestAlgorithm::HitTest( mScene.GetSize(), mScene.GetRenderTaskList(), mScene.GetLayerList(), iter->GetScreenPosition(), hitTestResults, actorHoverableCheck );
 
     TouchPoint newPoint( iter->GetTouchPoint() );
     newPoint.hitActor = hitTestResults.actor;
@@ -289,7 +283,7 @@ void HoverEventProcessor::ProcessHoverEvent( const Integration::HoverEvent& even
     if ( mLastRenderTask )
     {
       Dali::Actor leaveEventConsumer;
-      RenderTask& lastRenderTaskImpl( GetImplementation( mLastRenderTask ) );
+      RenderTask& lastRenderTaskImpl = *mLastRenderTask.Get();
 
       if( lastPrimaryHitActor &&
           lastPrimaryHitActor != primaryHitActor &&
index d28989e..92fea0c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_HOVER_EVENT_PROCESSOR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/render-tasks/render-task.h>
 #include <dali/internal/event/events/actor-observer.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
 {
@@ -38,7 +38,7 @@ namespace Internal
 {
 
 struct ActorObserver;
-class Stage;
+class Scene;
 
 /**
  * <h3>Multi-Hover Event Processing:</h3>
@@ -54,9 +54,9 @@ public:
 
   /**
    * Create an event processor.
-   * @param[in] stage The stage.
+   * @param[in] scene The scene the event processor belongs to.
    */
-  HoverEventProcessor( Stage& stage );
+  HoverEventProcessor( Scene& scene );
 
   /**
    * Non-virtual destructor; HoverEventProcessor is not a base class
@@ -77,11 +77,11 @@ private:
   // Undefined
   HoverEventProcessor& operator=(const HoverEventProcessor& rhs);
 
-  Stage& mStage; ///< Used to deliver touch events
+  Scene& mScene; ///< Reference to the scene
   ActorObserver mLastPrimaryHitActor; ///< Stores the last primary point hit actor
   ActorObserver mLastConsumedActor; ///< Stores the last consumed actor
   ActorObserver mHoverStartConsumedActor; ///< Stores the hover-start consumed actor
-  Dali::RenderTask mLastRenderTask; ///< The RenderTask used for the last hit actor
+  RenderTaskPtr mLastRenderTask; ///< The RenderTask used for the last hit actor
 };
 
 } // namespace Internal
index 73ee65c..1337008 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -44,7 +44,8 @@ namespace Internal
 {
 
 KeyEventImpl::KeyEventImpl( KeyEvent* keyEvent )
-: mCompose( "" ),
+: mLogicalKey( "" ),
+  mCompose( "" ),
   mDeviceName( "" ),
   mDeviceClass( Device::Class::NONE ),
   mDeviceSubclass( Device::Subclass::NONE )
@@ -68,6 +69,7 @@ KeyEventImpl& KeyEventImpl::operator=( const KeyEventImpl& rhs )
 {
   if( this != &rhs )
   {
+    mLogicalKey = rhs.mLogicalKey;
     mCompose = rhs.mCompose;
     mDeviceName = rhs.mDeviceName;
     mDeviceClass = rhs.mDeviceClass;
@@ -77,6 +79,16 @@ KeyEventImpl& KeyEventImpl::operator=( const KeyEventImpl& rhs )
   return *this;
 }
 
+std::string KeyEventImpl::GetLogicalKey() const
+{
+  return mLogicalKey;
+}
+
+void KeyEventImpl::SetLogicalKey( const std::string& logicalKey )
+{
+  mLogicalKey = logicalKey;
+}
+
 std::string KeyEventImpl::GetCompose() const
 {
   return mCompose;
index 5ab032d..c16ac2b 100755 (executable)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_KEY_EVENT_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -49,6 +49,18 @@ public:
   KeyEventImpl& operator=( const KeyEventImpl& rhs );
 
   /**
+   * @brief Get the key symbol string.
+   * @return The key symbol
+   */
+  std::string GetLogicalKey() const;
+
+  /**
+   * @brief Set the key symbol string to the KeyEvent.
+   * @param[in] key The key symbol to set
+   */
+  void SetLogicalKey( const std::string& logicalKey );
+
+  /**
    * @brief Get the compose string.
    *
    * @return The compose string.
@@ -116,6 +128,7 @@ private:
 
 private:
 
+  std::string mLogicalKey;
   std::string mCompose;
   std::string mDeviceName;
   Device::Class::Type mDeviceClass;
index a18f774..86f5d0a 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
 #include <dali/public-api/events/key-event.h>
 #include <dali/internal/event/events/key-event-impl.h>
 #include <dali/internal/event/actors/actor-impl.h>
-#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 #include <dali/integration-api/events/key-event-integ.h>
 
 namespace Dali
@@ -31,8 +31,8 @@ namespace Dali
 namespace Internal
 {
 
-KeyEventProcessor::KeyEventProcessor(Stage& stage)
-: mStage(stage)
+KeyEventProcessor::KeyEventProcessor( Scene& scene )
+: mScene( scene )
 {
 }
 
@@ -40,22 +40,17 @@ KeyEventProcessor::~KeyEventProcessor()
 {
 }
 
-void KeyEventProcessor::ProcessKeyEvent(const Integration::KeyEvent& event)
+void KeyEventProcessor::ProcessKeyEvent( const Integration::KeyEvent& event )
 {
   KeyEvent keyEvent(event.keyName, event.keyString, event.keyCode, event.keyModifier, event.time, static_cast<Dali::KeyEvent::State>(event.state));
-
+  GetImplementation( &keyEvent )->SetLogicalKey( event.logicalKey );
   GetImplementation( &keyEvent )->SetCompose( event.compose );
   GetImplementation( &keyEvent )->SetDeviceName( event.deviceName );
   GetImplementation( &keyEvent )->SetDeviceClass( event.deviceClass );
   GetImplementation( &keyEvent )->SetDeviceSubclass( event.deviceSubclass );
 
-  // Emit the key event signal from stage.
-  bool consumed = mStage.EmitKeyEventGeneratedSignal( keyEvent );
-
-  if( !consumed )
-  {
-    mStage.EmitKeyEventSignal(keyEvent);
-  }
+  // Emit the key event signal from the scene.
+  mScene.EmitKeyEventSignal( keyEvent );
 }
 
 } // namespace Internal
index 9f8fc23..c6b732b 100644 (file)
@@ -18,6 +18,8 @@
  *
  */
 
+#include <vector>
+
 namespace Dali
 {
 
@@ -29,12 +31,13 @@ struct KeyEvent;
 namespace Internal
 {
 
+class Scene;
 class Stage;
 
 /**
  *  KeyEventProcessor receives the filtered key events from the Dali Event processor.
  *
- *  When a key event is received the KeyEvent Processor queries the Stage to get the actor in focus.
+ *  When a key event is received the KeyEventProcessor queues the event in the scene events queue.
  *  Any actor can be set by the actor api to be the focus of key events.  The actor is then sent the key event.
  *  If no actor is set for focus then the key event is discarded.
  */
@@ -44,8 +47,9 @@ public:
 
   /**
    * Create a Key event processor.
+   * @param[in] scene The scene the event processor belongs to.
    */
-  KeyEventProcessor(Stage& stage);
+  KeyEventProcessor( Scene& scene );
 
   /**
    * Non-virtual destructor; KeyEventProcessor is not a base class
@@ -68,8 +72,7 @@ private:
 
 private:
 
-  Stage& mStage; ///< Used to deliver touch events
-
+  Scene& mScene; ///< Used to deliver key events
 };
 
 } // namespace Internal
index d2d2e2e..7cdfc95 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
 #include <dali/integration-api/gesture-manager.h>
 #include <dali/integration-api/debug.h>
 #include <dali/internal/event/actors/actor-impl.h>
-#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
@@ -98,9 +98,8 @@ struct IsNotAttachedFunctor
 
 } // unnamed namespace
 
-LongPressGestureProcessor::LongPressGestureProcessor( Stage& stage, Integration::GestureManager& gestureManager)
+LongPressGestureProcessor::LongPressGestureProcessor( Integration::GestureManager& gestureManager)
 : GestureProcessor( Gesture::LongPress ),
-  mStage( stage ),
   mGestureManager( gestureManager ),
   mGestureDetectors(),
   mCurrentEmitters(),
@@ -115,7 +114,7 @@ LongPressGestureProcessor::~LongPressGestureProcessor()
 {
 }
 
-void LongPressGestureProcessor::Process( const Integration::LongPressGestureEvent& longPressEvent )
+void LongPressGestureProcessor::Process( Scene& scene, const Integration::LongPressGestureEvent& longPressEvent )
 {
   switch ( longPressEvent.state )
   {
@@ -125,7 +124,7 @@ void LongPressGestureProcessor::Process( const Integration::LongPressGestureEven
       ResetActor();
 
       HitTestAlgorithm::Results hitTestResults;
-      if( HitTest( mStage, longPressEvent.point, hitTestResults ) )
+      if( HitTest( scene, longPressEvent.point, hitTestResults ) )
       {
         SetActor( &GetImplementation( hitTestResults.actor ) );
       }
@@ -138,7 +137,7 @@ void LongPressGestureProcessor::Process( const Integration::LongPressGestureEven
       if ( currentGesturedActor )
       {
         HitTestAlgorithm::Results hitTestResults;
-        HitTest( mStage, longPressEvent.point, hitTestResults );
+        HitTest( scene, longPressEvent.point, hitTestResults );
 
         if ( hitTestResults.actor && ( currentGesturedActor == &GetImplementation( hitTestResults.actor ) ) )
         {
@@ -179,7 +178,7 @@ void LongPressGestureProcessor::Process( const Integration::LongPressGestureEven
           if ( !mCurrentEmitters.empty() )
           {
             Vector2 actorCoords;
-            RenderTask& renderTaskImpl( GetImplementation( mCurrentRenderTask ) );
+            RenderTask& renderTaskImpl = *mCurrentRenderTask.Get();
             currentGesturedActor->ScreenToLocal( renderTaskImpl, actorCoords.x, actorCoords.y, longPressEvent.point.x, longPressEvent.point.y );
 
             EmitLongPressSignal( currentGesturedActor, mCurrentEmitters, longPressEvent, actorCoords );
index d34f246..5194cdb 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_LONG_PRESS_GESTURE_EVENT_PROCESSOR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/render-tasks/render-task.h>
 #include <dali/internal/event/events/long-press-gesture-detector-impl.h>
 #include <dali/internal/event/events/gesture-processor.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
 {
@@ -37,6 +37,7 @@ namespace Internal
 {
 
 class Stage;
+class Scene;
 
 /**
  * Long Press Gesture Event Processing:
@@ -51,10 +52,9 @@ public:
 
   /**
    * Create a long press gesture processor.
-   * @param[in] stage The stage.
    * @param[in] gestureManager The gesture manager.
    */
-  LongPressGestureProcessor( Stage& stage, Integration::GestureManager& gestureManager );
+  LongPressGestureProcessor( Integration::GestureManager& gestureManager );
 
   /**
    * Non-virtual destructor; LongPressGestureProcessor is not a base class
@@ -65,9 +65,10 @@ public: // To be called by GestureEventProcessor
 
   /**
    * This method is called whenever a long press gesture event occurs.
+   * @param[in] scene The scene the long press gesture event occurs in.
    * @param[in] longPressEvent The event that has occurred.
    */
-  void Process( const Integration::LongPressGestureEvent& longPressEvent );
+  void Process( Scene& scene, const Integration::LongPressGestureEvent& longPressEvent );
 
   /**
    * Adds a gesture detector to this gesture processor.
@@ -124,15 +125,14 @@ private:
 
 private:
 
-  Stage& mStage;
   Integration::GestureManager& mGestureManager;
   LongPressGestureDetectorContainer mGestureDetectors;
 
   GestureDetectorContainer mCurrentEmitters;
-  Dali::RenderTask mCurrentRenderTask;
+  RenderTaskPtr mCurrentRenderTask;
 
-  unsigned int mMinTouchesRequired;
-  unsigned int mMaxTouchesRequired;
+  uint32_t mMinTouchesRequired;
+  uint32_t mMaxTouchesRequired;
 
   const Integration::LongPressGestureEvent* mCurrentLongPressEvent; ///< Pointer to current longPressEvent, used when calling ProcessAndEmit()
 };
index dc91220..b8dfd89 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,7 +53,7 @@ DALI_PROPERTY( "localPosition",       VECTOR2, false, false, true,   Dali::PanGe
 DALI_PROPERTY( "localDisplacement",   VECTOR2, false, false, true,   Dali::PanGestureDetector::Property::LOCAL_DISPLACEMENT  )
 DALI_PROPERTY( "localVelocity",       VECTOR2, false, false, true,   Dali::PanGestureDetector::Property::LOCAL_VELOCITY      )
 DALI_PROPERTY( "panning",             BOOLEAN, false, false, true,   Dali::PanGestureDetector::Property::PANNING             )
-DALI_PROPERTY_TABLE_END( DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX )
+DALI_PROPERTY_TABLE_END( DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX, PanGestureDetectorDefaultProperties )
 
 // Signals
 
@@ -64,7 +64,7 @@ BaseHandle Create()
   return Dali::PanGestureDetector::New();
 }
 
-TypeRegistration mType( typeid(Dali::PanGestureDetector), typeid(Dali::GestureDetector), Create );
+TypeRegistration mType( typeid(Dali::PanGestureDetector), typeid(Dali::GestureDetector), Create, PanGestureDetectorDefaultProperties );
 
 SignalConnectorType signalConnector1( mType, SIGNAL_PAN_DETECTED, &PanGestureDetector::DoConnectSignal );
 
@@ -94,19 +94,8 @@ float GetOppositeAngle( float angle )
 
 PanGestureDetectorPtr PanGestureDetector::New()
 {
-  return new PanGestureDetector;
-}
-
-PanGestureDetector::PanGestureDetector()
-: GestureDetector(Gesture::Pan),
-  mMinimumTouches(1),
-  mMaximumTouches(1),
-  mSceneObject(NULL)
-{
-}
-
-PanGestureDetector::~PanGestureDetector()
-{
+  const SceneGraph::PanGesture& sceneObject = ThreadLocalStorage::Get().GetGestureEventProcessor().GetPanGestureProcessor().GetSceneObject();
+  return new PanGestureDetector( sceneObject );
 }
 
 void PanGestureDetector::SetMinimumTouchesRequired(unsigned int minimum)
@@ -147,12 +136,12 @@ void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum)
   }
 }
 
-unsigned int PanGestureDetector::GetMinimumTouchesRequired() const
+uint32_t PanGestureDetector::GetMinimumTouchesRequired() const
 {
   return mMinimumTouches;
 }
 
-unsigned int PanGestureDetector::GetMaximumTouchesRequired() const
+uint32_t PanGestureDetector::GetMaximumTouchesRequired() const
 {
   return mMaximumTouches;
 }
@@ -187,12 +176,12 @@ void PanGestureDetector::AddDirection( Radian direction, Radian threshold )
   AddAngle( direction, threshold );
 }
 
-size_t PanGestureDetector::GetAngleCount() const
+uint32_t PanGestureDetector::GetAngleCount() const
 {
-  return mAngleContainer.size();
+  return static_cast<uint32_t>( mAngleContainer.size() );
 }
 
-PanGestureDetector::AngleThresholdPair PanGestureDetector::GetAngle(size_t index) const
+PanGestureDetector::AngleThresholdPair PanGestureDetector::GetAngle(uint32_t index) const
 {
   PanGestureDetector::AngleThresholdPair ret( Radian(0),Radian(0) );
 
@@ -283,11 +272,6 @@ void PanGestureDetector::EmitPanGestureSignal(Dali::Actor actor, const PanGestur
   }
 }
 
-void PanGestureDetector::SetSceneObject( const SceneGraph::PanGesture* object )
-{
-  mSceneObject = object;
-}
-
 bool PanGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   bool connected( true );
@@ -311,95 +295,35 @@ void PanGestureDetector::SetPanGestureProperties( const PanGesture& pan )
   ThreadLocalStorage::Get().GetGestureEventProcessor().SetGestureProperties( pan );
 }
 
-void PanGestureDetector::OnActorAttach(Actor& actor)
-{
-  // Do nothing
-}
-
-void PanGestureDetector::OnActorDetach(Actor& actor)
-{
-  // Do nothing
-}
-
-void PanGestureDetector::OnActorDestroyed(Object& object)
-{
-  // Do nothing
-}
-
-unsigned int PanGestureDetector::GetDefaultPropertyCount() const
-{
-  return DEFAULT_PROPERTY_COUNT;
-}
-
-void PanGestureDetector::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  indices.Reserve( DEFAULT_PROPERTY_COUNT );
-
-  int index = DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX;
-  for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
-  {
-    indices.PushBack( index );
-  }
-}
-
-const char* PanGestureDetector::GetDefaultPropertyName( Property::Index index ) const
+PanGestureDetector::PanGestureDetector( const SceneGraph::PanGesture& sceneObject )
+: GestureDetector(Gesture::Pan, &sceneObject ),
+  mMinimumTouches(1),
+  mMaximumTouches(1)
 {
-  index -= DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX;
-  if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-  {
-    return DEFAULT_PROPERTY_DETAILS[ index ].name;
-  }
-
-  return NULL;
 }
 
-Property::Index PanGestureDetector::GetDefaultPropertyIndex(const std::string& name) const
+PanGestureDetector::~PanGestureDetector()
 {
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
-    if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
-    {
-      index = DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX + i;
-      break;
-    }
-  }
-  return index;
 }
 
-bool PanGestureDetector::IsDefaultPropertyWritable(Property::Index index) const
+const SceneGraph::PanGesture& PanGestureDetector::GetPanGestureSceneObject() const
 {
-  // None of our properties should be writable through the Public API
-  return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX ].writable;
+  return static_cast<const SceneGraph::PanGesture&>( GetSceneObject() );
 }
 
-bool PanGestureDetector::IsDefaultPropertyAnimatable(Property::Index index) const
+void PanGestureDetector::OnActorAttach(Actor& actor)
 {
-  // None of our properties are animatable
-  return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX ].animatable;
+  // Do nothing
 }
 
-bool PanGestureDetector::IsDefaultPropertyAConstraintInput( Property::Index index ) const
+void PanGestureDetector::OnActorDetach(Actor& actor)
 {
-  // All our properties can be used as an input to a constraint.
-  return DEFAULT_PROPERTY_DETAILS[ index - DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX ].constraintInput;
+  // Do nothing
 }
 
-Property::Type PanGestureDetector::GetDefaultPropertyType(Property::Index index) const
+void PanGestureDetector::OnActorDestroyed(Object& object)
 {
-  index -= DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX;
-  if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-  {
-    return DEFAULT_PROPERTY_DETAILS[ index ].type;
-  }
-  else
-  {
-    // Index out-of-range
-    return Property::NONE;
-  }
+  // Do nothing
 }
 
 void PanGestureDetector::SetDefaultProperty( Property::Index index, const Property::Value& property )
@@ -412,7 +336,7 @@ Property::Value PanGestureDetector::GetDefaultProperty( Property::Index index )
   return GetDefaultPropertyCurrentValue( index ); // Scene-graph only properties
 }
 
-Property::Value PanGestureDetector::GetDefaultPropertyCurrentValue(Property::Index index) const
+Property::Value PanGestureDetector::GetDefaultPropertyCurrentValue( Property::Index index ) const
 {
   Property::Value value;
 
@@ -420,92 +344,43 @@ Property::Value PanGestureDetector::GetDefaultPropertyCurrentValue(Property::Ind
   {
     case Dali::PanGestureDetector::Property::SCREEN_POSITION:
     {
-      if(mSceneObject)
-      {
-        value = mSceneObject->GetScreenPositionProperty().Get();
-      }
-      else
-      {
-        value = Vector2();
-      }
+      value = GetPanGestureSceneObject().GetScreenPositionProperty().Get();
       break;
     }
 
     case Dali::PanGestureDetector::Property::SCREEN_DISPLACEMENT:
     {
-      if(mSceneObject)
-      {
-        value = mSceneObject->GetScreenDisplacementProperty().Get();
-      }
-      else
-      {
-        value = Vector2();
-      }
+      value = GetPanGestureSceneObject().GetScreenDisplacementProperty().Get();
       break;
     }
 
     case Dali::PanGestureDetector::Property::SCREEN_VELOCITY:
     {
-      if(mSceneObject)
-      {
-        value = mSceneObject->GetScreenVelocityProperty().Get();
-      }
-      else
-      {
-        value = Vector2();
-      }
+      value = GetPanGestureSceneObject().GetScreenVelocityProperty().Get();
       break;
     }
 
     case Dali::PanGestureDetector::Property::LOCAL_POSITION:
     {
-      if(mSceneObject)
-      {
-        value = mSceneObject->GetLocalPositionProperty().Get();
-      }
-      else
-      {
-        value = Vector2();
-      }
+      value = GetPanGestureSceneObject().GetLocalPositionProperty().Get();
       break;
     }
 
     case Dali::PanGestureDetector::Property::LOCAL_DISPLACEMENT:
     {
-      if(mSceneObject)
-      {
-        value = mSceneObject->GetLocalDisplacementProperty().Get();
-      }
-      else
-      {
-        value = Vector2();
-      }
+      value = GetPanGestureSceneObject().GetLocalDisplacementProperty().Get();
       break;
     }
 
     case Dali::PanGestureDetector::Property::LOCAL_VELOCITY:
     {
-      if(mSceneObject)
-      {
-        value = mSceneObject->GetLocalVelocityProperty().Get();
-      }
-      else
-      {
-        value = Vector2();
-      }
+      value = GetPanGestureSceneObject().GetLocalVelocityProperty().Get();
       break;
     }
 
     case Dali::PanGestureDetector::Property::PANNING:
     {
-      if(mSceneObject)
-      {
-        value = mSceneObject->GetPanningProperty().Get();
-      }
-      else
-      {
-        value = false;
-      }
+      value = GetPanGestureSceneObject().GetPanningProperty().Get();
       break;
     }
 
@@ -519,86 +394,61 @@ Property::Value PanGestureDetector::GetDefaultPropertyCurrentValue(Property::Ind
   return value;
 }
 
-const SceneGraph::PropertyOwner* PanGestureDetector::GetSceneObject() const
-{
-  // This method should only return an object connected to the scene-graph
-  return mSceneObject;
-}
-
-const SceneGraph::PropertyBase* PanGestureDetector::GetSceneObjectAnimatableProperty( Property::Index index ) const
-{
-  DALI_ASSERT_ALWAYS( IsPropertyAnimatable(index) && "Property is not animatable" );
-
-  // None of our properties are animatable
-  return NULL;
-}
-
 const PropertyInputImpl* PanGestureDetector::GetSceneObjectInputProperty( Property::Index index ) const
 {
-  const PropertyInputImpl* property( NULL );
+  const PropertyInputImpl* property = nullptr;
 
-  // This method should only return a property of an object connected to the scene-graph
-  if ( !mSceneObject )
-  {
-    return property;
-  }
-
-  if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
-       ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
-  {
-    CustomPropertyMetadata* custom = FindCustomProperty( index );
-    DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
-    property = custom->GetSceneGraphProperty();
-  }
-  else
+  switch ( index )
   {
-    switch ( index )
+    case Dali::PanGestureDetector::Property::SCREEN_POSITION:
     {
-      case Dali::PanGestureDetector::Property::SCREEN_POSITION:
-      {
-        property = &mSceneObject->GetScreenPositionProperty();
-        break;
-      }
-
-      case Dali::PanGestureDetector::Property::SCREEN_DISPLACEMENT:
-      {
-        property = &mSceneObject->GetScreenDisplacementProperty();
-        break;
-      }
+      property = &GetPanGestureSceneObject().GetScreenPositionProperty();
+      break;
+    }
 
-      case Dali::PanGestureDetector::Property::SCREEN_VELOCITY:
-      {
-        property = &mSceneObject->GetScreenVelocityProperty();
-        break;
-      }
+    case Dali::PanGestureDetector::Property::SCREEN_DISPLACEMENT:
+    {
+      property = &GetPanGestureSceneObject().GetScreenDisplacementProperty();
+      break;
+    }
 
-      case Dali::PanGestureDetector::Property::LOCAL_POSITION:
-      {
-        property = &mSceneObject->GetLocalPositionProperty();
-        break;
-      }
+    case Dali::PanGestureDetector::Property::SCREEN_VELOCITY:
+    {
+      property = &GetPanGestureSceneObject().GetScreenVelocityProperty();
+      break;
+    }
 
-      case Dali::PanGestureDetector::Property::LOCAL_DISPLACEMENT:
-      {
-        property = &mSceneObject->GetLocalDisplacementProperty();
-        break;
-      }
+    case Dali::PanGestureDetector::Property::LOCAL_POSITION:
+    {
+      property = &GetPanGestureSceneObject().GetLocalPositionProperty();
+      break;
+    }
 
-      case Dali::PanGestureDetector::Property::LOCAL_VELOCITY:
-      {
-        property = &mSceneObject->GetLocalVelocityProperty();
-        break;
-      }
+    case Dali::PanGestureDetector::Property::LOCAL_DISPLACEMENT:
+    {
+      property = &GetPanGestureSceneObject().GetLocalDisplacementProperty();
+      break;
+    }
 
-      case Dali::PanGestureDetector::Property::PANNING:
-      {
-        property = &mSceneObject->GetPanningProperty();
-        break;
-      }
+    case Dali::PanGestureDetector::Property::LOCAL_VELOCITY:
+    {
+      property = &GetPanGestureSceneObject().GetLocalVelocityProperty();
+      break;
+    }
 
-      default:
-        break;
+    case Dali::PanGestureDetector::Property::PANNING:
+    {
+      property = &GetPanGestureSceneObject().GetPanningProperty();
+      break;
     }
+
+    default:
+      break;
+  }
+  if( !property )
+  {
+    // not our property, ask base
+    property = Object::GetSceneObjectInputProperty( index );
   }
 
   return property;
index 845b714..9eb0940 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_PAN_GESTURE_DETECTOR_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,11 +60,6 @@ public: // Creation
    */
   static PanGestureDetectorPtr New();
 
-  /**
-   * Construct a new PanGestureDetector.
-   */
-  PanGestureDetector();
-
 public:
 
   /**
@@ -80,12 +75,12 @@ public:
   /**
    * @copydoc Dali::PanGestureDetector::GetMinimumTouchesRequired() const
    */
-  unsigned int GetMinimumTouchesRequired() const;
+  uint32_t GetMinimumTouchesRequired() const;
 
   /**
    * @copydoc Dali::PanGestureDetector::GetMaximumTouchesRequired() const
    */
-  unsigned int GetMaximumTouchesRequired() const;
+  uint32_t GetMaximumTouchesRequired() const;
 
   /**
    * @copydoc Dali::PanGestureDetector::AddAngle()
@@ -100,12 +95,12 @@ public:
   /**
    * @copydoc Dali::PanGestureDetector::GetAngleCount()
    */
-  size_t GetAngleCount() const;
+  uint32_t GetAngleCount() const;
 
   /**
    * @copydoc Dali::PanGestureDetector::GetAngle()
    */
-  AngleThresholdPair GetAngle(size_t index) const;
+  AngleThresholdPair GetAngle(uint32_t index) const;
 
   /**
    * @copydoc Dali::PanGestureDetector::ClearAngles()
@@ -144,12 +139,6 @@ public:
    */
   void EmitPanGestureSignal(Dali::Actor actor, const PanGesture& pan);
 
-  /**
-   * Called by the PanGestureProcessor to set the scene object.
-   * @param[in]  object  The scene object.
-   */
-  void SetSceneObject( const SceneGraph::PanGesture* object );
-
 public: // Signals
 
   /**
@@ -181,6 +170,12 @@ public: // Override Pan Gesture
 protected:
 
   /**
+   * Construct a new PanGestureDetector.
+   * @param sceneObject the scene object
+   */
+  PanGestureDetector( const SceneGraph::PanGesture& sceneObject );
+
+  /**
    * A reference counted object may only be deleted by calling Unreference()
    */
   virtual ~PanGestureDetector();
@@ -188,10 +183,14 @@ protected:
 private:
 
   // Undefined
-  PanGestureDetector(const PanGestureDetector&);
+  PanGestureDetector() = delete;
+  PanGestureDetector(const PanGestureDetector&) = delete;
+  PanGestureDetector& operator=(const PanGestureDetector& rhs) = delete;
 
-  // Undefined
-  PanGestureDetector& operator=(const PanGestureDetector& rhs);
+  /**
+   * @return the pan gesture scene object
+   */
+  const SceneGraph::PanGesture& GetPanGestureSceneObject() const;
 
   // From GestureDetector
 
@@ -214,46 +213,6 @@ private:
   // Default property extensions from Object
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
-
-  /**
    * @copydoc Dali::Internal::Object::SetDefaultProperty()
    */
   virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
@@ -269,16 +228,6 @@ private:
   virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
 
   /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
-
-  /**
    * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
    */
   virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
@@ -292,8 +241,6 @@ private:
 
   AngleContainer mAngleContainer; ///< A container of all angles allowed for pan to occur.
 
-  const SceneGraph::PanGesture* mSceneObject; ///< Not owned
-
 };
 
 } // namespace Internal
index 4874424..3bb067b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
 #include <dali/integration-api/events/pan-gesture-event.h>
 #include <dali/integration-api/gesture-manager.h>
 #include <dali/integration-api/debug.h>
-#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
 
@@ -101,9 +101,8 @@ struct IsNotAttachedAndOutsideTouchesRangeFunctor
 
 } // unnamed namespace
 
-PanGestureProcessor::PanGestureProcessor( Stage& stage, Integration::GestureManager& gestureManager, SceneGraph::UpdateManager& updateManager )
+PanGestureProcessor::PanGestureProcessor( Integration::GestureManager& gestureManager, SceneGraph::UpdateManager& updateManager )
 : GestureProcessor( Gesture::Pan ),
-  mStage( stage ),
   mGestureManager( gestureManager ),
   mGestureDetectors(),
   mCurrentPanEmitters(),
@@ -123,7 +122,7 @@ PanGestureProcessor::~PanGestureProcessor()
   mSceneObject = NULL; // mSceneObject is owned and destroyed by update manager (there is only one of these for now)
 }
 
-void PanGestureProcessor::Process( const Integration::PanGestureEvent& panEvent )
+void PanGestureProcessor::Process( Scene& scene, const Integration::PanGestureEvent& panEvent )
 {
   switch( panEvent.state )
   {
@@ -133,7 +132,7 @@ void PanGestureProcessor::Process( const Integration::PanGestureEvent& panEvent
       ResetActor();
 
       HitTestAlgorithm::Results hitTestResults;
-      if( HitTest( mStage, panEvent.currentPosition, hitTestResults ) )
+      if( HitTest( scene, panEvent.currentPosition, hitTestResults ) )
       {
         SetActor( &GetImplementation( hitTestResults.actor ) );
         mPossiblePanPosition = panEvent.currentPosition;
@@ -150,7 +149,7 @@ void PanGestureProcessor::Process( const Integration::PanGestureEvent& panEvent
         // it can be told when the gesture ends as well.
 
         HitTestAlgorithm::Results hitTestResults;
-        HitTest( mStage, mPossiblePanPosition, hitTestResults ); // Hit test original possible position...
+        HitTest( scene, mPossiblePanPosition, hitTestResults ); // Hit test original possible position...
 
         if ( hitTestResults.actor && ( GetCurrentGesturedActor() == &GetImplementation( hitTestResults.actor ) ) )
         {
@@ -195,7 +194,7 @@ void PanGestureProcessor::Process( const Integration::PanGestureEvent& panEvent
 
           if ( !outsideTouchesRangeEmitters.empty() || !mCurrentPanEmitters.empty() )
           {
-            currentGesturedActor->ScreenToLocal( GetImplementation( mCurrentRenderTask ), actorCoords.x, actorCoords.y, panEvent.currentPosition.x, panEvent.currentPosition.y );
+            currentGesturedActor->ScreenToLocal( *mCurrentRenderTask.Get(), actorCoords.x, actorCoords.y, panEvent.currentPosition.x, panEvent.currentPosition.y );
 
             // EmitPanSignal checks whether we have a valid actor and whether the container we are passing in has emitters before it emits the pan.
             EmitPanSignal( currentGesturedActor, outsideTouchesRangeEmitters, panEvent, actorCoords, Gesture::Finished, mCurrentRenderTask);
@@ -238,9 +237,6 @@ void PanGestureProcessor::AddGestureDetector( PanGestureDetector* gestureDetecto
 
   mGestureDetectors.push_back(gestureDetector);
 
-  // Set the pan scene object on the gesture detector
-  gestureDetector->SetSceneObject( mSceneObject );
-
   if (firstRegistration)
   {
     mMinTouchesRequired = gestureDetector->GetMinimumTouchesRequired();
@@ -400,6 +396,11 @@ void PanGestureProcessor::SetMultitapSmoothingRange( int value )
   mSceneObject->SetMultitapSmoothingRange( value );
 }
 
+const SceneGraph::PanGesture& PanGestureProcessor::GetSceneObject() const
+{
+  return *mSceneObject;
+}
+
 void PanGestureProcessor::UpdateDetection()
 {
   DALI_ASSERT_DEBUG(!mGestureDetectors.empty());
@@ -444,7 +445,7 @@ void PanGestureProcessor::EmitPanSignal( Actor* actor,
                                          const Integration::PanGestureEvent& panEvent,
                                          Vector2 localCurrent,
                                          Gesture::State state,
-                                         Dali::RenderTask renderTask )
+                                         RenderTaskPtr renderTask )
 {
   if ( actor && !gestureDetectors.empty() )
   {
@@ -455,7 +456,7 @@ void PanGestureProcessor::EmitPanSignal( Actor* actor,
     pan.screenPosition = panEvent.currentPosition;
     pan.position = localCurrent;
 
-    RenderTask& renderTaskImpl( GetImplementation( renderTask ) );
+    RenderTask& renderTaskImpl( *renderTask.Get() );
 
     Vector2 localPrevious;
     actor->ScreenToLocal( renderTaskImpl, localPrevious.x, localPrevious.y, panEvent.previousPosition.x, panEvent.previousPosition.y );
@@ -472,11 +473,11 @@ void PanGestureProcessor::EmitPanSignal( Actor* actor,
     // Avoid dividing by 0
     if ( panEvent.timeDelta > 0 )
     {
-      pan.velocity.x = pan.displacement.x / panEvent.timeDelta;
-      pan.velocity.y = pan.displacement.y / panEvent.timeDelta;
+      pan.velocity.x = pan.displacement.x / static_cast<float>( panEvent.timeDelta );
+      pan.velocity.y = pan.displacement.y / static_cast<float>( panEvent.timeDelta );
 
-      pan.screenVelocity.x = pan.screenDisplacement.x / panEvent.timeDelta;
-      pan.screenVelocity.y = pan.screenDisplacement.y / panEvent.timeDelta;
+      pan.screenVelocity.x = pan.screenDisplacement.x / static_cast<float>( panEvent.timeDelta );
+      pan.screenVelocity.y = pan.screenDisplacement.y / static_cast<float>( panEvent.timeDelta );
     }
 
     // When the gesture ends, we may incorrectly get a ZERO velocity (as we have lifted our finger without any movement)
@@ -530,14 +531,14 @@ bool PanGestureProcessor::CheckGestureDetector( GestureDetector* detector, Actor
     {
       // It does, calculate the angle of the pan in local actor coordinates and ensures it fits
       // the detector's criteria.
-      RenderTask& renderTaskImpl( GetImplementation( mCurrentRenderTask ) );
+      RenderTask& renderTaskImpl = *mCurrentRenderTask.Get();
 
       Vector2 startPosition, currentPosition;
       actor->ScreenToLocal( renderTaskImpl, startPosition.x,   startPosition.y,   mPossiblePanPosition.x,              mPossiblePanPosition.y );
       actor->ScreenToLocal( renderTaskImpl, currentPosition.x, currentPosition.y, mCurrentPanEvent->currentPosition.x, mCurrentPanEvent->currentPosition.y );
       Vector2 displacement( currentPosition - startPosition );
 
-      Radian angle( atan( displacement.y / displacement.x ) );
+      Radian angle( atanf( displacement.y / displacement.x ) );
 
       /////////////////////////////
       //            |            //
@@ -592,7 +593,7 @@ void PanGestureProcessor::EmitGestureSignal( Actor* actor, const GestureDetector
   mCurrentPanEmitters.clear();
   ResetActor();
 
-  actor->ScreenToLocal( GetImplementation(mCurrentRenderTask), actorCoordinates.x, actorCoordinates.y, mCurrentPanEvent->currentPosition.x, mCurrentPanEvent->currentPosition.y );
+  actor->ScreenToLocal( *mCurrentRenderTask.Get(), actorCoordinates.x, actorCoordinates.y, mCurrentPanEvent->currentPosition.x, mCurrentPanEvent->currentPosition.y );
 
   EmitPanSignal( actor, gestureDetectors, *mCurrentPanEvent, actorCoordinates, mCurrentPanEvent->state, mCurrentRenderTask );
 
index 45d640d..15198ca 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_PAN_GESTURE_EVENT_PROCESSOR_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/render-tasks/render-task.h>
 #include <dali/internal/event/events/pan-gesture-detector-impl.h>
 #include <dali/internal/event/events/gesture-processor.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
 {
@@ -37,6 +37,7 @@ namespace Internal
 {
 
 class Stage;
+class Scene;
 
 namespace SceneGraph
 {
@@ -60,11 +61,10 @@ public:
 
   /**
    * Create a pan gesture processor.
-   * @param[in] stage The stage.
    * @param[in] gestureManager The gesture manager
    * @param[in] updateManager The Update Manager
    */
-  PanGestureProcessor( Stage& stage, Integration::GestureManager& gestureManager, SceneGraph::UpdateManager& updateManager );
+  PanGestureProcessor( Integration::GestureManager& gestureManager, SceneGraph::UpdateManager& updateManager );
 
   /**
    * Destructor
@@ -75,9 +75,10 @@ public: // To be called by GestureEventProcessor
 
   /**
    * This method is called whenever a pan gesture event occurs.
+   * @param[in] scene The scene the pan gesture event occurs in.
    * @param[in] panEvent The event that has occurred.
    */
-  void Process( const Integration::PanGestureEvent& panEvent );
+  void Process( Scene& scene, const Integration::PanGestureEvent& panEvent );
 
   /**
    * Adds a gesture detector to this gesture processor.
@@ -226,6 +227,13 @@ public: // To be called by GestureEventProcessor
    */
   void SetMultitapSmoothingRange( int value );
 
+public: // for PanGestureDetector
+
+  /**
+   * @return the pan gesture scene object
+   */
+  const SceneGraph::PanGesture& GetSceneObject() const;
+
 private:
 
   // Undefined
@@ -252,7 +260,7 @@ private:
                       const Integration::PanGestureEvent& panEvent,
                       Vector2 localCurrent,
                       Gesture::State state,
-                      Dali::RenderTask renderTask );
+                      RenderTaskPtr renderTask );
 
   // GestureProcessor overrides
 
@@ -273,15 +281,14 @@ private:
 
 private:
 
-  Stage& mStage;
   Integration::GestureManager& mGestureManager;
   PanGestureDetectorContainer mGestureDetectors;
   GestureDetectorContainer mCurrentPanEmitters;
-  Dali::RenderTask mCurrentRenderTask;
+  RenderTaskPtr mCurrentRenderTask;
   Vector2 mPossiblePanPosition;
 
-  unsigned int mMinTouchesRequired;
-  unsigned int mMaxTouchesRequired;
+  uint32_t mMinTouchesRequired;
+  uint32_t mMaxTouchesRequired;
 
   Vector2 mLastVelocity;       ///< The last recorded velocity in local actor coordinates.
   Vector2 mLastScreenVelocity; ///< The last recorded velocity in screen coordinates.
index 6fc7c7c..ed6e0ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
 #include <dali/integration-api/events/pinch-gesture-event.h>
 #include <dali/integration-api/gesture-manager.h>
 #include <dali/integration-api/debug.h>
-#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
@@ -100,9 +100,8 @@ struct IsNotAttachedFunctor
 
 } // unnamed namespace
 
-PinchGestureProcessor::PinchGestureProcessor( Stage& stage, Integration::GestureManager& gestureManager )
+PinchGestureProcessor::PinchGestureProcessor( Integration::GestureManager& gestureManager )
 : GestureProcessor( Gesture::Pinch ),
-  mStage(stage),
   mGestureManager(gestureManager),
   mGestureDetectors(),
   mCurrentPinchEmitters(),
@@ -114,7 +113,7 @@ PinchGestureProcessor::~PinchGestureProcessor()
 {
 }
 
-void PinchGestureProcessor::Process( const Integration::PinchGestureEvent& pinchEvent )
+void PinchGestureProcessor::Process( Scene& scene, const Integration::PinchGestureEvent& pinchEvent )
 {
   switch ( pinchEvent.state )
   {
@@ -127,7 +126,7 @@ void PinchGestureProcessor::Process( const Integration::PinchGestureEvent& pinch
       ResetActor();
 
       HitTestAlgorithm::Results hitTestResults;
-      if( HitTest( mStage, pinchEvent.centerPoint, hitTestResults ) )
+      if( HitTest( scene, pinchEvent.centerPoint, hitTestResults ) )
       {
         // Record the current render-task for Screen->Actor coordinate conversions
         mCurrentRenderTask = hitTestResults.renderTask;
@@ -159,7 +158,7 @@ void PinchGestureProcessor::Process( const Integration::PinchGestureEvent& pinch
           if ( !mCurrentPinchEmitters.empty() )
           {
             Vector2 actorCoords;
-            RenderTask& renderTaskImpl( GetImplementation(mCurrentRenderTask) );
+            RenderTask& renderTaskImpl( *mCurrentRenderTask.Get() );
             currentGesturedActor->ScreenToLocal( renderTaskImpl, actorCoords.x, actorCoords.y, pinchEvent.centerPoint.x, pinchEvent.centerPoint.y );
 
             EmitPinchSignal( currentGesturedActor, mCurrentPinchEmitters, pinchEvent, actorCoords );
index c76259c..07e154d 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_PINCH_GESTURE_EVENT_PROCESSOR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/render-tasks/render-task.h>
 #include <dali/internal/event/events/pinch-gesture-detector-impl.h>
 #include <dali/internal/event/events/gesture-processor.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
 {
@@ -36,6 +36,7 @@ struct PinchGestureEvent;
 namespace Internal
 {
 
+class Scene;
 class Stage;
 
 /**
@@ -54,10 +55,9 @@ public:
 
   /**
    * Create a pinch gesture processor.
-   * @param[in] stage The stage.
    * @param[in] gestureManager The gesture manager
    */
-  PinchGestureProcessor(Stage& stage, Integration::GestureManager& gestureManager);
+  PinchGestureProcessor( Integration::GestureManager& gestureManager );
 
   /**
    * Non-virtual destructor; PinchGestureProcessor is not a base class
@@ -68,9 +68,10 @@ public: // To be called by GestureEventProcessor
 
   /**
    * This method is called whenever a pinch gesture event occurs.
+   * @param[in] scene The scene the pinch gesture event occurs in.
    * @param[in] pinchEvent The event that has occurred.
    */
-  void Process(const Integration::PinchGestureEvent& pinchEvent);
+  void Process( Scene& scene, const Integration::PinchGestureEvent& pinchEvent );
 
   /**
    * Adds a gesture detector to this gesture processor.
@@ -121,11 +122,10 @@ private:
 
 private:
 
-  Stage& mStage;
   Integration::GestureManager& mGestureManager;
   PinchGestureDetectorContainer mGestureDetectors;
   GestureDetectorContainer mCurrentPinchEmitters;
-  Dali::RenderTask mCurrentRenderTask;
+  RenderTaskPtr mCurrentRenderTask;
 
   const Integration::PinchGestureEvent* mCurrentPinchEvent; ///< Pointer to current PinchEvent, used when calling ProcessAndEmit()
 };
index 20a5f19..9d3cbd8 100644 (file)
@@ -31,7 +31,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
-#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 
 namespace Dali
 {
@@ -72,9 +72,8 @@ void EmitTapSignal(
 
 } // unnamed namespace
 
-TapGestureProcessor::TapGestureProcessor( Stage& stage, Integration::GestureManager& gestureManager)
+TapGestureProcessor::TapGestureProcessor( Integration::GestureManager& gestureManager)
 : GestureProcessor( Gesture::Tap ),
-  mStage( stage ),
   mGestureManager( gestureManager ),
   mGestureDetectors(),
   mMinTapsRequired( 1 ),
@@ -90,7 +89,7 @@ TapGestureProcessor::~TapGestureProcessor()
 {
 }
 
-void TapGestureProcessor::Process( const Integration::TapGestureEvent& tapEvent )
+void TapGestureProcessor::Process( Scene& scene, const Integration::TapGestureEvent& tapEvent )
 {
   switch ( tapEvent.state )
   {
@@ -98,7 +97,7 @@ void TapGestureProcessor::Process( const Integration::TapGestureEvent& tapEvent
     {
       // Do a hit test and if an actor has been hit then save to see if tap event is still valid on a tap( same actor being hit )
       HitTestAlgorithm::Results hitTestResults;
-      if ( HitTest( mStage, tapEvent.point, hitTestResults ) )
+      if ( HitTest( scene, tapEvent.point, hitTestResults ) )
       {
         SetActor( &GetImplementation( hitTestResults.actor ) );
         mCurrentTapActor.SetActor( GetCurrentGesturedActor() );
@@ -117,7 +116,7 @@ void TapGestureProcessor::Process( const Integration::TapGestureEvent& tapEvent
     {
       // Ensure that we're processing a hit on the current actor and that we've already processed a touch down
       HitTestAlgorithm::Results hitTestResults;
-      if ( GetCurrentGesturedActor() && HitTest( mStage, tapEvent.point, hitTestResults ) && mPossibleProcessed )
+      if ( GetCurrentGesturedActor() && HitTest( scene, tapEvent.point, hitTestResults ) && mPossibleProcessed )
       {
         // Check that this actor is still the one that was used for the last touch down ?
         if ( mCurrentTapActor.GetActor() == &GetImplementation( hitTestResults.actor ) )
index 0f7c6ca..f391987 100644 (file)
@@ -36,6 +36,7 @@ struct TapGestureEvent;
 namespace Internal
 {
 
+class Scene;
 class Stage;
 class Actor;
 
@@ -52,10 +53,9 @@ public:
 
   /**
    * Create a tap gesture processor.
-   * @param[in] stage The stage.
    * @param[in] gestureManager The gesture manager.
    */
-  TapGestureProcessor(Stage& stage, Integration::GestureManager& gestureManager);
+  TapGestureProcessor( Integration::GestureManager& gestureManager );
 
   /**
    * Non-virtual destructor; TapGestureProcessor is not a base class
@@ -66,9 +66,10 @@ public: // To be called by GestureEventProcessor
 
   /**
    * This method is called whenever a tap gesture event occurs.
+   * @param[in] scene The scene the tap gesture event occurs in.
    * @param[in] tapEvent The event that has occurred.
    */
-  void Process(const Integration::TapGestureEvent& tapEvent);
+  void Process( Scene& scene, const Integration::TapGestureEvent& tapEvent);
 
   /**
    * Adds a gesture detector to this gesture processor.
@@ -125,7 +126,6 @@ private:
 
 private:
 
-  Stage& mStage;
   Integration::GestureManager& mGestureManager;
   TapGestureDetectorContainer mGestureDetectors;
 
old mode 100644 (file)
new mode 100755 (executable)
index 58547ea..fc26673
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -177,6 +177,15 @@ Device::Subclass::Type TouchData::GetDeviceSubclass( std::size_t point ) const
   return Device::Subclass::NONE;
 }
 
+MouseButton::Type TouchData::GetMouseButton( std::size_t point ) const
+{
+  if( point < mPoints.size() )
+  {
+    return mPoints[ point ].GetMouseButton();
+  }
+  return MouseButton::INVALID;
+}
+
 } // namsespace Internal
 
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index 15bfb4f..72de401
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_TOUCH_DATA_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -172,6 +172,14 @@ public:
    */
   Device::Subclass::Type GetDeviceSubclass( std::size_t point ) const;
 
+  /**
+   * @brief Get mouse's button value (ex: right/left button)
+   *
+   * @return The value of mouse button
+   */
+  MouseButton::Type GetMouseButton( std::size_t point ) const;
+
+
 private:
 
   /// Undefined Copy constructor
index 871d851..de87942 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/actors/layer-impl.h>
-#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
 #include <dali/internal/event/events/hit-test-algorithm-impl.h>
 #include <dali/internal/event/events/multi-point-event-util.h>
 #include <dali/internal/event/events/touch-data-impl.h>
@@ -149,8 +149,8 @@ Dali::Actor EmitTouchSignals( Actor* actor, RenderTask& renderTask, const TouchE
 
 } // unnamed namespace
 
-TouchEventProcessor::TouchEventProcessor( Stage& stage )
-: mStage( stage ),
+TouchEventProcessor::TouchEventProcessor( Scene& scene )
+: mScene( scene ),
   mLastPrimaryHitActor( MakeCallback( this, &TouchEventProcessor::OnObservedActorDisconnected ) ),
   mLastConsumedActor(),
   mTouchDownConsumedActor(),
@@ -167,11 +167,8 @@ TouchEventProcessor::~TouchEventProcessor()
 void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& event )
 {
   DALI_LOG_TRACE_METHOD( gLogFilter );
-
   DALI_ASSERT_ALWAYS( !event.points.empty() && "Empty TouchEvent sent from Integration\n" );
 
-  Stage& stage = mStage;
-
   PRINT_HIERARCHY(gLogFilter);
 
   // 1) Check if it is an interrupted event - we should inform our last primary hit actor about this
@@ -229,8 +226,7 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
     touchEvent.points.push_back( currentPoint.GetTouchPoint() );
     touchData->AddPoint( currentPoint );
 
-    mStage.EmitTouchedSignal( touchEvent, touchDataHandle );
-
+    mScene.EmitTouchedSignal( touchEvent, touchDataHandle );
     return; // No need for hit testing
   }
 
@@ -242,12 +238,12 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
   DALI_LOG_INFO( gLogFilter, Debug::Concise, "\n" );
   DALI_LOG_INFO( gLogFilter, Debug::General, "Point(s): %d\n", event.GetPointCount() );
 
-  Dali::RenderTask currentRenderTask;
+  RenderTaskPtr currentRenderTask;
 
   for ( Integration::PointContainerConstIterator iter = event.points.begin(), beginIter = event.points.begin(), endIter = event.points.end(); iter != endIter; ++iter )
   {
     HitTestAlgorithm::Results hitTestResults;
-    HitTestAlgorithm::HitTest( stage, iter->GetScreenPosition(), hitTestResults );
+    HitTestAlgorithm::HitTest( mScene.GetSize(), mScene.GetRenderTaskList(), mScene.GetLayerList(), iter->GetScreenPosition(), hitTestResults );
 
     Integration::Point newPoint( *iter );
     newPoint.SetHitActor( hitTestResults.actor );
@@ -299,10 +295,10 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
   Actor* lastConsumedActor( mLastConsumedActor.GetActor() );
   if( ( primaryPointState == PointState::MOTION ) || ( primaryPointState == PointState::UP ) || ( primaryPointState == PointState::STATIONARY ) )
   {
-    if ( mLastRenderTask )
+    if( mLastRenderTask )
     {
       Dali::Actor leaveEventConsumer;
-      RenderTask& lastRenderTaskImpl( GetImplementation( mLastRenderTask ) );
+      RenderTask& lastRenderTaskImpl = *mLastRenderTask.Get();
 
       if( lastPrimaryHitActor &&
           lastPrimaryHitActor != primaryHitActor &&
@@ -416,10 +412,11 @@ void TouchEventProcessor::ProcessTouchEvent( const Integration::TouchEvent& even
         mTouchDownConsumedActor.SetActor( NULL );
       }
       // No break, Fallthrough
+      __attribute__ ((fallthrough));
 
       case PointState::DOWN:
       {
-        mStage.EmitTouchedSignal( touchEvent, touchDataHandle );
+        mScene.EmitTouchedSignal( touchEvent, touchDataHandle );
         break;
       }
 
index e0c38b7..2ec2477 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_TOUCH_EVENT_PROCESSOR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/render-tasks/render-task.h>
 #include <dali/internal/event/events/actor-observer.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
 {
@@ -38,7 +38,7 @@ namespace Internal
 {
 
 class Actor;
-class Stage;
+class Scene;
 struct ActorObserver;
 
 /**
@@ -55,9 +55,9 @@ public:
 
   /**
    * Create an event processor.
-   * @param[in] stage The stage.
+   * @param[in] scene The scene the event processor belongs to.
    */
-  TouchEventProcessor( Stage& stage );
+  TouchEventProcessor( Scene& scene );
 
   /**
    * Non-virtual destructor; TouchEventProcessor is not a base class
@@ -78,6 +78,10 @@ private:
   // Undefined
   TouchEventProcessor& operator=(const TouchEventProcessor& rhs);
 
+private:
+
+  Scene& mScene; ///< Used to deliver touch events
+
   /**
    * Called by some actor-observers when the observed actor is disconnected.
    *
@@ -85,13 +89,10 @@ private:
    */
   void OnObservedActorDisconnected( Actor* actor );
 
-private:
-
-  Stage& mStage; ///< Used to deliver touch events
   ActorObserver mLastPrimaryHitActor; ///< Stores the last primary point hit actor
   ActorObserver mLastConsumedActor; ///< Stores the last consumed actor
   ActorObserver mTouchDownConsumedActor; ///< Stores the touch-down consumed actor
-  Dali::RenderTask mLastRenderTask; ///< The RenderTask used for the last hit actor
+  RenderTaskPtr mLastRenderTask; ///< The RenderTask used for the last hit actor
 };
 
 } // namespace Internal
index 0dcdb2f..107bd27 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/public-api/events/wheel-event.h>
-#include <dali/devel-api/events/hit-test-algorithm.h>
+
 #include <dali/public-api/math/vector2.h>
 #include <dali/integration-api/events/wheel-event-integ.h>
-#include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/actors/actor-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
+#include <dali/internal/event/events/hit-test-algorithm-impl.h>
 
 namespace Dali
 {
@@ -121,8 +122,8 @@ bool IsActorWheelableFunction(Dali::Actor actor, Dali::HitTestAlgorithm::Travers
 } // unnamed namespace
 
 
-WheelEventProcessor::WheelEventProcessor(Stage& stage)
-: mStage(stage)
+WheelEventProcessor::WheelEventProcessor( Scene& scene )
+: mScene( scene )
 {
 }
 
@@ -130,15 +131,14 @@ WheelEventProcessor::~WheelEventProcessor()
 {
 }
 
-void WheelEventProcessor::ProcessWheelEvent(const Integration::WheelEvent& event)
+void WheelEventProcessor::ProcessWheelEvent( const Integration::WheelEvent& event )
 {
-  Stage& stage = mStage;
-  WheelEvent wheelEvent( static_cast< WheelEvent::Type >(event.type), event.direction, event.modifiers, event.point, event.z, event.timeStamp );
+  WheelEvent wheelEvent( static_cast< WheelEvent::Type >( event.type ), event.direction, event.modifiers, event.point, event.z, event.timeStamp );
 
   if( wheelEvent.type == WheelEvent::MOUSE_WHEEL )
   {
-    HitTestAlgorithm::Results hitTestResults;
-    HitTestAlgorithm::HitTest( Dali::Stage(&stage), event.point, hitTestResults, IsActorWheelableFunction );
+    Dali::HitTestAlgorithm::Results hitTestResults;
+    HitTestAlgorithm::HitTest( mScene.GetSize(), mScene.GetRenderTaskList(), mScene.GetLayerList(), event.point, hitTestResults, IsActorWheelableFunction );
 
     DALI_LOG_INFO( gLogFilter, Debug::General, "  Screen(%.0f, %.0f), HitActor(%p, %s), Local(%.2f, %.2f)\n",
                    event.point.x, event.point.y,
@@ -154,8 +154,8 @@ void WheelEventProcessor::ProcessWheelEvent(const Integration::WheelEvent& event
   }
   else
   {
-    // if CUSTOM_WHEEL, emit the key event signal from stage.
-    mStage.EmitWheelEventSignal( wheelEvent );
+    // if CUSTOM_WHEEL, emit the wheel event signal from the scene.
+    mScene.EmitWheelEventSignal( wheelEvent );
   }
 }
 
index bc26322..3e1bdc1 100644 (file)
@@ -18,6 +18,8 @@
  *
  */
 
+#include <vector>
+
 namespace Dali
 {
 
@@ -29,7 +31,7 @@ struct WheelEvent;
 namespace Internal
 {
 
-class Stage;
+class Scene;
 
 /**
  *  WheelEventProcessor receives the wheel events from the Dali Event processor.
@@ -46,7 +48,7 @@ public:
   /**
    * Create a wheel event processor.
    */
-  WheelEventProcessor(Stage& stage);
+  WheelEventProcessor( Scene& scenes );
 
   /**
    * Non-virtual destructor; WheelEventProcessor is not a base class
@@ -69,7 +71,7 @@ private:
 
 private:
 
-  Stage& mStage;               ///< Used to deliver the wheel events
+  Scene& mScene;               ///< Used to deliver the wheel events
 };
 
 } // namespace Internal
index 65a01bc..3e057b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -44,9 +44,9 @@ BitmapCompressed::~BitmapCompressed()
 }
 
 void BitmapCompressed::Initialize( Pixel::Format pixelFormat,
-                          const unsigned int width,
-                          const unsigned int height,
-                          const size_t bufferSize )
+                                   const uint32_t width,
+                                   const uint32_t height,
+                                   const uint32_t bufferSize )
 {
   Dali::Integration::Bitmap::Initialize( pixelFormat, width, height );
   mBufferSize  = bufferSize;
@@ -54,9 +54,9 @@ void BitmapCompressed::Initialize( Pixel::Format pixelFormat,
 }
 
 Dali::Integration::PixelBuffer* BitmapCompressed::ReserveBufferOfSize( Pixel::Format pixelFormat,
-                                    const unsigned int  width,
-                                    const unsigned int  height,
-                                    const size_t        bufferSize )
+                                                                       const uint32_t  width,
+                                                                       const uint32_t  height,
+                                                                       const uint32_t  bufferSize )
 {
   // Sanity check that a not-outrageous amount of data is being passed in (indicating a client error):
   DALI_ASSERT_DEBUG(bufferSize < (1U << 27U) && "That is far too much compressed data."); // 128MB of compressed data == unreasonable.
index 874e976..2ee839a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_COMPRESSED_BITMAP_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -58,9 +58,9 @@ private:
    * @param[in] bufferSize    Buffer cpacity in pixels
    */
   void Initialize(Pixel::Format pixelFormat,
-                           unsigned int width,
-                           unsigned int height,
-                           const std::size_t bufferSize);
+                           uint32_t width,
+                           uint32_t height,
+                           uint32_t bufferSize);
 public:
   /**
    * (Re-)Allocate pixel buffer for the Bitmap. Any previously allocated pixel buffer
@@ -75,15 +75,15 @@ public:
    * @return pixel buffer pointer
    */
   virtual Dali::Integration::PixelBuffer* ReserveBufferOfSize( Pixel::Format pixelFormat,
-                                     const unsigned width,
-                                     const unsigned height,
-                                     const std::size_t numBytes );
+                                     const uint32_t width,
+                                     const uint32_t height,
+                                     const uint32_t numBytes );
 
   /**
    * Get the pixel buffer size in bytes
    * @return The buffer size in bytes.
    */
-  virtual std::size_t GetBufferSize() const
+  virtual uint32_t GetBufferSize() const
   {
     return mBufferSize;
   }
@@ -102,7 +102,7 @@ protected:
 
 private:
 
-  std::size_t mBufferSize;
+  uint32_t mBufferSize;
 
   BitmapCompressed(const BitmapCompressed& other);  ///< defined private to prevent use
   BitmapCompressed& operator = (const BitmapCompressed& other); ///< defined private to prevent use
index 2bc220d..07536b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,11 +43,11 @@ BitmapPackedPixel::BitmapPackedPixel( ResourcePolicy::Discardable discardable, D
 }
 
 // use power of two bufferWidth and bufferHeight for better performance
-Dali::Integration::PixelBuffer* BitmapPackedPixel::ReserveBuffer(Pixel::Format pixelFormat,
-                                    unsigned int  width,
-                                    unsigned int  height,
-                                    unsigned int  bufferWidth,
-                                    unsigned int  bufferHeight)
+Dali::Integration::PixelBuffer* BitmapPackedPixel::ReserveBuffer( Pixel::Format pixelFormat,
+                                                                  uint32_t width,
+                                                                  uint32_t height,
+                                                                  uint32_t bufferWidth,
+                                                                  uint32_t bufferHeight )
 {
   // delete existing buffer
   DeletePixelBuffer();
@@ -55,20 +55,20 @@ Dali::Integration::PixelBuffer* BitmapPackedPixel::ReserveBuffer(Pixel::Format p
   Initialize(pixelFormat, width, height, bufferWidth, bufferHeight);
 
   //allocate buffer
-  unsigned int bufSize = mBufferWidth * mBufferHeight * mBytesPerPixel;
+  uint32_t bufSize = mBufferWidth * mBufferHeight * mBytesPerPixel;
 
   mData = reinterpret_cast< Dali::Integration::PixelBuffer* >( malloc( bufSize) );
 
   return mData;
 }
 
-void BitmapPackedPixel::AssignBuffer(Pixel::Format pixelFormat,
-                                     Dali::Integration::PixelBuffer* buffer,
-                                     std::size_t bufferSize,
-                                     unsigned int width,
-                                     unsigned int height,
-                                     unsigned int bufferWidth,
-                                     unsigned int bufferHeight)
+void BitmapPackedPixel::AssignBuffer( Pixel::Format pixelFormat,
+                                      Dali::Integration::PixelBuffer* buffer,
+                                      uint32_t bufferSize,
+                                      uint32_t width,
+                                      uint32_t height,
+                                      uint32_t bufferWidth,
+                                      uint32_t bufferHeight)
 {
   DALI_ASSERT_DEBUG( buffer );
 
@@ -91,21 +91,21 @@ void BitmapPackedPixel::TestForTransparency()
 
   if(HasAlphaChannel())
   {
-    unsigned char* pixelBuffer=GetBuffer();
+    uint8_t* pixelBuffer=GetBuffer();
     if(pixelBuffer != NULL)
     {
-      unsigned char* row = pixelBuffer;
+      uint8_t* row = pixelBuffer;
 
-      int byte; int bits;
+      int32_t byte; int32_t bits;
       Pixel::GetAlphaOffsetAndMask(mPixelFormat, byte, bits);
 
-      int stride       = mBufferWidth * mBytesPerPixel;
-      int pixelsPerRow = mImageWidth;
+      int32_t stride       = mBufferWidth * mBytesPerPixel;
+      int32_t pixelsPerRow = mImageWidth;
 
-      for(size_t j=0; j<mImageHeight; j++)
+      for(uint32_t j=0; j<mImageHeight; j++)
       {
-        unsigned char* pixels = row;
-        for(int i=0; i<pixelsPerRow; i++)
+        uint8_t* pixels = row;
+        for(int32_t i=0; i<pixelsPerRow; i++)
         {
           if((pixels[byte] & bits) != bits)
           {
@@ -127,10 +127,10 @@ BitmapPackedPixel::~BitmapPackedPixel()
 }
 
 void BitmapPackedPixel::Initialize( Pixel::Format pixelFormat,
-                          unsigned int width,
-                          unsigned int height,
-                          unsigned int bufferWidth,
-                          unsigned int bufferHeight)
+                                    uint32_t width,
+                                    uint32_t height,
+                                    uint32_t bufferWidth,
+                                    uint32_t bufferHeight)
 {
   Dali::Integration::Bitmap::Initialize(pixelFormat, width, height);
   mBufferWidth  = (bufferWidth  != 0) ? bufferWidth  : width;
@@ -139,7 +139,7 @@ void BitmapPackedPixel::Initialize( Pixel::Format pixelFormat,
   DALI_ASSERT_DEBUG(mBufferWidth >= mImageWidth && mBufferHeight >= mImageHeight);
 }
 
-unsigned int BitmapPackedPixel::GetBufferStride() const
+uint32_t BitmapPackedPixel::GetBufferStride() const
 {
   return mBufferWidth*mBytesPerPixel;
 }
index 9a72759..85fb666 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_BITMAP_H__
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -65,10 +65,10 @@ public:
    * @return pixel buffer pointer
    */
   virtual Dali::Integration::PixelBuffer* ReserveBuffer(Pixel::Format pixelFormat,
-                                     unsigned int width,
-                                     unsigned int height,
-                                     unsigned int bufferWidth = 0,
-                                     unsigned int bufferHeight = 0);
+                                     uint32_t width,
+                                     uint32_t height,
+                                     uint32_t bufferWidth = 0,
+                                     uint32_t bufferHeight = 0);
 
   /**
    * Assign a pixel buffer. Any previously allocated pixel buffer is deleted.
@@ -85,11 +85,11 @@ public:
    */
   virtual void AssignBuffer(Pixel::Format pixelFormat,
                             Dali::Integration::PixelBuffer* buffer,
-                            std::size_t bufferSize,
-                            unsigned int width,
-                            unsigned int height,
-                            unsigned int bufferWidth = 0,
-                            unsigned int bufferHeight = 0);
+                            uint32_t bufferSize,
+                            uint32_t width,
+                            uint32_t height,
+                            uint32_t bufferWidth = 0,
+                            uint32_t bufferHeight = 0);
 
   /**
    * Get the width of the buffer (stride)
@@ -113,10 +113,9 @@ public:
    * Get the pixel buffer size in bytes
    * @return The buffer size in bytes.
    */
-  // unsigned int GetBufferSize() const
-  virtual size_t GetBufferSize() const
+  virtual uint32_t GetBufferSize() const
   {
-    return static_cast< size_t >( mBufferWidth ) * mBytesPerPixel * mBufferHeight; // need to cast to size_t to avoid possibility of overflow
+    return mBufferWidth * mBytesPerPixel * mBufferHeight;
   }
 
   /**
@@ -128,7 +127,7 @@ public:
    * Get the pixel buffer stride.
    * @return The buffer stride (in bytes).
    */
-  virtual unsigned int GetBufferStride() const;
+  virtual uint32_t GetBufferStride() const;
 
   /**
    * Get the pixel format
@@ -154,9 +153,9 @@ protected:
 
 protected:
 
-  unsigned int  mBufferWidth;         ///< Buffer width (stride) in pixels
-  unsigned int  mBufferHeight;        ///< Buffer height in pixels
-  unsigned int  mBytesPerPixel;       ///< Bytes per pixel
+  uint32_t  mBufferWidth;         ///< Buffer width (stride) in pixels
+  uint32_t  mBufferHeight;        ///< Buffer height in pixels
+  uint32_t  mBytesPerPixel;       ///< Bytes per pixel
 
 private:
 
@@ -169,10 +168,10 @@ private:
    * @param[in] bufferHeight  Buffer height in pixels
    */
   void Initialize(Pixel::Format pixelFormat,
-                           unsigned int width,
-                           unsigned int height,
-                           unsigned int bufferWidth,
-                           unsigned int bufferHeight);
+                           uint32_t width,
+                           uint32_t height,
+                           uint32_t bufferWidth,
+                           uint32_t bufferHeight);
 
 
   BitmapPackedPixel(const BitmapPackedPixel& other);  ///< defined private to prevent use
index 7879f06..ca659c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -139,8 +139,8 @@ void BufferImage::UploadArea( const RectArea& area )
 
   mBufferWidth = area.width ? area.width : mWidth;
   uint32_t bufferHeight = area.height ? area.height : mHeight;
-  size_t bufferSize = mBytesPerPixel * mBufferWidth * bufferHeight;
-  unsigned char* buffer = reinterpret_cast< Dali::Integration::PixelBuffer* >( malloc( bufferSize ) );
+  uint32_t bufferSize = mBytesPerPixel * mBufferWidth * bufferHeight;
+  Dali::Integration::PixelBuffer* buffer = reinterpret_cast< Dali::Integration::PixelBuffer* >( malloc( bufferSize ) );
   DALI_ASSERT_DEBUG(buffer != 0);
 
   // Are we uploading from an external or internal buffer ?
index 6666656..59ef463 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,8 +35,6 @@ namespace Internal
 namespace
 {
 
-TypeRegistration mType( typeid( Dali::EncodedBufferImage ), typeid( Dali::Image ), NULL );
-
 /** Raw bytes of a resource laid out exactly as it would be in a file, but in memory. */
 typedef Dali::RefCountedVector<uint8_t> RequestBuffer;
 /** Counting smart pointer for managing a buffer of raw bytes. */
@@ -86,7 +84,7 @@ EncodedBufferImagePtr EncodedBufferImage::New( const uint8_t * const encodedImag
     image->mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
 
     //Upload data to the texture
-    size_t bufferSize = bitmap->GetBufferSize();
+    uint32_t bufferSize = bitmap->GetBufferSize();
     PixelDataPtr pixelData = PixelData::New( bitmap->GetBufferOwnership(), bufferSize, width, height, format,
                                              static_cast< Dali::PixelData::ReleaseFunction >( bitmap->GetReleaseFunction() ) );
     image->mTexture->Upload( pixelData );
index 15aa6a8..4a9daa2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,14 +30,11 @@ namespace Internal
 
 namespace
 {
-TypeRegistration mType( typeid( Dali::FrameBufferImage ), typeid( Dali::Image ), NULL );
-
-const int RenderBufferFormatToFrameBufferAttachments[]  = { Dali::FrameBuffer::Attachment::NONE,
-                                                            Dali::FrameBuffer::Attachment::DEPTH,
-                                                            Dali::FrameBuffer::Attachment::STENCIL,
-                                                            Dali::FrameBuffer::Attachment::DEPTH_STENCIL
-                                                          };
-
+const Dali::FrameBuffer::Attachment::Mask RenderBufferFormatToFrameBufferAttachments[]  =
+  { Dali::FrameBuffer::Attachment::NONE,
+    Dali::FrameBuffer::Attachment::DEPTH,
+    Dali::FrameBuffer::Attachment::STENCIL,
+    Dali::FrameBuffer::Attachment::DEPTH_STENCIL };
 } // unnamed namespace
 
 FrameBufferImagePtr FrameBufferImage::New( unsigned int width,
index 9d5e275..49d7f54 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -37,38 +37,6 @@ namespace Dali
 namespace Internal
 {
 
-namespace
-{
-
-// Signals
-
-const char* const SIGNAL_IMAGE_UPLOADED = "uploaded";
-
-TypeRegistration mType( typeid( Dali::Image ), typeid( Dali::BaseHandle ), NULL );
-
-Dali::SignalConnectorType signalConnector1( mType, SIGNAL_IMAGE_UPLOADED, &Image::DoConnectSignal );
-
-}
-
-bool Image::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
-{
-  bool connected( true );
-  DALI_ASSERT_DEBUG( dynamic_cast<Image*>( object ) && "Failed to downcast from BaseObject to Image.\n" );
-  Image* image = static_cast<Image*>(object);
-
-  if( 0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_UPLOADED ) )
-  {
-    image->UploadedSignal().Connect( tracker, functor );
-  }
-  else
-  {
-    // signalName does not match any signal
-    connected = false;
-  }
-
-  return connected;
-}
-
 unsigned int Image::GetWidth() const
 {
   return mWidth;
@@ -81,7 +49,7 @@ unsigned int Image::GetHeight() const
 
 Vector2 Image::GetNaturalSize() const
 {
-  return Vector2( mWidth, mHeight );
+  return Vector2( static_cast<float>( mWidth ), static_cast<float>( mHeight ) );
 }
 
 Image::Image()
index 2a4f142..c219871 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_IMAGE_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -51,17 +51,6 @@ public:
   Dali::Image::ImageSignalType& UploadedSignal() { return mUploaded; }
 
   /**
-   * Connects a callback function with the object's signals.
-   * @param[in] object The object providing the signal.
-   * @param[in] tracker Used to disconnect the signal.
-   * @param[in] signalName The signal to connect to.
-   * @param[in] functor A newly allocated FunctorDelegate.
-   * @return True if the signal was connected.
-   * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
-   */
-  static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
-
-  /**
    * Get the width of the image.
    * Only to be used after the image has finished loading.
    * (Ticket's LoadingSucceeded callback was called)
index d7e3f9e..bd7072e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,11 +33,6 @@ namespace Dali
 namespace Internal
 {
 
-namespace
-{
-TypeRegistration mType( typeid(Dali::NativeImage), typeid(Dali::Image), NULL );
-}
-
 NativeImage::NativeImage( NativeImageInterface& resourceData )
 : Image()
 {
index b43d818..ca96236 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -167,11 +167,6 @@ namespace Dali
 namespace Internal
 {
 
-namespace
-{
-TypeRegistration mType( typeid( Dali::NinePatchImage ), typeid( Dali::Image ), NULL );
-} // unnamed namespace
-
 NinePatchImagePtr NinePatchImage::New( const std::string& filename )
 {
   Internal::NinePatchImagePtr internal( new NinePatchImage( filename ) );
@@ -199,8 +194,8 @@ NinePatchImage::NinePatchImage( const std::string& filename )
     mHeight = mBitmap->GetImageHeight();
     mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, mBitmap->GetPixelFormat(), mWidth, mHeight );
 
-    size_t bufferSize = mBitmap->GetBufferSize();
-    unsigned char* buffer = new unsigned char[bufferSize];
+    uint32_t bufferSize = mBitmap->GetBufferSize();
+    uint8_t* buffer = new uint8_t[bufferSize];
     memcpy( buffer, mBitmap->GetBuffer(), bufferSize );
     PixelDataPtr pixelData = PixelData::New( buffer, bufferSize, mWidth, mHeight, mBitmap->GetPixelFormat(), Dali::PixelData::DELETE_ARRAY );
     mTexture->Upload( pixelData );
@@ -269,13 +264,13 @@ Internal::BufferImagePtr NinePatchImage::CreateCroppedBufferImage()
     if( srcProfile )
     {
       PixelBuffer* destPixels = cropped->GetBuffer();
-      unsigned int destStride = cropped->GetBufferStride();
-      unsigned int pixelWidth = GetBytesPerPixel(pixelFormat);
+      uint32_t destStride = cropped->GetBufferStride();
+      uint32_t pixelWidth = GetBytesPerPixel(pixelFormat);
 
       PixelBuffer* srcPixels = mBitmap->GetBuffer();
-      unsigned int srcStride = srcProfile->GetBufferStride();
+      uint32_t srcStride = srcProfile->GetBufferStride();
 
-      for( unsigned int row=1; row < mHeight-1; ++row )
+      for( uint32_t row=1; row < mHeight-1; ++row )
       {
         PixelBuffer* src  = srcPixels + row*srcStride + pixelWidth;
         PixelBuffer* dest = destPixels + (row-1)*destStride;
@@ -325,15 +320,15 @@ void NinePatchImage::ParseBorders()
       testValue = 0;           // Black == stretch
     }
 
-    unsigned int pixelWidth = GetBytesPerPixel( pixelFormat );
+    uint32_t pixelWidth = GetBytesPerPixel( pixelFormat );
     const PixelBuffer* srcPixels = mBitmap->GetBuffer();
-    unsigned int srcStride = srcProfile->GetBufferStride();
+    uint32_t srcStride = srcProfile->GetBufferStride();
 
     //TOP
     const PixelBuffer* top = srcPixels + pixelWidth;
-    unsigned int index = 0;
-    unsigned int width = mBitmap->GetImageWidth();
-    unsigned int height = mBitmap->GetImageHeight();
+    uint32_t index = 0;
+    uint32_t width = mBitmap->GetImageWidth();
+    uint32_t height = mBitmap->GetImageHeight();
 
     for(; index < width - 2; )
     {
@@ -394,9 +389,9 @@ void NinePatchImage::ParseBorders()
   }
 }
 
-Uint16Pair NinePatchImage::ParseRange( unsigned int& index, unsigned int width, const PixelBuffer* & pixel, unsigned int pixelStride, int testByte, int testBits, int testValue )
+Uint16Pair NinePatchImage::ParseRange( uint32_t& index, uint32_t width, const PixelBuffer* & pixel, uint32_t pixelStride, int testByte, int testBits, int testValue )
 {
-  unsigned int start = 0xFFFF;
+  uint32_t start = 0xFFFF;
   for( ; index < width; ++index, pixel += pixelStride )
   {
     if( ( pixel[ testByte ] & testBits ) == testValue )
@@ -408,7 +403,7 @@ Uint16Pair NinePatchImage::ParseRange( unsigned int& index, unsigned int width,
     }
   }
 
-  unsigned int end = width;
+  uint32_t end = width;
   for( ; index < width; ++index, pixel += pixelStride )
   {
     if( ( pixel[ testByte ] & testBits ) != testValue )
index fbc76d4..544e0d6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // CLASS HEADER
 #include <dali/internal/event/images/pixel-data-impl.h>
 
-// EXTERNAL INCLUDES
-#include <stdlib.h>
-
 namespace Dali
 {
 
 namespace Internal
 {
 
-PixelData::PixelData( unsigned char* buffer,
-                      unsigned int bufferSize,
-                      unsigned int width,
-                      unsigned int height,
+PixelData::PixelData( uint8_t* buffer,
+                      uint32_t bufferSize,
+                      uint32_t width,
+                      uint32_t height,
                       Pixel::Format pixelFormat,
                       Dali::PixelData::ReleaseFunction releaseFunction )
 : mBuffer( buffer ),
@@ -46,7 +43,7 @@ PixelData::~PixelData()
 {
   if( mBuffer )
   {
-    if( mReleaseFunction == Dali::PixelData::FREE)
+    if( mReleaseFunction == Dali::PixelData::FREE )
     {
       free( mBuffer );
     }
@@ -57,22 +54,22 @@ PixelData::~PixelData()
   }
  }
 
-PixelDataPtr PixelData::New(unsigned char* buffer,
-                            unsigned int bufferSize,
-                            unsigned int width,
-                            unsigned int height,
-                            Pixel::Format pixelFormat,
-                            Dali::PixelData::ReleaseFunction releaseFunction)
+PixelDataPtr PixelData::New( uint8_t* buffer,
+                             uint32_t bufferSize,
+                             uint32_t width,
+                             uint32_t height,
+                             Pixel::Format pixelFormat,
+                             Dali::PixelData::ReleaseFunction releaseFunction )
 {
   return new PixelData( buffer, bufferSize, width, height, pixelFormat, releaseFunction );
 }
 
-unsigned int PixelData::GetWidth() const
+uint32_t PixelData::GetWidth() const
 {
   return mWidth;
 }
 
-unsigned int PixelData::GetHeight() const
+uint32_t PixelData::GetHeight() const
 {
   return mHeight;
 }
@@ -82,12 +79,12 @@ Pixel::Format PixelData::GetPixelFormat() const
   return mPixelFormat;
 }
 
-unsigned char* PixelData::GetBuffer() const
+uint8_t* PixelData::GetBuffer() const
 {
   return mBuffer;
 }
 
-unsigned int PixelData::GetBufferSize() const
+uint32_t PixelData::GetBufferSize() const
 {
   return mBufferSize;
 }
index 8967c96..01d6249 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_PIXEL_DATA_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,10 +46,10 @@ public:
    * @param [in] pixelFormat      The pixel format
    * @param [in] releaseFunction  The function used to release the memory.
    */
-  static PixelDataPtr New( unsigned char* buffer,
-                           unsigned int bufferSize,
-                           unsigned int width,
-                           unsigned int height,
+  static PixelDataPtr New( uint8_t* buffer,
+                           uint32_t bufferSize,
+                           uint32_t width,
+                           uint32_t height,
                            Pixel::Format pixelFormat,
                            Dali::PixelData::ReleaseFunction releaseFunction);
 
@@ -63,10 +63,10 @@ public:
    * @param [in] pixelFormat      The pixel format
    * @param [in] releaseFunction  The function used to release the memory.
    */
-  PixelData( unsigned char* buffer,
-             unsigned int bufferSize,
-             unsigned int width,
-             unsigned int height,
+  PixelData( uint8_t* buffer,
+             uint32_t bufferSize,
+             uint32_t width,
+             uint32_t height,
              Pixel::Format pixelFormat,
              Dali::PixelData::ReleaseFunction releaseFunction );
 
@@ -85,13 +85,13 @@ public:
    * Get the width of the buffer in pixels.
    * @return The width of the buffer in pixels
    */
-  unsigned int GetWidth() const;
+  uint32_t GetWidth() const;
 
   /**
    * Get the height of the buffer in pixels
    * @return The height of the buffer in pixels
    */
-  unsigned int GetHeight() const;
+  uint32_t GetHeight() const;
 
   /**
    * Get the pixel format
@@ -103,13 +103,13 @@ public:
    * Get the pixel buffer if it's present.
    * @return The buffer if exists, or NULL if there is no pixel buffer.
    */
-  unsigned char* GetBuffer() const;
+  uint8_t* GetBuffer() const;
 
   /**
    * Get the size of the buffer in bytes
    * @return The size of the buffer
    */
-  unsigned int GetBufferSize() const;
+  uint32_t GetBufferSize() const;
 
   /**
    * Return the buffer pointer and reset the internal buffer to zero.
@@ -131,11 +131,11 @@ private:
 
 private:
 
-  unsigned char* mBuffer;           ///< The raw pixel data
-  unsigned int   mBufferSize;       ///< Buffer sized in bytes
-  unsigned int   mWidth;            ///< Buffer width in pixels
-  unsigned int   mHeight;           ///< Buffer height in pixels
-  Pixel::Format  mPixelFormat;      ///< Pixel format
+  uint8_t*   mBuffer;           ///< The raw pixel data
+  uint32_t   mBufferSize;       ///< Buffer sized in bytes
+  uint32_t   mWidth;            ///< Buffer width in pixels
+  uint32_t   mHeight;           ///< Buffer height in pixels
+  Pixel::Format  mPixelFormat;  ///< Pixel format
   Dali::PixelData::ReleaseFunction mReleaseFunction;  ///< Function for releasing memory
 };
 
index dc116cc..9269e15 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,26 +38,6 @@ namespace Dali
 namespace Internal
 {
 
-namespace
-{
-
-// Signals
-
-const char* const SIGNAL_IMAGE_LOADING_FINISHED = "imageLoadingFinished";
-
-
-BaseHandle CreateImage()
-{
-  ImagePtr image = ResourceImage::New();
-  return Dali::Image(image.Get());
-}
-
-TypeRegistration mType( typeid( Dali::ResourceImage ), typeid( Dali::Image ), CreateImage );
-
-Dali::SignalConnectorType signalConnector1( mType, SIGNAL_IMAGE_LOADING_FINISHED, &ResourceImage::DoConnectSignal );
-
-}
-
 ResourceImage::ResourceImage()
 : Image(),
   mLoadingFinished(),
@@ -107,26 +87,6 @@ ResourceImage::~ResourceImage()
 {
 }
 
-bool ResourceImage::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
-{
-  bool connected( true );
-  DALI_ASSERT_DEBUG( dynamic_cast<ResourceImage*>( object ) && "Failed to downcast from BaseObject to ResourceImage.\n" );
-  ResourceImage* image = static_cast<ResourceImage*>(object);
-
-  if( 0 == strcmp( signalName.c_str(), SIGNAL_IMAGE_LOADING_FINISHED ) )
-  {
-    image->LoadingFinishedSignal().Connect( tracker, functor );
-  }
-  else
-  {
-    // signalName does not match any signal
-    connected = false;
-  }
-
-  return connected;
-}
-
-
 const ImageAttributes& ResourceImage::GetAttributes() const
 {
   return mAttributes;
@@ -159,7 +119,7 @@ void ResourceImage::Reload()
     mTexture = Texture::New( Dali::TextureType::TEXTURE_2D, format, width, height );
 
     //Upload data to the texture
-    size_t bufferSize = bitmap->GetBufferSize();
+    uint32_t bufferSize = bitmap->GetBufferSize();
     PixelDataPtr pixelData = PixelData::New( bitmap->GetBufferOwnership(), bufferSize, width, height, format,
                                              static_cast< Dali::PixelData::ReleaseFunction >( bitmap->GetReleaseFunction() ) );
     mTexture->Upload( pixelData );
@@ -201,7 +161,7 @@ unsigned int ResourceImage::GetHeight() const
 
 Vector2 ResourceImage::GetNaturalSize() const
 {
-  return Vector2(mWidth, mHeight);
+  return Vector2( static_cast<float>( mWidth ), static_cast<float>( mHeight ) );
 }
 
 
index 5843fd8..4f148bb 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_RESOURCE_IMAGE_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -71,17 +71,6 @@ public:
   Dali::ResourceImage::ResourceImageSignal& LoadingFinishedSignal() { return mLoadingFinished; }
 
   /**
-   * Connects a callback function with the object's signals.
-   * @param[in] object The object providing the signal.
-   * @param[in] tracker Used to disconnect the signal.
-   * @param[in] signalName The signal to connect to.
-   * @param[in] functor A newly allocated FunctorDelegate.
-   * @return True if the signal was connected.
-   * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
-   */
-  static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
-
-  /**
    * Get the attributes of the image.
    * Only to be used after the image has finished loading.
    * (Ticket's LoadingSucceeded callback was called)
diff --git a/dali/internal/event/object/custom-object-internal.cpp b/dali/internal/event/object/custom-object-internal.cpp
deleted file mode 100644 (file)
index 0ea8d5b..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/event/object/custom-object-internal.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/update/common/animatable-property.h>
-#include <dali/internal/update/common/property-owner.h>
-#include <dali/internal/update/manager/update-manager.h>
-#include <dali/internal/update/animation/scene-graph-constraint-base.h>
-
-using Dali::Internal::SceneGraph::PropertyOwner;
-using Dali::Internal::SceneGraph::PropertyBase;
-using Dali::Internal::SceneGraph::UpdateManager;
-using Dali::Internal::SceneGraph::AnimatableProperty;
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-CustomObject* CustomObject::New()
-{
-  return new CustomObject();
-}
-
-const SceneGraph::PropertyOwner* CustomObject::GetSceneObject() const
-{
-  return mUpdateObject;
-}
-
-const PropertyBase* CustomObject::GetSceneObjectAnimatableProperty( Property::Index index ) const
-{
-  CustomPropertyMetadata* custom = FindCustomProperty( index );
-  DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
-  return custom->GetSceneGraphProperty();
-}
-
-const PropertyInputImpl* CustomObject::GetSceneObjectInputProperty( Property::Index index ) const
-{
-  return GetSceneObjectAnimatableProperty( index );
-}
-
-unsigned int CustomObject::GetDefaultPropertyCount() const
-{
-  return 0u;
-}
-
-void CustomObject::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-}
-
-const char* CustomObject::GetDefaultPropertyName( Property::Index index ) const
-{
-  return NULL;
-}
-
-Property::Index CustomObject::GetDefaultPropertyIndex(const std::string& name) const
-{
-  return Property::INVALID_INDEX;
-}
-
-bool CustomObject::IsDefaultPropertyWritable(Property::Index index) const
-{
-  return false;
-}
-
-bool CustomObject::IsDefaultPropertyAnimatable(Property::Index index) const
-{
-  return false;
-}
-
-bool CustomObject::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  return false;
-}
-
-Property::Type CustomObject::GetDefaultPropertyType(Property::Index index) const
-{
-  return Property::NONE;
-}
-
-void CustomObject::SetDefaultProperty( Property::Index index, const Property::Value& property )
-{
-  // do nothing
-}
-
-Property::Value CustomObject::GetDefaultProperty(Property::Index index) const
-{
-  return Property::Value();
-}
-
-Property::Value CustomObject::GetDefaultPropertyCurrentValue( Property::Index index ) const
-{
-  return Property::Value();
-}
-
-CustomObject::~CustomObject()
-{
-  // Guard to allow handle destruction after Core has been destroyed
-  if( Stage::IsInstalled() )
-  {
-    if( NULL != mUpdateObject )
-    {
-      RemoveObjectMessage( GetEventThreadServices().GetUpdateManager(), mUpdateObject );
-      mUpdateObject = NULL; // object is about to be destroyed
-    }
-  }
-}
-
-CustomObject::CustomObject()
-{
-  mUpdateObject = PropertyOwner::New();
-
-  OwnerPointer< PropertyOwner > transferOwnership( mUpdateObject );
-  AddObjectMessage( GetEventThreadServices().GetUpdateManager(), transferOwnership );
-}
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/event/object/custom-object-internal.h b/dali/internal/event/object/custom-object-internal.h
deleted file mode 100644 (file)
index 574426e..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-#ifndef __DALI_INTERNAL_CUSTOM_OBJECT_H__
-#define __DALI_INTERNAL_CUSTOM_OBJECT_H__
-
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/internal/event/common/object-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace SceneGraph
-{
-class PropertyOwner;
-}
-
-class CustomObject : public Object
-{
-public:
-
-  /**
-   * Create a new custom object.
-   * @return A pointer to the newly allocated object.
-   */
-  static CustomObject* New();
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
-   */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::SetDefaultProperty()
-   */
-  virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultProperty()
-   */
-  virtual Property::Value GetDefaultProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue()
-   */
-  virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~CustomObject();
-
-  /**
-   * Private constructor; see also CustomObject::New()
-   */
-  CustomObject();
-
-  // Undefined
-  CustomObject(const CustomObject&);
-
-  // Undefined
-  CustomObject& operator=(const CustomObject& rhs);
-
-protected:
-
-  SceneGraph::PropertyOwner* mUpdateObject;
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_CUSTOM_OBJECT_H__
diff --git a/dali/internal/event/object/default-property-metadata.h b/dali/internal/event/object/default-property-metadata.h
new file mode 100644 (file)
index 0000000..a95a9cd
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef DALI_DEFAULT_PROPERTY_METADATA_H
+#define DALI_DEFAULT_PROPERTY_METADATA_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/object/property.h>
+
+namespace Dali
+{
+/**
+ * @addtogroup dali_core_object
+ * @{
+ */
+
+/**
+ * @brief Structure for setting up default properties and their details.
+ */
+struct PropertyDetails
+{
+  const char* name;           ///< The name of the property.
+  Property::Index enumIndex;  ///< Used to check the index is correct within a debug build.
+  Property::Type type;        ///< The property type.
+  bool writable;              ///< Whether the property is writable
+  bool animatable;            ///< Whether the property is animatable.
+  bool constraintInput;       ///< Whether the property can be used as an input to a constraint.
+};
+
+/**
+ * Struct to capture the address of the default property table and count of them.
+ */
+struct DefaultPropertyMetadata
+{
+  const PropertyDetails* propertyTable; ///< address of the table defining property meta-data.
+  Property::Index propertyCount;        ///< count of the default properties.
+};
+
+} // namespace Dali
+
+#endif // DALI_DEFAULT_PROPERTY_METADATA_H
index 9b765d2..e421b76 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,7 +32,6 @@
 #include <dali/internal/event/common/projection.h>
 #include <dali/internal/event/images/frame-buffer-image-impl.h>
 #include <dali/internal/update/nodes/node.h>
-#include <dali/internal/event/render-tasks/render-task-list-impl.h>
 #include <dali/internal/update/render-tasks/scene-graph-render-task.h>
 
 #if defined(DEBUG_ENABLED)
@@ -59,38 +58,58 @@ DALI_PROPERTY( "viewportPosition",   VECTOR2,    true,    true,    true,    Dali
 DALI_PROPERTY( "viewportSize",       VECTOR2,    true,    true,    true,    Dali::RenderTask::Property::VIEWPORT_SIZE     )
 DALI_PROPERTY( "clearColor",         VECTOR4,    true,    true,    true,    Dali::RenderTask::Property::CLEAR_COLOR       )
 DALI_PROPERTY( "requiresSync",       BOOLEAN,    true,    false,   false,   Dali::RenderTask::Property::REQUIRES_SYNC     )
-DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX )
+DALI_PROPERTY_TABLE_END( DEFAULT_OBJECT_PROPERTY_START_INDEX, RenderTaskDefaultProperties )
 
 // Signals
 
 const char* const SIGNAL_FINISHED = "finished";
 
-TypeRegistration mType( typeid( Dali::RenderTask ), typeid( Dali::BaseHandle ), NULL );
+TypeRegistration mType( typeid( Dali::RenderTask ), typeid( Dali::BaseHandle ), NULL, RenderTaskDefaultProperties );
 
 SignalConnectorType signalConnector1( mType, SIGNAL_FINISHED, &RenderTask::DoConnectSignal );
 
 } // Unnamed namespace
 
-RenderTask* RenderTask::New( bool isSystemLevel )
+RenderTaskPtr RenderTask::New( Actor* sourceActor, CameraActor* cameraActor, RenderTaskList& renderTaskList )
 {
-  RenderTask* task( new RenderTask( isSystemLevel ) );
+  // create scene object first so it's guaranteed to exist for the event side
+  auto sceneObject = SceneGraph::RenderTask::New();
 
+  // pass the pointer to base for message passing
+  RenderTaskPtr task( new RenderTask( sceneObject, renderTaskList ) );
+
+  // transfer scene object ownership to update manager
+  const SceneGraph::RenderTaskList& parentSceneObject = renderTaskList.GetSceneObject();
+  OwnerPointer< SceneGraph::RenderTask > transferOwnership( sceneObject );
+  AddTaskMessage( task->GetEventThreadServices(), parentSceneObject, transferOwnership );
+
+  // Set the default source & camera actors
+  task->SetSourceActor( sourceActor );
+  task->SetCameraActor( cameraActor );
+
+  // no need for additional messages as scene objects defaults match ours
   return task;
 }
 
 void RenderTask::SetSourceActor( Actor* actor )
 {
-  const Stage* stage = Stage::GetCurrent();
-  if ( stage )
+  mSourceActor = actor;
+  if ( mSourceActor )
+  {
+    SetSourceNodeMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), &mSourceActor->GetNode() );
+  }
+  else
   {
-    stage->GetRenderTaskList().SetExclusive( this, mExclusive );
+    SetSourceNodeMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), nullptr );
   }
-  mSourceConnector.SetActor( actor );
+
+  // set the actor on exclusive container for hit testing
+  mRenderTaskList.SetExclusive( this, mExclusive );
 }
 
 Actor* RenderTask::GetSourceActor() const
 {
-  return mSourceConnector.mActor;
+  return mSourceActor;
 }
 
 void RenderTask::SetExclusive( bool exclusive )
@@ -99,17 +118,10 @@ void RenderTask::SetExclusive( bool exclusive )
   {
     mExclusive = exclusive;
 
-    const Stage* stage = Stage::GetCurrent();
-    if ( stage )
-    {
-      stage->GetRenderTaskList().SetExclusive( this, exclusive );
-    }
+    mRenderTaskList.SetExclusive( this, exclusive );
 
-    if ( mSceneObject )
-    {
-      // mSceneObject is being used in a separate thread; queue a message to set the value
-      SetExclusiveMessage( GetEventThreadServices(), *mSceneObject, mExclusive );
-    }
+    // scene object is being used in a separate thread; queue a message to set the value
+    SetExclusiveMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), mExclusive );
   }
 }
 
@@ -130,21 +142,23 @@ bool RenderTask::GetInputEnabled() const
 
 void RenderTask::SetCameraActor( CameraActor* cameraActor )
 {
-  if( cameraActor )
+  mCameraActor = cameraActor;
+  if( mCameraActor )
   {
-    mCameraConnector.mCamera = cameraActor->GetCamera();
+    SetCameraMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), &mCameraActor->GetNode(), mCameraActor->GetCamera() );
   }
   else
   {
-    mCameraConnector.mCamera = NULL;
+    SetCameraMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), nullptr, nullptr );
   }
-  mCameraConnector.SetActor( cameraActor );
+
+  // set the actor on exclusive container for hit testing
+  mRenderTaskList.SetExclusive( this, mExclusive );
 }
 
 CameraActor* RenderTask::GetCameraActor() const
 {
-  // camera connector can only point to camera actor
-  return static_cast< CameraActor* >( mCameraConnector.mActor );
+  return mCameraActor;
 }
 
 void RenderTask::SetTargetFrameBuffer( FrameBufferImagePtr image )
@@ -162,13 +176,21 @@ void RenderTask::SetTargetFrameBuffer( FrameBufferImagePtr image )
 void RenderTask::SetFrameBuffer( FrameBufferPtr frameBuffer )
 {
   mFrameBuffer = frameBuffer;
-  SceneGraph::FrameBuffer* renderFrameBufferPtr( NULL );
+  SceneGraph::FrameBuffer* renderFrameBufferPtr( nullptr );
   if( frameBuffer )
   {
     renderFrameBufferPtr = mFrameBuffer->GetRenderObject();
   }
 
-  SetFrameBufferMessage( GetEventThreadServices(), *mSceneObject, renderFrameBufferPtr );
+  SetFrameBufferMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), renderFrameBufferPtr );
+
+  if( frameBuffer != nullptr &&
+      EqualsZero( mViewportSize.x ) &&
+      EqualsZero( mViewportSize.y ) )
+  {
+    // No viewport size has been set. Change it to the size of the framebuffer
+    SetViewportSize( Vector2( float(frameBuffer->GetWidth()), float(frameBuffer->GetHeight()) ));
+  }
 }
 
 FrameBuffer* RenderTask::GetFrameBuffer() const
@@ -191,51 +213,51 @@ RenderTask::ScreenToFrameBufferFunction RenderTask::GetScreenToFrameBufferFuncti
   return mScreenToFrameBufferFunction;
 }
 
-void RenderTask::SetScreenToFrameBufferMappingActor( Actor* mappingActor )
+void RenderTask::SetScreenToFrameBufferMappingActor( Dali::Actor& mappingActor )
 {
-  mMappingConnector.SetActor( mappingActor );
+  mInputMappingActor = WeakHandle<Dali::Actor>( mappingActor );
 }
 
-Actor* RenderTask::GetScreenToFrameBufferMappingActor() const
+Dali::Actor RenderTask::GetScreenToFrameBufferMappingActor() const
 {
-  return mMappingConnector.mActor;
+  return mInputMappingActor.GetHandle();
 }
 
 void RenderTask::SetViewportPosition(const Vector2& value)
 {
   mViewportPosition = value;
 
-  BakeViewportPositionMessage( GetEventThreadServices(), *mSceneObject, value );
+  BakeViewportPositionMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), value );
 }
 
 Vector2 RenderTask::GetCurrentViewportPosition() const
 {
-  return mSceneObject->GetViewportPosition( GetEventThreadServices().GetEventBufferIndex() );
+  return GetRenderTaskSceneObject().GetViewportPosition( GetEventThreadServices().GetEventBufferIndex() );
 }
 
 void RenderTask::SetViewportSize(const Vector2& value)
 {
   mViewportSize = value;
 
-  BakeViewportSizeMessage( GetEventThreadServices(), *mSceneObject, value );
+  BakeViewportSizeMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), value );
 }
 
 Vector2 RenderTask::GetCurrentViewportSize() const
 {
-  return mSceneObject->GetViewportSize( GetEventThreadServices().GetEventBufferIndex() );
+  return GetRenderTaskSceneObject().GetViewportSize( GetEventThreadServices().GetEventBufferIndex() );
 }
 
 void RenderTask::SetViewport( const Viewport& viewport )
 {
-  SetViewportPosition(Vector2(viewport.x, viewport.y));
-  SetViewportSize(Vector2(viewport.width, viewport.height));
+  SetViewportPosition( Vector2( static_cast<float>( viewport.x ), static_cast<float>( viewport.y ) ) );
+  SetViewportSize( Vector2( static_cast<float>( viewport.width ), static_cast<float>( viewport.height ) ) );
 }
 
 void RenderTask::GetViewport( Viewport& viewPort ) const
 {
   BufferIndex bufferIndex = GetEventThreadServices().GetEventBufferIndex();
 
-  if(!mSceneObject->GetViewportEnabled( bufferIndex ))
+  if( !GetRenderTaskSceneObject().GetViewportEnabled( bufferIndex ) )
   {
     if ( mFrameBufferImage )
     {
@@ -250,19 +272,19 @@ void RenderTask::GetViewport( Viewport& viewPort ) const
       {
         Vector2 size( stage->GetSize() );
         viewPort.x = viewPort.y = 0;
-        viewPort.width = size.width;
-        viewPort.height = size.height;
+        viewPort.width = static_cast<int32_t>( size.width ); // truncated
+        viewPort.height = static_cast<int32_t>( size.height ); // truncated
       }
     }
   }
   else
   {
-    const Vector2& position = mSceneObject->GetViewportPosition(bufferIndex);
-    const Vector2& size = mSceneObject->GetViewportSize(bufferIndex);
-    viewPort.x = position.x;
-    viewPort.y = position.y;
-    viewPort.width = size.width;
-    viewPort.height = size.height;
+    const Vector2& position = GetRenderTaskSceneObject().GetViewportPosition(bufferIndex);
+    const Vector2& size = GetRenderTaskSceneObject().GetViewportSize(bufferIndex);
+    viewPort.x = static_cast<int32_t>( position.x ); // truncated
+    viewPort.y = static_cast<int32_t>( position.y ); // truncated
+    viewPort.width = static_cast<int32_t>( size.width ); // truncated
+    viewPort.height = static_cast<int32_t>( size.height ); // truncated
   }
 }
 
@@ -272,17 +294,14 @@ void RenderTask::SetClearColor( const Vector4& color )
   {
     mClearColor = color;
 
-    if ( mSceneObject )
-    {
-      // mSceneObject is being used in a separate thread; queue a message to set the value
-      BakeClearColorMessage( GetEventThreadServices(), *mSceneObject, color );
-    }
+    // scene object is being used in a separate thread; queue a message to set the value
+    BakeClearColorMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), color );
   }
 }
 
 const Vector4& RenderTask::GetClearColor() const
 {
-  return mSceneObject->GetClearColor( GetEventThreadServices().GetEventBufferIndex() );
+  return GetRenderTaskSceneObject().GetClearColor( GetEventThreadServices().GetEventBufferIndex() );
 }
 
 void RenderTask::SetSyncRequired( bool requiresSync )
@@ -291,11 +310,8 @@ void RenderTask::SetSyncRequired( bool requiresSync )
   {
     mRequiresSync = requiresSync;
 
-    if( mSceneObject )
-    {
-      // mSceneObject is being used in a separate thread; queue a message to set the value
-      SetSyncRequiredMessage( GetEventThreadServices(), *mSceneObject, requiresSync );
-    }
+    // scene object is being used in a separate thread; queue a message to set the value
+    SetSyncRequiredMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), requiresSync );
   }
 }
 
@@ -310,11 +326,8 @@ void RenderTask::SetClearEnabled( bool enabled )
   {
     mClearEnabled = enabled;
 
-    if ( mSceneObject )
-    {
-      // mSceneObject is being used in a separate thread; queue a message to set the value
-      SetClearEnabledMessage( GetEventThreadServices(), *mSceneObject, mClearEnabled );
-    }
+    // scene object is being used in a separate thread; queue a message to set the value
+    SetClearEnabledMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), mClearEnabled );
   }
 }
 
@@ -329,11 +342,8 @@ void RenderTask::SetCullMode( bool mode )
   {
     mCullMode = mode;
 
-    if ( mSceneObject )
-    {
-      // mSceneObject is being used in a separate thread; queue a message to set the value
-      SetCullModeMessage( GetEventThreadServices(), *mSceneObject, mCullMode );
-    }
+    // scene object is being used in a separate thread; queue a message to set the value
+    SetCullModeMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), mCullMode );
   }
 }
 
@@ -342,7 +352,7 @@ bool RenderTask::GetCullMode() const
   return mCullMode;
 }
 
-void RenderTask::SetRefreshRate( unsigned int refreshRate )
+void RenderTask::SetRefreshRate( uint32_t refreshRate )
 {
   DALI_LOG_TRACE_METHOD_FMT(gLogRender, "this:%p  rate:%d\n", this, refreshRate);
   DALI_LOG_INFO(gLogRender, Debug::General, "RenderTask::SetRefreshRate(this:%p, %d)\n", this, refreshRate);
@@ -351,14 +361,11 @@ void RenderTask::SetRefreshRate( unsigned int refreshRate )
 
   // Note - even when refreshRate is the same as mRefreshRate, a message should be sent
 
-  if ( mSceneObject )
-  {
-    // mSceneObject is being used in a separate thread; queue a message to set the value
-    SetRefreshRateMessage( GetEventThreadServices(), *mSceneObject, refreshRate );
-  }
+  // sceneObject is being used in a separate thread; queue a message to set the value
+  SetRefreshRateMessage( GetEventThreadServices(), GetRenderTaskSceneObject(), refreshRate );
 }
 
-unsigned int RenderTask::GetRefreshRate() const
+uint32_t RenderTask::GetRefreshRate() const
 {
   return mRefreshRate;
 }
@@ -372,9 +379,9 @@ bool RenderTask::IsHittable( Vector2& screenCoords ) const
   CameraActor* cameraActor = GetCameraActor();
 
   if ( mInputEnabled  &&
-       NULL != sourceActor    &&
+       nullptr != sourceActor &&
        sourceActor->OnStage() &&
-       NULL != cameraActor    &&
+       nullptr != cameraActor &&
        cameraActor->OnStage() )
   {
     // If the actors are rendered off-screen, then the screen coordinates must be converted
@@ -395,8 +402,11 @@ bool RenderTask::TranslateCoordinates( Vector2& screenCoords ) const
   bool inside( true );
   // If the actors are rendered off-screen, then the screen coordinates must be converted
   // the function should only be called for offscreen tasks
-  if( mFrameBufferImage && mMappingConnector.mActor )
+  Dali::Actor mappingActor = GetScreenToFrameBufferMappingActor();
+
+  if( mFrameBufferImage && mappingActor )
   {
+    Internal::Actor* inputMappingActor = &GetImplementation( mappingActor );
     CameraActor* localCamera = GetCameraActor();
     StagePtr stage = Stage::GetCurrent();
     if( stage )
@@ -407,12 +417,12 @@ bool RenderTask::TranslateCoordinates( Vector2& screenCoords ) const
         Viewport viewport;
         Vector2 size( stage->GetSize() );
         viewport.x = viewport.y = 0;
-        viewport.width = size.width;
-        viewport.height = size.height;
+        viewport.width = static_cast<int32_t>( size.width ); // truncated
+        viewport.height = static_cast<int32_t>( size.height ); // truncated
 
         float localX, localY;
-        inside = mMappingConnector.mActor->ScreenToLocal(defaultCamera.GetViewMatrix(), defaultCamera.GetProjectionMatrix(), viewport, localX, localY, screenCoords.x, screenCoords.y);
-        Vector3 actorSize = mMappingConnector.mActor->GetCurrentSize();
+        inside = inputMappingActor->ScreenToLocal(defaultCamera.GetViewMatrix(), defaultCamera.GetProjectionMatrix(), viewport, localX, localY, screenCoords.x, screenCoords.y);
+        Vector3 actorSize = inputMappingActor->GetCurrentSize();
         if( inside && localX >= 0.f && localX <= actorSize.x && localY >= 0.f && localY <= actorSize.y)
         {
           screenCoords.x = localX;
@@ -436,11 +446,6 @@ bool RenderTask::TranslateCoordinates( Vector2& screenCoords ) const
   return inside;
 }
 
-bool RenderTask::IsSystemLevel() const
-{
-  return mIsSystemLevel;
-}
-
 bool RenderTask::WorldToViewport(const Vector3 &position, float& viewportX, float& viewportY) const
 {
   CameraActor* cam = GetCameraActor();
@@ -456,10 +461,10 @@ bool RenderTask::WorldToViewport(const Vector3 &position, float& viewportX, floa
   bool ok = ProjectFull(pos,
                         cam->GetViewMatrix(),
                         cam->GetProjectionMatrix(),
-                        viewport.x,
-                        viewport.y,
-                        viewport.width,
-                        viewport.height,
+                        static_cast<float>( viewport.x ), // truncated
+                        static_cast<float>( viewport.y ), // truncated
+                        static_cast<float>( viewport.width ), // truncated
+                        static_cast<float>( viewport.height ), // truncated
                         viewportPosition);
   if(ok)
   {
@@ -475,112 +480,20 @@ bool RenderTask::ViewportToLocal(Actor* actor, float viewportX, float viewportY,
   return actor->ScreenToLocal( *this, localX, localY, viewportX, viewportY );
 }
 
-SceneGraph::RenderTask* RenderTask::CreateSceneObject()
-{
-  // This should only be called once, with no existing scene-object
-  DALI_ASSERT_DEBUG( NULL == mSceneObject );
-
-  // Keep the raw-pointer until DiscardSceneObject is called
-  mSceneObject = SceneGraph::RenderTask::New();
-
-  // Send messages to set other properties that may have changed since last time we were on stage
-  SetExclusiveMessage( GetEventThreadServices(), *mSceneObject, mExclusive );
-  SetClearColorMessage(  GetEventThreadServices(), *mSceneObject, mClearColor );
-  SetClearEnabledMessage(  GetEventThreadServices(), *mSceneObject, mClearEnabled );
-  SetCullModeMessage(  GetEventThreadServices(), *mSceneObject, mCullMode );
-  SetRefreshRateMessage(  GetEventThreadServices(), *mSceneObject, mRefreshRate );
-  SetSyncRequiredMessage( GetEventThreadServices(), *mSceneObject, mRequiresSync );
-  SetFrameBuffer( mFrameBuffer );
-
-  // Caller takes ownership
-  return mSceneObject;
-}
-
-SceneGraph::RenderTask* RenderTask::GetRenderTaskSceneObject()
+const SceneGraph::RenderTask& RenderTask::GetRenderTaskSceneObject() const
 {
-  return mSceneObject;
+  return *static_cast<const SceneGraph::RenderTask*>( mUpdateObject );
 }
 
-void RenderTask::DiscardSceneObject()
+RenderTaskList& RenderTask::GetRenderTaskList() const
 {
-  // mSceneObject is not owned; throw away the raw-pointer
-  mSceneObject = NULL;
+  return mRenderTaskList;
 }
 
 /********************************************************************************
  ********************************   PROPERTY METHODS   **************************
  ********************************************************************************/
 
-unsigned int RenderTask::GetDefaultPropertyCount() const
-{
-  return DEFAULT_PROPERTY_COUNT;
-}
-
-void RenderTask::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  indices.Reserve( DEFAULT_PROPERTY_COUNT );
-
-  for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    indices.PushBack( i );
-  }
-}
-
-const char* RenderTask::GetDefaultPropertyName( Property::Index index ) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].name;
-  }
-  else
-  {
-    return NULL;
-  }
-}
-
-Property::Index RenderTask::GetDefaultPropertyIndex(const std::string& name) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_DETAILS[i].name ) ) // dont want to convert rhs to string
-    {
-      index = i;
-      break;
-    }
-  }
-
-  return index;
-}
-
-bool RenderTask::IsDefaultPropertyWritable(Property::Index index) const
-{
-  return DEFAULT_PROPERTY_DETAILS[ index ].writable;
-}
-
-bool RenderTask::IsDefaultPropertyAnimatable(Property::Index index) const
-{
-  return DEFAULT_PROPERTY_DETAILS[ index ].animatable;
-}
-
-bool RenderTask::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  return DEFAULT_PROPERTY_DETAILS[ index ].constraintInput;
-}
-
-Property::Type RenderTask::GetDefaultPropertyType(Property::Index index) const
-{
-  if( index < DEFAULT_PROPERTY_COUNT )
-  {
-    return DEFAULT_PROPERTY_DETAILS[index].type;
-  }
-
-  // index out of range...return Property::NONE
-  return Property::NONE;
-}
-
 void RenderTask::SetDefaultProperty( Property::Index index, const Property::Value& property )
 {
   switch ( index )
@@ -619,7 +532,6 @@ Property::Value RenderTask::GetDefaultProperty(Property::Index index) const
 
   switch ( index )
   {
-
     case Dali::RenderTask::Property::VIEWPORT_POSITION:
     {
       value = mViewportPosition;
@@ -657,7 +569,6 @@ Property::Value RenderTask::GetDefaultPropertyCurrentValue( Property::Index inde
 
   switch ( index )
   {
-
     case Dali::RenderTask::Property::VIEWPORT_POSITION:
     {
       value = GetCurrentViewportPosition();
@@ -754,73 +665,51 @@ void RenderTask::OnNotifyDefaultPropertyAnimation( Animation& animation, Propert
   }
 }
 
-const SceneGraph::PropertyOwner* RenderTask::GetSceneObject() const
-{
-  return mSceneObject;
-}
-
 const SceneGraph::PropertyBase* RenderTask::GetSceneObjectAnimatableProperty( Property::Index index ) const
 {
-  DALI_ASSERT_ALWAYS( IsPropertyAnimatable(index) && "Property is not animatable" );
-
   const SceneGraph::PropertyBase* property( NULL );
 
-  // This method should only return a property which is part of the scene-graph
-  if( mSceneObject != NULL )
+  switch ( index )
   {
-    switch ( index )
+    case Dali::RenderTask::Property::VIEWPORT_POSITION:
     {
-      case Dali::RenderTask::Property::VIEWPORT_POSITION:
-        property = &mSceneObject->mViewportPosition;
-        break;
-
-      case Dali::RenderTask::Property::VIEWPORT_SIZE:
-        property = &mSceneObject->mViewportSize;
-        break;
-
-      case Dali::RenderTask::Property::CLEAR_COLOR:
-        property = &mSceneObject->mClearColor;
-        break;
-
-      default:
-        break;
+      property = &GetRenderTaskSceneObject().mViewportPosition;
+      break;
+    }
+    case Dali::RenderTask::Property::VIEWPORT_SIZE:
+    {
+      property = &GetRenderTaskSceneObject().mViewportSize;
+      break;
+    }
+    case Dali::RenderTask::Property::CLEAR_COLOR:
+    {
+      property = &GetRenderTaskSceneObject().mClearColor;
+      break;
+    }
+    default:
+    {
+      break;
     }
   }
+  if( !property )
+  {
+    // not our property, ask base
+    property = Object::GetSceneObjectAnimatableProperty( index );
+  }
 
   return property;
 }
 
 const PropertyInputImpl* RenderTask::GetSceneObjectInputProperty( Property::Index index ) const
 {
-  const PropertyInputImpl* property( NULL );
-  if( mSceneObject != NULL )
-  {
-    switch ( index )
-    {
-      case Dali::RenderTask::Property::VIEWPORT_POSITION:
-        property = &mSceneObject->mViewportPosition;
-        break;
-
-      case Dali::RenderTask::Property::VIEWPORT_SIZE:
-        property = &mSceneObject->mViewportSize;
-        break;
-
-      case Dali::RenderTask::Property::CLEAR_COLOR:
-        property = &mSceneObject->mClearColor;
-        break;
-
-      default:
-        break;
-    }
-  }
-
-  return property;
+  // animatable properties are input as well, Object::GetSceneObjectInputProperty does the same so no need to call it
+  return GetSceneObjectAnimatableProperty( index );
 }
 
 bool RenderTask::HasFinished()
 {
   bool finished = false;
-  const unsigned int counter = mSceneObject->GetRenderedOnceCounter();
+  const uint32_t counter = GetRenderTaskSceneObject().GetRenderedOnceCounter();
 
   if( mRefreshOnceCounter < counter )
   {
@@ -828,7 +717,7 @@ bool RenderTask::HasFinished()
     mRefreshOnceCounter = counter;
   }
 
-  DALI_LOG_INFO(gLogRender, Debug::General, "RenderTask::HasFinished()=%s SCRT:%p  SC\n", finished?"T":"F", mSceneObject);
+  DALI_LOG_INFO(gLogRender, Debug::General, "RenderTask::HasFinished()=%s SCRT:%p  SC\n", finished?"T":"F", &GetRenderTaskSceneObject());
 
   return finished;
 }
@@ -867,11 +756,12 @@ bool RenderTask::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface
   return connected;
 }
 
-RenderTask::RenderTask( bool isSystemLevel )
-: mSceneObject( NULL ),
-  mSourceConnector( Connector::SOURCE_CONNECTOR, *this ),
-  mCameraConnector( Connector::CAMERA_CONNECTOR, *this ),
-  mMappingConnector( Connector::MAPPING_CONNECTOR, *this  ),
+RenderTask::RenderTask( const SceneGraph::RenderTask* sceneObject, RenderTaskList& renderTaskList )
+: Object( sceneObject ),
+  mSourceActor( nullptr ),
+  mCameraActor( nullptr ),
+  mInputMappingActor(),
+  mRenderTaskList( renderTaskList ),
   mClearColor( Dali::RenderTask::DEFAULT_CLEAR_COLOR ),
   mViewportPosition( Vector2::ZERO ),
   mViewportSize( Vector2::ZERO ),
@@ -882,108 +772,17 @@ RenderTask::RenderTask( bool isSystemLevel )
   mInputEnabled( Dali::RenderTask::DEFAULT_INPUT_ENABLED ),
   mClearEnabled( Dali::RenderTask::DEFAULT_CLEAR_ENABLED ),
   mCullMode( Dali::RenderTask::DEFAULT_CULL_MODE ),
-  mIsSystemLevel( isSystemLevel ),
   mRequiresSync( false )
 {
   DALI_LOG_INFO(gLogRender, Debug::General, "RenderTask::RenderTask(this:%p)\n", this);
+  // scene object handles observation of source and camera
 }
 
 RenderTask::~RenderTask()
 {
   DALI_LOG_INFO(gLogRender, Debug::General, "RenderTask::~RenderTask(this:%p)\n", this);
-}
-
-// Helper class for connecting Nodes to the scene-graph RenderTask
-
-RenderTask::Connector::Connector( Type type, RenderTask& renderTask )
-: mType( type ),
-  mRenderTask( renderTask ),
-  mActor( NULL ),
-  mCamera( NULL )
-{
-}
-
-RenderTask::Connector::~Connector()
-{
-  SetActor( NULL );
-}
-
-void RenderTask::Connector::SetActor( Actor* actor )
-{
-  if ( mActor != actor )
-  {
-    if ( mActor )
-    {
-      mActor->RemoveObserver( *this );
-    }
-
-    mActor = actor;
-
-    if ( mActor )
-    {
-      mActor->AddObserver( *this );
-    }
-
-    UpdateRenderTask();
-  }
-}
-
-void RenderTask::Connector::SceneObjectAdded( Object& object )
-{
-  UpdateRenderTask();
-}
-
-void RenderTask::Connector::SceneObjectRemoved( Object& object )
-{
-  UpdateRenderTask();
-}
-
-void RenderTask::Connector::ObjectDestroyed( Object& object )
-{
-  if ( SOURCE_CONNECTOR == mType )
-  {
-    const Stage* stage = Stage::GetCurrent();
-    if ( stage )
-    {
-      stage->GetRenderTaskList().SetExclusive( &mRenderTask, false );
-    }
-  }
-
-  mActor = NULL;
-  mCamera = NULL; // only meaningful for the camera connector but no simple way to distinguish
-
-  UpdateRenderTask();
-}
-
-void RenderTask::Connector::UpdateRenderTask()
-{
-  // Guard to allow handle destruction after Core has been destroyed
-  if( Internal::Stage::IsInstalled() &&
-      mRenderTask.mSceneObject )
-  {
-    const SceneGraph::Node* node( NULL );
-
-    // Check whether a Node exists in the scene-graph
-    if ( NULL != mActor )
-    {
-      const SceneGraph::PropertyOwner* object = mActor->GetSceneObject();
-      if ( NULL != object )
-      {
-        // actors only point to nodes as their scene objects
-        node = static_cast< const SceneGraph::Node* >( object );
-      }
-    }
-
-    //the mapping node is not used in the scene graph
-    if ( SOURCE_CONNECTOR == mType )
-    {
-      SetSourceNodeMessage( mRenderTask.GetEventThreadServices(), *(mRenderTask.mSceneObject), node );
-    }
-    else if( CAMERA_CONNECTOR == mType )
-    {
-      SetCameraMessage( mRenderTask.GetEventThreadServices(), *(mRenderTask.mSceneObject), node, mCamera );
-    }
-  }
+  // scene object deletion is handled by our parent
+  // scene object handles observation of source and camera
 }
 
 } // namespace Internal
index 1639b35..b32c451 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_RENDER_TASK_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-object.h>
+#include <dali/public-api/object/weak-handle.h>
 #include <dali/public-api/render-tasks/render-task.h>
 #include <dali/internal/event/images/frame-buffer-image-impl.h>
 #include <dali/internal/event/common/object-impl.h>
 #include <dali/internal/event/rendering/frame-buffer-impl.h>
+#include <dali/internal/event/render-tasks/render-task-list-impl.h>
 
 namespace Dali
 {
@@ -34,24 +36,32 @@ namespace Internal
 class Actor;
 class CameraActor;
 class EventThreadServices;
+class RenderTaskList;
 
 namespace SceneGraph
 {
+class RenderTaskList;
 class RenderTask;
 class Camera;
 }
 
+using RenderTaskPtr = IntrusivePtr<RenderTask>;
+
 class RenderTask : public Object
 {
 public:
 
-  typedef Dali::RenderTask::ScreenToFrameBufferFunction ScreenToFrameBufferFunction;
+  using ScreenToFrameBufferFunction = Dali::RenderTask::ScreenToFrameBufferFunction;
 
   /**
    * Creates a new RenderTask.
-   * @param[in] isSystemLevel Whether the render-task is on the system level task list.
+   *
+   * @param[in] sourceActor The source actor.
+   * @param[in] cameraActor The camera actor.
+   * @param[in] renderTaskList The render task list.
+   * @return The created render task
    */
-  static RenderTask* New( bool isSystemLevel );
+  static RenderTaskPtr New( Actor* sourceActor, CameraActor* cameraActor, RenderTaskList& renderTaskList );
 
   /**
    * @copydoc Dali::RenderTask::SetSourceActor()
@@ -126,12 +136,12 @@ public:
   /**
    * copydoc Dali::RenderTask::SetScreenToFrameBufferMappingActor
    */
-  void SetScreenToFrameBufferMappingActor( Actor* mappingActor );
+  void SetScreenToFrameBufferMappingActor( Dali::Actor& mappingActor );
 
   /**
    * copydoc Dali::RenderTask::GetScreenToFrameBufferMAppingActor
    */
-  Actor* GetScreenToFrameBufferMappingActor() const;
+  Dali::Actor GetScreenToFrameBufferMappingActor() const;
 
   /**
    * @copydoc Dali::RenderTask::SetViewportPosition
@@ -208,12 +218,12 @@ public:
   /**
    * @copydoc Dali::RenderTask::SetRefreshRate()
    */
-  void SetRefreshRate( unsigned int refreshRate );
+  void SetRefreshRate( uint32_t refreshRate );
 
   /**
    * @copydoc Dali::RenderTask::GetRefreshRate()
    */
-  unsigned int GetRefreshRate() const;
+  uint32_t GetRefreshRate() const;
 
   /**
    * Check if the render-task is hittable. If render task is offscreen, the screen coordinates may be translated.
@@ -230,12 +240,6 @@ public:
   bool TranslateCoordinates( Vector2& screenCoords ) const;
 
   /**
-   * Query whether the RenderTask is on the system level render-task list.
-   * @return true, if on the system level task list, false otherwise.
-   */
-  bool IsSystemLevel() const;
-
-  /**
    * @copydoc Dali::RenderTask::WorldToViewport()
    */
   bool WorldToViewport(const Vector3 &position, float& viewportX, float& viewportY) const;
@@ -248,66 +252,20 @@ public:
 public: // Used by RenderTaskList, which owns the SceneGraph::RenderTasks
 
   /**
-   * Create the scene-graph RenderTask object.
-   * @pre CreateSceneObject has not already been called.
-   * @return A newly allocated scene-graph object; the caller takes ownership.
-   */
-  SceneGraph::RenderTask* CreateSceneObject();
-
-  /**
    * Retrieve the scene-graph RenderTask object.
-   * @return The scene-graph object, or NULL if this has been discarded.
+   * @return The scene-graph object
    */
-  SceneGraph::RenderTask* GetRenderTaskSceneObject();
+  const SceneGraph::RenderTask& GetRenderTaskSceneObject() const;
 
   /**
-   * Discard the scene-graph RenderTask object.
+   * Retrieve the render task list RenderTask object belongs to.
+   * @return The render task list
    */
-  void DiscardSceneObject();
+  RenderTaskList& GetRenderTaskList() const;
 
 public: // Implementation of Object
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
-
-  /**
    * @copydoc Dali::Internal::Object::SetDefaultProperty()
    */
   virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
@@ -328,11 +286,6 @@ public: // Implementation of Object
   virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType );
 
   /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
-  /**
    * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
    */
   virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
@@ -377,102 +330,39 @@ public: //signals
 protected:
 
   /**
-   * Construct a new RenderTask.
-   * @param[in] isSystemLevel Whether the RenderTask is on the system level task list.
+   * Constructor.
+   *
+   * @param[in] sceneObject The scene graph object
+   * @param[in] renderTaskList The render task list
    */
-  RenderTask( bool isSystemLevel );
+  RenderTask( const SceneGraph::RenderTask* sceneObject, RenderTaskList& renderTaskList );
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
    */
   virtual ~RenderTask();
 
-  /**
-   * Helper class for connecting Nodes to the scene-graph RenderTask
-   */
-  class Connector : public Object::Observer
-  {
-  public:
-
-    enum Type
-    {
-      SOURCE_CONNECTOR,
-      CAMERA_CONNECTOR,
-      MAPPING_CONNECTOR
-    };
-
-    /**
-     * Create the helper class
-     */
-    Connector( Type type, RenderTask& renderTask );
-
-    /**
-     * Non-virtual destructor; not suitable as a base object.
-     */
-    ~Connector();
+private: // not copyable
 
-    /**
-     * Set the actor to be observed.
-     * @param[in] actor The actor to be observed.
-     */
-    void SetActor( Actor* actor );
-
-    /**
-     * Update the scene-graph RenderTask with a new source/camera Node.
-     */
-    void UpdateRenderTask();
-
-  public: // From Object::Observer
-
-    /**
-     * @copydoc Dali::Internal::Object::Observer::SceneObjectAdded
-     */
-    virtual void SceneObjectAdded( Object& object );
-
-    /**
-     * @copydoc Dali::Internal::Object::Observer::SceneObjectAdded
-     */
-    virtual void SceneObjectRemoved( Object& object );
-
-    /**
-     * @copydoc Dali::Internal::Object::Observer::ObjectDestroyed
-     */
-    virtual void ObjectDestroyed( Object& object );
-
-  private:
-
-    // Undefined
-    Connector(const Connector&);
-
-    // Undefined
-    Connector& operator=(const Connector& rhs);
-
-  public:
-
-    const Type mType;
-
-    RenderTask& mRenderTask;
-
-    Actor* mActor; ///< Raw-pointer to the actor; not owned.
-    const SceneGraph::Camera* mCamera;    ///< Raw-pointer to camera scene-graph object; not owned.
-  };
+  RenderTask() = delete;
+  RenderTask( const RenderTask& ) = delete;
+  RenderTask& operator=( const RenderTask& ) = delete;
 
 private:
 
-  SceneGraph::RenderTask* mSceneObject; ///< Raw-pointer to the scene-graph object; not owned.
-
-  Connector mSourceConnector; ///< Responsible for connecting/disconnecting source Nodes
-  Connector mCameraConnector; ///< Responsible for connecting/disconnecting camera Nodes
-  Connector mMappingConnector; /// Responsible for connecting/disconnecting actor node, which used to mapping screen to frame buffer coordinate
+  Actor* mSourceActor; ///< Source actor, we cannot keep the actor alive so raw pointer.
+  CameraActor* mCameraActor; ///< Camera actor, we cannot keep the actor alive so raw pointer.
+  WeakHandle<Dali::Actor> mInputMappingActor; /// used to mapping screen to frame buffer coordinate, not kept alive by rendertask
+  RenderTaskList& mRenderTaskList; ///< The render task list
 
   Vector4 mClearColor;       ///< Optional clear color
 
   Vector2 mViewportPosition; ///< The cached viewport position
   Vector2 mViewportSize;     ///< The cached viewport size
 
-  unsigned int mRefreshRate; ///< Determines how often the task is processed.
+  uint32_t mRefreshRate; ///< Determines how often the task is processed.
 
-  unsigned int mRefreshOnceCounter;
+  uint32_t mRefreshOnceCounter;
 
   FrameBufferImagePtr mFrameBufferImage;  ///< Optional off-screen render target.
   FrameBufferPtr  mFrameBuffer;
@@ -484,7 +374,6 @@ private:
   bool mInputEnabled  : 1; ///< True if the render-task should be considered for input handling.
   bool mClearEnabled  : 1; ///< True if the render-task should be clear the color buffer.
   bool mCullMode      : 1; ///< True if the render-task's actors should be culled
-  bool mIsSystemLevel : 1; ///< True if the render-task is on the system level task list.
   bool mRequiresSync  : 1; ///< True if the GL sync is required to track the render of.
 
   //Signals
old mode 100644 (file)
new mode 100755 (executable)
index 61a9803..96e454b
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/internal/event/common/event-thread-services.h>
-#include <dali/internal/event/common/thread-local-storage.h>
+#include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/render-tasks/render-task-defaults.h>
 #include <dali/internal/event/render-tasks/render-task-impl.h>
 #include <dali/internal/event/actors/camera-actor-impl.h>
@@ -43,61 +43,47 @@ namespace Dali
 namespace Internal
 {
 
-RenderTaskList* RenderTaskList::New( EventThreadServices& eventServices, RenderTaskDefaults& defaults, bool systemLevel )
+RenderTaskListPtr RenderTaskList::New()
 {
-  RenderTaskList* taskList = new RenderTaskList( eventServices, defaults, systemLevel );
+  RenderTaskListPtr taskList = new RenderTaskList();
 
-  taskList->Initialize( eventServices.GetUpdateManager() );
+  taskList->Initialize();
 
   return taskList;
 }
 
-Dali::RenderTask RenderTaskList::CreateTask()
+RenderTaskPtr RenderTaskList::CreateTask()
 {
-  RenderTask* taskImpl = RenderTask::New( mIsSystemLevel );
-
-  Dali::RenderTask newTask( taskImpl );
-  mTasks.push_back( newTask );
-
-  if ( mSceneObject )
-  {
-    SceneGraph::RenderTask* sceneObject = taskImpl->CreateSceneObject();
+  return CreateTask( &mDefaults.GetDefaultRootActor(), &mDefaults.GetDefaultCameraActor() );
+}
 
-    OwnerPointer< SceneGraph::RenderTask > transferOwnership( sceneObject );
-    AddTaskMessage( mEventThreadServices, *mSceneObject, transferOwnership );
-  }
+RenderTaskPtr RenderTaskList::CreateTask( Actor* sourceActor, CameraActor* cameraActor)
+{
+  RenderTaskPtr task = RenderTask::New( sourceActor, cameraActor, *this );
 
-  // Set the default source & camera actors
-  taskImpl->SetSourceActor( &mDefaults.GetDefaultRootActor() );
-  taskImpl->SetCameraActor( &mDefaults.GetDefaultCameraActor() );
+  mTasks.push_back( task );
 
-  return newTask;
+  return task;
 }
 
-void RenderTaskList::RemoveTask( Dali::RenderTask task )
+void RenderTaskList::RemoveTask( Internal::RenderTask& task )
 {
   for ( RenderTaskContainer::iterator iter = mTasks.begin(); mTasks.end() != iter; ++iter )
   {
-    if ( *iter == task )
-    {
-      RenderTask& taskImpl = GetImplementation( task );
-      if ( mSceneObject )
-      {
-        SceneGraph::RenderTask* sceneObject = taskImpl.GetRenderTaskSceneObject();
-        DALI_ASSERT_DEBUG( NULL != sceneObject );
-
-        // Send a message to remove the scene-graph RenderTask
-        RemoveTaskMessage( mEventThreadServices, *mSceneObject, *sceneObject );
+    RenderTask *ptr = iter->Get();
 
-        // The scene-graph RenderTask will be destroyed soon; discard the raw-pointer
-        taskImpl.DiscardSceneObject();
-      }
+    if ( ptr == &task )
+    {
+      const SceneGraph::RenderTask& sceneObject = task.GetRenderTaskSceneObject();
 
+      // delete the task
       mTasks.erase( iter );
+      // send a message to remove the scene-graph RenderTask
+      RemoveTaskMessage( mEventThreadServices, *mSceneObject, sceneObject );
 
       for ( Vector< Exclusive >::Iterator exclusiveIt = mExclusives.Begin(); exclusiveIt != mExclusives.End(); ++exclusiveIt )
       {
-        if ( exclusiveIt->renderTaskPtr == &taskImpl )
+        if ( exclusiveIt->renderTaskPtr == ptr )
         {
           mExclusives.Erase( exclusiveIt );
           break;
@@ -108,16 +94,16 @@ void RenderTaskList::RemoveTask( Dali::RenderTask task )
   }
 }
 
-unsigned int RenderTaskList::GetTaskCount() const
+uint32_t RenderTaskList::GetTaskCount() const
 {
-  return mTasks.size();
+  return static_cast<uint32_t>( mTasks.size() ); // only 4,294,967,295 render tasks supported
 }
 
-Dali::RenderTask RenderTaskList::GetTask( unsigned int index ) const
+RenderTaskPtr RenderTaskList::GetTask( uint32_t index ) const
 {
   DALI_ASSERT_ALWAYS( ( index < mTasks.size() ) && "RenderTask index out-of-range" );
 
-  return mTasks[index];
+  return mTasks[ index ];
 }
 
 void RenderTaskList::SetExclusive( RenderTask* task, bool exclusive )
@@ -149,25 +135,30 @@ void RenderTaskList::SetExclusive( RenderTask* task, bool exclusive )
   }
 }
 
-RenderTaskList::RenderTaskList( EventThreadServices& eventThreadServices, RenderTaskDefaults& defaults, bool systemLevel )
-: mEventThreadServices( eventThreadServices ),
-  mDefaults( defaults ),
-  mIsSystemLevel( systemLevel ),
-  mSceneObject( NULL )
+RenderTaskList::RenderTaskList()
+: mEventThreadServices( EventThreadServices::Get() ),
+  mDefaults( *Stage::GetCurrent() ),
+  mSceneObject( nullptr )
 {
 }
 
 RenderTaskList::~RenderTaskList()
 {
+  if( EventThreadServices::IsCoreRunning() && mSceneObject )
+  {
+    // Remove the render task list using a message to the update manager
+    RemoveRenderTaskListMessage( mEventThreadServices.GetUpdateManager(), *mSceneObject );
+  }
 }
 
-void RenderTaskList::Initialize( UpdateManager& updateManager )
+void RenderTaskList::Initialize()
 {
-  // This should only be called once, with no existing scene-object
-  DALI_ASSERT_DEBUG( NULL == mSceneObject );
+  // Create a new render task list, Keep a const pointer to the render task list.
+  mSceneObject = SceneGraph::RenderTaskList::New();
+
+  OwnerPointer< SceneGraph::RenderTaskList > transferOwnership( const_cast< SceneGraph::RenderTaskList* >( mSceneObject ) );
+  AddRenderTaskListMessage( mEventThreadServices.GetUpdateManager(), transferOwnership );
 
-  // Get raw-pointer to render task list
-  mSceneObject = updateManager.GetRenderTaskList( mIsSystemLevel );
   // set the callback to call us back when tasks are completed
   mSceneObject->SetCompleteNotificationInterface( this );
 }
@@ -176,43 +167,42 @@ void RenderTaskList::NotifyCompleted()
 {
   DALI_LOG_TRACE_METHOD(gLogRenderList);
 
-  std::vector< Dali::RenderTask > finishedRenderTasks;
+  RenderTaskContainer finishedRenderTasks;
 
   // Since render tasks can be unreferenced during the signal emissions, iterators into render tasks pointers may be invalidated.
   // First copy the finished render tasks, then emit signals
-  for ( std::vector<Dali::RenderTask>::iterator it = mTasks.begin(), endIt = mTasks.end(); it != endIt; ++it )
+  for ( RenderTaskContainer::iterator iter = mTasks.begin(), endIt = mTasks.end(); iter != endIt; ++iter )
   {
-    Dali::RenderTask& renderTask( *it );
-
-    if( GetImplementation( renderTask ).HasFinished() )
+    if( (*iter)->HasFinished() )
     {
-      finishedRenderTasks.push_back( Dali::RenderTask( renderTask ) );
+      finishedRenderTasks.push_back( *iter );
     }
   }
 
   // Now it's safe to emit the signals
-  for ( std::vector<Dali::RenderTask>::iterator it = finishedRenderTasks.begin(), endIt = finishedRenderTasks.end(); it != endIt; ++it )
+  for ( auto&& item : finishedRenderTasks )
   {
-    Dali::RenderTask& handle( *it );
-
-    GetImplementation(handle).EmitSignalFinish();
+    item->EmitSignalFinish();
   }
 }
 
 void RenderTaskList::RecoverFromContextLoss()
 {
-  for ( RenderTaskContainer::iterator iter = mTasks.begin(); mTasks.end() != iter; ++iter )
+  for ( auto&& item : mTasks )
   {
-    Dali::RenderTask task = *iter;
-
     // If the render target renders only once to an offscreen, re-render the render task
-    if( task.GetRefreshRate() == Dali::RenderTask::REFRESH_ONCE && task.GetTargetFrameBuffer() )
+    if( item->GetRefreshRate() == Dali::RenderTask::REFRESH_ONCE && item->GetTargetFrameBuffer() )
     {
-      task.SetRefreshRate( Dali::RenderTask::REFRESH_ONCE );
+      item->SetRefreshRate( Dali::RenderTask::REFRESH_ONCE );
     }
   }
 }
 
+const SceneGraph::RenderTaskList& RenderTaskList::GetSceneObject() const
+{
+  return *mSceneObject;
+}
+
 } // namespace Internal
 
 } // namespace Dali
index 3216793..a62c9d7 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_RENDER_TASK_LIST_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,9 +21,9 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/base-object.h>
-#include <dali/public-api/render-tasks/render-task.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/internal/event/common/complete-notification-interface.h>
+#include <dali/internal/event/render-tasks/render-task-impl.h>
 
 namespace Dali
 {
@@ -34,6 +34,11 @@ namespace Internal
 class EventThreadServices;
 class RenderTaskDefaults;
 class Actor;
+class CameraActor;
+
+using RenderTaskPtr = IntrusivePtr<RenderTask>;
+class RenderTaskList;
+using RenderTaskListPtr = IntrusivePtr<RenderTaskList>;
 
 namespace SceneGraph
 {
@@ -49,7 +54,7 @@ class RenderTaskList : public BaseObject, public CompleteNotificationInterface
 {
 public:
 
-  typedef std::vector< Dali::RenderTask > RenderTaskContainer;
+  using RenderTaskContainer = std::vector< RenderTaskPtr >;
 
   struct Exclusive
   {
@@ -59,32 +64,40 @@ public:
 
   /**
    * Create a RenderTaskList.
-   * @param[in] eventServices Used for sending message to the scene graph.
-   * @param[in] defaults Provides the default source & camera actors.
-   * @param[in] systemLevel True if this is the LayerList for actors added via the SystemLevel::Add().
    * @return A newly allocated RenderTaskList; the caller takes ownership.
    */
-  static RenderTaskList* New( EventThreadServices& eventServices, RenderTaskDefaults& defaults, bool systemLevel );
+  static RenderTaskListPtr New();
 
   /**
    * @copydoc Dali::RenderTaskList::CreateTask()
    */
-  Dali::RenderTask CreateTask();
+  RenderTaskPtr CreateTask();
+
+  /**
+   * @brief Creates a new RenderTask.
+   *
+   * This will be appended to the list of render-tasks.
+   *
+   * @param[in] sourceActor The actor and its children to be rendered for this render task.
+   * @param[in] cameraActor The actor from which the scene is viewed for this render task.
+   * @return A valid handle to a new RenderTask
+   */
+  RenderTaskPtr CreateTask( Actor* sourceActor, CameraActor* cameraActor);
 
   /**
    * @copydoc Dali::RenderTaskList::RemoveTask()
    */
-  void RemoveTask( Dali::RenderTask task );
+  void RemoveTask( Internal::RenderTask& task );
 
   /**
    * @copydoc Dali::RenderTaskList::GetTaskCount()
    */
-  unsigned int GetTaskCount() const;
+  uint32_t GetTaskCount() const;
 
   /**
    * @copydoc Dali::RenderTaskList::GetTask()
    */
-  Dali::RenderTask GetTask( unsigned int index ) const;
+  RenderTaskPtr GetTask( uint32_t index ) const;
 
   /**
    * Retrieve the container of render-tasks.
@@ -127,15 +140,18 @@ public:
    */
   void RecoverFromContextLoss();
 
+  /**
+   * Retrieve the SceneGraph::RenderTaskList object.
+   * @return The RenderTaskList.
+   */
+  const SceneGraph::RenderTaskList& GetSceneObject() const;
+
 protected:
 
   /**
    * Construct a new RenderTaskList.
-   * @param[in] eventThreadServices Used for creating render-tasks in the scene graph.
-   * @param[in] defaults Provides the default source & camera actors.
-   * @param[in] systemLevel True if this is the system-level list.
    */
-  RenderTaskList( EventThreadServices& eventThreadServices, RenderTaskDefaults& defaults, bool systemLevel );
+  RenderTaskList();
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
@@ -145,7 +161,7 @@ protected:
   /**
    * 2nd-phase construction
    */
-  void Initialize( SceneGraph::UpdateManager& updateManager );
+  void Initialize();
 
 private: // from CompleteNotificationInterface
 
@@ -159,8 +175,6 @@ private:
   EventThreadServices& mEventThreadServices;
   RenderTaskDefaults& mDefaults;
 
-  bool mIsSystemLevel; ///< True if the layers are added via the SystemLevel API
-
   SceneGraph::RenderTaskList* mSceneObject; ///< Raw-pointer to the scene-graph object; not owned.
 
   RenderTaskContainer mTasks;           ///< Reference counted render-tasks
index 0708095..d433f2c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // INTERNAL INCLUDES
 #include <dali/internal/update/manager/update-manager.h>
-#include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/update/rendering/scene-graph-frame-buffer.h>
+#include <dali/integration-api/render-surface.h>
 
 namespace Dali
 {
 namespace Internal
 {
 
-FrameBufferPtr FrameBuffer::New( unsigned int width, unsigned int height, unsigned int attachments  )
+FrameBufferPtr FrameBuffer::New( uint32_t width, uint32_t height, Mask attachments  )
 {
   FrameBufferPtr frameBuffer( new FrameBuffer( width, height, attachments ) );
   frameBuffer->Initialize();
   return frameBuffer;
 }
 
+FrameBufferPtr FrameBuffer::New( Dali::Integration::RenderSurface& renderSurface, Mask attachments )
+{
+  Dali::PositionSize positionSize = renderSurface.GetPositionSize();
+  FrameBufferPtr frameBuffer( new FrameBuffer( positionSize.width, positionSize.height, attachments ) );
+  frameBuffer->Initialize( &renderSurface );
+  return frameBuffer;
+}
 
 SceneGraph::FrameBuffer* FrameBuffer::GetRenderObject() const
 {
   return mRenderObject;
 }
 
-FrameBuffer::FrameBuffer( unsigned int width, unsigned int height, unsigned int attachments )
-: mEventThreadServices( *Stage::GetCurrent() ),
+FrameBuffer::FrameBuffer( uint32_t width, uint32_t height, Mask attachments )
+: mEventThreadServices( EventThreadServices::Get() ),
   mRenderObject( NULL ),
   mColor( NULL ),
   mWidth( width ),
@@ -51,14 +58,15 @@ FrameBuffer::FrameBuffer( unsigned int width, unsigned int height, unsigned int
 {
 }
 
-void FrameBuffer::Initialize()
+void FrameBuffer::Initialize( Integration::RenderSurface* renderSurface )
 {
   mRenderObject = new SceneGraph::FrameBuffer( mWidth, mHeight, mAttachments );
   OwnerPointer< SceneGraph::FrameBuffer > transferOwnership( mRenderObject );
   AddFrameBufferMessage( mEventThreadServices.GetUpdateManager(), transferOwnership );
+  //AddFrameBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject );
 }
 
-void FrameBuffer::AttachColorTexture( TexturePtr texture, unsigned int mipmapLevel, unsigned int layer )
+void FrameBuffer::AttachColorTexture( TexturePtr texture, uint32_t mipmapLevel, uint32_t layer )
 {
   if( ( texture->GetWidth() / ( 1u << mipmapLevel ) == mWidth ) &&
       ( texture->GetHeight() / ( 1u << mipmapLevel ) == mHeight ) )
index 4f65b65..e80c615 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_FRAME_BUFFER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 namespace Dali
 {
+
+namespace Integration
+{
+class RenderSurface;
+}
+
 namespace Internal
 {
 namespace SceneGraph
@@ -42,6 +48,8 @@ class FrameBuffer : public BaseObject
 {
 public:
 
+  using Mask = Dali::FrameBuffer::Attachment::Mask;
+
   /**
    * @brief Create a new FrameBuffer
    *
@@ -50,7 +58,21 @@ public:
    * @param[in] attachments The attachments comprising the format of the FrameBuffer (bit-mask)
    * @return A smart-pointer to the newly allocated Texture.
    */
-  static FrameBufferPtr New( unsigned int width, unsigned int height, unsigned int attachments );
+  static FrameBufferPtr New( uint32_t width, uint32_t height, Mask attachments );
+
+  /**
+   * @brief Create a new FrameBuffer
+   *
+   * @param[in] renderSurface  The render surface
+   * @param[in] attachments    The attachments comprising the format of the FrameBuffer (bit-mask)
+   * @return A smart-pointer to the newly allocated Texture.
+   */
+  static FrameBufferPtr New( Dali::Integration::RenderSurface& renderSurface, Mask attachments );
+
+  /**
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~FrameBuffer();
 
   /**
    * @brief Get the FrameBuffer render object
@@ -62,13 +84,23 @@ public:
   /**
    * @copydoc Dali::FrameBuffer::AttachColorTexture()
    */
-  void AttachColorTexture( TexturePtr texture, unsigned int mipmapLevel, unsigned int layer );
+  void AttachColorTexture( TexturePtr texture, uint32_t mipmapLevel, uint32_t layer );
 
   /**
    * @copydoc Dali::FrameBuffer::GetColorTexture()
    */
   Texture* GetColorTexture();
 
+  unsigned int GetWidth() const
+  {
+    return mWidth;
+  }
+
+  unsigned int GetHeight() const
+  {
+    return mHeight;
+  }
+
 private: // implementation
 
   /**
@@ -77,23 +109,20 @@ private: // implementation
    * @param[in] height      The height of the FrameBuffer
    * @param[in] attachments The attachments comprising the format of the FrameBuffer (bit-mask)
    */
-  FrameBuffer( unsigned int width, unsigned int height, unsigned int attachments );
+  FrameBuffer( uint32_t width, uint32_t height, Mask attachments );
 
   /**
    * Second stage initialization of the Texture
    */
-  void Initialize();
+  void Initialize( Integration::RenderSurface* renderSurface = nullptr );
 
 protected:
 
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~FrameBuffer();
-
 private: // unimplemented methods
-  FrameBuffer( const FrameBuffer& );
-  FrameBuffer& operator=( const FrameBuffer& );
+
+  FrameBuffer() = delete;
+  FrameBuffer( const FrameBuffer& ) = delete;
+  FrameBuffer& operator=( const FrameBuffer& ) = delete;
 
 private: // data
 
@@ -101,9 +130,9 @@ private: // data
   SceneGraph::FrameBuffer* mRenderObject;        ///< The Render::Framebuffer associated with this framebuffer
 
   TexturePtr mColor;
-  unsigned int mWidth;
-  unsigned int mHeight;
-  unsigned int mAttachments; ///< Bit-mask of type FrameBuffer::Attachment::Mask
+  uint32_t mWidth;
+  uint32_t mHeight;
+  Mask mAttachments;                           ///< Bit-mask of type FrameBuffer::Attachment::Mask
 };
 
 } // namespace Internal
index 9903023..59df17b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
 
-#include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
 #include <dali/internal/update/manager/update-manager.h>
 
 namespace Dali
@@ -36,19 +35,19 @@ GeometryPtr Geometry::New()
   return geometry;
 }
 
-std::size_t Geometry::AddVertexBuffer( PropertyBuffer& vertexBuffer )
+uint32_t Geometry::AddVertexBuffer( PropertyBuffer& vertexBuffer )
 {
   mVertexBuffers.push_back( &vertexBuffer );
   SceneGraph::AttachVertexBufferMessage( mEventThreadServices, *mRenderObject, *vertexBuffer.GetRenderObject() );
-  return mVertexBuffers.size() - 1u;
+  return static_cast<uint32_t>( mVertexBuffers.size() - 1u );
 }
 
-std::size_t Geometry::GetNumberOfVertexBuffers() const
+uint32_t Geometry::GetNumberOfVertexBuffers() const
 {
-  return mVertexBuffers.size();
+  return static_cast<uint32_t>( mVertexBuffers.size() );
 }
 
-void Geometry::RemoveVertexBuffer( std::size_t index )
+void Geometry::RemoveVertexBuffer( uint32_t index )
 {
   const SceneGraph::PropertyBuffer& renderPropertyBuffer = static_cast<const SceneGraph::PropertyBuffer&>( *(mVertexBuffers[index]->GetRenderObject()) );
   SceneGraph::RemoveVertexBufferMessage( mEventThreadServices, *mRenderObject, renderPropertyBuffer );
@@ -56,9 +55,9 @@ void Geometry::RemoveVertexBuffer( std::size_t index )
   mVertexBuffers.erase( mVertexBuffers.begin() + index );
 }
 
-void Geometry::SetIndexBuffer( const unsigned short* indices, size_t count )
+void Geometry::SetIndexBuffer( const uint16_t* indices, uint32_t count )
 {
-  Dali::Vector<unsigned short> indexData;
+  Dali::Vector<uint16_t> indexData;
   if( indices && count )
   {
     indexData.Resize( count );
@@ -89,7 +88,7 @@ const SceneGraph::Geometry* Geometry::GetRenderObject() const
 }
 
 Geometry::Geometry()
-: mEventThreadServices( *Stage::GetCurrent() ),
+: mEventThreadServices( EventThreadServices::Get() ),
   mRenderObject( NULL ),
   mType(Dali::Geometry::TRIANGLES)
 {
@@ -110,6 +109,6 @@ Geometry::~Geometry()
   }
 }
 
-
 } // namespace Internal
+
 } // namespace Dali
index 98e94e0..c9e9dd0 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_GEOMETRY_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -60,22 +60,22 @@ public:
   /**
    * @copydoc Dali::Geometry::AddVertexBuffer()
    */
-  std::size_t AddVertexBuffer( PropertyBuffer& vertexBuffer );
+  uint32_t AddVertexBuffer( PropertyBuffer& vertexBuffer );
 
   /**
    * @copydoc Dali::Geometry::GetNumberOfVertexBuffers()
    */
-  std::size_t GetNumberOfVertexBuffers() const;
+  uint32_t GetNumberOfVertexBuffers() const;
 
   /**
    * @copydoc Dali::Geometry::RemoveVertexBuffer()
    */
-  void RemoveVertexBuffer( std::size_t index );
+  void RemoveVertexBuffer( uint32_t index );
 
   /**
    * @copydoc Dali::Geometry::SetIndexBuffer()
    */
-  void SetIndexBuffer( const unsigned short* indices, size_t count );
+  void SetIndexBuffer( const uint16_t* indices, uint32_t count );
 
   /**
    * @copydoc Dali::Geometry::SetType()
index c244e3f..8d8566d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,9 +20,8 @@
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/scripting/scripting.h>
-#include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
+#include <dali/integration-api/debug.h>
 #include <dali/internal/event/common/property-helper.h>    // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
 #include <dali/internal/event/common/property-input-impl.h>
 #include <dali/internal/update/rendering/stencil-parameters.h>
@@ -37,6 +36,10 @@ namespace Internal
 
 namespace
 {
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_RENDERER" );
+#endif
+
 
 /**
  * Properties: |name                              |type     |writable|animatable|constraint-input|enum for index-checking|
@@ -67,7 +70,8 @@ DALI_PROPERTY( "stencilOperationOnFail",          INTEGER,   true, false,  false
 DALI_PROPERTY( "stencilOperationOnZFail",         INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL )
 DALI_PROPERTY( "stencilOperationOnZPass",         INTEGER,   true, false,  false, Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS )
 DALI_PROPERTY( "opacity",                         FLOAT,     true, true,   true,  Dali::DevelRenderer::Property::OPACITY )
-DALI_PROPERTY_TABLE_END( DEFAULT_RENDERER_PROPERTY_START_INDEX )
+DALI_PROPERTY( "renderingBehavior",               INTEGER,   true, false,  false, Dali::DevelRenderer::Property::RENDERING_BEHAVIOR )
+DALI_PROPERTY_TABLE_END( DEFAULT_RENDERER_PROPERTY_START_INDEX, RendererDefaultProperties )
 
 // Property string to enumeration tables:
 
@@ -161,21 +165,33 @@ DALI_ENUM_TO_STRING_WITH_SCOPE( StencilOperation, INCREMENT_WRAP )
 DALI_ENUM_TO_STRING_WITH_SCOPE( StencilOperation, DECREMENT_WRAP )
 DALI_ENUM_TO_STRING_TABLE_END( STENCIL_OPERATION )
 
-const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> RENDERER_IMPL = { DEFAULT_PROPERTY_DETAILS, DEFAULT_RENDERER_PROPERTY_START_INDEX };
+DALI_ENUM_TO_STRING_TABLE_BEGIN( RENDERING_BEHAVIOR )
+DALI_ENUM_TO_STRING_WITH_SCOPE( DevelRenderer::Rendering, IF_REQUIRED )
+DALI_ENUM_TO_STRING_WITH_SCOPE( DevelRenderer::Rendering, CONTINUOUSLY )
+DALI_ENUM_TO_STRING_TABLE_END( RENDERING_BEHAVIOR )
 
 BaseHandle Create()
 {
   return Dali::BaseHandle();
 }
 
-TypeRegistration mType( typeid( Dali::Renderer ), typeid( Dali::Handle ), Create );
+TypeRegistration mType( typeid( Dali::Renderer ), typeid( Dali::Handle ), Create, RendererDefaultProperties );
 
 } // unnamed namespace
 
 RendererPtr Renderer::New()
 {
-  RendererPtr rendererPtr( new Renderer() );
-  rendererPtr->Initialize();
+  // create scene object first so it's guaranteed to exist for the event side
+  auto sceneObject = SceneGraph::Renderer::New();
+  OwnerPointer< SceneGraph::Renderer > transferOwnership( sceneObject );
+  // pass the pointer to base for message passing
+  RendererPtr rendererPtr( new Renderer( sceneObject ) );
+  // transfer scene object ownership to update manager
+  EventThreadServices& eventThreadServices = rendererPtr->GetEventThreadServices();
+  SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
+  AddRendererMessage( updateManager, transferOwnership );
+
+  eventThreadServices.RegisterObject( rendererPtr.Get() );
   return rendererPtr;
 }
 
@@ -184,48 +200,48 @@ void Renderer::SetGeometry( Geometry& geometry )
   mGeometry = &geometry;
 
   const SceneGraph::Geometry* geometrySceneObject = geometry.GetRenderObject();
-  SetGeometryMessage( GetEventThreadServices(), *mSceneObject, *geometrySceneObject );
+  SetGeometryMessage( GetEventThreadServices(), GetRendererSceneObject(), *geometrySceneObject );
 }
 
-Geometry* Renderer::GetGeometry() const
+GeometryPtr Renderer::GetGeometry() const
 {
-  return mGeometry.Get();
+  return mGeometry;
 }
 
 void Renderer::SetTextures( TextureSet& textureSet )
 {
   mTextureSet = &textureSet;
   const SceneGraph::TextureSet* textureSetSceneObject = textureSet.GetTextureSetSceneObject();
-  SetTexturesMessage( GetEventThreadServices(), *mSceneObject, *textureSetSceneObject );
+  SetTexturesMessage( GetEventThreadServices(), GetRendererSceneObject(), *textureSetSceneObject );
 }
 
-TextureSet* Renderer::GetTextures() const
+TextureSetPtr Renderer::GetTextures() const
 {
-  return mTextureSet.Get();
+  return mTextureSet;
 }
 
 void Renderer::SetShader( Shader& shader )
 {
   mShader = &shader;
-  SceneGraph::Shader& sceneGraphShader = *shader.GetShaderSceneObject();
-  SceneGraph::SetShaderMessage( GetEventThreadServices(), *mSceneObject, sceneGraphShader );
+  const SceneGraph::Shader& sceneGraphShader = shader.GetShaderSceneObject();
+  SceneGraph::SetShaderMessage( GetEventThreadServices(), GetRendererSceneObject(), sceneGraphShader );
 }
 
-Shader* Renderer::GetShader() const
+ShaderPtr Renderer::GetShader() const
 {
-  return mShader.Get();
+  return mShader;
 }
 
-void Renderer::SetDepthIndex( int depthIndex )
+void Renderer::SetDepthIndex( int32_t depthIndex )
 {
   if ( mDepthIndex != depthIndex )
   {
     mDepthIndex = depthIndex;
-    SetDepthIndexMessage( GetEventThreadServices(), *mSceneObject, depthIndex );
+    SetDepthIndexMessage( GetEventThreadServices(), GetRendererSceneObject(), depthIndex );
   }
 }
 
-int Renderer::GetDepthIndex() const
+int32_t Renderer::GetDepthIndex() const
 {
   return mDepthIndex;
 }
@@ -236,7 +252,9 @@ void Renderer::SetBlendMode( BlendMode::Type mode )
   {
     mBlendMode = mode;
 
-    SetBlendModeMessage( GetEventThreadServices(), *mSceneObject, mBlendMode );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Renderer::SetBlendMode( %s )\n", Scripting::GetEnumerationName<BlendMode::Type>( mBlendMode, BLEND_MODE_TABLE, BLEND_MODE_TABLE_COUNT ) );
+
+    SetBlendModeMessage( GetEventThreadServices(), GetRendererSceneObject(), mBlendMode );
   }
 }
 
@@ -248,7 +266,7 @@ BlendMode::Type Renderer::GetBlendMode() const
 void Renderer::SetBlendFunc( BlendFactor::Type srcFactorRgba, BlendFactor::Type destFactorRgba )
 {
   mBlendingOptions.SetBlendFunc( srcFactorRgba, destFactorRgba, srcFactorRgba, destFactorRgba );
-  SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() );
+  SetBlendingOptionsMessage( GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask() );
 }
 
 void Renderer::SetBlendFunc( BlendFactor::Type srcFactorRgb,
@@ -257,7 +275,7 @@ void Renderer::SetBlendFunc( BlendFactor::Type srcFactorRgb,
                              BlendFactor::Type destFactorAlpha )
 {
   mBlendingOptions.SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
-  SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() );
+  SetBlendingOptionsMessage( GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask() );
 }
 
 void Renderer::GetBlendFunc( BlendFactor::Type& srcFactorRgb,
@@ -274,14 +292,14 @@ void Renderer::GetBlendFunc( BlendFactor::Type& srcFactorRgb,
 void Renderer::SetBlendEquation( BlendEquation::Type equationRgba )
 {
   mBlendingOptions.SetBlendEquation( equationRgba, equationRgba );
-  SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() );
+  SetBlendingOptionsMessage( GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask() );
 }
 
 void Renderer::SetBlendEquation( BlendEquation::Type equationRgb,
                                  BlendEquation::Type equationAlpha )
 {
   mBlendingOptions.SetBlendEquation( equationRgb, equationAlpha );
-  SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() );
+  SetBlendingOptionsMessage( GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask() );
 }
 
 void Renderer::GetBlendEquation( BlendEquation::Type& equationRgb,
@@ -292,21 +310,21 @@ void Renderer::GetBlendEquation( BlendEquation::Type& equationRgb,
   equationAlpha = mBlendingOptions.GetBlendEquationAlpha();
 }
 
-void Renderer::SetIndexedDrawFirstElement( size_t firstElement )
+void Renderer::SetIndexedDrawFirstElement( uint32_t firstElement )
 {
   if( firstElement != mIndexedDrawFirstElement )
   {
     mIndexedDrawFirstElement = firstElement;
-    SetIndexedDrawFirstElementMessage( GetEventThreadServices(), *mSceneObject, mIndexedDrawFirstElement );
+    SetIndexedDrawFirstElementMessage( GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawFirstElement );
   }
 }
 
-void Renderer::SetIndexedDrawElementsCount( size_t elementsCount )
+void Renderer::SetIndexedDrawElementsCount( uint32_t elementsCount )
 {
   if( elementsCount != mIndexedDrawElementCount )
   {
     mIndexedDrawElementCount = elementsCount;
-    SetIndexedDrawElementsCountMessage( GetEventThreadServices(), *mSceneObject, mIndexedDrawElementCount );
+    SetIndexedDrawElementsCountMessage( GetEventThreadServices(), GetRendererSceneObject(), mIndexedDrawElementCount );
   }
 }
 
@@ -319,8 +337,12 @@ void Renderer::EnablePreMultipliedAlpha( bool preMultipled )
     {
       SetBlendFunc( BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA );
     }
+    else
+    {
+      SetBlendFunc( BlendFactor::SRC_ALPHA, BlendFactor::ONE_MINUS_SRC_ALPHA, BlendFactor::ONE, BlendFactor::ONE_MINUS_SRC_ALPHA );
+    }
     mPremultipledAlphaEnabled = preMultipled;
-    SetEnablePreMultipliedAlphaMessage( GetEventThreadServices(), *mSceneObject, mPremultipledAlphaEnabled );
+    SetEnablePreMultipliedAlphaMessage( GetEventThreadServices(), GetRendererSceneObject(), mPremultipledAlphaEnabled );
   }
 }
 
@@ -329,49 +351,9 @@ bool Renderer::IsPreMultipliedAlphaEnabled() const
   return mPremultipledAlphaEnabled;
 }
 
-SceneGraph::Renderer* Renderer::GetRendererSceneObject()
-{
-  return mSceneObject;
-}
-
-unsigned int Renderer::GetDefaultPropertyCount() const
+const SceneGraph::Renderer& Renderer::GetRendererSceneObject() const
 {
-  return RENDERER_IMPL.GetDefaultPropertyCount();
-}
-
-void Renderer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  RENDERER_IMPL.GetDefaultPropertyIndices( indices );
-}
-
-const char* Renderer::GetDefaultPropertyName(Property::Index index) const
-{
-  return RENDERER_IMPL.GetDefaultPropertyName( index );
-}
-
-Property::Index Renderer::GetDefaultPropertyIndex( const std::string& name ) const
-{
-  return RENDERER_IMPL.GetDefaultPropertyIndex( name );
-}
-
-bool Renderer::IsDefaultPropertyWritable( Property::Index index ) const
-{
-  return RENDERER_IMPL.IsDefaultPropertyWritable( index );
-}
-
-bool Renderer::IsDefaultPropertyAnimatable( Property::Index index ) const
-{
-  return RENDERER_IMPL.IsDefaultPropertyAnimatable( index );
-}
-
-bool Renderer::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  return RENDERER_IMPL.IsDefaultPropertyAConstraintInput( index );
-}
-
-Property::Type Renderer::GetDefaultPropertyType( Property::Index index ) const
-{
-  return RENDERER_IMPL.GetDefaultPropertyType( index );
+  return static_cast<const SceneGraph::Renderer&>( GetSceneObject() );
 }
 
 void Renderer::SetDefaultProperty( Property::Index index,
@@ -381,7 +363,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
   {
     case Dali::Renderer::Property::DEPTH_INDEX:
     {
-      SetDepthIndex( propertyValue.Get<int>() );
+      SetDepthIndex( propertyValue.Get<int32_t>() );
       break;
     }
     case Dali::Renderer::Property::FACE_CULLING_MODE:
@@ -390,7 +372,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       if( Scripting::GetEnumerationProperty< FaceCullingMode::Type >( propertyValue, FACE_CULLING_MODE_TABLE, FACE_CULLING_MODE_TABLE_COUNT, convertedValue ) )
       {
         mFaceCullingMode = convertedValue;
-        SetFaceCullingModeMessage( GetEventThreadServices(), *mSceneObject, convertedValue );
+        SetFaceCullingModeMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
       }
       break;
     }
@@ -411,7 +393,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       {
         BlendEquation::Type alphaEquation = mBlendingOptions.GetBlendEquationAlpha();
         mBlendingOptions.SetBlendEquation( convertedValue, alphaEquation );
-        SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() );
+        SetBlendingOptionsMessage( GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask() );
       }
       break;
     }
@@ -423,7 +405,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       {
         BlendEquation::Type rgbEquation = mBlendingOptions.GetBlendEquationRgb();
         mBlendingOptions.SetBlendEquation( rgbEquation, convertedValue );
-        SetBlendingOptionsMessage( GetEventThreadServices(), *mSceneObject, mBlendingOptions.GetBitmask() );
+        SetBlendingOptionsMessage( GetEventThreadServices(), GetRendererSceneObject(), mBlendingOptions.GetBitmask() );
       }
       break;
     }
@@ -491,7 +473,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
     }
     case Dali::Renderer::Property::INDEX_RANGE_FIRST:
     {
-      int firstElement;
+      int32_t firstElement;
       if( propertyValue.Get( firstElement ) )
       {
         SetIndexedDrawFirstElement( firstElement );
@@ -500,7 +482,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
     }
     case Dali::Renderer::Property::INDEX_RANGE_COUNT:
     {
-      int elementsCount;
+      int32_t elementsCount;
       if( propertyValue.Get( elementsCount ) )
       {
         SetIndexedDrawElementsCount( elementsCount );
@@ -513,7 +495,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       if( Scripting::GetEnumerationProperty< DepthWriteMode::Type >( propertyValue, DEPTH_WRITE_MODE_TABLE, DEPTH_WRITE_MODE_TABLE_COUNT, convertedValue ) )
       {
         mDepthWriteMode = convertedValue;
-        SetDepthWriteModeMessage( GetEventThreadServices(), *mSceneObject, convertedValue );
+        SetDepthWriteModeMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
       }
       break;
     }
@@ -523,7 +505,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       if( Scripting::GetEnumerationProperty< DepthFunction::Type >( propertyValue, DEPTH_FUNCTION_TABLE, DEPTH_FUNCTION_TABLE_COUNT, convertedValue ) )
       {
         mDepthFunction = convertedValue;
-        SetDepthFunctionMessage( GetEventThreadServices(), *mSceneObject, convertedValue );
+        SetDepthFunctionMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
       }
       break;
     }
@@ -533,7 +515,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       if( Scripting::GetEnumerationProperty< DepthTestMode::Type >( propertyValue, DEPTH_TEST_MODE_TABLE, DEPTH_TEST_MODE_TABLE_COUNT, convertedValue ) )
       {
         mDepthTestMode = convertedValue;
-        SetDepthTestModeMessage( GetEventThreadServices(), *mSceneObject, convertedValue );
+        SetDepthTestModeMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
       }
       break;
     }
@@ -543,7 +525,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       if( Scripting::GetEnumerationProperty< RenderMode::Type >( propertyValue, RENDER_MODE_TABLE, RENDER_MODE_TABLE_COUNT, convertedValue ) )
       {
         mStencilParameters.renderMode = convertedValue;
-        SetRenderModeMessage( GetEventThreadServices(), *mSceneObject, convertedValue );
+        SetRenderModeMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
       }
       break;
     }
@@ -553,45 +535,45 @@ void Renderer::SetDefaultProperty( Property::Index index,
       if( Scripting::GetEnumerationProperty< StencilFunction::Type >( propertyValue, STENCIL_FUNCTION_TABLE, STENCIL_FUNCTION_TABLE_COUNT, convertedValue ) )
       {
         mStencilParameters.stencilFunction = convertedValue;
-        SetStencilFunctionMessage( GetEventThreadServices(), *mSceneObject, convertedValue );
+        SetStencilFunctionMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
       }
       break;
     }
     case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
     {
-      int stencilFunctionMask;
+      int32_t stencilFunctionMask;
       if( propertyValue.Get( stencilFunctionMask ) )
       {
         if( stencilFunctionMask != mStencilParameters.stencilFunctionMask )
         {
           mStencilParameters.stencilFunctionMask = stencilFunctionMask;
-          SetStencilFunctionMaskMessage( GetEventThreadServices(), *mSceneObject, stencilFunctionMask );
+          SetStencilFunctionMaskMessage( GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionMask );
         }
       }
       break;
     }
     case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
     {
-      int stencilFunctionReference;
+      int32_t stencilFunctionReference;
       if( propertyValue.Get( stencilFunctionReference ) )
       {
         if( stencilFunctionReference != mStencilParameters.stencilFunctionReference )
         {
           mStencilParameters.stencilFunctionReference = stencilFunctionReference;
-          SetStencilFunctionReferenceMessage( GetEventThreadServices(), *mSceneObject, stencilFunctionReference );
+          SetStencilFunctionReferenceMessage( GetEventThreadServices(), GetRendererSceneObject(), stencilFunctionReference );
         }
       }
       break;
     }
     case Dali::Renderer::Property::STENCIL_MASK:
     {
-      int stencilMask;
+      int32_t stencilMask;
       if( propertyValue.Get( stencilMask ) )
       {
         if( stencilMask != mStencilParameters.stencilMask )
         {
           mStencilParameters.stencilMask = stencilMask;
-          SetStencilMaskMessage( GetEventThreadServices(), *mSceneObject, stencilMask );
+          SetStencilMaskMessage( GetEventThreadServices(), GetRendererSceneObject(), stencilMask );
         }
       }
       break;
@@ -602,7 +584,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       if( Scripting::GetEnumerationProperty< StencilOperation::Type >( propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue ) )
       {
         mStencilParameters.stencilOperationOnFail = convertedValue;
-        SetStencilOperationOnFailMessage( GetEventThreadServices(), *mSceneObject, convertedValue );
+        SetStencilOperationOnFailMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
       }
       break;
     }
@@ -612,7 +594,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       if( Scripting::GetEnumerationProperty< StencilOperation::Type >( propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue ) )
       {
         mStencilParameters.stencilOperationOnZFail = convertedValue;
-        SetStencilOperationOnZFailMessage( GetEventThreadServices(), *mSceneObject, convertedValue );
+        SetStencilOperationOnZFailMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
       }
       break;
     }
@@ -622,7 +604,7 @@ void Renderer::SetDefaultProperty( Property::Index index,
       if( Scripting::GetEnumerationProperty< StencilOperation::Type >( propertyValue, STENCIL_OPERATION_TABLE, STENCIL_OPERATION_TABLE_COUNT, convertedValue ) )
       {
         mStencilParameters.stencilOperationOnZPass = convertedValue;
-        SetStencilOperationOnZPassMessage( GetEventThreadServices(), *mSceneObject, convertedValue );
+        SetStencilOperationOnZPassMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
       }
       break;
     }
@@ -634,22 +616,24 @@ void Renderer::SetDefaultProperty( Property::Index index,
         if( !Equals( mOpacity, opacity ) )
         {
           mOpacity = opacity;
-          BakeOpacityMessage( GetEventThreadServices(), *mSceneObject, mOpacity );
+          BakeOpacityMessage( GetEventThreadServices(), GetRendererSceneObject(), mOpacity );
         }
       }
       break;
     }
+    case DevelRenderer::Property::RENDERING_BEHAVIOR:
+    {
+      DevelRenderer::Rendering::Type convertedValue = mRenderingBehavior;
+      if( Scripting::GetEnumerationProperty< DevelRenderer::Rendering::Type >( propertyValue, RENDERING_BEHAVIOR_TABLE, RENDERING_BEHAVIOR_TABLE_COUNT, convertedValue ) )
+      {
+        mRenderingBehavior = convertedValue;
+        SetRenderingBehaviorMessage( GetEventThreadServices(), GetRendererSceneObject(), convertedValue );
+      }
+      break;
+    }
   }
 }
 
-void Renderer::SetSceneGraphProperty( Property::Index index,
-                                      const PropertyMetadata& entry,
-                                      const Property::Value& value )
-{
-  RENDERER_IMPL.SetSceneGraphProperty( GetEventThreadServices(), this, index, entry, value );
-  OnPropertySet(index, value);
-}
-
 Property::Value Renderer::GetDefaultProperty( Property::Index index ) const
 {
   Property::Value value;
@@ -709,33 +693,18 @@ void Renderer::OnNotifyDefaultPropertyAnimation( Animation& animation, Property:
   }
 }
 
-const SceneGraph::PropertyOwner* Renderer::GetPropertyOwner() const
-{
-  return mSceneObject;
-}
-
-const SceneGraph::PropertyOwner* Renderer::GetSceneObject() const
-{
-  return mSceneObject;
-}
-
 const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty( Property::Index index ) const
 {
-  DALI_ASSERT_ALWAYS( IsPropertyAnimatable(index) && "Property is not animatable" );
   const SceneGraph::PropertyBase* property = NULL;
 
-  property = RENDERER_IMPL.GetRegisteredSceneGraphProperty(
-    this,
-    &Renderer::FindAnimatableProperty,
-    &Renderer::FindCustomProperty,
-    index );
-
+  if( index == DevelRenderer::Property::OPACITY )
+  {
+    property = &GetRendererSceneObject().mOpacity;
+  }
   if( !property )
   {
-    if( index == DevelRenderer::Property::OPACITY )
-    {
-      property = &mSceneObject->mOpacity;
-    }
+    // not our property, ask base
+    property = Object::GetSceneObjectAnimatableProperty( index );
   }
 
   return property;
@@ -743,25 +712,12 @@ const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty( Prop
 
 const PropertyInputImpl* Renderer::GetSceneObjectInputProperty( Property::Index index ) const
 {
-  const PropertyInputImpl* property = NULL;
-
-  const SceneGraph::PropertyBase* baseProperty =
-    RENDERER_IMPL.GetRegisteredSceneGraphProperty( this,
-                                                   &Renderer::FindAnimatableProperty,
-                                                   &Renderer::FindCustomProperty,
-                                                   index );
-  property = static_cast<const PropertyInputImpl*>( baseProperty );
-
-  return property;
+  // reuse animatable property getter, Object::GetSceneObjectInputProperty does the same so no need to call that0
+  return GetSceneObjectAnimatableProperty( index );
 }
 
-int Renderer::GetPropertyComponentIndex( Property::Index index ) const
-{
-  return Property::INVALID_COMPONENT_INDEX;
-}
-
-Renderer::Renderer()
-: mSceneObject(NULL ),
+Renderer::Renderer( const SceneGraph::Renderer* sceneObject )
+: Object( sceneObject ),
   mDepthIndex( 0 ),
   mIndexedDrawFirstElement( 0 ),
   mIndexedDrawElementCount( 0 ),
@@ -773,26 +729,15 @@ Renderer::Renderer()
   mBlendMode( BlendMode::AUTO ),
   mDepthWriteMode( DepthWriteMode::AUTO ),
   mDepthTestMode( DepthTestMode::AUTO ),
+  mRenderingBehavior( DevelRenderer::Rendering::IF_REQUIRED ),
   mPremultipledAlphaEnabled( false )
 {
 }
 
-void Renderer::Initialize()
-{
-  EventThreadServices& eventThreadServices = GetEventThreadServices();
-  SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
-
-  mSceneObject = SceneGraph::Renderer::New();
-  OwnerPointer< SceneGraph::Renderer > transferOwnership( mSceneObject );
-  AddRendererMessage( updateManager, transferOwnership );
-
-  eventThreadServices.RegisterObject( this );
-}
-
 void Renderer::SetBlendColor( const Vector4& blendColor )
 {
   mBlendingOptions.SetBlendColor( blendColor );
-  SetBlendColorMessage( GetEventThreadServices(), *mSceneObject, GetBlendColor() );
+  SetBlendColorMessage( GetEventThreadServices(), GetRendererSceneObject(), GetBlendColor() );
 }
 
 const Vector4& Renderer::GetBlendColor() const
@@ -811,7 +756,7 @@ Renderer::~Renderer()
   {
     EventThreadServices& eventThreadServices = GetEventThreadServices();
     SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
-    RemoveRendererMessage( updateManager, *mSceneObject );
+    RemoveRendererMessage( updateManager, GetRendererSceneObject() );
 
     eventThreadServices.UnregisterObject( this );
   }
@@ -840,12 +785,12 @@ bool Renderer::GetCachedPropertyValue( Property::Index index, Property::Value& v
     }
     case Dali::Renderer::Property::BLEND_EQUATION_RGB:
     {
-      value = static_cast<int>( mBlendingOptions.GetBlendEquationRgb() );
+      value = static_cast<int32_t>( mBlendingOptions.GetBlendEquationRgb() );
       break;
     }
     case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
     {
-      value = static_cast<int>( mBlendingOptions.GetBlendEquationAlpha() );
+      value = static_cast<int32_t>( mBlendingOptions.GetBlendEquationAlpha() );
       break;
     }
     case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
@@ -855,7 +800,7 @@ bool Renderer::GetCachedPropertyValue( Property::Index index, Property::Value& v
       BlendFactor::Type srcFactorAlpha;
       BlendFactor::Type destFactorAlpha;
       GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
-      value = static_cast<int>( srcFactorRgb );
+      value = static_cast<int32_t>( srcFactorRgb );
       break;
     }
     case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
@@ -865,7 +810,7 @@ bool Renderer::GetCachedPropertyValue( Property::Index index, Property::Value& v
       BlendFactor::Type srcFactorAlpha;
       BlendFactor::Type destFactorAlpha;
       GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
-      value = static_cast<int>( destFactorRgb );
+      value = static_cast<int32_t>( destFactorRgb );
       break;
     }
     case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
@@ -875,7 +820,7 @@ bool Renderer::GetCachedPropertyValue( Property::Index index, Property::Value& v
       BlendFactor::Type srcFactorAlpha;
       BlendFactor::Type destFactorAlpha;
       GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
-      value = static_cast<int>( srcFactorAlpha );
+      value = static_cast<int32_t>( srcFactorAlpha );
       break;
     }
     case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
@@ -885,7 +830,7 @@ bool Renderer::GetCachedPropertyValue( Property::Index index, Property::Value& v
       BlendFactor::Type srcFactorAlpha;
       BlendFactor::Type destFactorAlpha;
       GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
-      value = static_cast<int>( destFactorAlpha );
+      value = static_cast<int32_t>( destFactorAlpha );
       break;
     }
     case Dali::Renderer::Property::BLEND_COLOR:
@@ -900,12 +845,12 @@ bool Renderer::GetCachedPropertyValue( Property::Index index, Property::Value& v
     }
     case Dali::Renderer::Property::INDEX_RANGE_FIRST:
     {
-      value = static_cast<int>( mIndexedDrawFirstElement );
+      value = static_cast<int32_t>( mIndexedDrawFirstElement );
       break;
     }
     case Dali::Renderer::Property::INDEX_RANGE_COUNT:
     {
-      value = static_cast<int>( mIndexedDrawElementCount );
+      value = static_cast<int32_t>( mIndexedDrawElementCount );
       break;
     }
     case Dali::Renderer::Property::DEPTH_WRITE_MODE:
@@ -968,6 +913,11 @@ bool Renderer::GetCachedPropertyValue( Property::Index index, Property::Value& v
       value = mOpacity;
       break;
     }
+    case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
+    {
+      value = mRenderingBehavior;
+      break;
+    }
     default:
     {
       // Must be a scene-graph only property
@@ -982,140 +932,146 @@ bool Renderer::GetCachedPropertyValue( Property::Index index, Property::Value& v
 bool Renderer::GetCurrentPropertyValue( Property::Index index, Property::Value& value  ) const
 {
   bool valueSet = true;
+  const SceneGraph::Renderer& sceneObject = GetRendererSceneObject();
 
   switch( index )
   {
     case Dali::Renderer::Property::DEPTH_INDEX:
     {
-      value = mSceneObject->GetDepthIndex();
+      value = sceneObject.GetDepthIndex();
       break;
     }
     case Dali::Renderer::Property::FACE_CULLING_MODE:
     {
-      value = mSceneObject->GetFaceCullingMode();
+      value = sceneObject.GetFaceCullingMode();
       break;
     }
     case Dali::Renderer::Property::BLEND_MODE:
     {
-      value = mSceneObject->GetBlendMode();
+      value = sceneObject.GetBlendMode();
       break;
     }
     case Dali::Renderer::Property::BLEND_EQUATION_RGB:
     {
-      value = static_cast<int>( mBlendingOptions.GetBlendEquationRgb() );
+      value = static_cast<int32_t>( mBlendingOptions.GetBlendEquationRgb() );
       break;
     }
     case Dali::Renderer::Property::BLEND_EQUATION_ALPHA:
     {
-      value = static_cast<int>( mBlendingOptions.GetBlendEquationAlpha() );
+      value = static_cast<int32_t>( mBlendingOptions.GetBlendEquationAlpha() );
       break;
     }
     case Dali::Renderer::Property::BLEND_FACTOR_SRC_RGB:
     {
-      value = static_cast<int>( mBlendingOptions.GetBlendSrcFactorRgb() );
+      value = static_cast<int32_t>( mBlendingOptions.GetBlendSrcFactorRgb() );
       break;
     }
     case Dali::Renderer::Property::BLEND_FACTOR_DEST_RGB:
     {
-      value = static_cast<int>( mBlendingOptions.GetBlendDestFactorRgb() );
+      value = static_cast<int32_t>( mBlendingOptions.GetBlendDestFactorRgb() );
       break;
     }
     case Dali::Renderer::Property::BLEND_FACTOR_SRC_ALPHA:
     {
-      value = static_cast<int>( mBlendingOptions.GetBlendSrcFactorAlpha() );
+      value = static_cast<int32_t>( mBlendingOptions.GetBlendSrcFactorAlpha() );
       break;
     }
     case Dali::Renderer::Property::BLEND_FACTOR_DEST_ALPHA:
     {
-      value = static_cast<int>( mBlendingOptions.GetBlendDestFactorAlpha() );
+      value = static_cast<int32_t>( mBlendingOptions.GetBlendDestFactorAlpha() );
       break;
     }
     case Dali::Renderer::Property::BLEND_COLOR:
     {
-      value = mSceneObject->GetBlendColor();
+      value = sceneObject.GetBlendColor();
       break;
     }
     case Dali::Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA:
     {
-      value = mSceneObject->IsPreMultipliedAlphaEnabled();
+      value = sceneObject.IsPreMultipliedAlphaEnabled();
       break;
     }
     case Dali::Renderer::Property::INDEX_RANGE_FIRST:
     {
-      value = static_cast<int>( mSceneObject->GetIndexedDrawFirstElement() );
+      value = static_cast<int32_t>( sceneObject.GetIndexedDrawFirstElement() );
       break;
     }
     case Dali::Renderer::Property::INDEX_RANGE_COUNT:
     {
-      value = static_cast<int>( mSceneObject->GetIndexedDrawElementsCount() );
+      value = static_cast<int32_t>( sceneObject.GetIndexedDrawElementsCount() );
       break;
     }
     case Dali::Renderer::Property::DEPTH_WRITE_MODE:
     {
-      value = mSceneObject->GetDepthWriteMode();
+      value = sceneObject.GetDepthWriteMode();
       break;
     }
     case Dali::Renderer::Property::DEPTH_FUNCTION:
     {
-      value = mSceneObject->GetDepthFunction();
+      value = sceneObject.GetDepthFunction();
       break;
     }
     case Dali::Renderer::Property::DEPTH_TEST_MODE:
     {
-      value = mSceneObject->GetDepthTestMode();
+      value = sceneObject.GetDepthTestMode();
       break;
     }
     case Dali::Renderer::Property::STENCIL_FUNCTION:
     {
-      SceneGraph::StencilParameters stencilParameters = mSceneObject->GetStencilParameters();
+      SceneGraph::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
       value = stencilParameters.stencilFunction;
       break;
     }
     case Dali::Renderer::Property::STENCIL_FUNCTION_MASK:
     {
-      SceneGraph::StencilParameters stencilParameters = mSceneObject->GetStencilParameters();
+      SceneGraph::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
       value = stencilParameters.stencilFunctionMask;
       break;
     }
     case Dali::Renderer::Property::STENCIL_FUNCTION_REFERENCE:
     {
-      SceneGraph::StencilParameters stencilParameters = mSceneObject->GetStencilParameters();
+      SceneGraph::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
       value = stencilParameters.stencilFunctionReference;
       break;
     }
     case Dali::Renderer::Property::STENCIL_MASK:
     {
-      SceneGraph::StencilParameters stencilParameters = mSceneObject->GetStencilParameters();
+      SceneGraph::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
       value = stencilParameters.stencilMask;
       break;
     }
     case Dali::Renderer::Property::RENDER_MODE:
     {
-      SceneGraph::StencilParameters stencilParameters = mSceneObject->GetStencilParameters();
+      SceneGraph::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
       value = stencilParameters.renderMode;
       break;
     }
     case Dali::Renderer::Property::STENCIL_OPERATION_ON_FAIL:
     {
-      SceneGraph::StencilParameters stencilParameters = mSceneObject->GetStencilParameters();
+      SceneGraph::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
       value = stencilParameters.stencilOperationOnFail;
       break;
     }
     case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_FAIL:
     {
-      SceneGraph::StencilParameters stencilParameters = mSceneObject->GetStencilParameters();
+      SceneGraph::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
       value = stencilParameters.stencilOperationOnZFail;
       break;
     }
     case Dali::Renderer::Property::STENCIL_OPERATION_ON_Z_PASS:
     {
-      SceneGraph::StencilParameters stencilParameters = mSceneObject->GetStencilParameters();
+      SceneGraph::StencilParameters stencilParameters = sceneObject.GetStencilParameters();
       value = stencilParameters.stencilOperationOnZPass;
       break;
     }
     case Dali::DevelRenderer::Property::OPACITY:
     {
-      value = mSceneObject->GetOpacity( GetEventThreadServices().GetEventBufferIndex() );
+      value = sceneObject.GetOpacity( GetEventThreadServices().GetEventBufferIndex() );
+      break;
+    }
+    case Dali::DevelRenderer::Property::RENDERING_BEHAVIOR:
+    {
+      value = sceneObject.GetRenderingBehavior();
       break;
     }
     default:
@@ -1130,4 +1086,5 @@ bool Renderer::GetCurrentPropertyValue( Property::Index index, Property::Value&
 }
 
 } // namespace Internal
+
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index 02a211e..a9a13e5
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_RENDERER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/rendering/renderer.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/internal/common/blending-options.h>
 #include <dali/internal/event/common/object-connector.h>
 #include <dali/internal/event/common/object-impl.h>
@@ -62,7 +63,7 @@ public:
   /**
    * @copydoc Dali::Renderer::GetGeometry()
    */
-  Geometry* GetGeometry() const;
+  GeometryPtr GetGeometry() const;
 
   /**
    * @copydoc Dali::Renderer::SetTextures()
@@ -72,7 +73,7 @@ public:
   /**
    * @copydoc Dali::Renderer::GetTextures()
    */
-  TextureSet* GetTextures() const;
+  TextureSetPtr GetTextures() const;
 
   /**
    * @copydoc Dali::Renderer::SetShader()
@@ -82,142 +83,97 @@ public:
   /**
    * @copydoc Dali::Renderer::GetShader()
    */
-  Shader* GetShader() const;
+  ShaderPtr GetShader() const;
 
   /**
    * @copydoc Dali::Renderer::SetDepthIndex()
    */
-  void SetDepthIndex( int depthIndex );
+  void SetDepthIndex( int32_t depthIndex );
 
   /**
    * @copydoc Dali::Renderer::GetDepthIndex()
    */
-  int GetDepthIndex() const;
+  int32_t GetDepthIndex() const;
 
-   /**
-    * @copydoc Dali::Renderer::SetBlendMode()
-    */
-   void SetBlendMode( BlendMode::Type mode );
-
-   /**
-    * @copydoc Dali::Renderer::GetBlendMode()
-    */
-   BlendMode::Type GetBlendMode() const;
-
-   /**
-    * @copydoc Dali::Renderer::SetBlendFunc()
-    */
-   void SetBlendFunc( BlendFactor::Type srcFactorRgba, BlendFactor::Type destFactorRgba );
-
-   /**
-    * @copydoc Dali::Renderer::SetBlendFunc()
-    */
-   void SetBlendFunc( BlendFactor::Type srcFactorRgb,   BlendFactor::Type destFactorRgb,
-                      BlendFactor::Type srcFactorAlpha, BlendFactor::Type destFactorAlpha );
-
-   /**
-    * @copydoc Dali::Renderer::GetBlendFunc()
-    */
-   void GetBlendFunc( BlendFactor::Type& srcFactorRgb,   BlendFactor::Type& destFactorRgb,
-                      BlendFactor::Type& srcFactorAlpha, BlendFactor::Type& destFactorAlpha ) const;
-
-   /**
-    * @copydoc Dali::Renderer::SetBlendEquation()
-    */
-   void SetBlendEquation( BlendEquation::Type equationRgba );
-
-   /**
-    * @copydoc Dali::Renderer::SetBlendEquation()
-    */
-   void SetBlendEquation( BlendEquation::Type equationRgb, BlendEquation::Type equationAlpha );
-
-   /**
-    * @copydoc Dali::Renderer::GetBlendEquation()
-    */
-   void GetBlendEquation( BlendEquation::Type& equationRgb, BlendEquation::Type& equationAlpha ) const;
-
-   /**
-    * @copydoc Dali::Renderer::SetIndexedDrawFirstElement
-    */
-   void SetIndexedDrawFirstElement( size_t firstElement );
-
-   /**
-    * @copydoc Dali::Renderer::SetIndexedDrawElementsCount
-    */
-   void SetIndexedDrawElementsCount( size_t elementsCount );
-
-   /**
-    * @brief Set whether the Pre-multiplied Alpha Blending is required
-    *
-    * @param[in] preMultipled whether alpha is pre-multiplied.
-    */
-   void EnablePreMultipliedAlpha( bool preMultipled );
+  /**
+   * @copydoc Dali::Renderer::SetBlendMode()
+   */
+  void SetBlendMode( BlendMode::Type mode );
 
-   /**
-    * @brief Query whether alpha is pre-multiplied.
-    *
-    * @return True is alpha is pre-multiplied, false otherwise.
-    */
-   bool IsPreMultipliedAlphaEnabled() const;
+  /**
+   * @copydoc Dali::Renderer::GetBlendMode()
+   */
+  BlendMode::Type GetBlendMode() const;
 
-   /**
-    * @brief Get the scene graph object
-    *
-    * @return the scene object
-    */
-   SceneGraph::Renderer* GetRendererSceneObject();
+  /**
+   * @copydoc Dali::Renderer::SetBlendFunc()
+   */
+  void SetBlendFunc( BlendFactor::Type srcFactorRgba, BlendFactor::Type destFactorRgba );
 
-public: // Default property extensions from Object
+  /**
+   * @copydoc Dali::Renderer::SetBlendFunc()
+   */
+  void SetBlendFunc( BlendFactor::Type srcFactorRgb,   BlendFactor::Type destFactorRgb,
+                     BlendFactor::Type srcFactorAlpha, BlendFactor::Type destFactorAlpha );
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
+   * @copydoc Dali::Renderer::GetBlendFunc()
    */
-  virtual unsigned int GetDefaultPropertyCount() const;
+  void GetBlendFunc( BlendFactor::Type& srcFactorRgb,   BlendFactor::Type& destFactorRgb,
+                    BlendFactor::Type& srcFactorAlpha, BlendFactor::Type& destFactorAlpha ) const;
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
+   * @copydoc Dali::Renderer::SetBlendEquation()
    */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
+  void SetBlendEquation( BlendEquation::Type equationRgba );
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
+   * @copydoc Dali::Renderer::SetBlendEquation()
    */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
+  void SetBlendEquation( BlendEquation::Type equationRgb, BlendEquation::Type equationAlpha );
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
+   * @copydoc Dali::Renderer::GetBlendEquation()
    */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
+  void GetBlendEquation( BlendEquation::Type& equationRgb, BlendEquation::Type& equationAlpha ) const;
 
   /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
+   * @copydoc Dali::Renderer::SetIndexedDrawFirstElement
    */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
+  void SetIndexedDrawFirstElement( uint32_t firstElement );
 
   /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
+   * @copydoc Dali::Renderer::SetIndexedDrawElementsCount
    */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
+  void SetIndexedDrawElementsCount( uint32_t elementsCount );
 
   /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
+   * @brief Set whether the Pre-multiplied Alpha Blending is required
+   *
+   * @param[in] preMultipled whether alpha is pre-multiplied.
    */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
+  void EnablePreMultipliedAlpha( bool preMultipled );
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
+   * @brief Query whether alpha is pre-multiplied.
+   *
+   * @return True is alpha is pre-multiplied, false otherwise.
    */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
+  bool IsPreMultipliedAlphaEnabled() const;
 
   /**
-   * @copydoc Dali::Internal::Object::SetDefaultProperty()
+   * @brief Get the scene graph object
+   *
+   * @return the scene object
    */
-  virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
+  const SceneGraph::Renderer& GetRendererSceneObject() const;
+
+public: // Default property extensions from Object
 
   /**
-   * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
+   * @copydoc Dali::Internal::Object::SetDefaultProperty()
    */
-  virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value );
+  virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
 
   /**
    * @copydoc Dali::Internal::Object::GetDefaultProperty()
@@ -235,16 +191,6 @@ public: // Default property extensions from Object
    virtual void OnNotifyDefaultPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType );
 
   /**
-   * @copydoc Dali::Internal::Object::GetPropertyOwner()
-   */
-  virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
-  /**
    * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
    */
   virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
@@ -254,22 +200,14 @@ public: // Default property extensions from Object
    */
   virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
 
-  /**
-   * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
-   */
-  virtual int GetPropertyComponentIndex( Property::Index index ) const;
-
 private: // implementation
 
   /**
-   * @brief Default constructor.
-   */
-  Renderer();
-
-  /**
-   * @brief Initializes the Renderer.
+   * @brief Constructor.
+   *
+   * @param sceneObject the scene graph renderer
    */
-  void Initialize();
+  Renderer( const SceneGraph::Renderer* sceneObject );
 
   /**
    * @brief Sets the blend color.
@@ -310,27 +248,27 @@ private: // unimplemented methods
   Renderer& operator=( const Renderer& );
 
 private: // data
-  SceneGraph::Renderer*               mSceneObject;
-  GeometryPtr                         mGeometry;                     ///< Connector that holds the geometry used by this renderer
-  TextureSetPtr                       mTextureSet;                   ///< Connector that holds the texture set used by this renderer
-  ShaderPtr                           mShader;                       ///< Connector that holds the shader used by this renderer
-
-  int                                 mDepthIndex;
 
-  size_t                              mIndexedDrawFirstElement;      ///< Offset of first element to draw from bound index buffer
-  size_t                              mIndexedDrawElementCount;      ///< Number of elements to draw
+  GeometryPtr                         mGeometry;                   ///< Intrusive pointer to the geometry used by this renderer
+  TextureSetPtr                       mTextureSet;                 ///< Intrusive pointer to the texture set used by this renderer
+  ShaderPtr                           mShader;                     ///< Intrusive pointer to the shader used by this renderer
 
-  SceneGraph::StencilParameters       mStencilParameters;            ///< Struct containing all stencil related options
-  BlendingOptions                     mBlendingOptions;              ///< Local copy of blending options bitmask
+  int32_t                             mDepthIndex;
 
-  float                               mOpacity;                      ///< Local copy of the opacity
+  uint32_t                            mIndexedDrawFirstElement;    ///< Offset of first element to draw from bound index buffer
+  uint32_t                            mIndexedDrawElementCount;    ///< Number of elements to draw
 
-  DepthFunction::Type                 mDepthFunction:3;              ///< Local copy of the depth function
-  FaceCullingMode::Type               mFaceCullingMode:2;            ///< Local copy of the mode of face culling
-  BlendMode::Type                     mBlendMode:2;                  ///< Local copy of the mode of blending
-  DepthWriteMode::Type                mDepthWriteMode:2;             ///< Local copy of the depth write mode
-  DepthTestMode::Type                 mDepthTestMode:2;              ///< Local copy of the depth test mode
-  bool                                mPremultipledAlphaEnabled:1;   ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
+  SceneGraph::StencilParameters       mStencilParameters;            ///< Struct containing all stencil related options
+  BlendingOptions                     mBlendingOptions;            ///< Local copy of blending options bitmask
+
+  float                               mOpacity;                    ///< Local copy of the opacity
+  DepthFunction::Type                 mDepthFunction:4;            ///< Local copy of the depth function
+  FaceCullingMode::Type               mFaceCullingMode:3;          ///< Local copy of the mode of face culling
+  BlendMode::Type                     mBlendMode:3;                ///< Local copy of the mode of blending
+  DepthWriteMode::Type                mDepthWriteMode:3;           ///< Local copy of the depth write mode
+  DepthTestMode::Type                 mDepthTestMode:3;            ///< Local copy of the depth test mode
+  DevelRenderer::Rendering::Type      mRenderingBehavior:2;        ///< The rendering behavior
+  bool                                mPremultipledAlphaEnabled:1; ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
 };
 
 } // namespace Internal
index 0bede78..8fd9dda 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ SceneGraph::Sampler* Sampler::GetSamplerRenderObject()
 
 
 Sampler::Sampler()
-:mEventThreadServices( *Stage::GetCurrent() ),
+:mEventThreadServices( EventThreadServices::Get() ),
  mRenderObject( NULL )
 {
 }
index 09a5d04..61b354c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SAMPLER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -76,7 +76,7 @@ private:
   /**
    * Second stage initialization
    */
-  void Initialize( );
+  void Initialize(  );
 
 protected:
   /**
index 0646ea5..4f71690 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,6 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/devel-api/rendering/shader-devel.h>
-#include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
 #include <dali/internal/event/common/property-helper.h> // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
 #include <dali/internal/event/common/thread-local-storage.h>
 #include <dali/internal/event/effects/shader-factory.h>
@@ -41,9 +40,7 @@ namespace
  */
 DALI_PROPERTY_TABLE_BEGIN
 DALI_PROPERTY( "program",       MAP,     true,     false,     false,  Dali::Shader::Property::PROGRAM )
-DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
-
-const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> SHADER_IMPL = { DEFAULT_PROPERTY_DETAILS, DEFAULT_ACTOR_PROPERTY_START_INDEX };
+DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX, ShaderDefaultProperties )
 
 Dali::Scripting::StringEnum ShaderHintsTable[] =
   { { "NONE",                     Dali::Shader::Hint::NONE},
@@ -51,14 +48,14 @@ Dali::Scripting::StringEnum ShaderHintsTable[] =
     { "MODIFIES_GEOMETRY",        Dali::Shader::Hint::MODIFIES_GEOMETRY}
   };
 
-const unsigned int ShaderHintsTableSize = sizeof( ShaderHintsTable ) / sizeof( ShaderHintsTable[0] );
+const uint32_t ShaderHintsTableSize = static_cast<uint32_t>( sizeof( ShaderHintsTable ) / sizeof( ShaderHintsTable[0] ) );
 
 BaseHandle Create()
 {
   return Dali::BaseHandle();
 }
 
-TypeRegistration mType( typeid( Dali::Shader ), typeid( Dali::Handle ), Create );
+TypeRegistration mType( typeid( Dali::Shader ), typeid( Dali::Handle ), Create, ShaderDefaultProperties );
 
 #define TOKEN_STRING(x) (#x)
 
@@ -93,80 +90,54 @@ Property::Value HintString(const Dali::Shader::Hint::Value& hints)
   return Property::Value(s);
 }
 
-
 } // unnamed namespace
 
 ShaderPtr Shader::New( const std::string& vertexShader,
                        const std::string& fragmentShader,
                        Dali::Shader::Hint::Value hints )
 {
-  ShaderPtr shader( new Shader() );
-  shader->Initialize( vertexShader, fragmentShader, hints );
+  // create scene object first so it's guaranteed to exist for the event side
+  auto sceneObject = new SceneGraph::Shader( hints );
+  OwnerPointer< SceneGraph::Shader > transferOwnership( sceneObject );
+  // pass the pointer to base for message passing
+  ShaderPtr shader( new Shader( sceneObject ) );
+  // transfer scene object ownership to update manager
+  auto&& services = shader->GetEventThreadServices();
+  SceneGraph::UpdateManager& updateManager = services.GetUpdateManager();
+  AddShaderMessage( updateManager, transferOwnership );
+
+  services.RegisterObject( shader.Get() );
+  shader->SetShader( vertexShader, fragmentShader, hints );
   return shader;
 }
 
 ShaderPtr Shader::New( std::vector<char>& vertexShader,
                        std::vector<char>& fragmentShader,
                        DevelShader::ShaderLanguage language,
-                       const Property::Map& specializationConstants )
-{
-  ShaderPtr shader( new Shader() );
-  shader->Initialize(vertexShader, fragmentShader, language, specializationConstants );
-  return shader;
-}
-
-const SceneGraph::Shader* Shader::GetShaderSceneObject() const
-{
-  return mSceneObject;
-}
-
-SceneGraph::Shader* Shader::GetShaderSceneObject()
-{
-  return mSceneObject;
-}
-
-unsigned int Shader::GetDefaultPropertyCount() const
-{
-  return SHADER_IMPL.GetDefaultPropertyCount();
-}
-
-void Shader::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  SHADER_IMPL.GetDefaultPropertyIndices( indices );
-}
-
-const char* Shader::GetDefaultPropertyName(Property::Index index) const
-{
-  return SHADER_IMPL.GetDefaultPropertyName( index );
-}
-
-Property::Index Shader::GetDefaultPropertyIndex( const std::string& name ) const
-{
-  return SHADER_IMPL.GetDefaultPropertyIndex( name );
-}
-
-bool Shader::IsDefaultPropertyWritable( Property::Index index ) const
-{
-  return SHADER_IMPL.IsDefaultPropertyWritable( index );
-}
-
-bool Shader::IsDefaultPropertyAnimatable( Property::Index index ) const
+                       const Property::Map& specializationConstants,
+                       Dali::Shader::Hint::Value hints )
 {
-  return SHADER_IMPL.IsDefaultPropertyAnimatable( index );
-}
+  // create scene object first so it's guaranteed to exist for the event side
+  auto sceneObject = new SceneGraph::Shader( hints );
+  OwnerPointer< SceneGraph::Shader > transferOwnership( sceneObject );
+  // pass the pointer to base for message passing
+  ShaderPtr shader( new Shader( sceneObject ) );
+  // transfer scene object ownership to update manager
+  auto&& services = shader->GetEventThreadServices();
+  SceneGraph::UpdateManager& updateManager = services.GetUpdateManager();
+  AddShaderMessage( updateManager, transferOwnership );
 
-bool Shader::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  return SHADER_IMPL.IsDefaultPropertyAConstraintInput( index );
+  services.RegisterObject( shader.Get() );
+  shader->SetShader(vertexShader, fragmentShader, language, specializationConstants, hints );
+  return shader;
 }
 
-Property::Type Shader::GetDefaultPropertyType( Property::Index index ) const
+const SceneGraph::Shader& Shader::GetShaderSceneObject() const
 {
-  return SHADER_IMPL.GetDefaultPropertyType( index );
+  return static_cast<const SceneGraph::Shader&>( GetSceneObject() );
 }
 
-void Shader::SetDefaultProperty( Property::Index index,
-                                 const Property::Value& propertyValue )
+void Shader::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
 {
   switch(index)
   {
@@ -199,7 +170,7 @@ void Shader::SetDefaultProperty( Property::Index index,
               );
           }
 
-          Initialize(vertex, fragment, hints );
+          SetShader( vertex, fragment, hints );
         }
       }
       else
@@ -211,14 +182,6 @@ void Shader::SetDefaultProperty( Property::Index index,
   }
 }
 
-void Shader::SetSceneGraphProperty( Property::Index index,
-                                    const PropertyMetadata& entry,
-                                    const Property::Value& value )
-{
-  SHADER_IMPL.SetSceneGraphProperty( GetEventThreadServices(), this, index, entry, value );
-  OnPropertySet(index, value);
-}
-
 Property::Value Shader::GetDefaultProperty( Property::Index index ) const
 {
   Property::Value value;
@@ -247,106 +210,38 @@ Property::Value Shader::GetDefaultPropertyCurrentValue( Property::Index index )
   return GetDefaultProperty( index ); // Event-side only properties
 }
 
-const SceneGraph::PropertyOwner* Shader::GetPropertyOwner() const
+Shader::Shader( const SceneGraph::Shader* sceneObject )
+: Object( sceneObject ),
+  mShaderData( nullptr )
 {
-  return mSceneObject;
 }
 
-const SceneGraph::PropertyOwner* Shader::GetSceneObject() const
+void Shader::SetShader( const std::string& vertexSource,
+                        const std::string& fragmentSource,
+                        Dali::Shader::Hint::Value hints )
 {
-  return mSceneObject;
-}
-
-const SceneGraph::PropertyBase* Shader::GetSceneObjectAnimatableProperty( Property::Index index ) const
-{
-  DALI_ASSERT_ALWAYS( IsPropertyAnimatable( index ) && "Property is not animatable" );
-  const SceneGraph::PropertyBase* property = NULL;
-
-  property = SHADER_IMPL.GetRegisteredSceneGraphProperty( this,
-                                                          &Shader::FindAnimatableProperty,
-                                                          &Shader::FindCustomProperty,
-                                                          index );
-
-  if( property == NULL && index < DEFAULT_PROPERTY_MAX_COUNT )
-  {
-    DALI_ASSERT_ALWAYS( 0 && "Property is not animatable" );
-  }
-
-  return property;
-}
-
-const PropertyInputImpl* Shader::GetSceneObjectInputProperty( Property::Index index ) const
-{
-  PropertyMetadata* property = NULL;
-
-  if( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
-      ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
-  {
-    property = FindCustomProperty( index );
-  }
-  else if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
-  {
-    property = FindAnimatableProperty( index );
-  }
-
-  DALI_ASSERT_ALWAYS( property && "property index is invalid" );
-  return property->GetSceneGraphProperty();
-}
-
-int Shader::GetPropertyComponentIndex( Property::Index index ) const
-{
-  return Property::INVALID_COMPONENT_INDEX;
-}
-
-Shader::Shader()
-  : mSceneObject( NULL ),
-    mShaderData( NULL )
-{
-}
-
-void Shader::Initialize(
-  const std::string& vertexSource,
-  const std::string& fragmentSource,
-  Dali::Shader::Hint::Value hints )
-{
-  EventThreadServices& eventThreadServices = GetEventThreadServices();
-  SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
-  mSceneObject = new SceneGraph::Shader( hints );
-
-  OwnerPointer< SceneGraph::Shader > transferOwnership( mSceneObject );
-  AddShaderMessage( updateManager, transferOwnership );
-
-  // Try to load a precompiled shader binary for the source pair:
+  // Try to load a pre-compiled shader binary for the source pair:
   ThreadLocalStorage& tls = ThreadLocalStorage::Get();
   ShaderFactory& shaderFactory = tls.GetShaderFactory();
   size_t shaderHash;
   mShaderData = shaderFactory.Load( vertexSource, fragmentSource, hints, shaderHash );
 
-  // Add shader program to scene-object using a message to the UpdateManager
-  SetShaderProgramMessage( eventThreadServices, *mSceneObject, mShaderData, (hints & Dali::Shader::Hint::MODIFIES_GEOMETRY) != 0x0 );
-
-  eventThreadServices.RegisterObject( this );
+  EventThreadServices& eventThreadServices = GetEventThreadServices();
+  SetShaderProgramMessage( eventThreadServices, *const_cast<SceneGraph::Shader*>(&GetShaderSceneObject()), mShaderData, (hints & Dali::Shader::Hint::MODIFIES_GEOMETRY) != 0x0 );
 }
 
-void Shader::Initialize( std::vector<char>& vertexShader,
-                         std::vector<char>& fragmentShader,
-                         DevelShader::ShaderLanguage language,
-                         const Property::Map& specializationConstants )
+
+void Shader::SetShader( std::vector<char>& vertexShader,
+                        std::vector<char>& fragmentShader,
+                        DevelShader::ShaderLanguage language,
+                        const Property::Map& specializationConstants,
+                        Dali::Shader::Hint::Value hints )
 {
-  auto hints = Dali::Shader::Hint::Value::NONE;
   EventThreadServices& eventThreadServices = GetEventThreadServices();
-  SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
-  mSceneObject = new SceneGraph::Shader( hints );
-
-  OwnerPointer< SceneGraph::Shader > transferOwnership( mSceneObject );
-  AddShaderMessage( updateManager, transferOwnership );
 
   mShaderData = new ShaderData( vertexShader, fragmentShader, hints );
+  SetShaderProgramMessage( eventThreadServices, *const_cast<SceneGraph::Shader*>(&GetShaderSceneObject()), mShaderData, (hints & Dali::Shader::Hint::MODIFIES_GEOMETRY) != 0x0 );
 
-  // Add shader program to scene-object using a message to the UpdateManager
-  SetShaderProgramMessage( eventThreadServices, *mSceneObject, mShaderData, false );
-
-  eventThreadServices.RegisterObject( this );
 }
 
 Shader::~Shader()
@@ -355,7 +250,7 @@ Shader::~Shader()
   {
     EventThreadServices& eventThreadServices = GetEventThreadServices();
     SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
-    RemoveShaderMessage( updateManager, *mSceneObject);
+    RemoveShaderMessage( updateManager, &GetShaderSceneObject() );
 
     eventThreadServices.UnregisterObject( this );
   }
index 146f9ff..0218b3d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SHADER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,84 +55,35 @@ public:
                         Dali::Shader::Hint::Value hints );
 
   /**
+   * Create a new shader object
    *
-   * @param vertexShader
-   * @param fragmentShader
-   * @param language
-   * @param specializationConstants
+   * @param[in] vertexShader
+   * @param[in] fragmentShader
+   * @param[in] language
+   * @param[in] specializationConstants
+   * @param[in] hints Hints to define the geometry of the rendered object
    * @return
    */
   static ShaderPtr New( std::vector<char>& vertexShader,
                         std::vector<char>& fragmentShader,
                         DevelShader::ShaderLanguage language,
-                        const Property::Map& specializationConstants );
-
-  /**
-   * @brief Get the shader scene object
-   *
-   * @return the shader scene object
-   */
-  const SceneGraph::Shader* GetShaderSceneObject() const;
+                        const Property::Map& specializationConstants,
+                        Dali::Shader::Hint::Value hints );
 
   /**
    * Retrieve the scene-graph shader added by this object.
    * @return A pointer to the shader.
    */
-  SceneGraph::Shader* GetShaderSceneObject();
+  const SceneGraph::Shader& GetShaderSceneObject() const;
 
 public: // Default property extensions from Object
 
   /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
-   */
-  virtual unsigned int GetDefaultPropertyCount() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
-   */
-  virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
-   */
-  virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
-   */
-  virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
-   */
-  virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
-   */
-  virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
-   */
-  virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
-   */
-  virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
-
-  /**
    * @copydoc Dali::Internal::Object::SetDefaultProperty()
    */
   virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
 
   /**
-   * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
-   */
-  virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value );
-
-  /**
    * @copydoc Dali::Internal::Object::GetDefaultProperty()
    */
   virtual Property::Value GetDefaultProperty( Property::Index index ) const;
@@ -142,38 +93,19 @@ public: // Default property extensions from Object
    */
   virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const;
 
-  /**
-   * @copydoc Dali::Internal::Object::GetPropertyOwner()
-   */
-  virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
-   */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
+private: // implementation
 
   /**
-   * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
+   * Constructor
+   *
+   * @param sceneObject the scene object
    */
-  virtual int GetPropertyComponentIndex( Property::Index index ) const;
-
-private: // implementation
-  Shader();
+  Shader( const SceneGraph::Shader* sceneObject );
 
   /**
    * Second stage initialization
    */
-  void Initialize( const std::string& vertexShader, const std::string& fragmentShader, Dali::Shader::Hint::Value hints );
+  void SetShader( const std::string& vertexShader, const std::string& fragmentShader, Dali::Shader::Hint::Value hints );
 
   /**
    *
@@ -184,11 +116,13 @@ private: // implementation
    * @param fragmentShader
    * @param language
    * @param specializationConstants
+   * @param[in] hints Hints to define the geometry of the rendered object
    */
-  void Initialize(  std::vector<char>& vertexShader,
-                    std::vector<char>& fragmentShader,
-                    DevelShader::ShaderLanguage language,
-                    const Property::Map& specializationConstants );
+  void SetShader( std::vector<char>& vertexShader,
+                   std::vector<char>& fragmentShader,
+                   DevelShader::ShaderLanguage language,
+                   const Property::Map& specializationConstants,
+                   Dali::Shader::Hint::Value hints );
 
 protected:
   /**
@@ -197,12 +131,15 @@ protected:
   virtual ~Shader();
 
 private: // unimplemented methods
-  Shader( const Shader& );
-  Shader& operator=( const Shader& );
+
+  Shader() = delete;
+  Shader( const Shader& ) = delete;
+  Shader& operator=( const Shader& ) = delete;
 
 private:
-  SceneGraph::Shader* mSceneObject;
+
   Internal::ShaderDataPtr mShaderData;
+
 };
 
 } // namespace Internal
index fb22890..4f45bdd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/update/manager/update-manager.h>
-#include <dali/internal/update/manager/update-manager.h>
 #include <dali/internal/event/common/stage-impl.h>
 #include <dali/integration-api/render-controller.h>
 
@@ -51,7 +50,7 @@ SceneGraph::Texture* Texture::GetRenderObject() const
 }
 
 Texture::Texture(TextureType::Type type, Pixel::Format format, ImageDimensions size )
-: mEventThreadServices( *Stage::GetCurrent() ),
+: mEventThreadServices( EventThreadServices::Get() ),
   mRenderObject( NULL ),
   mNativeImage(),
   mSize( size ),
@@ -61,7 +60,7 @@ Texture::Texture(TextureType::Type type, Pixel::Format format, ImageDimensions s
 }
 
 Texture::Texture( NativeImageInterfacePtr nativeImageInterface )
-: mEventThreadServices( *Stage::GetCurrent() ),
+: mEventThreadServices( EventThreadServices::Get() ),
   mRenderObject( NULL ),
   mNativeImage( nativeImageInterface ),
   mSize( nativeImageInterface->GetWidth(), nativeImageInterface->GetHeight() ),
index c55591c..d609efc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
-#include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
 #include <dali/internal/update/manager/update-manager.h>
 #include <dali/internal/update/rendering/scene-graph-texture-set.h>
 
+namespace
+{
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_TEXTURE_SET" );
+#endif
+}
+
 namespace Dali
 {
 namespace Internal
@@ -36,9 +42,12 @@ TextureSetPtr TextureSet::New()
   return textureSet;
 }
 
-void TextureSet::SetTexture( size_t index, TexturePtr texture )
+void TextureSet::SetTexture( uint32_t index, TexturePtr texture )
 {
-  size_t textureCount( mTextures.size() );
+  DALI_LOG_INFO( gLogFilter, Debug::General, "TS::SetTexture( T:%p )  SG::TS:%p SG:T:%p\n",
+                 texture, mSceneObject, texture?texture->GetRenderObject():nullptr );
+
+  uint32_t textureCount = static_cast<uint32_t>( mTextures.size() );
   if( index >= textureCount )
   {
     mTextures.resize(index + 1);
@@ -50,7 +59,7 @@ void TextureSet::SetTexture( size_t index, TexturePtr texture )
       samplerExist = false;
     }
 
-    for( size_t i(textureCount); i<=index; ++i )
+    for( uint32_t i(textureCount); i<=index; ++i )
     {
       mTextures[i] = NULL;
 
@@ -72,7 +81,7 @@ void TextureSet::SetTexture( size_t index, TexturePtr texture )
   SceneGraph::SetTextureMessage( mEventThreadServices, *mSceneObject, index, renderTexture );
 }
 
-Texture* TextureSet::GetTexture( size_t index ) const
+Texture* TextureSet::GetTexture( uint32_t index ) const
 {
   Texture* result(0);
   if( index < mTextures.size() )
@@ -87,13 +96,13 @@ Texture* TextureSet::GetTexture( size_t index ) const
   return result;
 }
 
-void TextureSet::SetSampler( size_t index, SamplerPtr sampler )
+void TextureSet::SetSampler( uint32_t index, SamplerPtr sampler )
 {
-  size_t samplerCount( mSamplers.size() );
+  uint32_t samplerCount = static_cast<uint32_t>( mSamplers.size() );
   if( samplerCount < index + 1  )
   {
     mSamplers.resize( index + 1 );
-    for( size_t i(samplerCount); i<=index; ++i )
+    for( uint32_t i = samplerCount; i<=index; ++i )
     {
       mSamplers[i] = NULL;
     }
@@ -110,7 +119,7 @@ void TextureSet::SetSampler( size_t index, SamplerPtr sampler )
   SceneGraph::SetSamplerMessage( mEventThreadServices, *mSceneObject, index, renderSampler );
 }
 
-Sampler* TextureSet::GetSampler( size_t index ) const
+Sampler* TextureSet::GetSampler( uint32_t index ) const
 {
   Sampler* result(0);
   if( index < mSamplers.size() )
@@ -125,9 +134,9 @@ Sampler* TextureSet::GetSampler( size_t index ) const
   return result;
 }
 
-size_t TextureSet::GetTextureCount() const
+uint32_t TextureSet::GetTextureCount() const
 {
-  return mTextures.size();
+  return static_cast<uint32_t>( mTextures.size() );
 }
 
 const SceneGraph::TextureSet* TextureSet::GetTextureSetSceneObject() const
@@ -136,7 +145,7 @@ const SceneGraph::TextureSet* TextureSet::GetTextureSetSceneObject() const
 }
 
 TextureSet::TextureSet()
-:mEventThreadServices( *Stage::GetCurrent() ),
+:mEventThreadServices( EventThreadServices::Get() ),
  mSceneObject( NULL )
 {
 }
index eb692b9..148286f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TEXTURE_SET_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -59,27 +59,27 @@ public:
   /**
    * @copydoc Dali::TextureSet::SetTexture()
    */
-  void SetTexture( size_t index, TexturePtr texture );
+  void SetTexture( uint32_t index, TexturePtr texture );
 
   /**
    * @copydoc Dali::TextureSet::GetTexture()
    */
-  Texture* GetTexture( size_t index ) const;
+  Texture* GetTexture( uint32_t index ) const;
 
   /**
    * @copydoc Dali::TextureSet::SetSampler()
    */
-  void SetSampler( size_t index, SamplerPtr sampler );
+  void SetSampler( uint32_t index, SamplerPtr sampler );
 
   /**
    * @copydoc Dali::TextureSet::GetSampler()
    */
-  Sampler* GetSampler( size_t index ) const;
+  Sampler* GetSampler( uint32_t index ) const;
 
   /**
    * @copydoc Dali::TextureSet::GetTextureCount()
    */
-  size_t GetTextureCount() const;
+  uint32_t GetTextureCount() const;
 
  /**
    * @brief Get the TextureSet scene object
index 193ae67..87d8645 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
 // EXTERNAL INCLUDES
 #if defined(DEBUG_ENABLED)
 #include <sstream>
-#include <dali/internal/event/common/system-overlay-impl.h>
 #endif // defined(DEBUG_ENABLED)
 
 // INTERNAL INCLUDES
@@ -31,7 +30,6 @@
 #include <dali/public-api/object/object-registry.h>
 #include <dali/internal/event/actors/actor-impl.h>
 #include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/event/common/system-overlay-impl.h>
 #include <dali/internal/event/common/thread-local-storage.h>
 
 namespace Dali
@@ -76,8 +74,8 @@ void PrintChildren( Dali::Actor actor, int level )
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, output.str().c_str() );
 
   ++level;
-  unsigned int numChildren = actor.GetChildCount();
-  for( unsigned int i=0; i<numChildren; ++i )
+  uint32_t numChildren = actor.GetChildCount();
+  for( uint32_t i=0; i<numChildren; ++i )
   {
     PrintChildren( actor.GetChildAt(i), level );
   }
@@ -92,6 +90,7 @@ void PrintHierarchy()
   if ( gLogFilter->IsEnabledFor( Debug::Verbose ) )
   {
     DALI_LOG_INFO( gLogFilter, Debug::Verbose, "---------- ROOT LAYER ----------\n" );
+
     PrintChildren( Stage::GetCurrent()->GetRootLayer(), 0 );
   }
 }
@@ -111,7 +110,6 @@ RelayoutController::RelayoutController( Integration::RenderController& controlle
   mRelayoutInfoAllocator(),
   mSlotDelegate( this ),
   mRelayoutStack( new MemoryPoolRelayoutContainer( mRelayoutInfoAllocator ) ),
-  mStageSize(), // zero initialized
   mRelayoutConnection( false ),
   mRelayoutFlag( false ),
   mEnabled( false ),
@@ -132,17 +130,12 @@ RelayoutController* RelayoutController::Get()
   return &ThreadLocalStorage::Get().GetRelayoutController();
 }
 
-void RelayoutController::SetStageSize( unsigned int width, unsigned int height )
+void RelayoutController::QueueActor( Internal::Actor* actor, RelayoutContainer& actors, Vector2 size )
 {
-  mStageSize.width = width;
-  mStageSize.height = height;
-}
-
-void RelayoutController::QueueActor( Dali::Actor& actor, RelayoutContainer& actors, Vector2 size )
-{
-  if( GetImplementation( actor ).RelayoutRequired() )
+  if( actor && actor->RelayoutRequired() )
   {
-    actors.Add( actor, size );
+    Dali::Actor actorHandle = Dali::Actor( actor );
+    actors.Add( actorHandle, size );
   }
 }
 
@@ -159,7 +152,7 @@ void RelayoutController::RequestRelayout( Dali::Actor& actor, Dimension::Type di
   topOfSubTreeStack.push_back( actor );
 
   // Propagate on all dimensions
-  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
   {
     if( dimension & ( 1 << i ) )
     {
@@ -210,21 +203,6 @@ void RelayoutController::OnApplicationSceneCreated()
   // Open relayout controller to receive relayout requests
   mEnabled = true;
 
-  // Spread the dirty flag through whole tree - don't need to explicity
-  // add request on rootLayer as it will automatically be added below.
-  Dali::Stage stage = Dali::Stage::GetCurrent();
-  Dali::Actor rootLayer = stage.GetRootLayer();
-  RequestRelayoutTree( rootLayer );
-
-  // Also add request on the root of system overlay
-  Dali::Internal::SystemOverlay* systemOverlay = GetImplementation(stage).GetSystemOverlayInternal();
-  if( systemOverlay )
-  {
-    Dali::Internal::Actor& systemOverlayInternalRoot = systemOverlay->GetDefaultRootActor();
-    Dali::Actor systemOverlayRoot = Dali::Actor(&systemOverlayInternalRoot);
-    RequestRelayoutTree( systemOverlayRoot );
-  }
-
   // Flag request for end of frame
   Request();
 }
@@ -253,7 +231,7 @@ void RelayoutController::RequestRelayoutTree( Dali::Actor& actor )
   }
 
   // Propagate down to children
-  for( unsigned int i = 0; i < actor.GetChildCount(); ++i )
+  for( uint32_t i = 0; i < actor.GetChildCount(); ++i )
   {
     Dali::Actor child = actor.GetChildAt( i );
 
@@ -273,7 +251,7 @@ void RelayoutController::PropagateAll( Dali::Actor& actor, Dimension::Type dimen
 
     // Check for dimension dependecy: width for height/height for width etc
     // Check each possible dimension and see if it is dependent on the input one
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       Dimension::Type dimensionToCheck = static_cast< Dimension::Type >( 1 << i );
 
@@ -293,9 +271,9 @@ void RelayoutController::PropagateAll( Dali::Actor& actor, Dimension::Type dimen
       {
         // Store the highest parent reached
         bool found = false;
-        for( unsigned int i = 0, count = topOfSubTreeStack.size(); i < count; ++i )
+        for( auto&& element : topOfSubTreeStack )
         {
-          if( topOfSubTreeStack[ i ] == parent )
+          if( element == parent )
           {
             found = true;
             break;
@@ -347,7 +325,7 @@ void RelayoutController::PropagateFlags( Dali::Actor& actor, Dimension::Type dim
 
     // Check for dimension dependecy: width for height/height for width etc
     // Check each possible dimension and see if it is dependent on the input one
-    for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+    for( uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i )
     {
       Dimension::Type dimensionToCheck = static_cast< Dimension::Type >( 1 << i );
 
@@ -370,7 +348,7 @@ void RelayoutController::PropagateFlags( Dali::Actor& actor, Dimension::Type dim
     }
 
     // Propagate down to children
-    for( unsigned int i = 0, childCount = actor.GetChildCount(); i < childCount; ++i )
+    for( uint32_t i = 0, childCount = actor.GetChildCount(); i < childCount; ++i )
     {
       Dali::Actor child = actor.GetChildAt( i );
       Actor& childImpl = GetImplementation( child );
@@ -385,13 +363,13 @@ void RelayoutController::PropagateFlags( Dali::Actor& actor, Dimension::Type dim
 
 void RelayoutController::AddRequest( Dali::Actor& actor )
 {
-  BaseObject* actorPtr = &GetImplementation( actor );
+  Internal::Actor* actorPtr = &GetImplementation( actor );
 
   // Only add the rootActor if it is not already recorded
   bool found = false;
-  for( unsigned int i = 0, count = mDirtyLayoutSubTrees.Size(); i < count; ++i )
+  for( auto&& item : mDirtyLayoutSubTrees )
   {
-    if( mDirtyLayoutSubTrees[ i ] == actorPtr )
+    if( item == actorPtr )
     {
       found = true;
       break;
@@ -406,7 +384,7 @@ void RelayoutController::AddRequest( Dali::Actor& actor )
 
 void RelayoutController::RemoveRequest( Dali::Actor& actor )
 {
-  BaseObject* actorPtr = &GetImplementation( actor );
+  Internal::Actor* actorPtr = &GetImplementation( actor );
 
   // Remove actor from dirty sub trees
   for( RawActorList::Iterator it = mDirtyLayoutSubTrees.Begin(), itEnd = mDirtyLayoutSubTrees.End(); it != itEnd; ++it )
@@ -425,8 +403,7 @@ void RelayoutController::Request()
 
   if( !mRelayoutConnection )
   {
-    Dali::Stage stage = Dali::Stage::GetCurrent();
-    stage.GetObjectRegistry().ObjectDestroyedSignal().Connect( mSlotDelegate, &RelayoutController::OnObjectDestroyed );
+    ThreadLocalStorage::Get().GetObjectRegistry().ObjectDestroyedSignal().Connect( mSlotDelegate, &RelayoutController::OnObjectDestroyed );
 
     mRelayoutConnection = true;
   }
@@ -452,19 +429,16 @@ void RelayoutController::Relayout()
     //    These controls are paired with the parent/stage size and added to the stack.
     for( RawActorList::Iterator it = mDirtyLayoutSubTrees.Begin(), itEnd = mDirtyLayoutSubTrees.End(); it != itEnd; ++it )
     {
-      BaseObject* dirtyActor = *it;
+      Internal::Actor* dirtyActor = *it;
 
       // Need to test if actor is valid (could have been deleted and had the pointer cleared)
       if( dirtyActor )
       {
-        // We know that BaseObject is a base class of Internal::Actor but need to instruct the compiler to do the cast
-        Dali::Actor actor = Dali::Actor( reinterpret_cast<Dali::Internal::Actor*>( dirtyActor ) );
-
         // Only negotiate actors that are on stage
-        if( actor.OnStage() )
+        if( dirtyActor->OnStage() )
         {
-          Dali::Actor parent = actor.GetParent();
-          QueueActor( actor, *mRelayoutStack, ( parent ) ? Vector2( parent.GetTargetSize() ) : mStageSize );
+          Internal::Actor* parent = dirtyActor->GetParent();
+          QueueActor( dirtyActor, *mRelayoutStack, ( parent ) ? Vector2( parent->GetTargetSize() ) : dirtyActor->GetScene().GetSize() );
         }
       }
     }
index d8e7bfa..5f7fb1f 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/base-object.h>
@@ -65,13 +68,6 @@ public:
   static RelayoutController* Get();
 
   /**
-   * Set the stage size
-   * @param width of the stage
-   * @param height of the stage
-   */
-  void SetStageSize( unsigned int width, unsigned int height );
-
-  /**
    * @brief Request to relayout the given actor and all sub-actors of it.
    *
    * This flags the actor and all actors dependent on it for relayout. The actual
@@ -147,7 +143,7 @@ public: // CALLBACKS
 
 private:
 
-  typedef Dali::Vector< BaseObject* > RawActorList;
+  using RawActorList = Dali::Vector< Dali::Internal::Actor* >;
 
   /**
    * @brief Request for relayout. Relays out whole scene.
@@ -191,7 +187,7 @@ private:
    * @param[in] actors The container to add the actor to
    * @param[in] size The size that this actor should be
    */
-  void QueueActor( Dali::Actor& actor, RelayoutContainer& actors, Vector2 size );
+  void QueueActor( Internal::Actor* actor, RelayoutContainer& actors, Vector2 size );
 
   /**
    * @brief Find the given object in the list and null it out
@@ -202,8 +198,8 @@ private:
   void FindAndZero( const RawActorList& list, const Dali::RefObject* object );
 
   // Undefined
-  RelayoutController(const RelayoutController&);
-  RelayoutController& operator=(const RelayoutController&);
+  RelayoutController(const RelayoutController&) = delete;
+  RelayoutController& operator=(const RelayoutController&) = delete;
 
 private:
 
@@ -215,7 +211,6 @@ private:
   RawActorList mDirtyLayoutSubTrees;    ///< List of roots of sub trees that are dirty
   MemoryPoolRelayoutContainer* mRelayoutStack;  ///< Stack for relayouting
 
-  Vector2 mStageSize;              ///< size of the stage
   bool mRelayoutConnection : 1;    ///< Whether EventProcessingFinishedSignal signal is connected.
   bool mRelayoutFlag : 1;          ///< Relayout flag to avoid unnecessary calls
   bool mEnabled : 1;               ///< Initially disabled. Must be enabled at some point.
diff --git a/dali/internal/event/update/frame-callback-interface-impl.h b/dali/internal/event/update/frame-callback-interface-impl.h
new file mode 100644 (file)
index 0000000..ce92562
--- /dev/null
@@ -0,0 +1,98 @@
+#ifndef DALI_FRAME_CALLBACK_INTERFACE_IMPL_H
+#define DALI_FRAME_CALLBACK_INTERFACE_IMPL_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/update/frame-callback-interface.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+namespace SceneGraph
+{
+class FrameCallback;
+}
+}
+
+/**
+ * The Implementation of the FrameCallbackInterface
+ * @see FrameCallbackInterface
+ */
+class FrameCallbackInterface::Impl final
+{
+public:
+
+  Impl() = default; ///< Default constructor.
+  ~Impl() = default; ///< Default non-virtual destructor.
+
+  /**
+   * Retrieve the Impl of a FrameCallbackInterface.
+   * @param[in]  frameCallback  The frame-callb
+   */
+  static inline Impl& Get( FrameCallbackInterface& frameCallback )
+  {
+    return *frameCallback.mImpl;
+  }
+
+  /**
+   * Links this FrameCallback to the given scene-graph-frame-callback.
+   * @param[in]  sceneGraphObject  The scene-graph-frame-callback to link this with.
+   */
+  void ConnectToSceneGraphObject( Internal::SceneGraph::FrameCallback& sceneGraphObject )
+  {
+    mSceneGraphFrameCallback = &sceneGraphObject;
+  }
+
+  /**
+   * Disconnects this FrameCallback from the scene-graph-frame-callback.
+   */
+  void DisconnectFromSceneGraphObject()
+  {
+    mSceneGraphFrameCallback = nullptr;
+  }
+
+  /**
+   * Checks whether we are connected to a scene-graph-frame-callback.
+   * @return True if connected, false otherwise.
+   */
+  bool IsConnectedToSceneGraph() const
+  {
+    return mSceneGraphFrameCallback;
+  }
+
+  /**
+   * Invalidates this FrameCallback and linked SceneGraph::FrameCallback.
+   */
+  void Invalidate()
+  {
+    if( mSceneGraphFrameCallback )
+    {
+      mSceneGraphFrameCallback->Invalidate();
+    }
+  }
+
+private:
+  Internal::SceneGraph::FrameCallback* mSceneGraphFrameCallback{ nullptr }; ///< Pointer to the scene-graph object, not owned.
+};
+
+} // namespace Dali
+
+#endif // DALI_FRAME_CALLBACK_INTERFACE_IMPL_H
diff --git a/dali/internal/file-unix.list b/dali/internal/file-unix.list
new file mode 100644 (file)
index 0000000..82a0b83
--- /dev/null
@@ -0,0 +1,11 @@
+# Set the source directory
+SET( internal_src_dir ${ROOT_SRC_DIR}/dali/internal )
+
+# Add internal unix source files here
+SET( internal_unix_src_files
+  ${internal_src_dir}/event/common/demangler-unix.cpp
+)
+
+SET( SOURCES ${SOURCES}
+  ${internal_unix_src_files}
+)
diff --git a/dali/internal/file-windows.list b/dali/internal/file-windows.list
new file mode 100644 (file)
index 0000000..457babd
--- /dev/null
@@ -0,0 +1,11 @@
+# Set the source directory
+SET( internal_src_dir ${ROOT_SRC_DIR}/dali/internal )
+
+# Add internal unix source files here
+SET( internal_windows_src_files
+  ${internal_src_dir}/event/common/demangler-windows.cpp
+)
+
+SET( SOURCES ${SOURCES}
+  ${internal_windows_src_files}
+)
index 90341d6..eff514e 100644 (file)
 # Add internal source files here
+SET( internal_src_dir ${ROOT_SRC_DIR}/dali/internal )
 
-internal_src_files = \
-  $(internal_src_dir)/common/blending-options.cpp \
-  $(internal_src_dir)/common/core-impl.cpp \
-  $(internal_src_dir)/common/internal-constants.cpp \
-  $(internal_src_dir)/common/math.cpp \
-  $(internal_src_dir)/common/message-buffer.cpp \
-  $(internal_src_dir)/common/mutex-trace.cpp \
-  $(internal_src_dir)/common/image-sampler.cpp \
-  $(internal_src_dir)/common/image-attributes.cpp \
-  $(internal_src_dir)/common/fixed-size-memory-pool.cpp \
-  \
-  $(internal_src_dir)/event/actors/actor-impl.cpp \
-  $(internal_src_dir)/event/actors/custom-actor-internal.cpp \
-  $(internal_src_dir)/event/actors/layer-impl.cpp \
-  $(internal_src_dir)/event/actors/layer-list.cpp \
-  $(internal_src_dir)/event/actors/camera-actor-impl.cpp \
-  $(internal_src_dir)/event/animation/animation-impl.cpp \
-  $(internal_src_dir)/event/animation/animation-playlist.cpp \
-  $(internal_src_dir)/event/animation/constrainer.cpp \
-  $(internal_src_dir)/event/animation/constraint-base.cpp \
-  $(internal_src_dir)/event/animation/key-frames-impl.cpp \
-  $(internal_src_dir)/event/animation/linear-constrainer-impl.cpp \
-  $(internal_src_dir)/event/animation/path-impl.cpp \
-  $(internal_src_dir)/event/animation/path-constrainer-impl.cpp \
-  $(internal_src_dir)/event/common/demangler.cpp \
-  $(internal_src_dir)/event/common/event-thread-services.cpp \
-  $(internal_src_dir)/event/common/notification-manager.cpp \
-  $(internal_src_dir)/event/common/object-impl.cpp \
-  $(internal_src_dir)/event/common/object-registry-impl.cpp \
-  $(internal_src_dir)/event/common/projection.cpp \
-  $(internal_src_dir)/event/common/property-buffer-impl.cpp  \
-  $(internal_src_dir)/event/common/property-conditions-impl.cpp  \
-  $(internal_src_dir)/event/common/property-metadata.cpp  \
-  $(internal_src_dir)/event/common/property-notification-impl.cpp  \
-  $(internal_src_dir)/event/common/property-notification-manager.cpp \
-  $(internal_src_dir)/event/common/property-helper.cpp \
-  $(internal_src_dir)/event/common/stage-impl.cpp \
-  $(internal_src_dir)/event/common/system-overlay-impl.cpp \
-  $(internal_src_dir)/event/common/thread-local-storage.cpp \
-  $(internal_src_dir)/event/common/type-info-impl.cpp \
-  $(internal_src_dir)/event/common/type-registry-impl.cpp \
-  $(internal_src_dir)/event/effects/shader-factory.cpp \
-  $(internal_src_dir)/event/events/actor-gesture-data.cpp \
-  $(internal_src_dir)/event/events/actor-observer.cpp \
-  $(internal_src_dir)/event/events/event-processor.cpp \
-  $(internal_src_dir)/event/events/key-event-impl.cpp \
-  $(internal_src_dir)/event/events/key-event-processor.cpp \
-  $(internal_src_dir)/event/events/gesture-detector-impl.cpp \
-  $(internal_src_dir)/event/events/gesture-event-processor.cpp \
-  $(internal_src_dir)/event/events/gesture-processor.cpp \
-  $(internal_src_dir)/event/events/hit-test-algorithm-impl.cpp \
-  $(internal_src_dir)/event/events/hover-event-processor.cpp \
-  $(internal_src_dir)/event/events/long-press-gesture-detector-impl.cpp \
-  $(internal_src_dir)/event/events/long-press-gesture-processor.cpp \
-  $(internal_src_dir)/event/events/wheel-event-processor.cpp \
-  $(internal_src_dir)/event/events/multi-point-event-util.cpp \
-  $(internal_src_dir)/event/events/pan-gesture-detector-impl.cpp \
-  $(internal_src_dir)/event/events/pan-gesture-processor.cpp \
-  $(internal_src_dir)/event/events/pinch-gesture-detector-impl.cpp \
-  $(internal_src_dir)/event/events/pinch-gesture-processor.cpp \
-  $(internal_src_dir)/event/events/tap-gesture-detector-impl.cpp \
-  $(internal_src_dir)/event/events/tap-gesture-processor.cpp \
-  $(internal_src_dir)/event/events/touch-data-impl.cpp \
-  $(internal_src_dir)/event/events/touch-event-processor.cpp \
-  $(internal_src_dir)/event/images/bitmap-packed-pixel.cpp \
-  $(internal_src_dir)/event/images/bitmap-compressed.cpp \
-  $(internal_src_dir)/event/images/image-impl.cpp \
-  $(internal_src_dir)/event/images/buffer-image-impl.cpp \
-  $(internal_src_dir)/event/images/frame-buffer-image-impl.cpp \
-  $(internal_src_dir)/event/images/encoded-buffer-image-impl.cpp \
-  $(internal_src_dir)/event/images/nine-patch-image-impl.cpp \
-  $(internal_src_dir)/event/images/resource-image-impl.cpp \
-  $(internal_src_dir)/event/images/native-image-impl.cpp \
-  $(internal_src_dir)/event/images/pixel-data-impl.cpp \
-  $(internal_src_dir)/event/object/custom-object-internal.cpp \
-  $(internal_src_dir)/event/render-tasks/render-task-impl.cpp \
-  $(internal_src_dir)/event/render-tasks/render-task-list-impl.cpp \
-  $(internal_src_dir)/event/rendering/frame-buffer-impl.cpp \
-  $(internal_src_dir)/event/rendering/geometry-impl.cpp \
-  $(internal_src_dir)/event/rendering/texture-impl.cpp \
-  $(internal_src_dir)/event/rendering/texture-set-impl.cpp \
-  $(internal_src_dir)/event/rendering/renderer-impl.cpp \
-  $(internal_src_dir)/event/rendering/sampler-impl.cpp \
-  $(internal_src_dir)/event/rendering/shader-impl.cpp \
-  $(internal_src_dir)/event/size-negotiation/memory-pool-relayout-container.cpp \
-  $(internal_src_dir)/event/size-negotiation/relayout-controller-impl.cpp \
-  \
-  $(internal_src_dir)/update/animation/scene-graph-animation.cpp \
-  $(internal_src_dir)/update/animation/scene-graph-constraint-base.cpp \
-  $(internal_src_dir)/update/common/discard-queue.cpp \
-  $(internal_src_dir)/update/common/property-base.cpp \
-  $(internal_src_dir)/update/common/property-owner-messages.cpp \
-  $(internal_src_dir)/update/common/property-condition-functions.cpp \
-  $(internal_src_dir)/update/common/property-condition-step-functions.cpp \
-  $(internal_src_dir)/update/common/property-condition-variable-step-functions.cpp \
-  $(internal_src_dir)/update/common/property-owner.cpp \
-  $(internal_src_dir)/update/common/scene-graph-buffers.cpp \
-  $(internal_src_dir)/update/common/scene-graph-connection-change-propagator.cpp \
-  $(internal_src_dir)/update/common/scene-graph-property-notification.cpp \
-  $(internal_src_dir)/update/common/uniform-map.cpp \
-  $(internal_src_dir)/update/controllers/scene-controller-impl.cpp \
-  $(internal_src_dir)/update/gestures/pan-gesture-profiling.cpp \
-  $(internal_src_dir)/update/gestures/scene-graph-pan-gesture.cpp \
-  $(internal_src_dir)/update/graphics/graphics-algorithms.cpp \
-  $(internal_src_dir)/update/queue/update-message-queue.cpp \
-  $(internal_src_dir)/update/manager/render-instruction-processor.cpp \
-  $(internal_src_dir)/update/manager/render-task-processor.cpp \
-  $(internal_src_dir)/update/manager/transform-manager.cpp \
-  $(internal_src_dir)/update/manager/update-algorithms.cpp \
-  $(internal_src_dir)/update/manager/update-manager.cpp \
-  $(internal_src_dir)/update/manager/update-manager-debug.cpp \
-  $(internal_src_dir)/update/nodes/node.cpp \
-  $(internal_src_dir)/update/nodes/node-messages.cpp \
-  $(internal_src_dir)/update/nodes/scene-graph-layer.cpp \
-  $(internal_src_dir)/update/render-tasks/scene-graph-camera.cpp \
-  $(internal_src_dir)/update/render-tasks/scene-graph-render-task.cpp \
-  $(internal_src_dir)/update/render-tasks/scene-graph-render-task-list.cpp \
-  $(internal_src_dir)/update/rendering/data-providers/render-data-provider.cpp \
-  $(internal_src_dir)/update/rendering/render-instruction-container.cpp \
-  $(internal_src_dir)/update/rendering/render-instruction.cpp \
-  $(internal_src_dir)/update/rendering/render-item.cpp \
-  $(internal_src_dir)/update/rendering/scene-graph-frame-buffer.cpp \
-  $(internal_src_dir)/update/rendering/scene-graph-geometry.cpp \
-  $(internal_src_dir)/update/rendering/scene-graph-property-buffer.cpp \
-  $(internal_src_dir)/update/rendering/scene-graph-texture.cpp \
-  $(internal_src_dir)/update/rendering/scene-graph-shader.cpp \
-  $(internal_src_dir)/update/rendering/scene-graph-texture-set.cpp \
-  $(internal_src_dir)/update/rendering/scene-graph-renderer.cpp \
-  $(internal_src_dir)/update/rendering/shader-cache.cpp
+SET( internal_src_files
+  ${internal_src_dir}/common/blending-options.cpp
+  ${internal_src_dir}/common/core-impl.cpp
+  ${internal_src_dir}/common/internal-constants.cpp
+  ${internal_src_dir}/common/math.cpp
+  ${internal_src_dir}/common/message-buffer.cpp
+  ${internal_src_dir}/common/mutex-trace.cpp
+  ${internal_src_dir}/common/image-sampler.cpp
+  ${internal_src_dir}/common/image-attributes.cpp
+  ${internal_src_dir}/common/fixed-size-memory-pool.cpp
+  ${internal_src_dir}/event/actors/actor-impl.cpp
+  ${internal_src_dir}/event/actors/custom-actor-internal.cpp
+  ${internal_src_dir}/event/actors/layer-impl.cpp
+  ${internal_src_dir}/event/actors/layer-list.cpp
+  ${internal_src_dir}/event/actors/camera-actor-impl.cpp
+  ${internal_src_dir}/event/animation/animation-impl.cpp
+  ${internal_src_dir}/event/animation/animation-playlist.cpp
+  ${internal_src_dir}/event/animation/constrainer.cpp
+  ${internal_src_dir}/event/animation/constraint-base.cpp
+  ${internal_src_dir}/event/animation/key-frames-impl.cpp
+  ${internal_src_dir}/event/animation/linear-constrainer-impl.cpp
+  ${internal_src_dir}/event/animation/path-impl.cpp
+  ${internal_src_dir}/event/animation/path-constrainer-impl.cpp
+  ${internal_src_dir}/event/common/event-thread-services.cpp
+  ${internal_src_dir}/event/common/notification-manager.cpp
+  ${internal_src_dir}/event/common/object-impl.cpp
+  ${internal_src_dir}/event/common/object-registry-impl.cpp
+  ${internal_src_dir}/event/common/projection.cpp
+  ${internal_src_dir}/event/common/property-buffer-impl.cpp
+  ${internal_src_dir}/event/common/property-conditions-impl.cpp
+  ${internal_src_dir}/event/common/property-metadata.cpp
+  ${internal_src_dir}/event/common/property-notification-impl.cpp
+  ${internal_src_dir}/event/common/property-notification-manager.cpp
+  ${internal_src_dir}/event/common/property-helper.cpp
+  ${internal_src_dir}/event/common/scene-impl.cpp
+  ${internal_src_dir}/event/common/stage-impl.cpp
+  ${internal_src_dir}/event/common/thread-local-storage.cpp
+  ${internal_src_dir}/event/common/type-info-impl.cpp
+  ${internal_src_dir}/event/common/type-registry-impl.cpp
+  ${internal_src_dir}/event/effects/shader-factory.cpp
+  ${internal_src_dir}/event/events/actor-gesture-data.cpp
+  ${internal_src_dir}/event/events/actor-observer.cpp
+  ${internal_src_dir}/event/events/event-processor.cpp
+  ${internal_src_dir}/event/events/key-event-impl.cpp
+  ${internal_src_dir}/event/events/key-event-processor.cpp
+  ${internal_src_dir}/event/events/gesture-detector-impl.cpp
+  ${internal_src_dir}/event/events/gesture-event-processor.cpp
+  ${internal_src_dir}/event/events/gesture-processor.cpp
+  ${internal_src_dir}/event/events/hit-test-algorithm-impl.cpp
+  ${internal_src_dir}/event/events/hover-event-processor.cpp
+  ${internal_src_dir}/event/events/long-press-gesture-detector-impl.cpp
+  ${internal_src_dir}/event/events/long-press-gesture-processor.cpp
+  ${internal_src_dir}/event/events/wheel-event-processor.cpp
+  ${internal_src_dir}/event/events/multi-point-event-util.cpp
+  ${internal_src_dir}/event/events/pan-gesture-detector-impl.cpp
+  ${internal_src_dir}/event/events/pan-gesture-processor.cpp
+  ${internal_src_dir}/event/events/pinch-gesture-detector-impl.cpp
+  ${internal_src_dir}/event/events/pinch-gesture-processor.cpp
+  ${internal_src_dir}/event/events/tap-gesture-detector-impl.cpp
+  ${internal_src_dir}/event/events/tap-gesture-processor.cpp
+  ${internal_src_dir}/event/events/touch-data-impl.cpp
+  ${internal_src_dir}/event/events/touch-event-processor.cpp
+  ${internal_src_dir}/event/images/bitmap-packed-pixel.cpp
+  ${internal_src_dir}/event/images/bitmap-compressed.cpp
+  ${internal_src_dir}/event/images/image-impl.cpp
+  ${internal_src_dir}/event/images/buffer-image-impl.cpp
+  ${internal_src_dir}/event/images/frame-buffer-image-impl.cpp
+  ${internal_src_dir}/event/images/encoded-buffer-image-impl.cpp
+  ${internal_src_dir}/event/images/nine-patch-image-impl.cpp
+  ${internal_src_dir}/event/images/resource-image-impl.cpp
+  ${internal_src_dir}/event/images/native-image-impl.cpp
+  ${internal_src_dir}/event/images/pixel-data-impl.cpp
+  ${internal_src_dir}/event/render-tasks/render-task-impl.cpp
+  ${internal_src_dir}/event/render-tasks/render-task-list-impl.cpp
+  ${internal_src_dir}/event/rendering/frame-buffer-impl.cpp
+  ${internal_src_dir}/event/rendering/geometry-impl.cpp
+  ${internal_src_dir}/event/rendering/texture-impl.cpp
+  ${internal_src_dir}/event/rendering/texture-set-impl.cpp
+  ${internal_src_dir}/event/rendering/renderer-impl.cpp
+  ${internal_src_dir}/event/rendering/sampler-impl.cpp
+  ${internal_src_dir}/event/rendering/shader-impl.cpp
+  ${internal_src_dir}/event/size-negotiation/memory-pool-relayout-container.cpp
+  ${internal_src_dir}/event/size-negotiation/relayout-controller-impl.cpp
+
+  ${internal_src_dir}/update/animation/scene-graph-animation.cpp
+  ${internal_src_dir}/update/animation/scene-graph-constraint-base.cpp
+  ${internal_src_dir}/update/common/discard-queue.cpp
+  ${internal_src_dir}/update/common/property-base.cpp
+  ${internal_src_dir}/update/common/property-owner-messages.cpp
+  ${internal_src_dir}/update/common/property-condition-functions.cpp
+  ${internal_src_dir}/update/common/property-condition-step-functions.cpp
+  ${internal_src_dir}/update/common/property-condition-variable-step-functions.cpp
+  ${internal_src_dir}/update/common/property-owner.cpp
+  ${internal_src_dir}/update/common/scene-graph-buffers.cpp
+  ${internal_src_dir}/update/common/scene-graph-connection-change-propagator.cpp
+  ${internal_src_dir}/update/common/scene-graph-property-notification.cpp
+  ${internal_src_dir}/update/common/uniform-map.cpp
+  ${internal_src_dir}/update/controllers/scene-controller-impl.cpp
+  ${internal_src_dir}/update/gestures/pan-gesture-profiling.cpp
+  ${internal_src_dir}/update/gestures/scene-graph-pan-gesture.cpp
+  ${internal_src_dir}/update/graphics/graphics-algorithms.cpp
+  ${internal_src_dir}/update/graphics/graphics-buffer-manager.cpp
+  ${internal_src_dir}/update/queue/update-message-queue.cpp
+  ${internal_src_dir}/update/manager/frame-callback-processor.cpp
+  ${internal_src_dir}/update/manager/render-instruction-processor.cpp
+  ${internal_src_dir}/update/manager/render-task-processor.cpp
+  ${internal_src_dir}/update/manager/scene-graph-frame-callback.cpp
+  ${internal_src_dir}/update/manager/transform-manager.cpp
+  ${internal_src_dir}/update/manager/update-algorithms.cpp
+  ${internal_src_dir}/update/manager/update-manager.cpp
+  ${internal_src_dir}/update/manager/update-manager-debug.cpp
+  ${internal_src_dir}/update/manager/update-proxy-impl.cpp
+  ${internal_src_dir}/update/nodes/node.cpp
+  ${internal_src_dir}/update/nodes/node-messages.cpp
+  ${internal_src_dir}/update/nodes/scene-graph-layer.cpp
+  ${internal_src_dir}/update/render-tasks/scene-graph-camera.cpp
+  ${internal_src_dir}/update/render-tasks/scene-graph-render-task.cpp
+  ${internal_src_dir}/update/render-tasks/scene-graph-render-task-list.cpp
+  ${internal_src_dir}/update/rendering/render-instruction-container.cpp
+  ${internal_src_dir}/update/rendering/render-instruction.cpp
+  ${internal_src_dir}/update/rendering/render-item.cpp
+  ${internal_src_dir}/update/rendering/scene-graph-frame-buffer.cpp
+  ${internal_src_dir}/update/rendering/scene-graph-geometry.cpp
+  ${internal_src_dir}/update/rendering/scene-graph-property-buffer.cpp
+  ${internal_src_dir}/update/rendering/scene-graph-texture.cpp
+  ${internal_src_dir}/update/rendering/scene-graph-shader.cpp
+  ${internal_src_dir}/update/rendering/scene-graph-texture-set.cpp
+  ${internal_src_dir}/update/rendering/scene-graph-renderer.cpp
+  ${internal_src_dir}/update/rendering/shader-cache.cpp
+)
+
+SET( SOURCES ${SOURCES}
+  ${internal_src_files}
+)
diff --git a/dali/internal/render/renderers/render-surface-frame-buffer.cpp b/dali/internal/render/renderers/render-surface-frame-buffer.cpp
new file mode 100644 (file)
index 0000000..7cc38bb
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// CLASS HEADER
+#include <dali/internal/render/renderers/render-surface-frame-buffer.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/render/renderers/render-texture.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Render
+{
+
+SurfaceFrameBuffer::SurfaceFrameBuffer( Integration::RenderSurface* surface )
+: FrameBuffer(),
+  mSurface( surface ),
+  mContext( nullptr )
+{
+}
+
+SurfaceFrameBuffer::~SurfaceFrameBuffer()
+{}
+
+void SurfaceFrameBuffer::Destroy( Context& context )
+{
+}
+
+void SurfaceFrameBuffer::GlContextDestroyed()
+{
+  if ( mContext )
+  {
+    mContext->GlContextDestroyed();
+  }
+}
+
+void SurfaceFrameBuffer::Initialize(Context& context)
+{
+  mContext = &context;
+  mContext->GlContextCreated();
+  mSurface->InitializeGraphics();
+}
+
+void SurfaceFrameBuffer::Bind( Context& context )
+{
+  mSurface->PreRender( false );
+  context.BindFramebuffer( GL_FRAMEBUFFER, 0u );
+}
+
+uint32_t SurfaceFrameBuffer::GetWidth() const
+{
+  return mSurface->GetPositionSize().width;
+}
+
+uint32_t SurfaceFrameBuffer::GetHeight() const
+{
+  return mSurface->GetPositionSize().height;
+}
+
+void SurfaceFrameBuffer::PostRender()
+{
+  mSurface->PostRender( false, false, false );
+}
+
+Context* SurfaceFrameBuffer::GetContext()
+{
+  return mContext;
+}
+
+Integration::DepthBufferAvailable SurfaceFrameBuffer::GetDepthBufferRequired()
+{
+  return mSurface->GetDepthBufferRequired();
+}
+
+Integration::StencilBufferAvailable SurfaceFrameBuffer::GetStencilBufferRequired()
+{
+  return mSurface->GetStencilBufferRequired();
+}
+
+Vector4 SurfaceFrameBuffer::GetBackgroundColor()
+{
+  return mSurface->GetBackgroundColor();
+}
+
+} //Render
+
+} //Internal
+
+} //Dali
diff --git a/dali/internal/render/renderers/render-surface-frame-buffer.h b/dali/internal/render/renderers/render-surface-frame-buffer.h
new file mode 100644 (file)
index 0000000..576ea65
--- /dev/null
@@ -0,0 +1,130 @@
+#ifndef DALI_INTERNAL_RENDER_SURFACE_FRAME_BUFFER_H
+#define DALI_INTERNAL_RENDER_SURFACE_FRAME_BUFFER_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/render/renderers/render-frame-buffer.h>
+#include <dali/integration-api/render-surface.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+class Context;
+
+namespace Render
+{
+
+class SurfaceFrameBuffer : public FrameBuffer
+{
+public:
+
+  /**
+   * Constructor
+   * @param[in] surface The render surface
+   */
+  SurfaceFrameBuffer( Integration::RenderSurface* surface );
+
+  /**
+   * Destructor
+   */
+  virtual ~SurfaceFrameBuffer();
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::Initialize()
+   */
+  void Initialize( Context& context ) override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::Destroy()
+   */
+  void Destroy( Context& context ) override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::GlContextDestroyed()
+   */
+  void GlContextDestroyed() override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::Bind()
+   */
+  void Bind( Context& context ) override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::GetWidth()
+   */
+  uint32_t GetWidth() const override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::GetHeight()
+   */
+  uint32_t GetHeight() const override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::IsSurfaceBacked()
+   */
+  bool IsSurfaceBacked() override { return true; };
+
+public:
+
+  /**
+   * Called after this frame buffer is rendered in the render manager
+   */
+  void PostRender();
+
+  /**
+   * Gets the context holding the GL state of rendering for the surface
+   * @return the context
+   */
+  Context* GetContext();
+
+  /**
+   * @brief Gets whether the depth buffer is required
+   * @return TRUE if the depth buffer is required
+   */
+  Integration::DepthBufferAvailable GetDepthBufferRequired();
+
+  /**
+   * @brief Gets whether the stencil buffer is required
+   * @return TRUE if the stencil buffer is required
+   */
+  Integration::StencilBufferAvailable GetStencilBufferRequired();
+
+  /**
+   * @brief Gets the background color of the surface.
+   * @return The background color
+   */
+  Vector4 GetBackgroundColor();
+
+private:
+
+  Integration::RenderSurface* mSurface;   ///< The render surface
+  Context*                    mContext;   ///< The context holding the GL state of rendering for the surface backed frame buffer
+};
+
+
+} // namespace Render
+
+} // namespace Internal
+
+} // namespace Dali
+
+
+#endif // DALI_INTERNAL_RENDER_SURFACE_FRAME_BUFFER_H
diff --git a/dali/internal/render/renderers/render-texture-frame-buffer.h b/dali/internal/render/renderers/render-texture-frame-buffer.h
new file mode 100644 (file)
index 0000000..021890f
--- /dev/null
@@ -0,0 +1,111 @@
+#ifndef DALI_INTERNAL_RENDER_TEXTURE_FRAME_BUFFER_H
+#define DALI_INTERNAL_RENDER_TEXTURE_FRAME_BUFFER_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/render/renderers/render-frame-buffer.h>
+
+namespace Dali
+{
+using Mask = Dali::FrameBuffer::Attachment::Mask;
+
+namespace Internal
+{
+namespace Render
+{
+class Texture;
+
+class TextureFrameBuffer : public FrameBuffer
+{
+public:
+
+  /**
+   * Constructor
+   * @param[in] width The width of the FrameBuffer
+   * @param[in] height The height of the FrameBuffer
+   * @param[in] attachments The attachments comprising the format of the FrameBuffer (bit-mask)
+   */
+  TextureFrameBuffer( uint32_t width, uint32_t height, Mask attachments );
+
+  /**
+   * Destructor
+   */
+  virtual ~TextureFrameBuffer();
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::Initialize()
+   */
+  void Initialize( Context& context ) override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::Destroy()
+   */
+  void Destroy( Context& context ) override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::GlContextDestroyed()
+   */
+  void GlContextDestroyed() override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::Bind()
+   */
+  void Bind( Context& context ) override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::GetWidth()
+   */
+  uint32_t GetWidth() const override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::GetHeight()
+   */
+  uint32_t GetHeight() const override;
+
+  /**
+   * @copydoc Dali::Internal::Renderer::FrameBuffer::IsSurfaceBacked()
+   */
+  bool IsSurfaceBacked() override { return false; };
+
+  /**
+   * @brief Attach a texture for color rendering. Valid only for Framebuffers with COLOR attachments.
+   * param[in] context The GL context
+   * @param[in] texture The texture that will be used as output when rendering
+   * @param[in] mipmapLevel The mipmap of the texture to be attached
+   * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
+   */
+  void AttachColorTexture( Context& context, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer );
+
+private:
+
+  GLuint mId;
+  GLuint mDepthBuffer;
+  GLuint mStencilBuffer;
+  uint32_t mWidth;
+  uint32_t mHeight;
+};
+
+
+} // namespace Render
+
+} // namespace Internal
+
+} // namespace Dali
+
+
+#endif // DALI_INTERNAL_RENDER_TEXTURE_FRAME_BUFFER_H
index f745112..fc00ca3 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_PROPERTY_ACCESSOR_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ public:
    * @param [in] property The property to access.
    */
   PropertyAccessor( SceneGraph::PropertyBase* property )
-  : mProperty( dynamic_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) )
+  : mProperty( static_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) ) // we know the type
   {
   }
 
@@ -60,7 +60,7 @@ public:
    */
   bool IsSet() const
   {
-    return mProperty != NULL;
+    return mProperty != nullptr;
   }
 
   /**
@@ -69,7 +69,7 @@ public:
    */
   void Reset()
   {
-    mProperty = NULL;
+    mProperty = nullptr;
   }
 
   /**
@@ -86,7 +86,7 @@ public:
    */
   const PropertyType& Get( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyAccessor::Get() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyAccessor::Get() mProperty was nullptr" );
     return mProperty->Get( bufferIndex );
   }
 
@@ -95,7 +95,7 @@ public:
    */
   void Set( BufferIndex bufferIndex, const PropertyType& value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyAccessor::Set() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyAccessor::Set() mProperty was nullptr" );
     mProperty->Set( bufferIndex, value );
   }
 
@@ -104,27 +104,25 @@ public:
    */
   void Bake( BufferIndex bufferIndex, const PropertyType& value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyAccessor::Bake() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyAccessor::Bake() mProperty was nullptr" );
     mProperty->Bake( bufferIndex, value );
   }
 
 private:
 
   // Undefined
-  PropertyAccessor(const PropertyAccessor& property);
-
-  // Undefined
-  PropertyAccessor& operator=(const PropertyAccessor& rhs);
+  PropertyAccessor() = delete;
+  PropertyAccessor(const PropertyAccessor& property) = delete;
+  PropertyAccessor& operator=(const PropertyAccessor& rhs) = delete;
 
 private:
 
   SceneGraph::AnimatableProperty<PropertyType>* mProperty; ///< The real property
-};
-
 
+};
 
 /**
- * A wrapper class for getting/setting a property.
+ * A wrapper class for getting/setting a transform manager property
  * Animators use this instead of accessing properties directly.
  */
 template <typename T>
@@ -137,7 +135,7 @@ public:
    * @param [in] property The property to access.
    */
   TransformManagerPropertyAccessor( SceneGraph::PropertyBase* property )
-  : mProperty( dynamic_cast< SceneGraph::TransformManagerPropertyHandler<T>* >(property) )
+  : mProperty( static_cast< SceneGraph::TransformManagerPropertyHandler<T>* >(property) ) // we know the type
   {
   }
 
@@ -154,7 +152,7 @@ public:
    */
   bool IsSet() const
   {
-    return mProperty != NULL;
+    return mProperty != nullptr;
   }
 
   /**
@@ -163,7 +161,7 @@ public:
    */
   void Reset()
   {
-    mProperty = NULL;
+    mProperty = nullptr;
   }
 
   /**
@@ -181,7 +179,7 @@ public:
    */
   const T& Get( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyAccessor::Get() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyAccessor::Get() mProperty was nullptr" );
     return mProperty->Get( bufferIndex );
   }
 
@@ -190,7 +188,7 @@ public:
    */
   void Set( BufferIndex bufferIndex, const T& value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyAccessor::Set() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyAccessor::Set() mProperty was nullptr" );
     mProperty->Set( bufferIndex, value );
   }
 
@@ -199,25 +197,28 @@ public:
    */
   void Bake( BufferIndex bufferIndex, const T& value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyAccessor::Bake() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyAccessor::Bake() mProperty was nullptr" );
     mProperty->Bake( bufferIndex, value );
   }
 
 private:
 
   // Undefined
-  TransformManagerPropertyAccessor(const TransformManagerPropertyAccessor& property);
-
-  // Undefined
-  TransformManagerPropertyAccessor& operator=(const TransformManagerPropertyAccessor& rhs);
+  TransformManagerPropertyAccessor() = delete;
+  TransformManagerPropertyAccessor(const TransformManagerPropertyAccessor& property) = delete;
+  TransformManagerPropertyAccessor& operator=(const TransformManagerPropertyAccessor& rhs) = delete;
 
 private:
 
   SceneGraph::TransformManagerPropertyHandler<T>* mProperty; ///< The real property
-};
 
+};
 
-template <typename T, unsigned int COMPONENT>
+/**
+ * A wrapper class for getting/setting a transform manager property component
+ * Animators use this instead of accessing properties directly.
+ */
+template <typename T, uint32_t COMPONENT>
 class TransformManagerPropertyComponentAccessor
 {
 public:
@@ -227,7 +228,7 @@ public:
    * @param [in] property The property to access.
    */
   TransformManagerPropertyComponentAccessor( SceneGraph::PropertyBase* property )
-  : mProperty( dynamic_cast< SceneGraph::TransformManagerPropertyHandler<T>* >(property) )
+  : mProperty( static_cast< SceneGraph::TransformManagerPropertyHandler<T>* >(property) ) // we know the type
   {
   }
 
@@ -244,7 +245,7 @@ public:
    */
   bool IsSet() const
   {
-    return mProperty != NULL;
+    return mProperty != nullptr;
   }
 
   /**
@@ -253,7 +254,7 @@ public:
    */
   void Reset()
   {
-    mProperty = NULL;
+    mProperty = nullptr;
   }
 
   /**
@@ -269,41 +270,41 @@ public:
    * @param [in] bufferIndex The current update buffer index.
    * @return The value of the component of the property
    */
-  const float& Get( BufferIndex bufferIndex ) const
+  float Get( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyAccessor::Get() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyAccessor::Get() mProperty was nullptr" );
     return mProperty->GetFloatComponent( COMPONENT );
   }
 
   /**
    * @copydoc AnimatableProperty<float>::Set()
    */
-  void Set( BufferIndex bufferIndex, const float& value ) const
+  void Set( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyAccessor::Set() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyAccessor::Set() mProperty was nullptr" );
     mProperty->SetFloatComponent( value, COMPONENT );
   }
 
   /**
    * @copydoc AnimatableProperty<float>::Bake()
    */
-  void Bake( BufferIndex bufferIndex, const float& value ) const
+  void Bake( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyAccessor::Bake() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyAccessor::Bake() mProperty was nullptr" );
     mProperty->BakeFloatComponent( value, COMPONENT );
   }
 
 private:
 
   // Undefined
-  TransformManagerPropertyComponentAccessor(const TransformManagerPropertyComponentAccessor& property);
-
-  // Undefined
-  TransformManagerPropertyComponentAccessor& operator=(const TransformManagerPropertyComponentAccessor& rhs);
+  TransformManagerPropertyComponentAccessor() = delete;
+  TransformManagerPropertyComponentAccessor(const TransformManagerPropertyComponentAccessor& property) = delete;
+  TransformManagerPropertyComponentAccessor& operator=(const TransformManagerPropertyComponentAccessor& rhs) = delete;
 
 private:
 
   SceneGraph::TransformManagerPropertyHandler<T>* mProperty; ///< The real property
+
 };
 
 } // namespace Internal
index e1e596b..44c2e1b 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_PROPERTY_COMPONENT_ACCESSOR_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ public:
    * @param [in] property The property which holds a float component.
    */
   PropertyComponentAccessorX( SceneGraph::PropertyBase* property )
-  : mProperty( dynamic_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) )
+  : mProperty( static_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) ) // we know the type
   {
   }
 
@@ -59,7 +59,7 @@ public:
    */
   bool IsSet() const
   {
-    return mProperty != NULL;
+    return mProperty != nullptr;
   }
 
   /**
@@ -68,7 +68,7 @@ public:
    */
   void Reset()
   {
-    mProperty = NULL;
+    mProperty = nullptr;
   }
 
   /**
@@ -83,9 +83,9 @@ public:
    * Read access to the property.
    * @param [in] bufferIndex The current update buffer index.
    */
-  const float& Get( BufferIndex bufferIndex ) const
+  float Get( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorX::Get() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorX::Get() mProperty was nullptr" );
     return mProperty->Get( bufferIndex ).x; // X Component only!
   }
 
@@ -94,7 +94,7 @@ public:
    */
   void Set( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorX::Set() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorX::Set() mProperty was nullptr" );
     mProperty->SetX( bufferIndex, value );
   }
 
@@ -103,21 +103,21 @@ public:
    */
   void Bake( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorX::Bake() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorX::Bake() mProperty was nullptr" );
     mProperty->BakeX( bufferIndex, value );
   }
 
 private:
 
   // Undefined
-  PropertyComponentAccessorX(const PropertyComponentAccessorX& property);
-
-  // Undefined
-  PropertyComponentAccessorX& operator=(const PropertyComponentAccessorX& rhs);
+  PropertyComponentAccessorX() = delete;
+  PropertyComponentAccessorX(const PropertyComponentAccessorX& property) = delete;
+  PropertyComponentAccessorX& operator=(const PropertyComponentAccessorX& rhs) = delete;
 
 private:
 
   SceneGraph::AnimatableProperty<PropertyType>* mProperty; ///< The real property
+
 };
 
 /**
@@ -134,7 +134,7 @@ public:
    * @param [in] property The property which holds a float component.
    */
   PropertyComponentAccessorY( SceneGraph::PropertyBase* property )
-  : mProperty( dynamic_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) )
+  : mProperty( static_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) ) // we know the type
   {
   }
 
@@ -151,7 +151,7 @@ public:
    */
   bool IsSet() const
   {
-    return mProperty != NULL;
+    return mProperty != nullptr;
   }
 
   /**
@@ -160,7 +160,7 @@ public:
    */
   void Reset()
   {
-    mProperty = NULL;
+    mProperty = nullptr;
   }
 
   /**
@@ -175,9 +175,9 @@ public:
    * Read access to the property.
    * @param [in] bufferIndex The current update buffer index.
    */
-  const float& Get( BufferIndex bufferIndex ) const
+  float Get( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorY::Get() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorY::Get() mProperty was nullptr" );
     return mProperty->Get( bufferIndex ).y; // Y Component only!
   }
 
@@ -186,7 +186,7 @@ public:
    */
   void Set( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorY::Set() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorY::Set() mProperty was nullptr" );
     mProperty->SetY( bufferIndex, value );
   }
 
@@ -195,17 +195,16 @@ public:
    */
   void Bake( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorY::Bake() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorY::Bake() mProperty was nullptr" );
     mProperty->BakeY( bufferIndex, value );
   }
 
 private:
 
   // Undefined
-  PropertyComponentAccessorY(const PropertyComponentAccessorY& property);
-
-  // Undefined
-  PropertyComponentAccessorY& operator=(const PropertyComponentAccessorY& rhs);
+  PropertyComponentAccessorY() = delete;
+  PropertyComponentAccessorY(const PropertyComponentAccessorY& property) = delete;
+  PropertyComponentAccessorY& operator=(const PropertyComponentAccessorY& rhs) = delete;
 
 private:
 
@@ -226,7 +225,7 @@ public:
    * @param [in] property The property which holds a float component.
    */
   PropertyComponentAccessorZ( SceneGraph::PropertyBase* property )
-  : mProperty( dynamic_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) )
+  : mProperty( static_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) ) // we know the type
   {
   }
 
@@ -243,7 +242,7 @@ public:
    */
   bool IsSet() const
   {
-    return mProperty != NULL;
+    return mProperty != nullptr;
   }
 
   /**
@@ -252,7 +251,7 @@ public:
    */
   void Reset()
   {
-    mProperty = NULL;
+    mProperty = nullptr;
   }
 
   /**
@@ -267,9 +266,9 @@ public:
    * Read access to the property.
    * @param [in] bufferIndex The current update buffer index.
    */
-  const float& Get( BufferIndex bufferIndex ) const
+  float Get( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorZ::Get() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorZ::Get() mProperty was nullptr" );
     return mProperty->Get( bufferIndex ).z; // Z Component only!
   }
 
@@ -278,7 +277,7 @@ public:
    */
   void Set( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorZ::Set() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorZ::Set() mProperty was nullptr" );
     mProperty->SetZ( bufferIndex, value );
   }
 
@@ -287,17 +286,16 @@ public:
    */
   void Bake( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorZ::Bake() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorZ::Bake() mProperty was nullptr" );
     mProperty->BakeZ( bufferIndex, value );
   }
 
 private:
 
   // Undefined
-  PropertyComponentAccessorZ(const PropertyComponentAccessorZ& property);
-
-  // Undefined
-  PropertyComponentAccessorZ& operator=(const PropertyComponentAccessorZ& rhs);
+  PropertyComponentAccessorZ() = delete;
+  PropertyComponentAccessorZ(const PropertyComponentAccessorZ& property) = delete;
+  PropertyComponentAccessorZ& operator=(const PropertyComponentAccessorZ& rhs) = delete;
 
 private:
 
@@ -318,7 +316,7 @@ public:
    * @param [in] property The property which holds a float component.
    */
   PropertyComponentAccessorW( SceneGraph::PropertyBase* property )
-  : mProperty( dynamic_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) )
+  : mProperty( static_cast< SceneGraph::AnimatableProperty<PropertyType>* >(property) ) // we know the type
   {
   }
 
@@ -335,7 +333,7 @@ public:
    */
   bool IsSet() const
   {
-    return mProperty != NULL;
+    return mProperty != nullptr;
   }
 
   /**
@@ -344,7 +342,7 @@ public:
    */
   void Reset()
   {
-    mProperty = NULL;
+    mProperty = nullptr;
   }
 
   /**
@@ -359,9 +357,9 @@ public:
    * Read access to the property.
    * @param [in] bufferIndex The current update buffer index.
    */
-  const float& Get( BufferIndex bufferIndex ) const
+  float Get( BufferIndex bufferIndex ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorW::Get() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorW::Get() mProperty was nullptr" );
     return mProperty->Get( bufferIndex ).w; // W Component only!
   }
 
@@ -370,7 +368,7 @@ public:
    */
   void Set( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorW::Set() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorW::Set() mProperty was nullptr" );
     mProperty->SetW( bufferIndex, value );
   }
 
@@ -379,21 +377,21 @@ public:
    */
   void Bake( BufferIndex bufferIndex, float value ) const
   {
-    DALI_ASSERT_DEBUG( NULL != mProperty && "PropertyComponentAccessorW::Bake() mProperty was NULL" );
+    DALI_ASSERT_DEBUG( nullptr != mProperty && "PropertyComponentAccessorW::Bake() mProperty was nullptr" );
     mProperty->BakeW( bufferIndex, value );
   }
 
 private:
 
   // Undefined
-  PropertyComponentAccessorW(const PropertyComponentAccessorW& property);
-
-  // Undefined
-  PropertyComponentAccessorW& operator=(const PropertyComponentAccessorW& rhs);
+  PropertyComponentAccessorW() = delete;
+  PropertyComponentAccessorW(const PropertyComponentAccessorW& property) = delete;
+  PropertyComponentAccessorW& operator=(const PropertyComponentAccessorW& rhs) = delete;
 
 private:
 
   SceneGraph::AnimatableProperty<PropertyType>* mProperty; ///< The real property
+
 };
 
 } // namespace Internal
index a457f68..b1d607d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -59,12 +59,12 @@ namespace Internal
 namespace SceneGraph
 {
 
-Animation* Animation::New( float durationSeconds, float speedFactor, const Vector2& playRange, int loopCount, EndAction endAction, EndAction disconnectAction )
+Animation* Animation::New( float durationSeconds, float speedFactor, const Vector2& playRange, int32_t loopCount, EndAction endAction, EndAction disconnectAction )
 {
   return new ( gAnimationMemoryPool.AllocateRawThreadSafe() ) Animation( durationSeconds, speedFactor, playRange, loopCount, endAction, disconnectAction );
 }
 
-Animation::Animation( float durationSeconds, float speedFactor, const Vector2& playRange, int loopCount, Dali::Animation::EndAction endAction, Dali::Animation::EndAction disconnectAction )
+Animation::Animation( float durationSeconds, float speedFactor, const Vector2& playRange, int32_t loopCount, Dali::Animation::EndAction endAction, Dali::Animation::EndAction disconnectAction )
 : mPlayRange( playRange ),
   mDurationSeconds( durationSeconds ),
   mDelaySeconds( 0.0f ),
@@ -105,7 +105,7 @@ void Animation::SetProgressNotification( float progress )
   }
 }
 
-void Animation::SetLoopCount(int loopCount)
+void Animation::SetLoopCount(int32_t loopCount)
 {
   mLoopCount = loopCount;
   mCurrentLoop = 0;
@@ -122,9 +122,9 @@ void Animation::SetDisconnectAction(Dali::Animation::EndAction action)
   {
     mDisconnectAction = action;
 
-    for ( AnimatorIter iter = mAnimators.Begin(), endIter = mAnimators.End(); iter != endIter; ++iter )
+    for ( auto&& item : mAnimators )
     {
-      (*iter)->SetDisconnectAction( action );
+      item->SetDisconnectAction( action );
     }
   }
 }
@@ -224,9 +224,9 @@ void Animation::Bake(BufferIndex bufferIndex, EndAction action)
 
 void Animation::SetAnimatorsActive( bool active )
 {
-  for ( AnimatorIter iter = mAnimators.Begin(), endIter = mAnimators.End(); iter != endIter; ++iter )
+  for ( auto&& item : mAnimators )
   {
-    (*iter)->SetActive( active );
+    item->SetActive( active );
   }
 }
 
@@ -283,13 +283,12 @@ void Animation::SetLoopingMode( bool loopingMode )
 {
   mAutoReverseEnabled = loopingMode;
 
-  for ( AnimatorIter iter = mAnimators.Begin(), endIter = mAnimators.End(); iter != endIter; ++iter )
+  for ( auto&& item : mAnimators )
   {
     // Send some variables together to figure out the Animation status
-    (*iter)->SetSpeedFactor( mSpeedFactor );
-    (*iter)->SetLoopCount( mLoopCount );
-
-    (*iter)->SetLoopingMode( loopingMode );
+    item->SetSpeedFactor( mSpeedFactor );
+    item->SetLoopCount( mLoopCount );
+    item->SetLoopingMode( loopingMode );
   }
 }
 
@@ -301,7 +300,7 @@ void Animation::AddAnimator( OwnerPointer<AnimatorBase>& animator )
   mAnimators.PushBack( animator.Release() );
 }
 
-void Animation::Update(BufferIndex bufferIndex, float elapsedSeconds, bool& looped, bool& finished, bool& progressReached )
+void Animation::Update( BufferIndex bufferIndex, float elapsedSeconds, bool& looped, bool& finished, bool& progressReached )
 {
   looped = false;
   finished = false;
@@ -316,7 +315,7 @@ void Animation::Update(BufferIndex bufferIndex, float elapsedSeconds, bool& loop
   if (mState == Playing)
   {
     // Sign value of speed factor. It can optimize many arithmetic comparision
-    int signSpeedFactor = ( mSpeedFactor < 0.0f ) ? -1 : 1;
+    float signSpeedFactor = ( mSpeedFactor < 0.0f ) ? -1.f : 1.f;
 
     // If there is delay time before Animation starts, wait the Animation until mDelaySeconds.
     if( mDelaySeconds > 0.0f )
@@ -430,7 +429,7 @@ void Animation::UpdateAnimators( BufferIndex bufferIndex, bool bake, bool animat
 
   //Loop through all animators
   bool applied(true);
-  for ( AnimatorIter iter = mAnimators.Begin(); iter != mAnimators.End(); )
+  for ( auto&& iter = mAnimators.Begin(); iter != mAnimators.End(); )
   {
     AnimatorBase *animator = *iter;
 
index a30a347..5b0b794 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_ANIMATION_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,13 +35,6 @@ namespace Internal
 namespace SceneGraph
 {
 
-class Animation;
-
-typedef OwnerContainer< Animation* > AnimationContainer;
-
-typedef AnimationContainer::Iterator AnimationIter;
-typedef AnimationContainer::ConstIterator AnimationConstIter;
-
 /**
  * Animations are used to change the properties of scene graph objects, as part of a scene
  * managers "update" phase. An animation is a container of Animator objects; the actual setting
@@ -51,7 +44,7 @@ class Animation
 {
 public:
 
-  typedef Dali::Animation::EndAction EndAction;
+  using EndAction = Dali::Animation::EndAction;
 
   enum State
   {
@@ -71,7 +64,7 @@ public:
    * @param[in] disconnectAction The action to perform when the property owner of an animator is disconnected.
    * @return A new Animation
    */
-  static Animation* New( float durationSeconds, float speedFactor, const Vector2& playRange, int loopCount, EndAction endAction, EndAction disconnectAction );
+  static Animation* New( float durationSeconds, float speedFactor, const Vector2& playRange, int32_t loopCount, EndAction endAction, EndAction disconnectAction );
 
   /**
    * Virtual destructor
@@ -143,7 +136,7 @@ public:
    * 0 is loop forever, N loop play N times
    * @param[in] loopCount The loop count
    */
-  void SetLoopCount(int loopCount);
+  void SetLoopCount(int32_t loopCount);
 
   /**
    * Query whether the animation will loop.
@@ -158,7 +151,7 @@ public:
    * Get the loop count
    * @return the loop count
    */
-  int GetLoopCount() const
+  int32_t GetLoopCount() const
   {
     return mLoopCount;
   }
@@ -252,7 +245,7 @@ public:
    * Retrive a count of the number of times the animation has been played to completion.
    * This can be used to emit "Finised" signals from the public-api
    */
-  int GetPlayedCount() const
+  int32_t GetPlayedCount() const
   {
     return mPlayedCount;
   }
@@ -260,7 +253,7 @@ public:
   /**
    * Get the current loop count from zero to GetLoopCount().
    */
-  int GetCurrentLoop() const
+  int32_t GetCurrentLoop() const
   {
     return mCurrentLoop;
   }
@@ -283,15 +276,6 @@ public:
   void AddAnimator( OwnerPointer<AnimatorBase>& animator );
 
   /**
-   * Retrieve the animators from an animation.
-   * @return The container of animators.
-   */
-  AnimatorContainer& GetAnimators()
-  {
-    return mAnimators;
-  }
-
-  /**
    * This causes the animators to change the properties of objects in the scene graph.
    * @pre The animation is playing or paused.
    * @param[in] bufferIndex The buffer to update.
@@ -308,7 +292,7 @@ protected:
   /**
    * Protected constructor. See New()
    */
-  Animation( float durationSeconds, float speedFactor, const Vector2& playRange, int loopCount, EndAction endAction, EndAction disconnectAction );
+  Animation( float durationSeconds, float speedFactor, const Vector2& playRange, int32_t loopCount, EndAction endAction, EndAction disconnectAction );
 
 
 private:
@@ -343,7 +327,7 @@ private:
 
 protected:
 
-  AnimatorContainer mAnimators;
+  OwnerContainer< AnimatorBase* > mAnimators;
 
   Vector2 mPlayRange;
 
@@ -353,10 +337,10 @@ protected:
   float mSpeedFactor;
   float mProgressMarker;         // Progress marker to trigger a notification
 
-  int mPlayedCount;              // Incremented at end of animation or completion of all loops
+  int32_t mPlayedCount;              // Incremented at end of animation or completion of all loops
                                  // Never incremented when looping forever. Event thread tracks to signal end.
-  int mLoopCount;                // N loop setting
-  int mCurrentLoop;              // Current loop number
+  int32_t mLoopCount;                // N loop setting
+  int32_t mCurrentLoop;              // Current loop number
 
   EndAction mEndAction;
   EndAction mDisconnectAction;
@@ -379,10 +363,10 @@ namespace SceneGraph
 
 inline void SetDurationMessage( EventThreadServices& eventThreadServices, const Animation& animation, float durationSeconds )
 {
-  typedef MessageValue1< Animation, float > LocalType;
+  using LocalType = MessageValue1< Animation, float >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::SetDuration, durationSeconds );
@@ -390,22 +374,22 @@ inline void SetDurationMessage( EventThreadServices& eventThreadServices, const
 
 inline void SetProgressNotificationMessage( EventThreadServices& eventThreadServices, const Animation& animation, float progress )
 {
-  typedef MessageValue1< Animation, float > LocalType;
+  using LocalType = MessageValue1< Animation, float >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::SetProgressNotification, progress );
 }
 
 
-inline void SetLoopingMessage( EventThreadServices& eventThreadServices, const Animation& animation, int loopCount )
+inline void SetLoopingMessage( EventThreadServices& eventThreadServices, const Animation& animation, int32_t loopCount )
 {
-  typedef MessageValue1< Animation, int > LocalType;
+  using LocalType = MessageValue1< Animation, int32_t >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::SetLoopCount, loopCount );
@@ -413,10 +397,10 @@ inline void SetLoopingMessage( EventThreadServices& eventThreadServices, const A
 
 inline void SetEndActionMessage( EventThreadServices& eventThreadServices, const Animation& animation, Dali::Animation::EndAction action )
 {
-  typedef MessageValue1< Animation, Dali::Animation::EndAction > LocalType;
+  using LocalType = MessageValue1< Animation, Dali::Animation::EndAction >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::SetEndAction, action );
@@ -424,10 +408,10 @@ inline void SetEndActionMessage( EventThreadServices& eventThreadServices, const
 
 inline void SetDisconnectActionMessage( EventThreadServices& eventThreadServices, const Animation& animation, Dali::Animation::EndAction action )
 {
-  typedef MessageValue1< Animation, Dali::Animation::EndAction > LocalType;
+  using LocalType = MessageValue1< Animation, Dali::Animation::EndAction >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::SetDisconnectAction, action );
@@ -435,10 +419,10 @@ inline void SetDisconnectActionMessage( EventThreadServices& eventThreadServices
 
 inline void SetCurrentProgressMessage( EventThreadServices& eventThreadServices, const Animation& animation, float progress )
 {
-  typedef MessageValue1< Animation, float > LocalType;
+  using LocalType = MessageValue1< Animation, float >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::SetCurrentProgress, progress );
@@ -446,10 +430,10 @@ inline void SetCurrentProgressMessage( EventThreadServices& eventThreadServices,
 
 inline void SetSpeedFactorMessage( EventThreadServices& eventThreadServices, const Animation& animation, float factor )
 {
-  typedef MessageValue1< Animation, float > LocalType;
+  using LocalType = MessageValue1< Animation, float >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::SetSpeedFactor, factor );
@@ -457,10 +441,10 @@ inline void SetSpeedFactorMessage( EventThreadServices& eventThreadServices, con
 
 inline void SetPlayRangeMessage( EventThreadServices& eventThreadServices, const Animation& animation, const Vector2& range )
 {
-  typedef MessageValue1< Animation, Vector2 > LocalType;
+  using LocalType = MessageValue1< Animation, Vector2 >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::SetPlayRange, range );
@@ -468,10 +452,10 @@ inline void SetPlayRangeMessage( EventThreadServices& eventThreadServices, const
 
 inline void PlayAnimationMessage( EventThreadServices& eventThreadServices, const Animation& animation )
 {
-  typedef Message< Animation > LocalType;
+  using LocalType = Message< Animation >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::Play );
@@ -479,10 +463,10 @@ inline void PlayAnimationMessage( EventThreadServices& eventThreadServices, cons
 
 inline void PlayAnimationFromMessage( EventThreadServices& eventThreadServices, const Animation& animation, float progress )
 {
-  typedef MessageValue1< Animation,float > LocalType;
+  using LocalType = MessageValue1< Animation, float >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::PlayFrom, progress );
@@ -490,10 +474,10 @@ inline void PlayAnimationFromMessage( EventThreadServices& eventThreadServices,
 
 inline void PauseAnimationMessage( EventThreadServices& eventThreadServices, const Animation& animation )
 {
-  typedef Message< Animation > LocalType;
+  using LocalType = Message< Animation >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::Pause );
@@ -501,10 +485,10 @@ inline void PauseAnimationMessage( EventThreadServices& eventThreadServices, con
 
 inline void AddAnimatorMessage( EventThreadServices& eventThreadServices, const Animation& animation, AnimatorBase& animator )
 {
-  typedef MessageValue1< Animation, OwnerPointer<AnimatorBase> > LocalType;
+  using LocalType = MessageValue1< Animation, OwnerPointer<AnimatorBase> >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   OwnerPointer<AnimatorBase> parameter( &animator );
@@ -513,10 +497,10 @@ inline void AddAnimatorMessage( EventThreadServices& eventThreadServices, const
 
 inline void PlayAfterMessage( EventThreadServices& eventThreadServices, const Animation& animation, float delaySeconds )
 {
-  typedef MessageValue1< Animation, float > LocalType;
+  using LocalType = MessageValue1< Animation, float >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::PlayAfter, delaySeconds );
@@ -524,10 +508,10 @@ inline void PlayAfterMessage( EventThreadServices& eventThreadServices, const An
 
 inline void SetLoopingModeMessage( EventThreadServices& eventThreadServices, const Animation& animation, bool loopingMode )
 {
-  typedef MessageValue1< Animation, bool > LocalType;
+  using LocalType = MessageValue1< Animation, bool >;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &animation, &Animation::SetLoopingMode, loopingMode );
index b8da716..11b851a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_ANIMATOR_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // INTERNAL INCLUDES
-#include <dali/devel-api/common/owner-container.h>
-#include <dali/internal/event/animation/key-frames-impl.h>
-#include <dali/internal/event/animation/path-impl.h>
-#include <dali/internal/update/nodes/node.h>
-#include <dali/internal/update/common/property-base.h>
 #include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/math/quaternion.h>
 #include <dali/public-api/math/radian.h>
+#include <dali/devel-api/common/owner-container.h>
+#include <dali/internal/event/animation/key-frames-impl.h>
+#include <dali/internal/event/animation/path-impl.h>
+#include <dali/internal/update/nodes/node.h>
+#include <dali/internal/update/common/property-base.h>
 #include <dali/internal/update/animation/property-accessor.h>
 #include <dali/integration-api/debug.h>
 
@@ -40,29 +40,74 @@ namespace Dali
 namespace Internal
 {
 
-typedef Dali::Animation::Interpolation Interpolation;
+using Interpolation = Dali::Animation::Interpolation;
 
-struct AnimatorFunctionBase;
-
-namespace SceneGraph
+/**
+ * AnimatorFunction base class.
+ * Needs to be declared first so AnimatorBase knows about it's destructor
+ * All update functions must inherit from AnimatorFunctionBase and overload the appropiate "()" operator
+ */
+struct AnimatorFunctionBase
 {
+  /**
+   * Constructor
+   */
+  AnimatorFunctionBase() {}
 
-class AnimatorBase;
+  /*
+   * Virtual destructor (Intended as base class)
+   */
+  virtual ~AnimatorFunctionBase() {}
 
-typedef OwnerContainer< AnimatorBase* > AnimatorContainer;
+  ///Stub "()" operators.
+  virtual bool operator()(float progress, const bool& property)
+  {
+    return property;
+  }
 
-typedef AnimatorContainer::Iterator AnimatorIter;
-typedef AnimatorContainer::ConstIterator AnimatorConstIter;
+  virtual float operator()(float progress, const int32_t& property)
+  {
+    return static_cast<float>( property );
+  }
+
+  virtual float operator()(float progress, const float& property)
+  {
+    return property;
+  }
+
+  virtual Vector2 operator()(float progress, const Vector2& property)
+  {
+    return property;
+  }
+
+  virtual Vector3 operator()(float progress, const Vector3& property)
+  {
+    return property;
+  }
+
+  virtual Vector4 operator()(float progress, const Vector4& property)
+  {
+    return property;
+  }
+
+  virtual Quaternion operator()(float progress, const Quaternion& property)
+  {
+    return property;
+  }
+};
+
+namespace SceneGraph
+{
 
 /**
  * An abstract base class for Animators, which can be added to scene graph animations.
  * Each animator changes a single property of an object in the scene graph.
  */
-class AnimatorBase
+class AnimatorBase : public PropertyOwner::Observer
 {
 public:
 
-  typedef float (*AlphaFunc)(float progress); ///< Definition of an alpha function
+  using AlphaFunc = float (*)(float progress); ///< Definition of an alpha function
 
   /**
    * Observer to determine when the animator is no longer present
@@ -86,17 +131,23 @@ public:
   /**
    * Constructor.
    */
-  AnimatorBase()
-  : mLifecycleObserver(nullptr),
-    mDurationSeconds(1.0f),
-    mIntervalDelaySeconds(0.0f),
-    mSpeedFactor(1.0f),
-    mLoopCount(1),
-    mAlphaFunction(AlphaFunction::DEFAULT),
-    mDisconnectAction(Dali::Animation::BakeFinal),
-    mActive(false),
-    mEnabled(true),
-    mConnectedToSceneGraph(false),
+  AnimatorBase( PropertyOwner* propertyOwner,
+                AnimatorFunctionBase* animatorFunction,
+                AlphaFunction alphaFunction,
+                const TimePeriod& timePeriod )
+  : mLifecycleObserver( nullptr ),
+    mPropertyOwner( propertyOwner ),
+    mAnimatorFunction( animatorFunction ),
+    mDurationSeconds( timePeriod.durationSeconds ),
+    mIntervalDelaySeconds( timePeriod.delaySeconds ),
+    mSpeedFactor( 1.0f ),
+    mCurrentProgress( 0.f ),
+    mLoopCount( 1 ),
+    mAlphaFunction( alphaFunction ),
+    mDisconnectAction( Dali::Animation::BakeFinal ),
+    mAnimationPlaying( false ),
+    mEnabled( true ),
+    mConnectedToSceneGraph( false ),
     mAutoReverseEnabled( false )
   {
   }
@@ -106,6 +157,11 @@ public:
    */
   virtual ~AnimatorBase()
   {
+    delete mAnimatorFunction;
+    if (mPropertyOwner && mConnectedToSceneGraph)
+    {
+      mPropertyOwner->RemoveObserver(*this);
+    }
     if( mLifecycleObserver != nullptr )
     {
       mLifecycleObserver->ObjectDestroyed();
@@ -122,10 +178,48 @@ public:
     mLifecycleObserver = nullptr;
   }
 
+private: // From PropertyOwner::Observer
+
+  /**
+   * @copydoc PropertyOwner::Observer::PropertyOwnerConnected( PropertyOwner& owner )
+   */
+  void PropertyOwnerConnected( PropertyOwner& owner ) override final
+  {
+    mEnabled = true;
+  }
+
+  /**
+   * @copydoc PropertyOwner::Observer::PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner )
+   */
+  void PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner ) override final
+  {
+    // If we are active, then bake the value if required
+    if ( mAnimationPlaying && mDisconnectAction != Dali::Animation::Discard )
+    {
+      // Bake to target-value if BakeFinal, otherwise bake current value
+      Update( bufferIndex, ( mDisconnectAction == Dali::Animation::Bake ? mCurrentProgress : 1.0f ), true );
+    }
+
+    mEnabled = false;
+  }
+
+  /**
+   * @copydoc PropertyOwner::Observer::PropertyOwnerDestroyed( PropertyOwner& owner )
+   */
+  void PropertyOwnerDestroyed( PropertyOwner& owner ) override final
+  {
+    mPropertyOwner = nullptr;
+  }
+
+public:
   /**
    * Called when Animator is added to the scene-graph in update-thread.
    */
-  virtual void ConnectToSceneGraph() = 0;
+  void ConnectToSceneGraph()
+  {
+    mConnectedToSceneGraph = true;
+    mPropertyOwner->AddObserver(*this);
+  }
 
   /**
    * Set the duration of the animator.
@@ -153,7 +247,7 @@ public:
     mSpeedFactor = factor;
   }
 
-  void SetLoopCount(int loopCount)
+  void SetLoopCount(int32_t loopCount)
   {
     mLoopCount = loopCount;
   }
@@ -329,7 +423,7 @@ public:
         float upperBound(1.0f);
         float currentT(0.5f);
         float currentX = EvaluateCubicBezier( controlPoints.x, controlPoints.z, currentT);
-        while( fabs( progress - currentX ) > tolerance )
+        while( fabsf( progress - currentX ) > tolerance )
         {
           if( progress > currentX )
           {
@@ -376,20 +470,11 @@ public:
    */
   void SetActive( bool active )
   {
-    mActive = active;
+    mAnimationPlaying = active;
   }
 
   /**
-   * Retrieve whether the animator has been set to active or not.
-   * @return The active state.
-   */
-  bool GetActive() const
-  {
-    return mActive;
-  }
-
-  /**
-   * Retrive wheter the animator's target object is valid and on the stage.
+   * Whether the animator's target object is valid and on the stage.
    * @return The enabled state.
    */
   bool IsEnabled() const
@@ -412,7 +497,10 @@ public:
    * @return True if animator is orphan, false otherwise   *
    * @note The SceneGraph::Animation will delete any orphan animator in its Update method.
    */
-  virtual bool Orphan() = 0;
+  bool Orphan()
+  {
+    return (mPropertyOwner == nullptr);
+  }
 
   /**
    * Update the scene object attached to the animator.
@@ -420,7 +508,29 @@ public:
    * @param[in] progress A value from 0 to 1, where 0 is the start of the animation, and 1 is the end point.
    * @param[in] bake Bake.
    */
-  virtual void Update(BufferIndex bufferIndex, float progress, bool bake) = 0;
+  void Update( BufferIndex bufferIndex, float progress, bool bake )
+  {
+    if( mLoopCount >= 0 )
+    {
+      // Update the progress value
+      progress = SetProgress( progress );
+    }
+
+    float alpha = ApplyAlphaFunction( progress );
+
+    // PropertyType specific part
+    DoUpdate( bufferIndex, bake, alpha );
+
+    mCurrentProgress = progress;
+  }
+
+  /**
+   * Type specific part of the animator
+   * @param bufferIndex index to use
+   * @param bake whether to bake or not
+   * @param alpha value from alpha based on progress
+   */
+  virtual void DoUpdate( BufferIndex bufferIndex, bool bake, float alpha ) = 0;
 
 protected:
 
@@ -438,16 +548,19 @@ protected:
   }
 
   LifecycleObserver* mLifecycleObserver;
+  PropertyOwner* mPropertyOwner;
+  AnimatorFunctionBase* mAnimatorFunction;
   float mDurationSeconds;
   float mIntervalDelaySeconds;
   float mSpeedFactor;
+  float mCurrentProgress;
 
-  int mLoopCount;
+  int32_t mLoopCount;
 
   AlphaFunction mAlphaFunction;
 
   Dali::Animation::EndAction mDisconnectAction;     ///< EndAction to apply when target object gets disconnected from the stage.
-  bool mActive:1;                                   ///< Animator is "active" while it's running.
+  bool mAnimationPlaying:1;                         ///< whether disconnect has been applied while it's running.
   bool mEnabled:1;                                  ///< Animator is "enabled" while its target object is valid and on the stage.
   bool mConnectedToSceneGraph:1;                    ///< True if ConnectToSceneGraph() has been called in update-thread.
   bool mAutoReverseEnabled:1;
@@ -457,7 +570,7 @@ protected:
  * An animator for a specific property type PropertyType.
  */
 template < typename PropertyType, typename PropertyAccessorType >
-class Animator : public AnimatorBase, public PropertyOwner::Observer
+class Animator : public AnimatorBase
 {
 public:
 
@@ -475,18 +588,12 @@ public:
                             AlphaFunction alphaFunction,
                             const TimePeriod& timePeriod )
   {
-    typedef Animator< PropertyType, PropertyAccessorType > AnimatorType;
-
     // The property was const in the actor-thread, but animators are used in the scene-graph thread.
-    AnimatorType* animator = new AnimatorType( const_cast<PropertyOwner*>( &propertyOwner ),
-                                               const_cast<PropertyBase*>( &property ),
-                                               animatorFunction );
-
-    animator->SetAlphaFunction( alphaFunction );
-    animator->SetIntervalDelay( timePeriod.delaySeconds );
-    animator->SetDuration( timePeriod.durationSeconds );
-
-    return animator;
+    return new Animator( const_cast<PropertyOwner*>( &propertyOwner ),
+                                  const_cast<PropertyBase*>( &property ),
+                                  animatorFunction,
+                                  alphaFunction,
+                                  timePeriod );
   }
 
   /**
@@ -494,71 +601,18 @@ public:
    */
   virtual ~Animator()
   {
-    if (mPropertyOwner && mConnectedToSceneGraph)
-    {
-      mPropertyOwner->RemoveObserver(*this);
-    }
-
-    delete mAnimatorFunction;
   }
 
   /**
-   * Called when Animator is added to the scene-graph in update-thread.
+   * @copydoc AnimatorBase::DoUpdate( BufferIndex bufferIndex, bool bake, float alpha )
    */
-  virtual void ConnectToSceneGraph()
+  virtual void DoUpdate( BufferIndex bufferIndex, bool bake, float alpha ) override final
   {
-    mConnectedToSceneGraph = true;
-    mPropertyOwner->AddObserver(*this);
-  }
-
-  /**
-   * Called when mPropertyOwner is connected to the scene graph.
-   */
-  virtual void PropertyOwnerConnected( PropertyOwner& owner )
-  {
-    mEnabled = true;
-  }
-
-  /**
-   * Called when mPropertyOwner is disconnected from the scene graph.
-   */
-  virtual void PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner )
-  {
-    // If we are active, then bake the value if required
-    if ( mActive && mDisconnectAction != Dali::Animation::Discard )
-    {
-      // Bake to target-value if BakeFinal, otherwise bake current value
-      Update( bufferIndex, ( mDisconnectAction == Dali::Animation::Bake ? mCurrentProgress : 1.0f ), true );
-    }
-
-    mActive = false;
-    mEnabled = false;
-  }
-
-  /**
-   * Called shortly before mPropertyOwner is destroyed
-   */
-  virtual void PropertyOwnerDestroyed( PropertyOwner& owner )
-  {
-    mPropertyOwner = NULL;
-  }
-
-  /**
-   * From AnimatorBase.
-   */
-  virtual void Update( BufferIndex bufferIndex, float progress, bool bake )
-  {
-    if( mLoopCount >= 0 )
-    {
-      // Update the progress value
-      progress = SetProgress( progress );
-    }
-
-    float alpha = ApplyAlphaFunction( progress );
-
     const PropertyType& current = mPropertyAccessor.Get( bufferIndex );
 
-    const PropertyType result = (*mAnimatorFunction)( alpha, current );
+    // need to cast the return value in case property is integer
+    const PropertyType result = static_cast<PropertyType>( (*mAnimatorFunction)( alpha, current ) );
+
     if ( bake )
     {
       mPropertyAccessor.Bake( bufferIndex, result );
@@ -567,16 +621,6 @@ public:
     {
       mPropertyAccessor.Set( bufferIndex, result );
     }
-
-    mCurrentProgress = progress;
-  }
-
-  /**
-   * From AnimatorBase.
-   */
-  virtual bool Orphan()
-  {
-    return (mPropertyOwner == NULL);
   }
 
 private:
@@ -586,11 +630,11 @@ private:
    */
   Animator( PropertyOwner* propertyOwner,
             PropertyBase* property,
-            AnimatorFunctionBase* animatorFunction )
-  : mPropertyOwner( propertyOwner ),
-    mPropertyAccessor( property ),
-    mAnimatorFunction( animatorFunction ),
-    mCurrentProgress( 0.0f )
+            AnimatorFunctionBase* animatorFunction,
+            AlphaFunction alphaFunction,
+            const TimePeriod& timePeriod )
+  : AnimatorBase( propertyOwner, animatorFunction, alphaFunction, timePeriod ),
+    mPropertyAccessor( property )
   {
     // WARNING - this object is created in the event-thread
     // The scene-graph mPropertyOwner object cannot be observed here
@@ -604,11 +648,8 @@ private:
 
 protected:
 
-  PropertyOwner* mPropertyOwner;
   PropertyAccessorType mPropertyAccessor;
 
-  AnimatorFunctionBase* mAnimatorFunction;
-  float mCurrentProgress;
 };
 
 
@@ -616,8 +657,8 @@ protected:
 /**
  * An animator for a specific property type PropertyType.
  */
-template <typename T, typename PropertyAccessorType>
-class AnimatorTransformProperty : public AnimatorBase, public PropertyOwner::Observer
+template <typename PropertyType, typename PropertyAccessorType>
+class AnimatorTransformProperty : public AnimatorBase
 {
 public:
 
@@ -637,15 +678,11 @@ public:
   {
 
     // The property was const in the actor-thread, but animators are used in the scene-graph thread.
-    AnimatorTransformProperty* animator = new AnimatorTransformProperty( const_cast<PropertyOwner*>( &propertyOwner ),
-                                               const_cast<PropertyBase*>( &property ),
-                                               animatorFunction );
-
-    animator->SetAlphaFunction( alphaFunction );
-    animator->SetIntervalDelay( timePeriod.delaySeconds );
-    animator->SetDuration( timePeriod.durationSeconds );
-
-    return animator;
+    return new AnimatorTransformProperty( const_cast<PropertyOwner*>( &propertyOwner ),
+                                                                         const_cast<PropertyBase*>( &property ),
+                                                                         animatorFunction,
+                                                                         alphaFunction,
+                                                                         timePeriod );
   }
 
   /**
@@ -653,72 +690,17 @@ public:
    */
   virtual ~AnimatorTransformProperty()
   {
-    if (mPropertyOwner && mConnectedToSceneGraph)
-    {
-      mPropertyOwner->RemoveObserver(*this);
-    }
-
-    delete mAnimatorFunction;
-  }
-
-  /**
-   * Called when Animator is added to the scene-graph in update-thread.
-   */
-  virtual void ConnectToSceneGraph()
-  {
-    mConnectedToSceneGraph = true;
-    mPropertyOwner->AddObserver(*this);
   }
 
   /**
-   * Called when mPropertyOwner is connected to the scene graph.
+   * @copydoc AnimatorBase::DoUpdate( BufferIndex bufferIndex, bool bake, float alpha )
    */
-  virtual void PropertyOwnerConnected( PropertyOwner& owner )
+  virtual void DoUpdate( BufferIndex bufferIndex, bool bake, float alpha ) override final
   {
-    mEnabled = true;
-  }
-
-  /**
-   * Called when mPropertyOwner is disconnected from the scene graph.
-   */
-  virtual void PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner )
-  {
-    // If we are active, then bake the value if required
-    if ( mActive && mDisconnectAction != Dali::Animation::Discard )
-    {
-      // Bake to target-value if BakeFinal, otherwise bake current value
-      Update( bufferIndex, ( mDisconnectAction == Dali::Animation::Bake ? mCurrentProgress : 1.0f ), true );
-    }
-
-    mActive = false;
-    mEnabled = false;
-  }
-
-  /**
-   * Called shortly before mPropertyOwner is destroyed
-   */
-  virtual void PropertyOwnerDestroyed( PropertyOwner& owner )
-  {
-    mPropertyOwner = NULL;
-  }
-
-  /**
-   * From AnimatorBase.
-   */
-  virtual void Update( BufferIndex bufferIndex, float progress, bool bake )
-  {
-    if( mLoopCount >= 0 )
-    {
-      // Update the progress value
-      progress = SetProgress( progress );
-    }
-
-    float alpha = ApplyAlphaFunction( progress );
-
-    const T& current = mPropertyAccessor.Get( bufferIndex );
-
-    const T result = (*mAnimatorFunction)( alpha, current );
+    const PropertyType& current = mPropertyAccessor.Get( bufferIndex );
 
+    // need to cast the return value in case property is integer
+    const PropertyType result = static_cast<PropertyType>( (*mAnimatorFunction)( alpha, current ) );
 
     if ( bake )
     {
@@ -728,16 +710,6 @@ public:
     {
       mPropertyAccessor.Set( bufferIndex, result );
     }
-
-    mCurrentProgress = progress;
-  }
-
-  /**
-   * From AnimatorBase.
-   */
-  virtual bool Orphan()
-  {
-    return (mPropertyOwner == NULL);
   }
 
 private:
@@ -747,91 +719,29 @@ private:
    */
   AnimatorTransformProperty( PropertyOwner* propertyOwner,
             PropertyBase* property,
-            AnimatorFunctionBase* animatorFunction )
-  : mPropertyOwner( propertyOwner ),
-    mPropertyAccessor( property ),
-    mAnimatorFunction( animatorFunction ),
-    mCurrentProgress( 0.0f )
+            AnimatorFunctionBase* animatorFunction,
+            AlphaFunction alphaFunction,
+            const TimePeriod& timePeriod )
+  : AnimatorBase( propertyOwner, animatorFunction, alphaFunction, timePeriod ),
+    mPropertyAccessor( property )
   {
     // WARNING - this object is created in the event-thread
     // The scene-graph mPropertyOwner object cannot be observed here
   }
 
   // Undefined
-  AnimatorTransformProperty( const AnimatorTransformProperty& );
-
-  // Undefined
-  AnimatorTransformProperty& operator=( const AnimatorTransformProperty& );
+  AnimatorTransformProperty() = delete;
+  AnimatorTransformProperty( const AnimatorTransformProperty& ) = delete;
+  AnimatorTransformProperty& operator=( const AnimatorTransformProperty& ) = delete;
 
 protected:
 
-  PropertyOwner* mPropertyOwner;
   PropertyAccessorType mPropertyAccessor;
 
-  AnimatorFunctionBase* mAnimatorFunction;
-  float mCurrentProgress;
 };
 
 } // namespace SceneGraph
 
-/*
- * AnimatorFunction base class.
- * All update functions must inherit from AnimatorFunctionBase and overload the appropiate "()" operator
- */
-struct AnimatorFunctionBase
-{
-  /**
-   * Constructor
-   */
-  AnimatorFunctionBase(){}
-
-  /*
-   * Virtual destructor (Intended as base class)
-   */
-  virtual ~AnimatorFunctionBase(){}
-
-  ///Stub "()" operators.
-  virtual bool operator()(float progress, const bool& property)
-  {
-    return property;
-  }
-
-  virtual float operator()(float progress, const int& property)
-  {
-    return property;
-  }
-
-  virtual float operator()(float progress, const unsigned int& property)
-  {
-    return property;
-  }
-
-  virtual float operator()(float progress, const float& property)
-  {
-    return property;
-  }
-
-  virtual Vector2 operator()(float progress, const Vector2& property)
-  {
-    return property;
-  }
-
-  virtual Vector3 operator()(float progress, const Vector3& property)
-  {
-    return property;
-  }
-
-  virtual Vector4 operator()(float progress, const Vector4& property)
-  {
-    return property;
-  }
-
-  virtual Quaternion operator()(float progress, const Quaternion& property)
-  {
-    return property;
-  }
-};
-
 // Update functions
 
 struct AnimateByInteger : public AnimatorFunctionBase
@@ -842,12 +752,13 @@ struct AnimateByInteger : public AnimatorFunctionBase
   }
 
   using AnimatorFunctionBase::operator();
-  float operator()(float alpha, const int& property)
+  float operator()(float alpha, const int32_t& property)
   {
-    return int(property + mRelative * alpha + 0.5f );
+    // integers need to be correctly rounded
+    return roundf(static_cast<float>( property ) + static_cast<float>( mRelative ) * alpha );
   }
 
-  int mRelative;
+  int32_t mRelative;
 };
 
 struct AnimateToInteger : public AnimatorFunctionBase
@@ -858,12 +769,13 @@ struct AnimateToInteger : public AnimatorFunctionBase
   }
 
   using AnimatorFunctionBase::operator();
-  float operator()(float alpha, const int& property)
+  float operator()(float alpha, const int32_t& property)
   {
-    return int(property + ((mTarget - property) * alpha) + 0.5f);
+    // integers need to be correctly rounded
+    return roundf(static_cast<float>( property ) + (static_cast<float>(mTarget - property) * alpha) );
   }
 
-  int mTarget;
+  int32_t mTarget;
 };
 
 struct AnimateByFloat : public AnimatorFunctionBase
@@ -1134,13 +1046,13 @@ struct KeyFrameIntegerFunctor : public AnimatorFunctionBase
   }
 
   using AnimatorFunctionBase::operator();
-  float operator()(float progress, const int& property)
+  float operator()(float progress, const int32_t& property)
   {
     if(mKeyFrames->IsActive(progress))
     {
-      return mKeyFrames->GetValue(progress, mInterpolation);
+      return static_cast<float>( mKeyFrames->GetValue(progress, mInterpolation) );
     }
-    return property;
+    return static_cast<float>( property );
   }
 
   KeyFrameIntegerPtr mKeyFrames;
index 7c39de9..2805e88 100644 (file)
@@ -28,8 +28,8 @@ namespace SceneGraph
 {
 
 #ifdef DEBUG_ENABLED
-  unsigned int ConstraintBase::mCurrentInstanceCount = 0;
-  unsigned int ConstraintBase::mTotalInstanceCount   = 0;
+  uint32_t ConstraintBase::mCurrentInstanceCount = 0;
+  uint32_t ConstraintBase::mTotalInstanceCount   = 0;
 #endif
 
 ConstraintBase::ConstraintBase( PropertyOwnerContainer& ownerSet, RemoveAction removeAction )
@@ -62,7 +62,7 @@ ConstraintBase::~ConstraintBase()
 #endif
 }
 
-unsigned int ConstraintBase::GetCurrentInstanceCount()
+uint32_t ConstraintBase::GetCurrentInstanceCount()
 {
 #ifdef DEBUG_ENABLED
   return mCurrentInstanceCount;
@@ -71,7 +71,7 @@ unsigned int ConstraintBase::GetCurrentInstanceCount()
 #endif
 }
 
-unsigned int ConstraintBase::GetTotalInstanceCount()
+uint32_t ConstraintBase::GetTotalInstanceCount()
 {
 #ifdef DEBUG_ENABLED
   return mTotalInstanceCount;
index c816bcc..4f360e3 100644 (file)
@@ -138,13 +138,13 @@ public:
    * Helper for internal test cases; only available for debug builds.
    * @return The current number of Constraint instances in existence.
    */
-  static unsigned int GetCurrentInstanceCount();
+  static uint32_t GetCurrentInstanceCount();
 
   /**
    * Helper for internal test cases; only available for debug builds.
    * @return The total number of Constraint instances created during the Dali core lifetime.
    */
-  static unsigned int GetTotalInstanceCount();
+  static uint32_t GetTotalInstanceCount();
 
 private:
 
@@ -242,8 +242,8 @@ private:
   LifecycleObserver* mLifecycleObserver; ///< Resetter observers this object
 
 #ifdef DEBUG_ENABLED
-  static unsigned int mCurrentInstanceCount;  ///< The current number of Constraint instances in existence.
-  static unsigned int mTotalInstanceCount;    ///< The total number of Constraint instances created during the Dali core lifetime.
+  static uint32_t mCurrentInstanceCount;  ///< The current number of Constraint instances in existence.
+  static uint32_t mTotalInstanceCount;    ///< The total number of Constraint instances created during the Dali core lifetime.
 #endif
 };
 
@@ -254,7 +254,7 @@ inline void  SetRemoveActionMessage( EventThreadServices& eventThreadServices, c
   typedef MessageValue1< ConstraintBase, Dali::Constraint::RemoveAction > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &constraint, &ConstraintBase::SetRemoveAction, removeAction );
index 406883c..95f7ed0 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_CONSTRAINT_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ class Constraint : public ConstraintBase
 {
 public:
 
-  typedef typename PropertyConstraintPtr< PropertyType >::Type ConstraintFunctionPtr;
+  using ConstraintFunctionPtr = typename PropertyConstraintPtr< PropertyType >::Type;
 
   /**
    * Create a new scene-graph constraint.
@@ -81,31 +81,29 @@ public:
    */
   virtual void Apply( BufferIndex updateBufferIndex )
   {
-    if ( mDisconnected )
+    if ( !mDisconnected )
     {
-      return; // Early-out when property owners have been disconnected
-    }
-
-    if ( mFunc->InputsInitialized() )
-    {
-      PropertyType current = mTargetProperty.Get( updateBufferIndex );
-      mFunc->Apply( updateBufferIndex, current );
-
-      // Optionally bake the final value
-      if ( Dali::Constraint::Bake == mRemoveAction )
+      if ( mFunc->InputsInitialized() )
       {
-        mTargetProperty.Bake( updateBufferIndex, current );
+        PropertyType current = mTargetProperty.Get( updateBufferIndex );
+        mFunc->Apply( updateBufferIndex, current );
+
+        // Optionally bake the final value
+        if ( Dali::Constraint::Bake == mRemoveAction )
+        {
+          mTargetProperty.Bake( updateBufferIndex, current );
+        }
+        else
+        {
+          mTargetProperty.Set( updateBufferIndex, current );
+        }
+
+        INCREASE_COUNTER(PerformanceMonitor::CONSTRAINTS_APPLIED);
       }
       else
       {
-        mTargetProperty.Set( updateBufferIndex, current );
+        INCREASE_COUNTER(PerformanceMonitor::CONSTRAINTS_SKIPPED);
       }
-
-      INCREASE_COUNTER(PerformanceMonitor::CONSTRAINTS_APPLIED);
-    }
-    else
-    {
-      INCREASE_COUNTER(PerformanceMonitor::CONSTRAINTS_SKIPPED);
     }
   }
 
@@ -125,10 +123,9 @@ private:
   }
 
   // Undefined
-  Constraint( const Constraint& constraint );
-
-  // Undefined
-  Constraint& operator=( const Constraint& rhs );
+  Constraint() = delete;
+  Constraint( const Constraint& constraint ) = delete;
+  Constraint& operator=( const Constraint& rhs ) = delete;
 
   /**
    * @copydoc Dali::Internal::SceneGraph::ConstraintBase::OnDisconnect()
@@ -137,7 +134,7 @@ private:
   {
     // Discard target object/property pointers
     mTargetProperty.Reset();
-    mFunc = NULL;
+    mFunc = nullptr;
   }
 
 protected:
@@ -145,6 +142,7 @@ protected:
   PropertyAccessorType mTargetProperty; ///< Raw-pointer to the target property. Not owned.
 
   ConstraintFunctionPtr mFunc;
+
 };
 
 } // namespace SceneGraph
index f82ed88..94730ad 100644 (file)
@@ -52,9 +52,9 @@ namespace SceneGraph
  * However if the property was only "Set" (and not "Baked"), then typically the base value and previous value will not match.
  * In this case the reset operation is equivalent to a "Bake", and the value is considered "dirty" for an additional frame.
  */
-static const unsigned int CLEAN_FLAG = 0x00; ///< Indicates that the value did not change in this, or the previous frame
-static const unsigned int BAKED_FLAG = 0x01; ///< Indicates that the value was Baked during the previous frame
-static const unsigned int SET_FLAG   = 0x02; ///< Indicates that the value was Set during the previous frame
+static const uint32_t CLEAN_FLAG = 0x00; ///< Indicates that the value did not change in this, or the previous frame
+static const uint32_t BAKED_FLAG = 0x01; ///< Indicates that the value was Baked during the previous frame
+static const uint32_t SET_FLAG   = 0x02; ///< Indicates that the value was Set during the previous frame
 
 template <class T>
 class AnimatableProperty;
@@ -118,7 +118,7 @@ public: // From PropertyBase
 
 protected: // so that ResetToBaseValue can set it directly
 
-  unsigned int mDirtyFlags; ///< Flag whether value changed during previous 2 frames
+  uint32_t mDirtyFlags; ///< Flag whether value changed during previous 2 frames
 
 };
 
@@ -214,7 +214,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  bool& Get(size_t bufferIndex)
+  bool& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -222,7 +222,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  const bool& Get(size_t bufferIndex) const
+  const bool& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -232,7 +232,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  bool& operator[](size_t bufferIndex)
+  bool& operator[]( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -242,7 +242,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const bool& operator[](size_t bufferIndex) const
+  const bool& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -378,7 +378,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  int& Get(size_t bufferIndex)
+  int& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -386,7 +386,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  const int& Get(size_t bufferIndex) const
+  const int& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -396,7 +396,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  int& operator[](size_t bufferIndex)
+  int& operator[]( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -406,7 +406,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const int& operator[](size_t bufferIndex) const
+  const int& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -559,7 +559,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  float& Get(size_t bufferIndex)
+  float& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -567,7 +567,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  const float& Get(size_t bufferIndex) const
+  const float& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -577,7 +577,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  float& operator[](size_t bufferIndex)
+  float& operator[]( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -587,7 +587,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const float& operator[](size_t bufferIndex) const
+  const float& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -791,7 +791,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  Vector2& Get(size_t bufferIndex)
+  Vector2& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -799,7 +799,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  const Vector2& Get(size_t bufferIndex) const
+  const Vector2& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -809,7 +809,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  Vector2& operator[](size_t bufferIndex)
+  Vector2& operator[]( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -819,7 +819,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Vector2& operator[](size_t bufferIndex) const
+  const Vector2& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -1088,7 +1088,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  Vector3& Get(size_t bufferIndex)
+  Vector3& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -1096,7 +1096,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  const Vector3& Get(size_t bufferIndex) const
+  const Vector3& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -1106,7 +1106,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  Vector3& operator[](size_t bufferIndex)
+  Vector3& operator[]( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -1116,7 +1116,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Vector3& operator[](size_t bufferIndex) const
+  const Vector3& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -1439,7 +1439,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  Vector4& Get(size_t bufferIndex)
+  Vector4& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -1447,7 +1447,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  const Vector4& Get(size_t bufferIndex) const
+  const Vector4& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -1457,7 +1457,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  Vector4& operator[](size_t bufferIndex)
+  Vector4& operator[]( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -1467,7 +1467,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Vector4& operator[](size_t bufferIndex) const
+  const Vector4& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -1724,7 +1724,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  Quaternion& Get(size_t bufferIndex)
+  Quaternion& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -1732,7 +1732,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  const Quaternion& Get(size_t bufferIndex) const
+  const Quaternion& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -1742,7 +1742,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  Quaternion& operator[](size_t bufferIndex)
+  Quaternion& operator[]( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -1752,7 +1752,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Quaternion& operator[](size_t bufferIndex) const
+  const Quaternion& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -1885,7 +1885,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  Matrix& Get(size_t bufferIndex)
+  Matrix& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -1893,7 +1893,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  const Matrix& Get(size_t bufferIndex) const
+  const Matrix& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -1903,7 +1903,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  Matrix& operator[](size_t bufferIndex)
+  Matrix& operator[]( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -1913,7 +1913,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Matrix& operator[](size_t bufferIndex) const
+  const Matrix& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -2046,7 +2046,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  Matrix3& Get(size_t bufferIndex)
+  Matrix3& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -2054,7 +2054,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  const Matrix3& Get(size_t bufferIndex) const
+  const Matrix3& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -2064,7 +2064,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  Matrix3& operator[](size_t bufferIndex)
+  Matrix3& operator[]( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -2074,7 +2074,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Matrix3& operator[](size_t bufferIndex) const
+  const Matrix3& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -2137,7 +2137,7 @@ void BakeMessage( EventThreadServices& eventThreadServices,
   typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, T > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &property,
@@ -2153,7 +2153,7 @@ void BakeRelativeMessage( EventThreadServices& eventThreadServices,
   typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, const T& > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &property,
@@ -2169,7 +2169,7 @@ void SetXComponentMessage( EventThreadServices& eventThreadServices,
   typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &property,
@@ -2185,7 +2185,7 @@ void SetYComponentMessage( EventThreadServices& eventThreadServices,
   typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &property,
@@ -2201,7 +2201,7 @@ void SetZComponentMessage( EventThreadServices& eventThreadServices,
   typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &property,
@@ -2217,7 +2217,7 @@ void SetWComponentMessage( EventThreadServices& eventThreadServices,
   typedef MessageDoubleBuffered1< SceneGraph::AnimatableProperty<T>, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &property,
index ee81a6a..cfe57f7 100644 (file)
@@ -93,6 +93,19 @@ void DiscardQueue::Clear( BufferIndex updateBufferIndex )
   mCameraQueue[ updateBufferIndex ].Clear();
 }
 
+bool DiscardQueue::IsEmpty( BufferIndex updateBufferIndex )
+{
+  return mNodeQueue[ updateBufferIndex ].Empty() ||
+    mShaderQueue[ updateBufferIndex ].Empty() ||
+    mRendererQueue[ updateBufferIndex ].Empty() ||
+    mCameraQueue[ updateBufferIndex ].Empty();
+}
+
+DiscardQueue::RendererQueue::SizeType DiscardQueue::GetRendererCount( BufferIndex updateBufferIndex )
+{
+  return mRendererQueue[ updateBufferIndex ].Count();
+}
+
 } // namespace SceneGraph
 
 } // namespace Internal
index b0ef581..9da6084 100644 (file)
@@ -105,17 +105,23 @@ public:
    */
   void Clear( BufferIndex updateBufferIndex );
 
-private:
-
-  // Undefined
-  DiscardQueue( const DiscardQueue& );
+  /**
+   * @param[in] updateBufferIndex The current update buffer index.
+   * @return true if the queues for the given buffer index are empty
+   */
+  bool IsEmpty( BufferIndex updateBufferIndex );
 
-  // Undefined
-  DiscardQueue& operator=( const DiscardQueue& rhs );
+  /**
+   * @param[in] updateBufferIndex The current update buffer index.
+   * @return size of the renderer discard queue.
+   */
+  RendererQueue::SizeType GetRendererCount( BufferIndex updateBufferIndex );
 
 private:
+  DiscardQueue( const DiscardQueue& ) = delete;
+  DiscardQueue& operator=( const DiscardQueue& rhs ) = delete;
 
-  //RenderQueue& mRenderQueue; ///< Used to send GL clean-up messages for the next Render.
+private:
 
   // Messages are queued here following the current update buffer number
   OwnerContainer< Node* >      mNodeQueue[2];
index 412e49c..79c1642 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_DOUBLE_BUFFERED_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,14 +56,14 @@ public:
   {
   }
 
-  inline T& operator[](const size_t i)
+  inline T& operator[](const BufferIndex i)
   {
     DALI_ASSERT_DEBUG(i < NUM_SCENE_GRAPH_BUFFERS);
 
     return *(&mValue1+i);
   }
 
-  inline const T& operator[](const size_t i) const
+  inline const T& operator[](const BufferIndex i) const
   {
     DALI_ASSERT_DEBUG(i < NUM_SCENE_GRAPH_BUFFERS);
 
@@ -118,7 +118,7 @@ public:
 
   private:
     Setter( DoubleBuffered& object,
-            size_t i,
+            BufferIndex i,
             T* value )
     : mObject( object ),
       mIndex( i ),
@@ -133,9 +133,9 @@ public:
     {
     }
 
-    DoubleBuffered& mObject; ///< Double-buffered object that will be changed
-    const size_t mIndex;                          ///< Buffer index that will be changed
-    T* mValue;                                    ///< Value of the pointer
+    DoubleBuffered& mObject;  ///< Double-buffered object that will be changed
+    const BufferIndex mIndex; ///< Buffer index that will be changed
+    T* mValue;                ///< Value of the pointer
 
     friend class DoubleBuffered;
   };
@@ -161,7 +161,7 @@ public:
     delete mValue1;
   }
 
-  void Set( size_t i, T* value )
+  void Set( BufferIndex i, T* value )
   {
     T*& current = *(&mValue1 + i);
     T*& previous = *(&mValue1 + 1u-i);
@@ -173,12 +173,12 @@ public:
     current = value;
   }
 
-  Setter operator[](size_t i)
+  Setter operator[]( BufferIndex i )
   {
     return Setter( *this, i, *(&mValue1+i) );
   }
 
-  const T* operator[](size_t i) const
+  const T* operator[]( BufferIndex i ) const
   {
     DALI_ASSERT_DEBUG(i < NUM_SCENE_GRAPH_BUFFERS);
 
@@ -189,7 +189,7 @@ public:
    * Auto-age the property: if it was set the previous frame,
    * then copy the value into the current frame's buffer.
    */
-  void CopyPrevious( size_t i )
+  void CopyPrevious( BufferIndex i )
   {
     DALI_ASSERT_DEBUG(i < NUM_SCENE_GRAPH_BUFFERS);
 
index 0c6cc8f..eaea49a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_INHERITED_PROPERTY_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -159,7 +159,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  Vector3& Get(size_t bufferIndex)
+  Vector3& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -167,7 +167,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  const Vector3& Get(size_t bufferIndex) const
+  const Vector3& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -177,7 +177,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Vector3& operator[](size_t bufferIndex) const
+  const Vector3& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -330,7 +330,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  Vector4& Get(size_t bufferIndex)
+  Vector4& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -338,7 +338,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  const Vector4& Get(size_t bufferIndex) const
+  const Vector4& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -348,7 +348,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Vector4& operator[](size_t bufferIndex) const
+  const Vector4& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -479,7 +479,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  Quaternion& Get(size_t bufferIndex)
+  Quaternion& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -487,7 +487,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  const Quaternion& Get(size_t bufferIndex) const
+  const Quaternion& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -497,7 +497,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Quaternion& operator[](size_t bufferIndex) const
+  const Quaternion& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -629,7 +629,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  Matrix& Get(size_t bufferIndex)
+  Matrix& Get( BufferIndex bufferIndex )
   {
     return mValue[bufferIndex];
   }
@@ -637,7 +637,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  const Matrix& Get(size_t bufferIndex) const
+  const Matrix& Get( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
@@ -647,12 +647,12 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Matrix& operator[](size_t bufferIndex) const
+  const Matrix& operator[]( BufferIndex bufferIndex ) const
   {
     return mValue[bufferIndex];
   }
 
-  void SetDirty(size_t bufferIndex)
+  void SetDirty( BufferIndex bufferIndex )
   {
     mReinheritedFlag = true;
 
index 9422c88..006b817 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -87,7 +87,7 @@ bool LessThan::EvalBoolean( const Dali::PropertyInput& value, PropertyNotificati
 
 bool LessThan::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
-  const int arg0 = arg[0];
+  const int32_t arg0 = static_cast<int32_t>( arg[0] );
   return (value.GetInteger() < arg0);
 }
 
@@ -176,7 +176,7 @@ bool GreaterThan::EvalBoolean( const Dali::PropertyInput& value, PropertyNotific
 
 bool GreaterThan::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
-  const int arg0 = arg[0];
+  const int32_t arg0 = static_cast<int32_t>( arg[0] );
   return (value.GetInteger() > arg0);
 }
 
@@ -265,8 +265,8 @@ bool Inside::EvalBoolean( const Dali::PropertyInput& value, PropertyNotification
 
 bool Inside::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
-  const int valueInteger = value.GetInteger();
-  return ( (valueInteger > arg[0]) && (valueInteger < arg[1]) );
+  const int32_t valueInteger = value.GetInteger();
+  return ( ( valueInteger > static_cast<int32_t>( arg[0] ) ) && ( valueInteger < static_cast<int32_t>( arg[1] ) ) );
 }
 
 bool Inside::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
@@ -354,8 +354,8 @@ bool Outside::EvalBoolean( const Dali::PropertyInput& value, PropertyNotificatio
 
 bool Outside::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
 {
-  const int valueInteger = value.GetInteger();
-  return ( (valueInteger < arg[0]) || (valueInteger > arg[1]) );
+  const int32_t valueInteger = value.GetInteger();
+  return ( ( valueInteger < static_cast<int32_t>( arg[0] ) ) || ( valueInteger > static_cast<int32_t>( arg[0] ) ) );
 }
 
 bool Outside::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
index a32981d..e305d42 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,9 +34,9 @@ namespace SceneGraph
 namespace
 {
 
-const int ARGINDEX_REF_VALUE = 0;
-const int ARGINDEX_STEP_SIZE = 1;
-const int ARGINDEX_CURRENT_STEP = 2;
+const int32_t ARGINDEX_REF_VALUE = 0;
+const int32_t ARGINDEX_STEP_SIZE = 1;
+const int32_t ARGINDEX_CURRENT_STEP = 2;
 
 } // namespace
 
@@ -85,10 +85,10 @@ bool Step::Evaluate( const float propertyValue, PropertyNotification::RawArgumen
 {
   const float refValue = arg[ARGINDEX_REF_VALUE];
   const float step = arg[ARGINDEX_STEP_SIZE];
-  const int currentStep = static_cast<int>(arg[ARGINDEX_CURRENT_STEP]);
+  const int32_t currentStep = static_cast<int32_t>(arg[ARGINDEX_CURRENT_STEP]);
   const float distance = (propertyValue - refValue);
   // step is actual 1.0f / step so can multiply instead of dividing
-  const int newStep = static_cast<int>(floorf(distance * step));
+  const int32_t newStep = static_cast<int32_t>(floorf(distance * step));
 
   if( newStep != currentStep )
   {
index 60fca7b..583a4c1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,9 +34,9 @@ namespace SceneGraph
 namespace
 {
 
-const int ARGINDEX_STEP_INDEX = 0;
-const int ARGINDEX_LIST_SIZE = 1;
-const int ARGINDEX_LIST_START = 2;
+const int32_t ARGINDEX_STEP_INDEX = 0;
+const int32_t ARGINDEX_LIST_SIZE = 1;
+const int32_t ARGINDEX_LIST_START = 2;
 
 }
 
@@ -83,12 +83,12 @@ ConditionFunction VariableStep::GetFunction( Property::Type valueType )
 
 bool VariableStep::Evaluate( const float propertyValue, PropertyNotification::RawArgumentContainer& arg )
 {
-  const int currentIndex = arg[ARGINDEX_STEP_INDEX];
-  const int numSteps = arg[ARGINDEX_LIST_SIZE];
+  const int32_t currentIndex = static_cast<int32_t>( arg[ARGINDEX_STEP_INDEX] ); // truncated
+  const int32_t numSteps = static_cast<int32_t>( arg[ARGINDEX_LIST_SIZE] ); // truncated
   const float first = arg[ARGINDEX_LIST_START];
   const float last = arg[ARGINDEX_LIST_START + (numSteps - 1)];
   const bool ascending = (last > first) ? true : false;
-  int newIndex = currentIndex;
+  int32_t newIndex = currentIndex;
 
   // avoid loop if property currently not within any of the range values
   if( ascending )
@@ -114,7 +114,7 @@ bool VariableStep::Evaluate( const float propertyValue, PropertyNotification::Ra
       newIndex = numSteps - 1;
     }
   }
-  int i = 0;
+  int32_t i = 0;
   for( i = 0 ; i < numSteps - 1 ; ++i )
   {
     const float arg1 = arg[ARGINDEX_LIST_START + i];
index 3a14bc4..c2dafca 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_PROPERTY_OWNER_MESSAGES_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
+#include <string>
 
+// INTERNAL INCLUDES
 #include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/event/common/property-input-impl.h>
 #include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/animation/scene-graph-constraint-base.h>
-#include <string>
 
 namespace Dali
 {
@@ -89,7 +90,7 @@ public:
                     typename ParameterType< P >::PassingType value )
   {
     // Reserve some memory inside the message queue
-    unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( AnimatablePropertyMessage ) );
+    uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( AnimatablePropertyMessage ) );
 
     // Construct message in the message queue memory; note that delete should not be called on the return value
     new (slot) AnimatablePropertyMessage( sceneObject, property, member, value );
@@ -168,7 +169,7 @@ public:
                     float value )
   {
     // Reserve some memory inside the message queue
-    unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( AnimatablePropertyComponentMessage ) );
+    uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( AnimatablePropertyComponentMessage ) );
 
     // Construct message in the message queue memory; note that delete should not be called on the return value
     new (slot) AnimatablePropertyComponentMessage( sceneObject, property, member, value );
@@ -227,7 +228,7 @@ inline void InstallCustomPropertyMessage( EventThreadServices& eventThreadServic
   typedef MessageValue1< PropertyOwner, OwnerPointer<PropertyBase> > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &owner, &PropertyOwner::InstallCustomProperty, property );
@@ -238,7 +239,7 @@ inline void ApplyConstraintMessage( EventThreadServices& eventThreadServices, co
   typedef MessageValue1< PropertyOwner, OwnerPointer<ConstraintBase> > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &owner, &PropertyOwner::ApplyConstraint, constraint );
@@ -252,7 +253,7 @@ inline void RemoveConstraintMessage( EventThreadServices& eventThreadServices, c
   typedef MessageValue1< PropertyOwner, ConstraintBase* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &owner, &PropertyOwner::RemoveConstraint, &constraint );
@@ -263,7 +264,7 @@ inline void AddUniformMapMessage( EventThreadServices& eventThreadServices, cons
   typedef MessageValue1< PropertyOwner, OwnerPointer< UniformPropertyMapping > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &owner, &PropertyOwner::AddUniformMapping, map );
 }
@@ -273,7 +274,7 @@ inline void RemoveUniformMapMessage( EventThreadServices& eventThreadServices, c
   typedef MessageValue1< PropertyOwner, std::string > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &owner, &PropertyOwner::RemoveUniformMapping, uniformName );
 }
index ec5a862..e5ab8bf 100644 (file)
@@ -18,8 +18,6 @@
  *
  */
 
-// EXTERNAL INCLUDES
-
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/devel-api/common/owner-container.h>
index c28322f..305fb14 100644 (file)
@@ -17,6 +17,9 @@
  * limitations under the License.
  */
 
+// EXTERNAL INCLDUES
+#include <cstdint> // int8_t
+
 #include <dali/internal/update/animation/scene-graph-animator.h>
 #include <dali/internal/update/animation/scene-graph-constraint-base.h>
 #include <dali/internal/update/animation/property-accessor.h>
@@ -66,8 +69,16 @@ public:
    */
   void ResetToBaseValue( BufferIndex updateBufferIndex )
   {
-    if( mPropertyOwner != nullptr && !mDisconnected )
+    if( mPropertyOwner != nullptr && mActive )
     {
+      // If property-owner has disconnected, start aging.
+      // We need to reset the property for two frames after disconnection to ensure both
+      // property values are set appropriately.
+      if( mDisconnected )
+      {
+        --mActive;
+      }
+
       mBaseProperty->ResetToBaseValue( updateBufferIndex );
     }
   };
@@ -83,6 +94,7 @@ public:
   virtual void PropertyOwnerConnected( PropertyOwner& owner ) override
   {
     mDisconnected = false;
+    mActive = ACTIVE;
   }
 
   /**
@@ -105,7 +117,8 @@ public:
     mPropertyOwner = nullptr;
 
     // Don't need to wait another frame as the property is being destroyed
-    mRunning = 0;
+    mActive = STOPPED;
+    mRunning = STOPPED;
   }
 
   /**
@@ -119,16 +132,23 @@ public:
    */
   virtual bool IsFinished()
   {
-    bool finished = mRunning <= 0;
-    if( mRunning == 1 )
+    bool finished = mRunning <= STOPPED;
+    if( mRunning == AGING )
     {
-      mRunning = 0;
+      mRunning = STOPPED;
     }
     return finished;
   }
 
 protected:
 
+  enum
+  {
+    STOPPED = 0,
+    AGING   = 1,
+    ACTIVE  = 2,
+  };
+
   /**
    * Constructor
    *
@@ -139,14 +159,16 @@ protected:
                         PropertyBase* baseProperty )
   : mPropertyOwner( propertyOwner ),
     mBaseProperty( baseProperty ),
-    mRunning( 2 ),
+    mRunning( ACTIVE ),
+    mActive( ACTIVE ),
     mDisconnected( false )
   {
   }
 
   PropertyOwner* mPropertyOwner; ///< The property owner
   PropertyBase* mBaseProperty;   ///< The base property being animated or constrained
-  int mRunning;                  ///< 2 if running, 1 if aging, 0 if stopped
+  int8_t mRunning;                  ///< Used to determine if we should finish or not, 2 if running, 1 if aging, 0 if stopped
+  int8_t mActive;                   ///< 2 if active, 1 if aging, 0 if stopped
   bool mDisconnected;            ///< True if the property owner has been disconnected
 };
 
diff --git a/dali/internal/update/common/property-vector3.h b/dali/internal/update/common/property-vector3.h
deleted file mode 100644 (file)
index 463ff28..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-#ifndef __DALI_INTERNAL_SCENE_GRAPH_VECTOR3_PROPERTY_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_VECTOR3_PROPERTY_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/math/vector3.h>
-#include <dali/public-api/object/property.h>
-#include <dali/public-api/object/property-input.h>
-#include <dali/public-api/object/property-types.h>
-#include <dali/internal/common/buffer-index.h>
-#include <dali/internal/event/common/property-input-impl.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace SceneGraph
-{
-
-/**
- * A Vector3 non-animatable property.
- */
-class PropertyVector3 : public PropertyInputImpl
-{
-public:
-
-  /**
-   * Create an non-animatable property.
-   * @param [in] initialValue The initial value of the property.
-   */
-  PropertyVector3( Vector3 initialValue )
-  : mValue( initialValue ),
-    mDirtyFlag( true )
-  {
-  }
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~PropertyVector3()
-  {
-  }
-
-  /**
-   * Clear the dirty flag
-   */
-  void Clear()
-  {
-    mDirtyFlag = false;
-  }
-
-  /**
-   * @copydoc Dali::Internal::PropertyInputImpl::GetType()
-   */
-  virtual Dali::Property::Type GetType() const
-  {
-    return Dali::PropertyTypes::Get<Vector3>();
-  }
-
-  /**
-   * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
-   */
-  virtual bool InputInitialized() const
-  {
-    return true;
-  }
-
-  /**
-   * @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
-   */
-  virtual bool InputChanged() const
-  {
-    return mDirtyFlag;
-  }
-
-  /**
-   * @copydoc Dali::PropertyInput::GetVector3()
-   */
-  virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
-  {
-    return mValue;
-  }
-
-  /**
-   * Flag that the property has been Set during the current frame.
-   */
-  void OnSet()
-  {
-    mDirtyFlag = true;
-  }
-
-private:
-
-  // Undefined
-  PropertyVector3(const PropertyVector3& property);
-
-  // Undefined
-  PropertyVector3& operator=(const PropertyVector3& rhs);
-
-public:
-
-  Vector3 mValue; ///< The property value
-
-private:
-
-  bool mDirtyFlag;
-
-};
-
-} // namespace SceneGraph
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_SCENE_GRAPH_VECTOR3_PROPERTY_H__
index b9fb6e0..945dca7 100644 (file)
@@ -30,6 +30,16 @@ namespace Internal
 namespace SceneGraph
 {
 
+namespace
+{
+
+/**
+ * Maximum number of graphics data buffers ( render commands,
+ * uniform buffers )
+ */
+const auto MAX_GRAPHICS_DATA_BUFFER_COUNT = 2u;
+}
+
 /**
  * Node values (position etc.) are double-buffered.  A SceneGraphBuffers object
  * can be used to keep track of which buffers are being written or read.
index 9d4fa6f..72af02a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,8 @@
  * limitations under the License.
  */
 
-#include "uniform-map.h"
+// CLASS HEADER
+#include <dali/internal/update/common/uniform-map.h>
 
 namespace Dali
 {
@@ -150,12 +151,12 @@ const PropertyInputImpl* UniformMap::Find( const std::string& uniformName )
   return NULL;
 }
 
-unsigned int UniformMap::Count() const
+UniformMap::SizeType UniformMap::Count() const
 {
-  return mUniformMaps.Count();
+  return static_cast<UniformMap::SizeType>( mUniformMaps.Count() );
 }
 
-const UniformPropertyMapping& UniformMap::operator[]( unsigned int index ) const
+const UniformPropertyMapping& UniformMap::operator[]( UniformMap::SizeType index ) const
 {
   return *mUniformMaps[index];
 }
index 664a8cd..57d87c4 100644 (file)
  * limitations under the License.
  */
 
+// EXTERNAL INCLUDES
+#include <string>
+#include <cstdint> // uint32_t
+
+// INTERNAL INCLUDES
 #include <dali/devel-api/common/hash.h>
 #include <dali/devel-api/common/owner-container.h>
-#include <string>
 
 namespace Dali
 {
@@ -43,15 +47,31 @@ public:
    */
   UniformPropertyMapping( const std::string& theUniformName, const PropertyInputImpl* thePropertyPtr )
   : propertyPtr( thePropertyPtr ),
-    uniformName( theUniformName ),
-    uniformNameHash( Dali::CalculateHash( theUniformName ) )
+    uniformNameHashNoArray( 0 )
   {
+    arrayIndex = 0;
+
+    // Look for array index closing bracket
+    auto pos = theUniformName.rfind( "]" );
+
+    // If found, extract the array index and store it
+    if( pos != std::string::npos )
+    {
+      auto pos0 = theUniformName.rfind( "[", pos );
+      arrayIndex = atoi( theUniformName.c_str() + pos0 + 1 );
+      // Calculate hash from name without array index
+      uniformNameHashNoArray = Dali::CalculateHash( theUniformName.substr( 0, pos0 ) );
+    }
+    uniformName = theUniformName;
+    uniformNameHash = Dali::CalculateHash( theUniformName );
   }
 
   UniformPropertyMapping()
-  : propertyPtr( NULL ),
-    uniformName( "" ),
-    uniformNameHash( 0 )
+    : propertyPtr( NULL ),
+      uniformName( "" ),
+      uniformNameHash( 0 ),
+      uniformNameHashNoArray( 0 ),
+      arrayIndex( 0 )
   {
   }
 
@@ -59,6 +79,8 @@ public:
   const PropertyInputImpl* propertyPtr;
   std::string uniformName;
   Hash uniformNameHash;
+  Hash uniformNameHashNoArray;
+  int32_t arrayIndex;
 };
 
 /**
@@ -71,6 +93,8 @@ public:
 class UniformMap
 {
 public:
+  using SizeType = uint32_t;
+
   class Observer
   {
   public:
@@ -129,14 +153,14 @@ public:
    * Get the count of uniforms in the map
    * @return The number of uniform mappings
    */
-  unsigned int Count() const;
+  SizeType Count() const;
 
   /**
    * @pre index must be in the range 0 :: Count()-1
    * @param[in] index The index of the element to fetch
    * @return reference to the element in the map
    */
-  const UniformPropertyMapping& operator[]( unsigned int index ) const;
+  const UniformPropertyMapping& operator[]( SizeType index ) const;
 
 private:
   /**
index c33a543..e84ec6a 100644 (file)
@@ -164,7 +164,7 @@ void PanGesture::PredictionMode1(int eventsThisFrame, PanInfo& gestureOut, PanIn
       ++iter;
       continue;
     }
-    float previousValueWeight = ( static_cast< float >( MAX_GESTURE_AGE ) - (lastVSyncTime - lastTime) ) / static_cast< float >( MAX_GESTURE_AGE );
+    float previousValueWeight = ( static_cast<float>( MAX_GESTURE_AGE ) - static_cast<float>(lastVSyncTime - lastTime) ) / static_cast<float>( MAX_GESTURE_AGE );
     float velMag = currentGesture.screen.velocity.Length();
     float velDiff = velMag - screenVelocity.Length();
     float acceleration = 0.0f;
@@ -188,7 +188,7 @@ void PanGesture::PredictionMode1(int eventsThisFrame, PanInfo& gestureOut, PanIn
     }
     else
     {
-      newVelMag = velMag + (((acceleration * (1.0f - previousValueWeight)) + (previousAccel * previousValueWeight)) * currentInterpolation);
+      newVelMag = velMag + (((acceleration * (1.0f - previousValueWeight)) + (previousAccel * previousValueWeight)) * static_cast<float>( currentInterpolation ) );
     }
     float velMod = 1.0f;
     if( velMag > Math::MACHINE_EPSILON_1 )
@@ -197,8 +197,8 @@ void PanGesture::PredictionMode1(int eventsThisFrame, PanInfo& gestureOut, PanIn
     }
     gestureOut.screen.velocity = currentGesture.screen.velocity * velMod;
     gestureOut.local.velocity = currentGesture.local.velocity * velMod;
-    screenDisplacement = gestureOut.screen.displacement + (gestureOut.screen.velocity * interpolationTime);
-    localDisplacement = gestureOut.local.displacement + (gestureOut.local.velocity * interpolationTime);
+    screenDisplacement = gestureOut.screen.displacement + (gestureOut.screen.velocity * static_cast<float>( interpolationTime ) );
+    localDisplacement = gestureOut.local.displacement + (gestureOut.local.velocity * static_cast<float>( interpolationTime ) );
     screenVelocity = currentGesture.screen.velocity;
     localVelocity = currentGesture.local.velocity;
     previousAccel = acceleration;
@@ -222,7 +222,7 @@ void PanGesture::BlendPoints( PanInfo& gesture, PanInfo& lastGesture, float blen
   gesture.screen.displacement = gesture.screen.position - lastGesture.screen.position;
   gesture.local.displacement = gesture.local.position - lastGesture.local.position;
   // Calculate velocity relative to previous update-frame
-  float timeDifference( gesture.time - lastGesture.time );
+  float timeDifference = static_cast<float>( gesture.time - lastGesture.time );
   gesture.screen.velocity = gesture.screen.displacement / timeDifference;
   gesture.local.velocity = gesture.local.displacement / timeDifference;
 }
@@ -332,10 +332,11 @@ bool PanGesture::ReadAndResampleGestures( FrameGestureInfo& info, unsigned int c
 
     if( info.eventsThisFrame > 1 )
     {
-      info.frameGesture.screen.position /= info.eventsThisFrame;
-      info.frameGesture.local.position /= info.eventsThisFrame;
-      info.frameGesture.screen.velocity /= info.eventsThisFrame;
-      info.frameGesture.local.velocity /= info.eventsThisFrame;
+      const float eventsThisFrame = static_cast<float>( info.eventsThisFrame );
+      info.frameGesture.screen.position /= eventsThisFrame;
+      info.frameGesture.local.position /= eventsThisFrame;
+      info.frameGesture.screen.velocity /= eventsThisFrame;
+      info.frameGesture.local.velocity /= eventsThisFrame;
 
       info.frameGesture.screen.displacement = info.frameGesture.screen.position - mLastGesture.screen.position;
       info.frameGesture.local.displacement = info.frameGesture.local.position - mLastGesture.local.position;
@@ -430,7 +431,7 @@ bool PanGesture::UpdateProperties( unsigned int lastVSyncTime, unsigned int next
         // Ignore tiny velocity fluctuation to avoid unnecessary prediction amount change
         if( fabsf( frameInfo.acceleration ) > ACCELERATION_THRESHOLD )
         {
-          mCurrentPredictionAmount += mPredictionAmountAdjustment * ( frameInfo.acceleration > Math::MACHINE_EPSILON_0 ? 1.0f : -1.0f );
+          mCurrentPredictionAmount += static_cast<unsigned int>( static_cast<float>( mPredictionAmountAdjustment ) * ( frameInfo.acceleration > Math::MACHINE_EPSILON_0 ? 1.0f : -1.0f ) );
           if( mCurrentPredictionAmount > mMaxPredictionAmount + mPredictionAmountAdjustment ) // Guard against unsigned int overflow
           {
             mCurrentPredictionAmount = 0;
@@ -550,7 +551,7 @@ bool PanGesture::UpdateProperties( unsigned int lastVSyncTime, unsigned int next
   mLastGesture = frameGesture;
   mLastUnmodifiedGesture = unmodifiedGesture;
 
-  mInGesture &= ~frameInfo.justFinished;
+  mInGesture &= !frameInfo.justFinished;
   if( mProfiling && frameInfo.justFinished )
   {
     mProfiling->PrintData();
@@ -810,7 +811,7 @@ bool PanGesture::InputRateConversion( PanInfo& rateConvertedGesture, unsigned in
     // Some events were read this frame.
     if( eventsKeptThisFrame > 1 )
     {
-      float eventDivisor( eventsKeptThisFrame );
+      const float eventDivisor = static_cast<float>( eventsKeptThisFrame );
       rateConvertedGesture.screen.position /= eventDivisor;
       rateConvertedGesture.local.position /= eventDivisor;
       rateConvertedGesture.screen.velocity /= eventDivisor;
@@ -983,8 +984,8 @@ bool PanGesture::InterpolatePoint( PanInfoHistory& history, unsigned int current
     else
     {
       // If we just started, last velocity was 0. So difference of zero to current velocity over time gives acceleration of the first point.
-      newAcceleration.local = outPoint.local.velocity / outputTimeGranularity;
-      newAcceleration.screen = outPoint.screen.velocity / outputTimeGranularity;
+      newAcceleration.local = outPoint.local.velocity / static_cast<float>( outputTimeGranularity );
+      newAcceleration.screen = outPoint.screen.velocity / static_cast<float>( outputTimeGranularity );
     }
     pointGenerated = true;
   }
@@ -1037,7 +1038,7 @@ void PanGesture::PredictionMode2( PanInfo& startPoint, RelativeVectors& accelera
   else
   {
     // We are doing integration based prediction.
-    float predictionDelta( mCurrentPredictionAmount );
+    float predictionDelta = static_cast<float>( mCurrentPredictionAmount );
 
     predictedPoint.local.position = startPoint.local.position + ( startPoint.local.velocity * predictionDelta ) +
         ( accelerationToUse.local * ( predictionDelta * predictionDelta * 0.5f ) );
@@ -1137,7 +1138,7 @@ bool PanGesture::NewAlgorithm( unsigned int lastVSyncTime, unsigned int nextVSyn
     PanInfo targetPoint;
     float outputTimeGranularity( GetDivisibleTimeDifference( nextVSyncTime, lastVSyncTime, 1.0f, OUTPUT_TIME_DIFFERENCE ) );
     bool pointGenerated = InterpolatePoint( mPanHistory, nextVSyncTime, nextVSyncTime, mInterpolationTimeRange,
-        targetPoint, currentAcceleration, outputTimeGranularity, true );
+        targetPoint, currentAcceleration, static_cast<int>( outputTimeGranularity ), true ); // truncated
     if( pointGenerated )
     {
       mLastInitialAcceleration.local = currentAcceleration.local;
@@ -1178,7 +1179,7 @@ bool PanGesture::NewAlgorithm( unsigned int lastVSyncTime, unsigned int nextVSyn
       interpolatedAcceleration.local = mLastInterpolatedAcceleration.local;
       interpolatedAcceleration.screen = mLastInterpolatedAcceleration.screen;
       if( !InterpolatePoint( mPanHistory, nextVSyncTime, pastInterpolateTime, mTwoPointPastInterpolateTime,
-          outPoint, interpolatedAcceleration, outputTimeGranularity, false ) )
+          outPoint, interpolatedAcceleration, static_cast<int>( outputTimeGranularity ), false ) ) // truncated
       {
         if( justStarted )
         {
@@ -1232,7 +1233,7 @@ bool PanGesture::NewAlgorithm( unsigned int lastVSyncTime, unsigned int nextVSyn
         // Perform Multi-tap Smoothing.
         RelativeVectors blank;
         InterpolatePoint( mPredictionHistory, nextVSyncTime, nextVSyncTime, mMultiTapSmoothingRange,
-            targetPoint, blank, outputTimeGranularity, true );
+            targetPoint, blank, static_cast<int>( outputTimeGranularity ), true ); // truncated
       }
       else
       {
@@ -1280,7 +1281,7 @@ bool PanGesture::NewAlgorithm( unsigned int lastVSyncTime, unsigned int nextVSyn
     }
   }
 
-  mInGesture &= ~justFinished;
+  mInGesture &= !justFinished;
 
   return performUpdate;
 }
index d253c59..1be17a4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // EXTERNAL INCLUDES
 #include <dali/graphics-api/graphics-api-controller.h>
 #include <dali/graphics-api/graphics-api-render-command.h>
+#include <dali/graphics-api/graphics-api-framebuffer.h>
 
 // INTERNAL INCLUDES
+#include <dali/devel-api/common/hash.h>
 #include <dali/internal/common/buffer-index.h>
 #include <dali/internal/update/rendering/render-instruction-container.h>
-#include <dali/internal/update/rendering/render-instruction.h>
 #include <dali/internal/update/rendering/scene-graph-texture-set.h>
 #include <dali/internal/update/rendering/scene-graph-renderer.h>
 #include <dali/internal/update/rendering/scene-graph-geometry.h>
 #include <dali/internal/update/rendering/scene-graph-property-buffer.h>
 #include <dali/internal/update/rendering/scene-graph-shader.h>
+#include "../../../graphics-api/graphics-api-types.h"
 
 namespace Dali
 {
@@ -41,71 +43,438 @@ namespace SceneGraph
 {
 namespace
 {
+// Size of uniform buffer page used when resizing
+constexpr uint32_t UBO_PAGE_SIZE = 8192u;
+
+// UBO allocation threshold below which the UBO will shrink
+constexpr auto UBO_SHRINK_THRESHOLD = 0.75f;
+
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_RENDERER" );
+#endif
 
 static constexpr float CLIP_MATRIX_DATA[] = {
-  1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f, 0.0f, 0.0f, 0.5f, 1.0f
+  1.0f, 0.0f, 0.0f, 0.0f,
+  0.0f, -1.0f, 0.0f, 0.0f,
+  0.0f, 0.0f, -0.5f, 0.0f,
+  0.0f, 0.0f, 0.5f, 1.0f
 };
-static const Matrix CLIP_MATRIX(CLIP_MATRIX_DATA);
-
 
+static const Matrix CLIP_MATRIX(CLIP_MATRIX_DATA);
 
-constexpr Graphics::API::BlendFactor ConvertBlendFactor( BlendFactor::Type blendFactor )
+constexpr Graphics::BlendFactor ConvertBlendFactor( BlendFactor::Type blendFactor )
 {
   switch( blendFactor )
   {
     case BlendFactor::ZERO:
-      return Graphics::API::BlendFactor::ZERO;
+      return Graphics::BlendFactor::ZERO;
     case BlendFactor::ONE:
-      return Graphics::API::BlendFactor::ONE;
+      return Graphics::BlendFactor::ONE;
     case BlendFactor::SRC_COLOR:
-      return Graphics::API::BlendFactor::SRC_COLOR;
+      return Graphics::BlendFactor::SRC_COLOR;
     case BlendFactor::ONE_MINUS_SRC_COLOR:
-      return Graphics::API::BlendFactor::ONE_MINUS_SRC_COLOR;
+      return Graphics::BlendFactor::ONE_MINUS_SRC_COLOR;
     case BlendFactor::SRC_ALPHA:
-      return Graphics::API::BlendFactor::SRC_ALPHA;
+      return Graphics::BlendFactor::SRC_ALPHA;
     case BlendFactor::ONE_MINUS_SRC_ALPHA:
-      return Graphics::API::BlendFactor::ONE_MINUS_SRC_ALPHA;
+      return Graphics::BlendFactor::ONE_MINUS_SRC_ALPHA;
     case BlendFactor::DST_ALPHA:
-      return Graphics::API::BlendFactor::DST_ALPHA;
+      return Graphics::BlendFactor::DST_ALPHA;
     case BlendFactor::ONE_MINUS_DST_ALPHA:
-      return Graphics::API::BlendFactor::ONE_MINUS_DST_ALPHA;
+      return Graphics::BlendFactor::ONE_MINUS_DST_ALPHA;
     case BlendFactor::DST_COLOR:
-      return Graphics::API::BlendFactor::DST_COLOR;
+      return Graphics::BlendFactor::DST_COLOR;
     case BlendFactor::ONE_MINUS_DST_COLOR:
-      return Graphics::API::BlendFactor::ONE_MINUS_DST_COLOR;
+      return Graphics::BlendFactor::ONE_MINUS_DST_COLOR;
     case BlendFactor::SRC_ALPHA_SATURATE:
-      return Graphics::API::BlendFactor::SRC_ALPHA_SATURATE;
+      return Graphics::BlendFactor::SRC_ALPHA_SATURATE;
     case BlendFactor::CONSTANT_COLOR:
-      return Graphics::API::BlendFactor::CONSTANT_COLOR;
+      return Graphics::BlendFactor::CONSTANT_COLOR;
     case BlendFactor::ONE_MINUS_CONSTANT_COLOR:
-      return Graphics::API::BlendFactor::ONE_MINUS_CONSTANT_COLOR;
+      return Graphics::BlendFactor::ONE_MINUS_CONSTANT_COLOR;
     case BlendFactor::CONSTANT_ALPHA:
-      return Graphics::API::BlendFactor::CONSTANT_ALPHA;
+      return Graphics::BlendFactor::CONSTANT_ALPHA;
     case BlendFactor::ONE_MINUS_CONSTANT_ALPHA:
-      return Graphics::API::BlendFactor::ONE_MINUS_CONSTANT_ALPHA;
+      return Graphics::BlendFactor::ONE_MINUS_CONSTANT_ALPHA;
   }
-  return Graphics::API::BlendFactor{};
+  return Graphics::BlendFactor{};
 }
 
-constexpr Graphics::API::BlendOp ConvertBlendEquation( BlendEquation::Type blendEquation )
+constexpr Graphics::BlendOp ConvertBlendEquation( BlendEquation::Type blendEquation )
 {
   switch( blendEquation )
   {
     case BlendEquation::ADD:
-      return Graphics::API::BlendOp::ADD;
+      return Graphics::BlendOp::ADD;
     case BlendEquation::SUBTRACT:
-      return Graphics::API::BlendOp::SUBTRACT;
+      return Graphics::BlendOp::SUBTRACT;
     case BlendEquation::REVERSE_SUBTRACT:
-      return Graphics::API::BlendOp::REVERSE_SUBTRACT;
+      return Graphics::BlendOp::REVERSE_SUBTRACT;
   }
-  return Graphics::API::BlendOp{};
+  return Graphics::BlendOp{};
+}
+
+
+struct HashedName
+{
+  std::string name;
+  size_t hash;
+};
+
+constexpr Graphics::StencilOp ConvertStencilOp( StencilOperation::Type stencilOp )
+{
+  switch( stencilOp )
+  {
+    case StencilOperation::ZERO: return Graphics::StencilOp::ZERO;
+    case StencilOperation::DECREMENT: return Graphics::StencilOp::DECREMENT_AND_CLAMP;
+    case StencilOperation::DECREMENT_WRAP: return Graphics::StencilOp::DECREMENT_AND_WRAP;
+    case StencilOperation::INCREMENT: return Graphics::StencilOp::INCREMENT_AND_CLAMP;
+    case StencilOperation::INCREMENT_WRAP: return Graphics::StencilOp::INCREMENT_AND_WRAP;
+    case StencilOperation::INVERT: return Graphics::StencilOp::INVERT;
+    case StencilOperation::KEEP: return Graphics::StencilOp::KEEP;
+    case StencilOperation::REPLACE: return Graphics::StencilOp::REPLACE;
+  }
+  return {};
+}
+
+constexpr Graphics::CompareOp ConvertStencilFunc( StencilFunction::Type stencilFunc )
+{
+  switch( stencilFunc )
+  {
+    case StencilFunction::NEVER: return Graphics::CompareOp::NEVER;
+    case StencilFunction::LESS: return Graphics::CompareOp::LESS;
+    case StencilFunction::EQUAL: return Graphics::CompareOp::EQUAL;
+    case StencilFunction::LESS_EQUAL: return Graphics::CompareOp::LESS_OR_EQUAL;
+    case StencilFunction::GREATER: return Graphics::CompareOp::GREATER;
+    case StencilFunction::NOT_EQUAL: return Graphics::CompareOp::NOT_EQUAL;
+    case StencilFunction::GREATER_EQUAL: return Graphics::CompareOp::GREATER_OR_EQUAL;
+    case StencilFunction::ALWAYS: return Graphics::CompareOp::ALWAYS;
+  }
+  return {};
+}
+
+/**
+ * Helper function writing data to the DALi shader default uniforms
+ */
+template<class T>
+bool WriteDefaultUniform( Renderer* renderer, GraphicsBuffer& ubo, const std::vector<Graphics::RenderCommand::UniformBufferBinding>& bindings, Shader::DefaultUniformIndex defaultUniformIndex, const T& data )
+{
+  auto info = renderer->GetShader().GetDefaultUniform( defaultUniformIndex );
+  if( info )
+  {
+    renderer->WriteUniform( ubo, bindings, *info, data );
+    return true;
+  }
+  return false;
+}
+
+}
+
+ClippingBox IntersectAABB( const ClippingBox& aabbA, const ClippingBox& aabbB )
+{
+  ClippingBox intersectionBox;
+
+  // First calculate the largest starting positions in X and Y.
+  intersectionBox.x = std::max( aabbA.x, aabbB.x );
+  intersectionBox.y = std::max( aabbA.y, aabbB.y );
+
+  // Now calculate the smallest ending positions, and take the largest starting
+  // positions from the result, to get the width and height respectively.
+  // If the two boxes do not intersect at all, then we need a 0 width and height clipping area.
+  // We use max here to clamp both width and height to >= 0 for this use-case.
+  intersectionBox.width =  std::max( std::min( aabbA.x + aabbA.width,  aabbB.x + aabbB.width  ) - intersectionBox.x, 0 );
+  intersectionBox.height = std::max( std::min( aabbA.y + aabbA.height, aabbB.y + aabbB.height ) - intersectionBox.y, 0 );
+
+  return intersectionBox;
 }
 
-void SubmitRenderItemList( Graphics::API::Controller&           graphics,
-                           BufferIndex                          bufferIndex,
-                           Matrix                               viewProjection,
-                           RenderInstruction&                   instruction,
-                           const RenderList&                    renderItemList )
+GraphicsAlgorithms::GraphicsAlgorithms( Graphics::Controller& controller )
+{
+  mGraphicsBufferManager.reset( new GraphicsBufferManager( &controller ) );
+}
+
+bool GraphicsAlgorithms::SetupScissorClipping( const RenderItem& item)
+{
+  // Get the number of child scissors in the stack (do not include layer or root box).
+  size_t childStackDepth = mScissorStack.size() - 1u;
+  const uint32_t scissorDepth = item.mNode->GetScissorDepth();
+  const bool clippingNode = item.mNode->GetClippingMode() == Dali::ClippingMode::CLIP_TO_BOUNDING_BOX;
+  bool traversedUpTree = false;
+
+  // If we are using scissor clipping and we are at the same depth (or less), we need to undo previous clips.
+  // We do this by traversing up the scissor clip stack and then apply the appropriate clip for the current render item.
+  // To know this, we use clippingDepth. This value is set on *every* node, but only increased as clipping nodes are hit depth-wise.
+  // So we know if we are at depth 4 and the stackDepth is 5, that we have gone up.
+  // If the depth is the same then we are effectively part of a different sub-tree from the parent, we must also remove the current clip.
+  // Note: Stack depth must always be at least 1, as we will have the layer or stage size as the root value.
+  if( ( childStackDepth > 0u ) && ( scissorDepth < childStackDepth ) )
+  {
+    while( scissorDepth < childStackDepth )
+    {
+      mScissorStack.pop_back();
+      --childStackDepth;
+    }
+
+    // We traversed up the tree, we need to apply a new scissor rectangle (unless we are at the root).
+    traversedUpTree = true;
+  }
+  if( clippingNode && childStackDepth > 0u && childStackDepth == scissorDepth ) // case of sibling clip area
+  {
+    mScissorStack.pop_back();
+    --childStackDepth;
+  }
+
+  // If we are on a clipping node, or we have traveled up the tree and gone back past a clipping node, may need to apply a new scissor clip.
+  if( clippingNode || traversedUpTree )
+  {
+    // First, check if we are a clipping node.
+    if( clippingNode )
+    {
+      // This is a clipping node. We generate the AABB for this node and intersect it with the previous intersection further up the tree.
+      // If the viewport hasn't been set, and we're rendering to a framebuffer, then
+      // set the size of the viewport to that of the framebuffer.
+      // Get the AABB bounding box for the current render item.
+      const ClippingBox scissorBox( item.CalculateViewportSpaceAABB( mScissorStack[0].width, mScissorStack[0].height ) );
+
+      // Get the AABB for the parent item that we must intersect with.
+      const ClippingBox& parentBox( mScissorStack.back() );
+
+      // We must reduce the clipping area based on the parents area to allow nested clips. This is a set intersection function.
+      // We add the new scissor box to the stack so we can return to it if needed.
+      mScissorStack.emplace_back( IntersectAABB( parentBox, scissorBox ) );
+    }
+  }
+
+  return ( mScissorStack.size() > 0u );
+}
+
+bool GraphicsAlgorithms::SetupStencilClipping( const RenderItem& item, uint32_t& lastClippingDepth, uint32_t& lastClippingId )
+{
+  const Dali::Internal::SceneGraph::Node* node = item.mNode;
+  const uint32_t clippingId = node->GetClippingId();
+  // If there is no clipping Id, then either we haven't reached a clipping Node yet, or there aren't any.
+  // Either way we can skip clipping setup for this renderer.
+  if( clippingId == 0u )
+  {
+    mCurrentStencilState = {};
+    mCurrentStencilState.stencilTestEnable = false;
+    // Exit immediately if there are no clipping actions to perform (EG. we have not yet hit a clipping node).
+    return false;
+  }
+
+  mCurrentStencilState.stencilTestEnable = true;
+
+  const uint32_t clippingDepth = node->GetClippingDepth();
+
+  // Pre-calculate a mask which has all bits set up to and including the current clipping depth.
+  // EG. If depth is 3, the mask would be "111" in binary.
+  const uint32_t currentDepthMask = ( 1u << clippingDepth ) - 1u;
+
+  //@todo clear support between draw calls
+  //item.mClearStencilEnabled = false;
+
+  // Are we are writing to the stencil buffer?
+  if( item.mNode->GetClippingMode() == Dali::ClippingMode::CLIP_CHILDREN )
+  {
+    // We are writing to the stencil buffer.
+    // If clipping Id is 1, this is the first clipping renderer within this render-list.
+    if( clippingId == 1u )
+    {
+      // We are enabling the stencil-buffer for the first time within this render list.
+      // Clear the buffer at this point.
+      mCurrentStencilState.front.writeMask = 0xff;
+      mCurrentStencilState.back.writeMask = 0xff;
+
+      // tell render item to clear stencil with specified mask
+      // using clear command
+      //@todo clear support between draw calls
+      //item.mClearStencilValue = 0xff;
+      //item.mClearStencilEnabled = true;
+    }
+    else if( ( clippingDepth < lastClippingDepth ) ||
+             ( ( clippingDepth == lastClippingDepth ) && ( clippingId > lastClippingId ) ) )
+    {
+      // The above if() statement tests if we need to clear some (not all) stencil bit-planes.
+      // We need to do this if either of the following are true:
+      //   1) We traverse up the scene-graph to a previous stencil depth
+      //   2) We are at the same stencil depth but the clipping Id has increased.
+      //
+      // This calculation takes the new depth to move to, and creates an inverse-mask of that number of consecutive bits.
+      // This has the effect of clearing everything except the bit-planes up to (and including) our current depth.
+      const uint32_t stencilClearMask = ( currentDepthMask >> 1u ) ^ 0xff;
+
+      mCurrentStencilState.front.writeMask = stencilClearMask;
+      mCurrentStencilState.back.writeMask = stencilClearMask;
+
+      //@todo clear support between draw calls
+      //item.mClearStencilValue = stencilClearMask;
+      //item.mClearStencilEnabled = true;
+    }
+
+    // We keep track of the last clipping Id and depth so we can determine when we are
+    // moving back up the scene graph and require some of the stencil bit-planes to be deleted.
+    lastClippingDepth = clippingDepth;
+    lastClippingId = clippingId;
+
+    // We only ever write to bit-planes up to the current depth as we may need
+    // to erase individual bit-planes and revert to a previous clipping area.
+    // Our reference value for testing (in StencilFunc) is written to to the buffer, but we actually
+    // want to test a different value. IE. All the bit-planes up to but not including the current depth.
+    // So we use the Mask parameter of StencilFunc to mask off the top bit-plane when testing.
+    // Here we create our test mask to innore the top bit of the reference test value.
+    // As the mask is made up of contiguous "1" values, we can do this quickly with a bit-shift.
+    const uint32_t testMask = currentDepthMask >> 1u;
+
+    mCurrentStencilState.front.compareOp = Graphics::CompareOp::EQUAL;
+    mCurrentStencilState.front.reference = currentDepthMask;
+    mCurrentStencilState.front.compareMask = testMask;
+
+    mCurrentStencilState.front.failOp = Graphics::StencilOp::KEEP;
+    mCurrentStencilState.front.depthFailOp = Graphics::StencilOp::REPLACE;
+    mCurrentStencilState.front.passOp = Graphics::StencilOp::REPLACE;
+
+    mCurrentStencilState.back = mCurrentStencilState.front;
+  }
+  else
+  {
+    // We are reading from the stencil buffer. Set up the stencil accordingly
+    // This calculation sets all the bits up to the current depth bit.
+    // This has the effect of testing that the pixel being written to exists in every bit-plane up to the current depth.
+
+    mCurrentStencilState.front.compareOp = Graphics::CompareOp::EQUAL;
+    mCurrentStencilState.front.reference = currentDepthMask;
+    mCurrentStencilState.front.compareMask = 0xff;
+
+    mCurrentStencilState.front.failOp = Graphics::StencilOp::KEEP;
+    mCurrentStencilState.front.depthFailOp = Graphics::StencilOp::KEEP;
+    mCurrentStencilState.front.passOp = Graphics::StencilOp::KEEP;
+
+    mCurrentStencilState.back = mCurrentStencilState.front;
+  }
+
+  return true;
+}
+
+void GraphicsAlgorithms::SetupClipping( const RenderItem& item,
+                                        bool& usedStencilBuffer,
+                                        uint32_t& lastClippingDepth,
+                                        uint32_t& lastClippingId )
+{
+  RenderMode::Type renderMode = RenderMode::AUTO;
+  const Renderer *renderer = item.mRenderer;
+  if( renderer )
+  {
+    renderMode = renderer->GetStencilParameters().renderMode;
+  }
+
+  // Setup the stencil using either the automatic clipping feature, or, the manual per-renderer stencil API.
+  // Note: This switch is in order of most likely value first.
+  switch( renderMode )
+  {
+    case RenderMode::AUTO:
+    {
+      // Turn the color buffer on as we always want to render this renderer, regardless of clipping hierarchy.
+
+      // The automatic clipping feature will manage the scissor and stencil functions, only if stencil buffer is available for the latter.
+      // As both scissor and stencil clips can be nested, we may be simultaneously traversing up the scissor tree, requiring a scissor to be un-done. Whilst simultaneously adding a new stencil clip.
+      // We process both based on our current and old clipping depths for each mode.
+      // Both methods with return rapidly if there is nothing to be done for that type of clipping.
+      SetupScissorClipping( item );
+
+      //if( stencilBufferAvailable == Integration::StencilBufferAvailable::TRUE )
+      {
+        SetupStencilClipping( item, lastClippingDepth, lastClippingId );
+      }
+      break;
+    }
+    case RenderMode::NONE:
+    case RenderMode::COLOR:
+    {
+#if 0
+      // No clipping is performed for these modes.
+      // Note: We do not turn off scissor clipping as it may be used for the whole layer.
+      // The stencil buffer will not be used at all, but we only need to disable it if it's available.
+      if( stencilBufferAvailable == Integration::StencilBufferAvailable::TRUE )
+      {
+        context.EnableStencilBuffer( false );
+      }
+
+      // Setup the color buffer based on the RenderMode.
+      context.ColorMask( renderMode == RenderMode::COLOR );
+#endif
+      break;
+    }
+
+    case RenderMode::STENCIL:
+    case RenderMode::COLOR_STENCIL:
+    {
+#if 0
+      if( stencilBufferAvailable == Integration::StencilBufferAvailable::TRUE )
+      {
+        // We are using the low-level Renderer Stencil API.
+        // The stencil buffer must be enabled for every renderer with stencil mode on, as renderers in between can disable it.
+        // Note: As the command state is cached, it is only sent when needed.
+        context.EnableStencilBuffer( true );
+
+        // Setup the color buffer based on the RenderMode.
+        context.ColorMask( renderMode == RenderMode::COLOR_STENCIL );
+
+        // If this is the first use of the stencil buffer within this RenderList, clear it (this avoids unnecessary clears).
+        if( !usedStencilBuffer )
+        {
+          context.Clear( GL_STENCIL_BUFFER_BIT, Context::CHECK_CACHED_VALUES );
+          usedStencilBuffer = true;
+        }
+
+        // Setup the stencil buffer based on the renderers properties.
+        context.StencilFunc( DaliStencilFunctionToGL[ renderer->GetStencilFunction() ],
+                             renderer->GetStencilFunctionReference(),
+                             renderer->GetStencilFunctionMask() );
+        context.StencilOp( DaliStencilOperationToGL[ renderer->GetStencilOperationOnFail() ],
+                           DaliStencilOperationToGL[ renderer->GetStencilOperationOnZFail() ],
+                           DaliStencilOperationToGL[ renderer->GetStencilOperationOnZPass() ] );
+        context.StencilMask( renderer->GetStencilMask() );
+      }
+#endif
+      break;
+    }
+  }
+}
+
+
+bool GraphicsAlgorithms::SetupPipelineViewportState( Graphics::ViewportState& outViewportState )
+{
+  // The scissor test is enabled if we have more than one child (the first entry is always the viewport)
+  // on the stack, or the stack is empty and there is a layer clipping box.
+  // IE. It is not enabled if we are at the top of the stack and the layer does not have a specified clipping box.
+
+  auto scissorEnabled = ( mScissorStack.size() > 1u );// || mHasLayerScissor;
+  // If scissor is enabled, we use the calculated screen-space coordinates (now in the stack).
+  if( scissorEnabled )
+  {
+    ClippingBox useScissorBox( mScissorStack.back() );
+    outViewportState.SetScissorTestEnable( true  );
+    outViewportState.SetScissor( { useScissorBox.x,
+                                int32_t(outViewportState.viewport.height - float(useScissorBox.y + useScissorBox.height) ),
+                                uint32_t(useScissorBox.width),
+                                uint32_t(useScissorBox.height) } );
+  }
+  else
+  {
+    outViewportState.SetScissorTestEnable( false );
+    outViewportState.SetScissor({});
+  }
+  return scissorEnabled;
+}
+
+void GraphicsAlgorithms::RecordRenderItemList(
+  Graphics::Controller &graphics,
+  BufferIndex bufferIndex,
+  Graphics::RenderCommand::RenderTargetBinding &renderTargetBinding,
+  Matrix viewProjection,
+  RenderInstruction &instruction,
+  const RenderList &renderItemList,
+  std::vector<Graphics::RenderCommand *> &commandList)
 {
   auto numberOfRenderItems = renderItemList.Count();
 
@@ -115,38 +484,60 @@ void SubmitRenderItemList( Graphics::API::Controller&           graphics,
   Matrix vulkanProjectionMatrix;
   Matrix::Multiply( vulkanProjectionMatrix, *projectionMatrix, CLIP_MATRIX );
 
-  std::vector<Graphics::API::RenderCommand*> commandList;
-
-  // @todo: this should be probably separated ???
-  auto renderTargetBinding = Graphics::API::RenderCommand::RenderTargetBinding{}
-  .SetClearColors( {
-                     { instruction.mClearColor.r,
-                       instruction.mClearColor.g,
-                       instruction.mClearColor.b,
-                       instruction.mClearColor.a
-                     }});
-
-
   for( auto i = 0u; i < numberOfRenderItems; ++i )
   {
     auto& item = renderItemList.GetItem( i );
+    auto renderer = item.mRenderer;
+    if( !renderer )
+    {
+      continue;
+    }
+
+    auto &renderCmd = renderer->GetRenderCommand( &instruction, bufferIndex );
+    auto &cmd = renderCmd.GetGfxRenderCommand( bufferIndex );
+
     auto color = item.mNode->GetWorldColor( bufferIndex );
 
-    for( auto j = 0u; j < item.mNode->GetRendererCount(); ++j )
+    if (cmd.GetVertexBufferBindings()
+           .empty())
+    {
+      continue;
+    }
+    cmd.BindRenderTarget( renderTargetBinding );
+
+    auto width = float(instruction.mViewport.width);
+    auto height = float(instruction.mViewport.height);
+
+    // If the viewport hasn't been set, and we're rendering to a framebuffer, then
+    // set the size of the viewport to that of the framebuffer.
+    if( !instruction.mIsViewportSet && renderTargetBinding.framebuffer != nullptr )
+    {
+      width = renderTargetBinding.framebufferWidth;
+      height = renderTargetBinding.framebufferHeight;
+    }
+    cmd.mDrawCommand.SetViewport( { float( instruction.mViewport.x ),
+                                    float( instruction.mViewport.y ),
+                                    width,
+                                    height,
+                                    0.0f , 1.0f } )
+                    .SetViewportEnable( true );
+
+    // update the uniform buffer
+    // pass shared UBO and offset, return new offset for next item to be used
+    // don't process bindings if there are no uniform buffers allocated
+    auto shader = renderer->GetShader().GetGfxObject();
+    auto ubo = mUniformBuffer[bufferIndex].get();
+    if( ubo && shader )
     {
-      auto sgRenderer = item.mNode
-                            ->GetRendererAt(j);
-      auto &cmd = sgRenderer->GetGfxRenderCommand();
-      if (cmd.GetVertexBufferBindings()
-             .empty())
+      std::vector<Graphics::RenderCommand::UniformBufferBinding>* bindings{ nullptr };
+      if( renderer->UpdateUniformBuffers( instruction, *ubo, bindings, mUboOffset, bufferIndex ) )
       {
-        continue;
+        cmd.BindUniformBuffers( bindings );
       }
-      cmd.BindRenderTarget(renderTargetBinding);
 
-      auto opacity = sgRenderer->GetOpacity( bufferIndex );
+      auto opacity = renderer->GetOpacity( bufferIndex );
 
-      if( sgRenderer->IsPreMultipliedAlphaEnabled() )
+      if( renderer->IsPreMultipliedAlphaEnabled() )
       {
         float alpha = color.a * opacity;
         color = Vector4( color.r * alpha, color.g * alpha, color.b * alpha, alpha );
@@ -156,35 +547,41 @@ void SubmitRenderItemList( Graphics::API::Controller&           graphics,
         color.a *= opacity;
       }
 
+      // we know bindings for this render item, so we can use 'offset' and write additional
+      // uniforms
       Matrix mvp, mvp2;
       Matrix::Multiply(mvp, item.mModelMatrix, viewProjection);
       Matrix::Multiply(mvp2, mvp, CLIP_MATRIX);
-      sgRenderer->WriteUniform("uModelMatrix", item.mModelMatrix);
-      sgRenderer->WriteUniform("uMvpMatrix", mvp2);
-      sgRenderer->WriteUniform("uViewMatrix", *viewMatrix);
-      sgRenderer->WriteUniform("uModelView", item.mModelViewMatrix);
-
-      Matrix3 uNormalMatrix( item.mModelViewMatrix );
-      uNormalMatrix.Invert();
-      uNormalMatrix.Transpose();
 
-      sgRenderer->WriteUniform("uNormalMatrix", uNormalMatrix);
-      sgRenderer->WriteUniform("uProjection", vulkanProjectionMatrix);
-      sgRenderer->WriteUniform("uSize", item.mSize);
-      sgRenderer->WriteUniform("uColor", color );
+      WriteDefaultUniform( renderer, *ubo, *bindings, Shader::DefaultUniformIndex::MODEL_MATRIX, item.mModelMatrix );
+      WriteDefaultUniform( renderer, *ubo, *bindings, Shader::DefaultUniformIndex::MVP_MATRIX, mvp2 );
+      WriteDefaultUniform( renderer, *ubo, *bindings, Shader::DefaultUniformIndex::VIEW_MATRIX, *viewMatrix );
+      WriteDefaultUniform( renderer, *ubo, *bindings, Shader::DefaultUniformIndex::MODEL_VIEW_MATRIX, item.mModelViewMatrix );
+      WriteDefaultUniform( renderer, *ubo, *bindings, Shader::DefaultUniformIndex::PROJECTION_MATRIX, vulkanProjectionMatrix );
+      WriteDefaultUniform( renderer, *ubo, *bindings, Shader::DefaultUniformIndex::SIZE, item.mSize );
+      WriteDefaultUniform( renderer, *ubo, *bindings, Shader::DefaultUniformIndex::COLOR, color );
 
-      commandList.push_back(&cmd);
+      // Update normal matrix only when used in the shader
+      if( renderer->GetShader().GetDefaultUniform( Shader::DefaultUniformIndex::NORMAL_MATRIX ) )
+      {
+        Matrix3 uNormalMatrix( item.mModelViewMatrix );
+        uNormalMatrix.Invert();
+        uNormalMatrix.Transpose();
+        WriteDefaultUniform( renderer, *ubo, *bindings, Shader::DefaultUniformIndex::NORMAL_MATRIX, uNormalMatrix );
+      }
     }
-  }
 
-  graphics.SubmitCommands( std::move(commandList) );
+    commandList.push_back(&cmd);
+  }
 }
 
-void SubmitInstruction( Graphics::API::Controller& graphics,
-                        BufferIndex                bufferIndex,
-                        RenderInstruction&         instruction )
+void GraphicsAlgorithms::RecordInstruction(
+  Graphics::Controller& graphics,
+  BufferIndex bufferIndex,
+  RenderInstruction& instruction,
+  std::vector<Graphics::RenderCommand*>& commandList)
 {
-  using namespace Graphics::API;
+  using namespace Graphics;
 
   // Create constant buffer with static uniforms: view matrix, projection matrix
   const Matrix* viewMatrix       = instruction.GetViewMatrix( bufferIndex );
@@ -192,236 +589,468 @@ void SubmitInstruction( Graphics::API::Controller& graphics,
   Matrix        viewProjection;
   Matrix::Multiply( viewProjection, *viewMatrix, *projectionMatrix );
 
+
+  auto renderTargetBinding = Graphics::RenderCommand::RenderTargetBinding{}
+  .SetClearColors( {{ instruction.mClearColor.r,
+                    instruction.mClearColor.g,
+                    instruction.mClearColor.b,
+                    instruction.mClearColor.a }} );
+
+  if( !instruction.mIgnoreRenderToFbo )
+  {
+    if( instruction.mFrameBuffer != 0 )
+    {
+      renderTargetBinding.SetFramebuffer( instruction.mFrameBuffer->GetGfxObject());
+      // Store the size of the framebuffer in case the viewport isn't set.
+      renderTargetBinding.framebufferWidth = float(instruction.mFrameBuffer->GetWidth());
+      renderTargetBinding.framebufferHeight = float(instruction.mFrameBuffer->GetHeight());
+    }
+  }
+
   auto numberOfRenderLists = instruction.RenderListCount();
   for( auto i = 0u; i < numberOfRenderLists; ++i )
   {
-    SubmitRenderItemList(
-      graphics, bufferIndex, viewProjection, instruction, *instruction.GetRenderList( i ) );
+    RecordRenderItemList( graphics, bufferIndex, renderTargetBinding,
+                          viewProjection, instruction, *instruction.GetRenderList(i),
+                          commandList );
   }
 }
-} // namespace
-
 
-
-bool PrepareGraphicsPipeline( Graphics::API::Controller& controller,
+bool GraphicsAlgorithms::PrepareGraphicsPipeline( Graphics::Controller& controller,
                               RenderInstruction& instruction,
                               const RenderList* renderList,
                               RenderItem& item,
+                              bool& usesDepth,
+                              bool& usesStencil,
                               BufferIndex bufferIndex )
 {
-  using namespace Dali::Graphics::API;
+  using namespace Dali::Graphics;
 
-  // for each renderer within node
-  for( auto rendererIndex = 0u; rendererIndex < item.mNode->GetRendererCount(); ++rendererIndex )
-  {
-    // vertex input state
-    VertexInputState vi{};
+  const uint32_t UBO_ALIGNMENT = 256u;
+
+  // vertex input state
+  VertexInputState vi{};
+
+  auto *renderer = item.mRenderer;
+  auto &renderCmd = renderer->GetRenderCommand( &instruction, bufferIndex );
+  auto &cmd = renderCmd.GetGfxRenderCommand( bufferIndex );
+  auto *geometry = renderer->GetGeometry();
+  auto gfxShader = renderer->GetShader().GetGfxObject();
 
-    auto *renderer = item.mNode->GetRendererAt(rendererIndex);
-    auto *geometry = renderer->GetGeometry();
-    auto gfxShader = renderer->GetShader()
-                             .GetGfxObject();
+  if( !gfxShader )
+  {
+    return false;
+  }
 
-    if( !gfxShader.Exists() )
+  // Update allocation requirements
+  mUniformBlockAllocationCount += gfxShader->GetUniformBlockCount();
+  for( auto i = 0u; i < gfxShader->GetUniformBlockCount(); ++i )
+  {
+    auto size = gfxShader->GetUniformBlockSize( i );
+    auto blockSize = (( size / UBO_ALIGNMENT ) + ( ( size % UBO_ALIGNMENT ) ? 1 : 0 )) * UBO_ALIGNMENT;
+    if( mUniformBlockMaxSize < blockSize )
     {
-      continue;
+      mUniformBlockMaxSize = blockSize;
     }
-    /**
-     * Prepare vertex attribute buffer bindings
-     */
-    uint32_t                                                    bindingIndex{0u};
-    std::vector<Graphics::API::Accessor<Graphics::API::Buffer>> vertexBuffers{};
+    mUniformBlockAllocationBytes += blockSize;
+  }
 
-    for (auto &&vertexBuffer : geometry->GetVertexBuffers())
-    {
-      vertexBuffers.push_back(vertexBuffer->GetGfxObject());
-      auto attributeCountInForBuffer = vertexBuffer->GetAttributeCount();
+  /**
+   * Prepare vertex attribute buffer bindings
+   */
+  uint32_t bindingIndex{0u};
+  std::vector<Graphics::Buffer*> vertexBuffers{};
 
-      // update vertex buffer if necessary
-      vertexBuffer->Update(controller);
+  for (auto &&vertexBuffer : geometry->GetVertexBuffers())
+  {
+    vertexBuffers.push_back(vertexBuffer->GetGfxObject());
+    auto attributeCountInForBuffer = vertexBuffer->GetAttributeCount();
 
-      // store buffer binding
-      vi.bufferBindings
-        .emplace_back(vertexBuffer->GetFormat()
-                                  ->size, VertexInputRate::PER_VERTEX);
+    // update vertex buffer if necessary
+    vertexBuffer->Update(controller);
 
-      for (auto i = 0u; i < attributeCountInForBuffer; ++i)
-      {
-        // create attribute description
-        vi.attributes
-          .emplace_back(
-            gfxShader.Get()
-                     .GetVertexAttributeLocation(vertexBuffer->GetAttributeName(i)),
-            bindingIndex, (vertexBuffer->GetFormat()
-                                       ->components[i]).offset,
-            VertexInputFormat::UNDEFINED);
+    // store buffer binding
+    vi.bufferBindings
+      .emplace_back(vertexBuffer->GetFormat()
+                                ->size, VertexInputRate::PER_VERTEX);
+
+    for (auto i = 0u; i < attributeCountInForBuffer; ++i)
+    {
+      // create attribute description
+      vi.attributes
+        .emplace_back(
+          gfxShader->GetVertexAttributeLocation(vertexBuffer->GetAttributeName(i)),
+          bindingIndex, (vertexBuffer->GetFormat()
+                                     ->components[i]).offset,
+          VertexInputFormat::UNDEFINED);
 
-      }
-      bindingIndex++;
     }
+    bindingIndex++;
+  }
 
-    // Invalid input attributes!
-    if (gfxShader
-          .Get()
-          .GetVertexAttributeLocations()
-          .size() != vi.attributes
-                       .size())
-      continue; // incompatible pipeline!
-
-    // set optional index buffer
-    auto topology         = PrimitiveTopology::TRIANGLE_STRIP;
-    auto geometryTopology = geometry->GetType();
-    switch (geometryTopology)
+  // set optional index buffer
+  auto topology         = PrimitiveTopology::TRIANGLE_STRIP;
+  auto geometryTopology = geometry->GetType();
+  switch (geometryTopology)
+  {
+    case Dali::Geometry::Type::TRIANGLE_STRIP:
     {
-      case Dali::Geometry::Type::TRIANGLE_STRIP:
-      {
-        topology = PrimitiveTopology::TRIANGLE_STRIP;
-        break;
-      }
-      default:
-      {
-        topology = PrimitiveTopology::TRIANGLE_LIST;
-      }
+      topology = PrimitiveTopology::TRIANGLE_STRIP;
+      break;
     }
-
-    /**
-     * 1. DEPTH MDOE
-     */
-    // use correct depth mode
-    DepthStencilState depthStencilState;
-    depthStencilState.SetDepthTestEnable(false)
-                     .SetDepthCompareOp(CompareOp::GREATER_OR_EQUAL);
-
-    if ((renderer->GetDepthTestMode() == DepthTestMode::AUTO && !renderList->GetSourceLayer()
-                                                                           ->IsDepthTestDisabled())
-        || (renderer->GetDepthTestMode() == DepthTestMode::ON))
+    case Dali::Geometry::Type::LINE_LOOP:
+    case Dali::Geometry::Type::LINE_STRIP:
     {
-      depthStencilState.SetDepthTestEnable(true);
-      if (renderer->GetDepthWriteMode() == DepthWriteMode::ON)
-      {
-        depthStencilState.SetDepthWriteEnable(true);
-      }
+      topology = PrimitiveTopology::LINE_STRIP;
+      break;
     }
-
-    /**
-     * 2. BLENDING
-     */
-    ColorBlendState colorBlendState{};
-    colorBlendState.SetBlendEnable(false);
-    if( renderer->GetBlendMode() != BlendMode::OFF)
+    case Dali::Geometry::Type::LINES:
     {
-      colorBlendState.SetBlendEnable(true);
-      const auto& options = renderer->GetBlendingOptions();
-      colorBlendState
-        .SetSrcColorBlendFactor(ConvertBlendFactor(options.GetBlendSrcFactorRgb()))
-        .SetSrcAlphaBlendFactor(ConvertBlendFactor(options.GetBlendSrcFactorAlpha()))
-        .SetDstColorBlendFactor(ConvertBlendFactor(options.GetBlendDestFactorRgb()))
-        .SetDstAlphaBlendFactor(ConvertBlendFactor(options.GetBlendDestFactorAlpha()))
-        .SetColorBlendOp(ConvertBlendEquation(options.GetBlendEquationRgb()))
-        .SetAlphaBlendOp(ConvertBlendEquation(options.GetBlendEquationAlpha()));
+      topology = PrimitiveTopology::LINE_LIST;
+      break;
     }
-
-    /**
-     * 3. VIEWPORT
-     */
-    ViewportState viewportState{};
-    if (instruction.mIsViewportSet)
+    case Dali::Geometry::Type::TRIANGLE_FAN:
+    {
+      topology = PrimitiveTopology::TRIANGLE_FAN;
+      break;
+    }
+    case Dali::Geometry::Type::POINTS:
     {
-      viewportState.SetViewport({float(instruction.mViewport
-                                                  .x), float(instruction.mViewport
-                                                                        .y),
-                                  float(instruction.mViewport
-                                                   .width), float(instruction.mViewport
-                                                                             .height),
-                                  0.0, 1.0});
+      topology = PrimitiveTopology::POINT_LIST;
+      break;
     }
-    else
+    case Dali::Geometry::Type::TRIANGLES:
     {
-      viewportState.SetViewport({0.0, 0.0, 0.0, 0.0,
-                                  0.0, 1.0});
+      topology = PrimitiveTopology::TRIANGLE_LIST;
+      break;
     }
+    default:
+    {
+      topology = PrimitiveTopology::TRIANGLE_LIST;
+    }
+  }
+
+  /**
+   * 1. DEPTH MDOE
+   */
+  // use correct depth mode
+  DepthStencilState depthStencilState;
+  depthStencilState.SetDepthCompareOp( CompareOp::GREATER );
+
+  const bool depthTestEnable( !renderList->GetSourceLayer()->IsDepthTestDisabled() && renderList->HasColorRenderItems() );
+
+  const bool enableDepthWrite = ( ( renderer->GetDepthWriteMode() == DepthWriteMode::AUTO )
+                                  && depthTestEnable && item.mIsOpaque ) ||
+                                ( renderer->GetDepthWriteMode() == DepthWriteMode::ON );
+
+  // Set up whether or not to read from (test) the depth buffer.
+  const DepthTestMode::Type depthTestMode = item.mRenderer->GetDepthTestMode();
+
+  // Most common mode (AUTO) is tested first.
+  const bool enableDepthTest = ( ( depthTestMode == DepthTestMode::AUTO ) && depthTestEnable ) ||
+                               ( depthTestMode == DepthTestMode::ON );
+
+  depthStencilState.SetDepthTestEnable( enableDepthTest );
+  depthStencilState.SetDepthWriteEnable( enableDepthWrite );
+
+  if( !usesDepth && (enableDepthTest || enableDepthWrite) )
+  {
+    usesDepth = true; // set out-value to indicate at least 1 pipeline uses depth buffer
+  }
 
+  // Stencil setup
+  bool stencilEnabled = mCurrentStencilState.stencilTestEnable;
 
-    // create pipeline
-    auto pipeline = controller.CreatePipeline(controller.GetPipelineFactory()
+  if( !usesStencil && stencilEnabled )
+  {
+    usesStencil = true; // set out-value to indicate at least 1 pipeline uses stencil buffer
+  }
+
+  if( stencilEnabled)
+  {
+    depthStencilState
+      .SetStencilTestEnable( mCurrentStencilState.stencilTestEnable )
+      .SetFront( mCurrentStencilState.front )
+      .SetBack( mCurrentStencilState.back );
+  }
+
+  /**
+   * 2. BLENDING
+   */
+  ColorBlendState colorBlendState{};
+  colorBlendState.SetBlendEnable(false);
+
+  if( !item.mIsOpaque )
+  {
+    colorBlendState.SetBlendEnable(true);
+    const auto& options = renderer->GetBlendingOptions();
+    colorBlendState
+      .SetSrcColorBlendFactor(ConvertBlendFactor(options.GetBlendSrcFactorRgb()))
+      .SetSrcAlphaBlendFactor(ConvertBlendFactor(options.GetBlendSrcFactorAlpha()))
+      .SetDstColorBlendFactor(ConvertBlendFactor(options.GetBlendDestFactorRgb()))
+      .SetDstAlphaBlendFactor(ConvertBlendFactor(options.GetBlendDestFactorAlpha()))
+      .SetColorBlendOp(ConvertBlendEquation(options.GetBlendEquationRgb()))
+      .SetAlphaBlendOp(ConvertBlendEquation(options.GetBlendEquationAlpha()));
+  }
 
-                // vertex input
-              .SetVertexInputState(vi)
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "PrepareGraphicsPipeline(renderer=%p), opaque:%s, blendMode:%d  => Blending:%s\n", item.mRenderer, item.mIsOpaque?"T":"F", renderer->GetBlendMode(), colorBlendState.blendEnable?"T":"F" );
+  /**
+   * 3. VIEWPORT
+   */
+  ViewportState viewportState{};
 
-                // shaders
-              .SetShaderState(ShaderState()
-                                .SetShaderProgram(gfxShader.Get()))
+  // Set viewport only when not using dynamic viewport state
+  if( !cmd.GetDrawCommand().viewportEnable && instruction.mIsViewportSet )
+  {
+    // scissor test only when we have viewport
+    viewportState.SetViewport({ float(instruction.mViewport.x), float(instruction.mViewport.y),
+                                float(instruction.mViewport.width), float(instruction.mViewport.height),
+                                0.0, 1.0});
+  }
+  else
+  {
+    // Use zero-size viewport for dynamic viewport or viewport-less state
+    viewportState.SetViewport( { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 } );
+  }
 
-                // input assembly
-              .SetInputAssemblyState(InputAssemblyState()
-                                       .SetTopology(topology)
-                                       .SetPrimitiveRestartEnable(true))
+  FramebufferState framebufferState{};
+  if( instruction.mFrameBuffer )
+  {
+    framebufferState.SetFramebuffer( *instruction.mFrameBuffer->GetGfxObject() );
+  }
 
-                // viewport ( if zeroes then framebuffer size used )
-              .SetViewportState(viewportState)
+  /**
+   * Scissor test is represented only by the dynamic state as it can be transformed
+   * any time.
+   */
+  Graphics::PipelineDynamicStateMask dynamicStateMask{ 0u };
 
-                // depth stencil
-              .SetDepthStencilState(depthStencilState)
+  if( SetupPipelineViewportState( viewportState) )
+  {
+    cmd.mDrawCommand.SetScissor( viewportState.scissor );
+    cmd.mDrawCommand.SetScissorTestEnable( true );
+    dynamicStateMask = Graphics::PipelineDynamicStateBits::SCISSOR_BIT;
+  }
+  else
+  {
+    cmd.mDrawCommand.SetScissorTestEnable( false );
+  }
 
+  // todo: make it possible to decide earlier whether we want dynamic or static viewport
+  dynamicStateMask |= Graphics::PipelineDynamicStateBits::VIEWPORT_BIT;
 
-                // color blend
-              .SetColorBlendState(colorBlendState
-                                    .SetColorComponentsWriteBits(0xff)
-                                    .SetLogicOpEnable(false))
+  // reset pipeline's viewport to prevent hashing function changing due to animated values.
+  viewportState.SetViewport({0.0, 0.0, 0.0, 0.0, 0.0, 1.0});
 
-                // rasterization
-              .SetRasterizationState(RasterizationState()
-                                       .SetCullMode(CullMode::NONE)
-                                       .SetPolygonMode(PolygonMode::FILL)
-                                       .SetFrontFace(FrontFace::CLOCKWISE)));
+  // disable scissors per-pipeline
+  viewportState.SetScissorTestEnable( false );
+  viewportState.SetScissor( {} );
 
-    // bind pipeline to the renderer
-    renderer->BindPipeline(std::move(pipeline));
+  // set face culling
+  auto cullMode { CullMode::NONE };
+  switch( renderer->GetFaceCullingMode() )
+  {
+    case FaceCullingMode::BACK:
+    {
+      cullMode = CullMode::BACK;
+      break;
+    }
+    case FaceCullingMode::FRONT:
+    {
+      cullMode = CullMode::FRONT;
+      break;
+    }
+    case FaceCullingMode::FRONT_AND_BACK:
+    {
+      cullMode = CullMode::FRONT_AND_BACK;
+      break;
+    }
+    case FaceCullingMode::NONE:
+    {
+      cullMode = CullMode::NONE;
+    }
   }
 
+  // create pipeline
+  auto pipeline = controller.CreatePipeline( controller.GetPipelineFactory()
+            .SetOldPipeline( renderer->ReleaseGraphicsPipeline( bufferIndex, &instruction) ) // set old pipeline
+
+            // vertex input
+            .SetVertexInputState(vi)
+
+            // shaders
+            .SetShaderState( ShaderState()
+                              .SetShaderProgram(*gfxShader))
+
+            // input assembly
+            .SetInputAssemblyState( InputAssemblyState()
+                                     .SetTopology(topology)
+                                     .SetPrimitiveRestartEnable(false))
+
+            // viewport ( if zeroes then framebuffer size used )
+            .SetViewportState( viewportState )
+
+            .SetFramebufferState( framebufferState )
+
+            // depth stencil
+            .SetDepthStencilState( depthStencilState )
+
+            // color blend
+            .SetColorBlendState( colorBlendState
+                                  .SetColorComponentsWriteBits(0xff)
+                                  .SetLogicOpEnable(false))
+
+            // rasterization
+            .SetRasterizationState( RasterizationState()
+                                     .SetCullMode(cullMode)
+                                     .SetPolygonMode(PolygonMode::FILL)
+                                     .SetFrontFace(FrontFace::COUNTER_CLOCKWISE))
+
+            // dynamic state mask
+            .SetDynamicStateMask( dynamicStateMask )
+  );
+
+
+  // bind pipeline to the render command
+  renderer->BindPipeline( std::move(pipeline), bufferIndex, &instruction );
   return true;
 }
 
-void PrepareRendererPipelines( Graphics::API::Controller& controller,
-                               RenderInstructionContainer& renderInstructions,
-                               BufferIndex bufferIndex )
+
+void GraphicsAlgorithms::PrepareRendererPipelines( Graphics::Controller& controller,
+                                                   RenderInstructionContainer& renderInstructions,
+                                                   bool& usesDepth,
+                                                   bool& usesStencil,
+                                                   BufferIndex bufferIndex )
 {
+
+  mUniformBlockAllocationCount = 0u;
+  mUniformBlockAllocationBytes = 0u;
+  mUniformBlockMaxSize = 0u;
+
   for( auto i = 0u; i < renderInstructions.Count( bufferIndex ); ++i )
   {
     RenderInstruction &ri = renderInstructions.At(bufferIndex, i);
+
     for (auto renderListIndex = 0u; renderListIndex < ri.RenderListCount(); ++renderListIndex)
     {
       const auto *renderList = ri.GetRenderList(renderListIndex);
+
+      // Reset scissor stack
+      mScissorStack.clear();
+      mScissorStack.push_back( ri.mViewport );
+
+      // Reset stencil state
+      mCurrentStencilState = {};
+
+      uint32_t lastClippingDepth( 0u );
+      uint32_t lastClippingId( 0u );
+      bool usedStencilBuffer( false );
+
       for (auto renderItemIndex = 0u; renderItemIndex < renderList->Count(); ++renderItemIndex)
       {
         auto &item = renderList->GetItem(renderItemIndex);
-        PrepareGraphicsPipeline(controller, ri, renderList, item, bufferIndex);
+
+        // setup clipping for item
+        SetupClipping( item, usedStencilBuffer, lastClippingDepth, lastClippingId );
+
+        if( item.mRenderer )
+        {
+          PrepareGraphicsPipeline( controller, ri, renderList, item, usesDepth, usesStencil, bufferIndex );
+        }
       }
     }
   }
 }
 
-void SubmitRenderInstructions( Graphics::API::Controller&  controller,
-                               RenderInstructionContainer& renderInstructions,
-                               BufferIndex                 bufferIndex )
+void GraphicsAlgorithms::SubmitRenderInstructions(
+  Graphics::Controller&  controller,
+  RenderInstructionContainer& renderInstructions,
+  BufferIndex                 bufferIndex )
 {
-  PrepareRendererPipelines( controller, renderInstructions, bufferIndex );
+  bool usesDepth = false;
+  bool usesStencil = false;
+
+  PrepareRendererPipelines( controller, renderInstructions, usesDepth, usesStencil, bufferIndex );
+
+  // If state of depth/stencil has changed between frames then the pipelines must be
+  // prepared again. Note, this stage does not recompile shader but collects necessary
+  // data to compile pipelines at the further stage.
+  if( controller.EnableDepthStencilBuffer( usesDepth, usesStencil ) )
+  {
+    PrepareRendererPipelines( controller, renderInstructions, usesDepth, usesStencil, bufferIndex );
+  }
 
   auto numberOfInstructions = renderInstructions.Count( bufferIndex );
 
+  // Prepare uniform buffers
+  if( !mGraphicsBufferManager )
+  {
+    mGraphicsBufferManager.reset( new GraphicsBufferManager( &controller ) );
+  }
+
   controller.BeginFrame();
 
-  for( size_t i = 0; i < numberOfInstructions; ++i )
+  auto pagedAllocation = ( ( mUniformBlockAllocationBytes / UBO_PAGE_SIZE + 1u ) ) * UBO_PAGE_SIZE;
+
+  // Allocate twice memory as required by the uniform buffers
+  // todo: memory usage backlog to use optimal allocation
+  if( mUniformBlockAllocationBytes && !mUniformBuffer[bufferIndex] )
+  {
+    mUniformBuffer[bufferIndex] = std::move( mGraphicsBufferManager->AllocateUniformBuffer( pagedAllocation ) );
+  }
+  else if( mUniformBlockAllocationBytes && (
+    mUniformBuffer[bufferIndex]->GetSize() < pagedAllocation ||
+    (pagedAllocation < uint32_t(float(mUniformBuffer[bufferIndex]->GetSize()) * UBO_SHRINK_THRESHOLD ))))
+  {
+    mUniformBuffer[bufferIndex]->Reserve( pagedAllocation, true );
+  }
+
+  // Clear UBO
+  if( mUniformBuffer[bufferIndex] )
+  {
+    mUniformBuffer[bufferIndex]->Fill( 0, 0u, 0u );
+  }
+
+  mUboOffset = 0u;
+
+  std::vector<Graphics::RenderCommand*> commandList{};
+
+  for( uint32_t i = 0; i < numberOfInstructions; ++i )
   {
     RenderInstruction& instruction = renderInstructions.At( bufferIndex, i );
 
-    SubmitInstruction( controller, bufferIndex, instruction );
+    RecordInstruction(controller, bufferIndex, instruction, commandList);
+  }
+
+  // Submit all render commands in one go
+  controller.SubmitCommands( std::move(commandList) );
+
+  if( mUniformBlockAllocationBytes && mUniformBuffer[bufferIndex] )
+  {
+    mUniformBuffer[bufferIndex]->Flush();
   }
 
   controller.EndFrame();
+
+  mCurrentFrameIndex++;
+}
+
+void GraphicsAlgorithms::DiscardUnusedResources( Graphics::Controller& controller )
+{
+  // wait for queues to be idle
+  controller.WaitIdle();
+
+  // Destroy Uniform buffers
+  for( auto& ubo : mUniformBuffer )
+  {
+    ubo.reset( nullptr );
+  }
+
+  // Discard unused resources
+  controller.DiscardUnusedResources();
 }
 
 } // namespace SceneGraph
 } // namespace Internal
 } // namespace Dali
-
index cebb9ac..1bd0073 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_GRAPHICS_ALGORITHMS_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,9 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/update/rendering/render-instruction-container.h>
+#include <dali/internal/update/rendering/render-instruction.h>
 #include <dali/internal/common/buffer-index.h>
+#include <dali/internal/update/graphics/graphics-buffer-manager.h>
 
 namespace Dali
 {
@@ -31,10 +33,93 @@ namespace Internal
 {
 namespace SceneGraph
 {
-void SubmitRenderInstructions( Graphics::API::Controller& graphics,
-                               SceneGraph::RenderInstructionContainer& renderInstructions,
-                               BufferIndex                 bufferIndex );
+class UniformBuffer;
+class GraphicsAlgorithms
+{
+public:
+
+  GraphicsAlgorithms() = delete;
+  explicit GraphicsAlgorithms( Graphics::Controller& controller );
+
+  ~GraphicsAlgorithms() = default;
+
+  GraphicsAlgorithms(const GraphicsAlgorithms&) = delete;
+  GraphicsAlgorithms& operator=(const GraphicsAlgorithms&) = delete;
+
+  GraphicsAlgorithms(GraphicsAlgorithms&&) = default;
+  GraphicsAlgorithms& operator=(GraphicsAlgorithms&&) = default;
+
+
+  /**
+   * Submits render instructions
+   * @param graphics Instance of the Graphics object
+   * @param renderInstructions container of render instructions
+   * @param bufferIndex current buffer index
+   */
+  void SubmitRenderInstructions( Graphics::Controller &graphics,
+                                 SceneGraph::RenderInstructionContainer &renderInstructions,
+                                 BufferIndex bufferIndex );
+
+  void DiscardUnusedResources( Graphics::Controller& controller );
+
+private:
+
+  bool SetupScissorClipping( const RenderItem& item );
+
+  bool SetupStencilClipping( const RenderItem& item, uint32_t& lastClippingDepth, uint32_t& lastClippingId );
+
+  void SetupClipping( const RenderItem& item,
+                            bool& usedStencilBuffer,
+                            uint32_t& lastClippingDepth,
+                            uint32_t& lastClippingId );
+
+
+  bool SetupPipelineViewportState( Graphics::ViewportState& outViewportState );
+
+  void RecordRenderItemList( Graphics::Controller& graphics,
+                             BufferIndex bufferIndex,
+                             Graphics::RenderCommand::RenderTargetBinding& renderTargetBinding,
+                             Matrix viewProjection,
+                             RenderInstruction& instruction,
+                             const RenderList& renderItemList,
+                             std::vector<Graphics::RenderCommand*>& commandList);
+
+  void RecordInstruction( Graphics::Controller& graphics,
+                          BufferIndex bufferIndex,
+                          RenderInstruction& instruction,
+                          std::vector<Graphics::RenderCommand*>& commandList);
+
+  bool PrepareGraphicsPipeline( Graphics::Controller& controller,
+                                RenderInstruction& instruction,
+                                const RenderList* renderList,
+                                RenderItem& item,
+                                bool& usesDepth,
+                                bool& usesStencil,
+                                BufferIndex bufferIndex );
+
+  void PrepareRendererPipelines( Graphics::Controller& controller,
+                                 RenderInstructionContainer& renderInstructions,
+                                 bool& usesDepth,
+                                 bool& usesStencil,
+                                 BufferIndex bufferIndex );
+
+  using ScissorStackType = std::vector<Dali::ClippingBox>;      ///< The container type used to maintain the applied scissor hierarchy
+
+  ScissorStackType                        mScissorStack{};        ///< Contains the currently applied scissor hierarchy (so we can undo clips)
+
+  std::unique_ptr<GraphicsBufferManager> mGraphicsBufferManager;
+
+  using UniformBufferList = std::array<std::unique_ptr<GraphicsBuffer>, 2u>;
+  UniformBufferList           mUniformBuffer;
+
+  uint32_t mUniformBlockAllocationCount;
+  uint32_t mUniformBlockAllocationBytes;
+  uint32_t mUniformBlockMaxSize;
+  uint32_t mUboOffset { 0u };
+  uint32_t mCurrentFrameIndex { 0u };
 
+  Dali::Graphics::DepthStencilState mCurrentStencilState{};
+};
 } // namespace SceneGraph
 } // namespace Internal
 } // namespace Dali
diff --git a/dali/internal/update/graphics/graphics-buffer-manager.cpp b/dali/internal/update/graphics/graphics-buffer-manager.cpp
new file mode 100644 (file)
index 0000000..016cea6
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "graphics-buffer-manager.h"
+#include <dali/graphics-api/graphics-api-buffer-factory.h>
+#include <dali/graphics-api/graphics-api-buffer.h>
+
+#include <memory>
+#include <cstring>
+
+
+namespace Dali
+{
+namespace Internal
+{
+namespace SceneGraph
+{
+
+GraphicsBuffer::GraphicsBuffer(
+        Dali::Graphics::Controller* controller,
+        uint32_t sizeInBytes,
+        uint32_t alignment,
+        bool persistentMappedEnabled,
+        Graphics::BufferUsageFlags usageFlags )
+: mController( controller ),
+  mSize( 0u ),
+  mMappedPtr( nullptr ),
+  mPersistentMappedEnabled( persistentMappedEnabled ),
+  mUsageFlags( usageFlags )
+{
+  if( sizeInBytes )
+  {
+    Reserve( sizeInBytes, false );
+  }
+}
+
+GraphicsBuffer::~GraphicsBuffer()
+{
+  if( mBuffer && mMappedPtr )
+  {
+    mBuffer->Unmap();
+  }
+}
+
+void GraphicsBuffer::Flush()
+{
+  mBuffer->Flush();
+}
+
+void GraphicsBuffer::Reserve(uint32_t size, bool discardOldBuffer )
+{
+  if( mBuffer && mMappedPtr )
+  {
+    mBuffer->Unmap();
+    mMappedPtr = nullptr;
+
+    if( discardOldBuffer )
+    {
+      mController->WaitIdle();
+      mBuffer->DestroyNow();
+    }
+  }
+
+  mSize = size;
+  mBuffer = std::move(
+    mController->CreateBuffer( mController->GetBufferFactory()
+                                          .SetSize( mSize )
+                                          .SetUsageFlags( mUsageFlags ) )
+  );
+
+  if( mPersistentMappedEnabled )
+  {
+    mMappedPtr = mBuffer->Map();
+  }
+}
+
+
+void GraphicsBuffer::Fill( char data, uint32_t offset, uint32_t size )
+{
+  auto begin = (reinterpret_cast<char*>( mMappedPtr ) + offset);
+  if( size == 0 )
+  {
+    size = mSize - offset-1;
+  }
+  auto end = begin + size;
+  std::fill( begin, end, data );
+}
+
+void GraphicsBuffer::Write( const void* data, uint32_t size, uint32_t dstOffset, bool cachedWrite )
+{
+  bool locallyMapped = ( mMappedPtr == nullptr );
+  if(locallyMapped)
+  {
+    Map();
+  }
+  if(mMappedPtr)
+  {
+    std::memcpy( reinterpret_cast<char*>( mMappedPtr )+dstOffset, data, size );
+  }
+  if(locallyMapped)
+  {
+    Unmap();
+  }
+}
+
+
+void* GraphicsBuffer::Map()
+{
+  if( !mMappedPtr )
+  {
+    mMappedPtr = mBuffer->Map();
+  }
+  return mMappedPtr;
+}
+
+void GraphicsBuffer::Unmap()
+{
+  if( mMappedPtr )
+  {
+    mBuffer->Unmap();
+  }
+}
+
+GraphicsBufferManager::GraphicsBufferManager( Dali::Graphics::Controller* controller )
+: mController( controller )
+{
+}
+
+GraphicsBufferManager::~GraphicsBufferManager() = default;
+
+std::unique_ptr<GraphicsBuffer> GraphicsBufferManager::AllocateUniformBuffer( uint32_t size )
+{
+
+  return std::unique_ptr<GraphicsBuffer>(
+    new GraphicsBuffer( mController, size, 256u, true, Dali::Graphics::BufferUsageFlags{0u} |
+                                                            Dali::Graphics::BufferUsage::TRANSFER_DST |
+                                                            Dali::Graphics::BufferUsage::UNIFORM_BUFFER )
+  );
+}
+
+} // namespace SceneGraph
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/update/graphics/graphics-buffer-manager.h b/dali/internal/update/graphics/graphics-buffer-manager.h
new file mode 100644 (file)
index 0000000..6bf3365
--- /dev/null
@@ -0,0 +1,167 @@
+#ifndef DALI_INTERNAL_GRAPHICS_UNIFORM_BUFFER_MANAGER_H
+#define DALI_INTERNAL_GRAPHICS_UNIFORM_BUFFER_MANAGER_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/graphics-api/graphics-api-controller.h>
+
+#include <memory>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace SceneGraph
+{
+
+class GraphicsBuffer
+{
+  friend class GraphicsBufferManager;
+private:
+
+  /**
+   * Constructor of GraphicsBuffer
+   *
+   * @param[in] mController Pointer to the controller object
+   * @param[in] sizeInBytes initial size of allocated buffer
+   * @param[in] alignment memory alignment in bytes
+   * @param[in] persistentMappingEnabled if true, buffer is mapped persistently
+   * @param[in] usageFlags type of usage ( Graphics::BufferUsage )
+   */
+  GraphicsBuffer( Dali::Graphics::Controller* mController,
+                  uint32_t sizeInBytes,
+                  uint32_t alignment,
+                  bool persistentMappingEnabled,
+                  Graphics::BufferUsageFlags usageFlags );
+
+public:
+
+  /**
+   * Destructor of GraphicsBuffer
+   */
+  ~GraphicsBuffer();
+
+  /**
+   * Writes data into the buffer
+   *
+   * @param[in] data pointer to the source data
+   * @param[in] size size of source data
+   * @param[in] offset destination offset
+   * @param[in] enables cached write ( write on flush )
+   */
+  void Write( const void* data, uint32_t size, uint32_t offset, bool cachedWrite );
+
+  /**
+   * Flushes whole buffer range
+   */
+  void Flush();
+
+  /**
+   * Returns allocated ( requested ) size
+   * @return size of buffer
+   */
+  uint32_t GetSize() const
+  {
+    return mSize;
+  }
+
+  /**
+   * Return Graphics API buffer
+   * @return pointer to the buffer object
+   */
+  const Dali::Graphics::Buffer* GetBuffer() const
+  {
+    return mBuffer.get();
+  }
+
+  /**
+   * Returns memory alignment
+   * @return memory alignment
+   */
+  uint32_t GetAlignment() const
+  {
+    return mAlignment;
+  }
+
+  /**
+   * Reserves buffer memory
+   *
+   * @param size requested size
+   * @param discardOldBuffer If true discards old buffer without waiting for garbage collection
+   */
+  void Reserve( uint32_t size, bool discardOldBuffer );
+
+  /**
+   * Maps buffer memory
+   * @return pointer to mapped memory
+   */
+  void* Map();
+
+  /**
+   * Unmaps buffer memory
+   */
+  void Unmap();
+
+  /**
+   * Fills the buffer with given data ( single 8bit value )
+   * @param data char type data
+   * @param offset start offset
+   * @param size size to write, 0 if whole size
+   */
+  void Fill( char data, uint32_t offset, uint32_t size );
+
+private:
+
+  std::unique_ptr<Dali::Graphics::Buffer> mBuffer;
+  Dali::Graphics::Controller* mController;
+
+  uint32_t  mSize;
+  uint32_t  mAlignment;
+  void*     mMappedPtr;
+  bool      mPersistentMappedEnabled;
+
+  Graphics::BufferUsageFlags mUsageFlags;
+};
+
+class GraphicsBufferManager
+{
+public:
+
+  GraphicsBufferManager( Dali::Graphics::Controller* controller );
+
+  ~GraphicsBufferManager();
+
+  /**
+   * Allocates uniform buffer with given size
+   * @param size
+   * @return
+   */
+  std::unique_ptr<GraphicsBuffer> AllocateUniformBuffer( uint32_t size );
+
+private:
+
+  Dali::Graphics::Controller* mController;
+};
+
+
+
+} // namespace SceneGraph
+} // namespace Internal
+} // namespace Dali
+
+#endif // DALI_INTERNAL_GRAPHICS_UNIFORM_BUFFER_MANAGER_H
diff --git a/dali/internal/update/manager/frame-callback-processor.cpp b/dali/internal/update/manager/frame-callback-processor.cpp
new file mode 100644 (file)
index 0000000..5c713f2
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/update/manager/frame-callback-processor.h>
+
+// EXTERNAL INCLUDES
+#include <algorithm>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/update/frame-callback-interface.h>
+#include <dali/devel-api/update/update-proxy.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace SceneGraph
+{
+
+FrameCallbackProcessor::FrameCallbackProcessor( UpdateManager& updateManager, TransformManager& transformManager )
+: mFrameCallbacks(),
+  mUpdateManager( updateManager ),
+  mTransformManager( transformManager ),
+  mNodeHierarchyChanged( true )
+{
+}
+
+FrameCallbackProcessor::~FrameCallbackProcessor()
+{
+}
+
+void FrameCallbackProcessor::AddFrameCallback( OwnerPointer< FrameCallback >& frameCallback, const Node* rootNode )
+{
+  Node& node = const_cast< Node& >( *rootNode ); // Was sent as const from event thread, we need to be able to use non-const version here.
+
+  frameCallback->ConnectToSceneGraph( mUpdateManager, mTransformManager, node );
+
+  mFrameCallbacks.emplace_back( frameCallback );
+}
+
+void FrameCallbackProcessor::RemoveFrameCallback( FrameCallbackInterface* frameCallback )
+{
+  // Find and remove all frame-callbacks that use the given frame-callback-interface
+  auto iter = std::remove( mFrameCallbacks.begin(), mFrameCallbacks.end(), frameCallback );
+  mFrameCallbacks.erase( iter, mFrameCallbacks.end() );
+}
+
+void FrameCallbackProcessor::Update( BufferIndex bufferIndex, float elapsedSeconds )
+{
+  // If any of the FrameCallback::Update calls returns false, then they are no longer required & can be removed.
+  auto iter = std::remove_if(
+    mFrameCallbacks.begin(), mFrameCallbacks.end(),
+    [ & ]( OwnerPointer< FrameCallback >& frameCallback )
+    {
+      return ! frameCallback->Update( bufferIndex, elapsedSeconds, mNodeHierarchyChanged );
+    }
+  );
+  mFrameCallbacks.erase( iter, mFrameCallbacks.end() );
+
+  mNodeHierarchyChanged = false;
+}
+
+} // namespace SceneGraph
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/update/manager/frame-callback-processor.h b/dali/internal/update/manager/frame-callback-processor.h
new file mode 100644 (file)
index 0000000..09f4acd
--- /dev/null
@@ -0,0 +1,117 @@
+#ifndef DALI_INTERNAL_SCENE_GRAPH_FRAME_CALLBACK_PROCESSOR_H
+#define DALI_INTERNAL_SCENE_GRAPH_FRAME_CALLBACK_PROCESSOR_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/internal/common/buffer-index.h>
+#include <dali/internal/common/owner-pointer.h>
+#include <dali/internal/update/manager/scene-graph-frame-callback.h>
+#include <dali/internal/update/manager/update-proxy-impl.h>
+
+namespace Dali
+{
+
+class FrameCallbackInterface;
+
+namespace Internal
+{
+
+namespace SceneGraph
+{
+
+class Node;
+class TransformManager;
+class UpdateManager;
+
+/**
+ * This class processes all the registered frame-callbacks.
+ */
+class FrameCallbackProcessor
+{
+public:
+
+  /**
+   * Construct a new FrameCallbackProcessor.
+   * @param[in]  updateManager     A reference to the UpdateManager
+   * @param[in]  transformManager  A reference to the TransformManager
+   */
+  FrameCallbackProcessor( UpdateManager& updateManager, TransformManager& transformManager );
+
+  /**
+   * Non-virtual Destructor.
+   */
+  ~FrameCallbackProcessor();
+
+  // Movable but not copyable
+
+  FrameCallbackProcessor( const FrameCallbackProcessor& )            = delete;  ///< Deleted copy constructor.
+  FrameCallbackProcessor( FrameCallbackProcessor&& )                 = default; ///< Default move constructor.
+  FrameCallbackProcessor& operator=( const FrameCallbackProcessor& ) = delete;  ///< Deleted copy assignment operator.
+  FrameCallbackProcessor& operator=( FrameCallbackProcessor&& )      = default; ///< Default move assignment operator.
+
+  /**
+   * Adds an implementation of the FrameCallbackInterface.
+   * @param[in]  frameCallback  An OwnerPointer to the SceneGraph FrameCallback object
+   * @param[in]  rootNode       A pointer to the root node to apply the FrameCallback to
+   */
+  void AddFrameCallback( OwnerPointer< FrameCallback >& frameCallback, const Node* rootNode );
+
+  /**
+   * Removes the specified implementation of FrameCallbackInterface.
+   * @param[in]  frameCallback  A pointer to the implementation of the FrameCallbackInterface to remove.
+   */
+  void RemoveFrameCallback( FrameCallbackInterface* frameCallback );
+
+  /**
+   * Called on Update by the UpdateManager.
+   * @param[in]  bufferIndex     The bufferIndex to use
+   * @param[in]  elapsedSeconds  Time elapsed time since the last frame (in seconds)
+   */
+  void Update( BufferIndex bufferIndex, float elapsedSeconds );
+
+  /**
+   * Called by the UpdateManager when the node hierarchy changes.
+   */
+  void NodeHierarchyChanged()
+  {
+    mNodeHierarchyChanged = true;
+  }
+
+private:
+
+  std::vector< OwnerPointer< FrameCallback > > mFrameCallbacks; ///< A container of all the frame-callbacks & accompanying update-proxies.
+
+  UpdateManager& mUpdateManager;
+
+  TransformManager& mTransformManager;
+
+  bool mNodeHierarchyChanged; ///< Set to true if the node hierarchy changes
+};
+
+} // namespace SceneGraph
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_SCENE_GRAPH_FRAME_CALLBACK_PROCESSOR_H
index f195955..2072912 100644 (file)
@@ -1,9 +1,8 @@
-
 #ifndef FREE_LIST_H_
 #define FREE_LIST_H_
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-//INTERNAL INCLUDES
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
+// INTERNAL INCLUDES
 #include <dali/public-api/common/dali-vector.h>
 
 namespace Dali
@@ -58,18 +60,18 @@ struct FreeList
    * @param[in] value The value to add
    * @return The index where the value has been added
    */
-  unsigned int Add( unsigned int value )
+  uint32_t Add( uint32_t value )
   {
-    if( mData.Empty() || mFirstFreeIndex == mData.Size() )
+    const uint32_t size = static_cast<uint32_t>( mData.Size() ); // 4,294,967,295 entries is enough
+    if( mData.Empty() || mFirstFreeIndex == size )
     {
       //Make room for another item
-      size_t size = mData.Size();
-      mData.PushBack( size+1 );
+      mData.PushBack( size + 1 );
       mFirstFreeIndex = size;
     }
 
     //Update first free index
-    unsigned int index = mFirstFreeIndex;
+    uint32_t index = mFirstFreeIndex;
     mFirstFreeIndex = mData[mFirstFreeIndex];
 
     mData[index] = value;
@@ -82,7 +84,7 @@ struct FreeList
    *
    * @param[in] index The index of the element to remove
    */
-  void Remove( unsigned int index )
+  void Remove( uint32_t index )
   {
     mData[index] = mFirstFreeIndex;
     mFirstFreeIndex = index;
@@ -94,7 +96,7 @@ struct FreeList
    * @param[in]  index Index of the element.
    * @return Reference to the element for given index.
    */
-  unsigned int& operator[]( unsigned int index )
+  uint32_t& operator[]( uint32_t index )
   {
     return mData[index];
   }
@@ -105,14 +107,14 @@ struct FreeList
    * @param[in]  index Index of the element.
    * @return Reference to the element for given index.
    */
-  unsigned int operator[]( unsigned int index ) const
+  uint32_t operator[]( uint32_t index ) const
   {
     return mData[index];
   }
 
 private:
-  Dali::Vector<unsigned int> mData; ///< data
-  unsigned int mFirstFreeIndex;     ///< Index where a new element will be added
+  Dali::Vector< uint32_t > mData; ///< data
+  uint32_t mFirstFreeIndex;     ///< Index where a new element will be added
 };
 
 }
index 7bba30a..494533e 100644 (file)
@@ -157,7 +157,7 @@ inline void AddRendererToRenderList( BufferIndex updateBufferIndex,
                                      bool cull )
 {
   bool inside( true );
-  const Node* node = renderable.mNode;
+  Node* node = renderable.mNode;
 
   if( cull && renderable.mRenderer && !renderable.mRenderer->GetShader().HintEnabled( Dali::Shader::Hint::MODIFIES_GEOMETRY ) )
   {
@@ -169,12 +169,16 @@ inline void AddRendererToRenderList( BufferIndex updateBufferIndex,
   if( inside )
   {
     Renderer::OpacityType opacityType = renderable.mRenderer ? renderable.mRenderer->GetOpacityType( updateBufferIndex, *renderable.mNode ) : Renderer::OPAQUE;
+
+    DALI_LOG_INFO( gRenderListLogFilter, Debug::Verbose, "AddRendererToRenderList(%p) = %s\n", renderable.mRenderer, (opacityType== Renderer::TRANSPARENT ? "Transparent" : opacityType== Renderer::TRANSLUCENT ? "Translucent" : "Opaque"));
+
     if( opacityType != Renderer::TRANSPARENT || node->GetClippingMode() == ClippingMode::CLIP_CHILDREN )
     {
       // Get the next free RenderItem.
       RenderItem& item = renderList.GetNextFreeItem();
 
       item.mNode = renderable.mNode;
+      item.mRenderer = renderable.mRenderer;
       item.mIsOpaque = ( opacityType == Renderer::OPAQUE );
       item.mDepthIndex = 0;
 
@@ -198,6 +202,12 @@ inline void AddRendererToRenderList( BufferIndex updateBufferIndex,
 
       Matrix::Multiply( item.mModelViewMatrix, item.mModelMatrix, viewMatrix );
     }
+
+     node->SetCulled( updateBufferIndex, false );
+  }
+  else
+  {
+     node->SetCulled( updateBufferIndex, true );
   }
 }
 
@@ -222,12 +232,11 @@ inline void AddRenderersToRenderList( BufferIndex updateBufferIndex,
 {
   DALI_LOG_INFO( gRenderListLogFilter, Debug::Verbose, "AddRenderersToRenderList()\n");
 
-  unsigned int rendererCount( renderers.Size() );
-  for( unsigned int i(0); i < rendererCount; ++i )
+  for( auto&& renderer : renderers )
   {
     AddRendererToRenderList( updateBufferIndex,
                              renderList,
-                             renderers[i],
+                             renderer,
                              viewMatrix,
                              camera,
                              isLayer3d,
@@ -248,7 +257,7 @@ inline bool TryReuseCachedRenderers( Layer& layer,
                                      RenderableContainer& renderables )
 {
   bool retValue = false;
-  size_t renderableCount = renderables.Size();
+  uint32_t renderableCount = static_cast<uint32_t>( renderables.Size() );
   // Check that the cached list originates from this layer and that the counts match
   if( ( renderList.GetSourceLayer() == &layer )&&
       ( renderList.GetCachedItemCount() == renderableCount ) )
@@ -305,9 +314,9 @@ RenderInstructionProcessor::~RenderInstructionProcessor()
 
 inline void RenderInstructionProcessor::SortRenderItems( BufferIndex bufferIndex, RenderList& renderList, Layer& layer, bool respectClippingOrder )
 {
-  const size_t renderableCount = renderList.Count();
+  const uint32_t renderableCount = static_cast<uint32_t>( renderList.Count() );
   // Reserve space if needed.
-  const unsigned int oldcapacity = mSortingHelper.size();
+  const uint32_t oldcapacity = static_cast<uint32_t>( mSortingHelper.size() );
   if( oldcapacity < renderableCount )
   {
     mSortingHelper.reserve( renderableCount );
@@ -326,7 +335,7 @@ inline void RenderInstructionProcessor::SortRenderItems( BufferIndex bufferIndex
   // Using an if and two for-loops rather than if inside for as its better for branch prediction.
   if( layer.UsesDefaultSortFunction() )
   {
-    for( size_t index = 0; index < renderableCount; ++index )
+    for( uint32_t index = 0; index < renderableCount; ++index )
     {
       RenderItem& item = renderList.GetItem( index );
 
@@ -334,7 +343,7 @@ inline void RenderInstructionProcessor::SortRenderItems( BufferIndex bufferIndex
       mSortingHelper[ index ].textureSet = item.mTextureSet;
 
       // The default sorting function should get inlined here.
-      mSortingHelper[ index ].zValue = Internal::Layer::ZValue( item.mModelViewMatrix.GetTranslation3() ) - item.mDepthIndex;
+      mSortingHelper[ index ].zValue = Internal::Layer::ZValue( item.mModelViewMatrix.GetTranslation3() ) - static_cast<float>( item.mDepthIndex );
 
       // Keep the renderitem pointer in the helper so we can quickly reorder items after sort.
       mSortingHelper[ index ].renderItem = &item;
@@ -343,14 +352,14 @@ inline void RenderInstructionProcessor::SortRenderItems( BufferIndex bufferIndex
   else
   {
     const Dali::Layer::SortFunctionType sortFunction = layer.GetSortFunction();
-    for( size_t index = 0; index < renderableCount; ++index )
+    for( uint32_t index = 0; index < renderableCount; ++index )
     {
       RenderItem& item = renderList.GetItem( index );
 
       // texture set
       mSortingHelper[ index ].textureSet = item.mTextureSet;
 
-      mSortingHelper[ index ].zValue = (*sortFunction)( item.mModelViewMatrix.GetTranslation3() ) - item.mDepthIndex;
+      mSortingHelper[ index ].zValue = (*sortFunction)( item.mModelViewMatrix.GetTranslation3() ) - static_cast<float>( item.mDepthIndex );
 
       // Keep the RenderItem pointer in the helper so we can quickly reorder items after sort.
       mSortingHelper[ index ].renderItem = &item;
@@ -368,7 +377,7 @@ inline void RenderInstructionProcessor::SortRenderItems( BufferIndex bufferIndex
   // Reorder / re-populate the RenderItems in the RenderList to correct order based on the sortinghelper.
   DALI_LOG_INFO( gRenderListLogFilter, Debug::Verbose, "Sorted Transparent List:\n");
   RenderItemContainer::Iterator renderListIter = renderList.GetContainer().Begin();
-  for( unsigned int index = 0; index < renderableCount; ++index, ++renderListIter )
+  for( uint32_t index = 0; index < renderableCount; ++index, ++renderListIter )
   {
     *renderListIter = mSortingHelper[ index ].renderItem;
     DALI_LOG_INFO( gRenderListLogFilter, Debug::Verbose, "  sortedList[%d]\n", index );
@@ -382,10 +391,7 @@ void RenderInstructionProcessor::Prepare( BufferIndex updateBufferIndex,
                                           bool hasClippingNodes,
                                           RenderInstructionContainer& instructions )
 {
-  // Retrieve the RenderInstruction buffer from the RenderInstructionContainer
-  // then populate with instructions.
-  RenderInstruction& instruction = instructions.GetNextInstruction( updateBufferIndex );
-  renderTask.PrepareRenderInstruction( instruction, updateBufferIndex );
+  RenderInstruction& instruction = renderTask.PrepareRenderInstruction( updateBufferIndex );
   bool viewMatrixHasNotChanged = !renderTask.ViewMatrixUpdated();
   bool isRenderListAdded = false;
 
@@ -448,9 +454,9 @@ void RenderInstructionProcessor::Prepare( BufferIndex updateBufferIndex,
   // Inform the render instruction that all renderers have been added and this frame is complete.
   instruction.UpdateCompleted();
 
-  if( !isRenderListAdded && !instruction.mIsClearColorSet )
+  if( isRenderListAdded || instruction.mIsClearColorSet )
   {
-    instructions.DiscardCurrentInstruction( updateBufferIndex );
+    instructions.PushBack( updateBufferIndex, &instruction );
   }
 }
 
index be99faf..7e756d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
 #include <dali/internal/update/rendering/render-tracker.h>
 #include <dali/internal/update/rendering/render-instruction.h>
 #include <dali/internal/update/rendering/render-instruction-container.h>
+#include <dali/internal/update/rendering/scene-graph-renderer.h>
 #include <dali/integration-api/debug.h>
 
 #if defined(DEBUG_ENABLED)
@@ -96,8 +97,9 @@ Layer* FindLayer( Node& node )
  * @param[in]  clippingDepth The current stencil clipping depth
  * @param[in]  clippingDepth The current scissor clipping depth
  * @param[out] clippingUsed  Gets set to true if any clipping nodes have been found
+ * @return true if rendering should be kept, false otherwise.
  */
-void AddRenderablesForTask( BufferIndex updateBufferIndex,
+bool AddRenderablesForTask( BufferIndex updateBufferIndex,
                             Node& node,
                             Layer& currentLayer,
                             RenderTask& renderTask,
@@ -107,17 +109,19 @@ void AddRenderablesForTask( BufferIndex updateBufferIndex,
                             uint32_t scissorDepth,
                             bool& clippingUsed )
 {
+  bool keepRendering = false;
+
   // Short-circuit for invisible nodes
   if( !node.IsVisible( updateBufferIndex ) )
   {
-    return;
+    return keepRendering;
   }
 
   // Check whether node is exclusive to a different render-task
   const RenderTask* exclusiveTo = node.GetExclusiveRenderTask();
   if( exclusiveTo && ( exclusiveTo != &renderTask ) )
   {
-    return;
+    return keepRendering;
   }
 
   // Assume all children go to this layer (if this node is a layer).
@@ -136,7 +140,7 @@ void AddRenderablesForTask( BufferIndex updateBufferIndex,
 
   DALI_ASSERT_DEBUG( NULL != layer );
 
-  const unsigned int count = node.GetRendererCount();
+  const uint32_t count = node.GetRendererCount();
 
   // Update the clipping Id and depth for this node (if clipping is enabled).
   const Dali::ClippingMode::Type clippingMode = node.GetClippingMode();
@@ -163,7 +167,7 @@ void AddRenderablesForTask( BufferIndex updateBufferIndex,
   // Set the information in the node.
   node.SetClippingInformation( currentClippingId, clippingDepth, scissorDepth );
 
-  for( unsigned int i = 0; i < count; ++i )
+  for( uint32_t i = 0; i < count; ++i )
   {
     SceneGraph::Renderer* renderer = node.GetRendererAt( i );
 
@@ -176,6 +180,11 @@ void AddRenderablesForTask( BufferIndex updateBufferIndex,
     {
       layer->overlayRenderables.PushBack( Renderable( &node, renderer ) );
     }
+
+    if( renderer->GetRenderingBehavior() == DevelRenderer::Rendering::CONTINUOUSLY )
+    {
+      keepRendering = true;
+    }
   }
 
   // Recurse children.
@@ -184,8 +193,10 @@ void AddRenderablesForTask( BufferIndex updateBufferIndex,
   for( NodeIter iter = children.Begin(); iter != endIter; ++iter )
   {
     Node& child = **iter;
-    AddRenderablesForTask( updateBufferIndex, child, *layer, renderTask, inheritedDrawMode, currentClippingId, clippingDepth, scissorDepth, clippingUsed );
+    keepRendering |= AddRenderablesForTask( updateBufferIndex, child, *layer, renderTask, inheritedDrawMode, currentClippingId, clippingDepth, scissorDepth, clippingUsed );
   }
+
+  return keepRendering;
 }
 
 /**
@@ -201,8 +212,9 @@ void AddRenderablesForTask( BufferIndex updateBufferIndex,
  * @param[in]  renderToFboEnabled         Whether rendering into the Frame Buffer Object is enabled (used to measure FPS above 60)
  * @param[in]  isRenderingToFbo           Whether this frame is being rendered into the Frame Buffer Object (used to measure FPS above 60)
  * @param[in]  processOffscreen           Whether the offscreen render tasks are the ones processed. Otherwise it processes the onscreen tasks.
+ * @return true if rendering should be kept, false otherwise.
  */
-void ProcessTasks( BufferIndex updateBufferIndex,
+bool ProcessTasks( BufferIndex updateBufferIndex,
                    RenderTaskList::RenderTaskContainer& taskContainer,
                    Layer& rootNode,
                    SortedLayerPointers& sortedLayers,
@@ -216,6 +228,7 @@ void ProcessTasks( BufferIndex updateBufferIndex,
   bool hasClippingNodes = false;
 
   bool isFirstRenderTask = true;
+  bool keepRendering = false;
   for( RenderTaskList::RenderTaskContainer::Iterator iter = taskContainer.Begin(), endIter = taskContainer.End(); endIter != iter; ++iter )
   {
     RenderTask& renderTask = **iter;
@@ -251,24 +264,30 @@ void ProcessTasks( BufferIndex updateBufferIndex,
       continue;
     }
 
-    const unsigned int currentNumberOfInstructions = instructions.Count( updateBufferIndex );
+    // Ensure framebuffer graphics objects are created if needed
+    if( hasFrameBuffer )
+    {
+      renderTask.GetFrameBuffer()->PrepareFramebuffer();
+    }
+
+    const uint32_t currentNumberOfInstructions = instructions.Count( updateBufferIndex );
 
     if( renderTask.IsRenderRequired() )
     {
-      for( size_t i = 0u, layerCount = sortedLayers.size(); i < layerCount; ++i )
+      for( auto&& sortedLayer : sortedLayers )
       {
-        sortedLayers[i]->ClearRenderables();
+        sortedLayer->ClearRenderables();
       }
 
-      AddRenderablesForTask( updateBufferIndex,
-                             *sourceNode,
-                             *layer,
-                             renderTask,
-                             sourceNode->GetDrawMode(),
-                             clippingId,
-                             0u,
-                             0u,
-                             hasClippingNodes );
+      keepRendering |= AddRenderablesForTask( updateBufferIndex,
+                                              *sourceNode,
+                                              *layer,
+                                              renderTask,
+                                              sourceNode->GetDrawMode(),
+                                              clippingId,
+                                              0u,
+                                              0u,
+                                              hasClippingNodes );
 
       renderInstructionProcessor.Prepare( updateBufferIndex,
                                           sortedLayers,
@@ -281,13 +300,16 @@ void ProcessTasks( BufferIndex updateBufferIndex,
     if( !processOffscreen && isDefaultRenderTask && renderToFboEnabled && !isRenderingToFbo && hasFrameBuffer )
     {
       // Traverse the instructions of the default render task and mark them to be rendered into the frame buffer.
-      for( unsigned int index = currentNumberOfInstructions, count = instructions.Count( updateBufferIndex ); index < count; ++index )
+      const uint32_t count = instructions.Count( updateBufferIndex );
+      for( uint32_t index = currentNumberOfInstructions; index < count; ++index )
       {
         RenderInstruction& instruction = instructions.At( updateBufferIndex, index );
         instruction.mIgnoreRenderToFbo = true;
       }
     }
   }
+
+  return keepRendering;
 }
 
 } // Anonymous namespace.
@@ -300,7 +322,7 @@ RenderTaskProcessor::~RenderTaskProcessor()
 {
 }
 
-void RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
+bool RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
                                    RenderTaskList& renderTasks,
                                    Layer& rootNode,
                                    SortedLayerPointers& sortedLayers,
@@ -309,11 +331,12 @@ void RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
                                    bool isRenderingToFbo )
 {
   RenderTaskList::RenderTaskContainer& taskContainer = renderTasks.GetTasks();
+  bool keepRendering = false;
 
   if( taskContainer.IsEmpty() )
   {
     // Early-exit if there are no tasks to process
-    return;
+    return keepRendering;
   }
 
   // For each render-task:
@@ -326,30 +349,32 @@ void RenderTaskProcessor::Process( BufferIndex updateBufferIndex,
 
   // First process off screen render tasks - we may need the results of these for the on screen renders
 
-  ProcessTasks( updateBufferIndex,
-                taskContainer,
-                rootNode,
-                sortedLayers,
-                instructions,
-                mRenderInstructionProcessor,
-                renderToFboEnabled,
-                isRenderingToFbo,
-                true );
+  keepRendering = ProcessTasks( updateBufferIndex,
+                                taskContainer,
+                                rootNode,
+                                sortedLayers,
+                                instructions,
+                                mRenderInstructionProcessor,
+                                renderToFboEnabled,
+                                isRenderingToFbo,
+                                true );
 
   DALI_LOG_INFO( gRenderTaskLogFilter, Debug::General, "RenderTaskProcessor::Process() Onscreen\n" );
 
   // Now that the off screen renders are done we can process on screen render tasks.
   // Reset the clipping Id for the OnScreen render tasks.
 
-  ProcessTasks( updateBufferIndex,
-                taskContainer,
-                rootNode,
-                sortedLayers,
-                instructions,
-                mRenderInstructionProcessor,
-                renderToFboEnabled,
-                isRenderingToFbo,
-                false );
+  keepRendering |= ProcessTasks( updateBufferIndex,
+                                 taskContainer,
+                                 rootNode,
+                                 sortedLayers,
+                                 instructions,
+                                 mRenderInstructionProcessor,
+                                 renderToFboEnabled,
+                                 isRenderingToFbo,
+                                 false );
+
+  return keepRendering;
 }
 
 } // SceneGraph
index 5d2bdbb..2c919a0 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_PROCESSOR_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -61,8 +61,9 @@ public:
    * @param[out] instructions       The instructions for rendering the next frame.
    * @param[in]  renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled (used to measure FPS above 60)
    * @param[in]  isRenderingToFbo   Whether this frame is being rendered into the Frame Buffer Object (used to measure FPS above 60)
+   * @return true if rendering should be kept, false otherwise.
    */
-  void Process( BufferIndex updateBufferIndex,
+  bool Process( BufferIndex updateBufferIndex,
                 RenderTaskList& renderTasks,
                 Layer& rootNode,
                 SortedLayerPointers& sortedLayers,
diff --git a/dali/internal/update/manager/scene-graph-frame-callback.cpp b/dali/internal/update/manager/scene-graph-frame-callback.cpp
new file mode 100644 (file)
index 0000000..faf6c73
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/update/manager/scene-graph-frame-callback.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/threading/mutex.h>
+#include <dali/devel-api/update/frame-callback-interface.h>
+#include <dali/devel-api/update/update-proxy.h>
+#include <dali/internal/event/update/frame-callback-interface-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace SceneGraph
+{
+
+FrameCallback* FrameCallback::New( FrameCallbackInterface& frameCallbackInterface )
+{
+  return new FrameCallback( &frameCallbackInterface );
+}
+
+FrameCallback::~FrameCallback()
+{
+  if( mUpdateProxy )
+  {
+    mUpdateProxy->GetRootNode().RemoveObserver( *this );
+  }
+
+  {
+    Mutex::ScopedLock lock( mMutex );
+    if( mFrameCallbackInterface )
+    {
+      FrameCallbackInterface::Impl::Get( *mFrameCallbackInterface ).DisconnectFromSceneGraphObject();
+    }
+  }
+}
+
+void FrameCallback::ConnectToSceneGraph( UpdateManager& updateManager, TransformManager& transformManager, Node& rootNode )
+{
+  mUpdateProxy = std::unique_ptr< UpdateProxy >( new UpdateProxy( updateManager, transformManager, rootNode ) );
+  rootNode.AddObserver( *this );
+}
+
+bool FrameCallback::Update( BufferIndex bufferIndex, float elapsedSeconds, bool nodeHierarchyChanged )
+{
+  bool continueCalling = false;
+  if( mUpdateProxy )
+  {
+    mUpdateProxy->SetCurrentBufferIndex( bufferIndex );
+
+    if( nodeHierarchyChanged )
+    {
+      mUpdateProxy->NodeHierarchyChanged();
+    }
+
+    Mutex::ScopedLock lock( mMutex );
+    if( mFrameCallbackInterface )
+    {
+      Dali::UpdateProxy updateProxy( *mUpdateProxy );
+      mFrameCallbackInterface->Update( updateProxy, elapsedSeconds );
+      continueCalling = true;
+    }
+  }
+  return continueCalling;
+}
+
+void FrameCallback::Invalidate()
+{
+  Mutex::ScopedLock lock( mMutex );
+  if( mFrameCallbackInterface )
+  {
+    FrameCallbackInterface::Impl::Get( *mFrameCallbackInterface ).DisconnectFromSceneGraphObject();
+    mFrameCallbackInterface = nullptr;
+  }
+}
+
+void FrameCallback::PropertyOwnerDestroyed( PropertyOwner& owner )
+{
+  Invalidate();
+}
+
+FrameCallback::FrameCallback( FrameCallbackInterface* frameCallbackInterface )
+: mMutex(),
+  mFrameCallbackInterface( frameCallbackInterface )
+{
+  if( frameCallbackInterface )
+  {
+    FrameCallbackInterface::Impl::Get( *mFrameCallbackInterface ).ConnectToSceneGraphObject( *this );
+  }
+}
+
+} // namespace SceneGraph
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/update/manager/scene-graph-frame-callback.h b/dali/internal/update/manager/scene-graph-frame-callback.h
new file mode 100644 (file)
index 0000000..2f876e2
--- /dev/null
@@ -0,0 +1,156 @@
+#ifndef DALI_INTERNAL_SCENE_GRAPH_FRAME_CALLBACK_H
+#define DALI_INTERNAL_SCENE_GRAPH_FRAME_CALLBACK_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/threading/mutex.h>
+#include <dali/devel-api/update/frame-callback-interface.h>
+#include <dali/internal/common/owner-pointer.h>
+#include <dali/internal/update/common/property-owner.h>
+#include <dali/internal/update/manager/update-proxy-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace SceneGraph
+{
+
+class Node;
+class TransformManager;
+
+/**
+ * This is the update-thread owned entity of the FrameCallbackInterface.
+ * @see Dali::FrameCallbackInterface
+ */
+class FrameCallback final : public PropertyOwner::Observer
+{
+public:
+
+  /**
+   * Creates a new FrameCallback.
+   * @param[in]  frameCallbackInterface  A reference to the FrameCallbackInterface implementation
+   * @return A new FrameCallback.
+   */
+  static FrameCallback* New( FrameCallbackInterface& frameCallbackInterface );
+
+  /**
+   * Non-virtual Destructor.
+   */
+  ~FrameCallback();
+
+  /**
+   * Called from the update-thread when connecting to the scene-graph.
+   * @param[in]  updateManager     The Update Manager
+   * @param[in]  transformManager  The Transform Manager
+   * @param[in]  rootNode          The rootNode of this frame-callback
+   */
+  void ConnectToSceneGraph( UpdateManager& updateManager, TransformManager& transformManager, Node& rootNode );
+
+  // Movable but not copyable
+
+  FrameCallback( const FrameCallback& )            = delete;  ///< Deleted copy constructor.
+  FrameCallback( FrameCallback&& )                 = default; ///< Default move constructor.
+  FrameCallback& operator=( const FrameCallback& ) = delete;  ///< Deleted copy assignment operator.
+  FrameCallback& operator=( FrameCallback&& )      = default; ///< Default move assignment operator.
+
+  /**
+   * Called from the update-thread after the scene has been updated, and is ready to render.
+   * @param[in]  bufferIndex           The bufferIndex to use
+   * @param[in]  elapsedSeconds        Time elapsed time since the last frame (in seconds)
+   * @param[in]  nodeHierarchyChanged  Whether the node hierarchy has changed
+   * @return Whether to continue calling this FrameCallback or not.
+   */
+  bool Update( BufferIndex bufferIndex, float elapsedSeconds, bool nodeHierarchyChanged );
+
+  /**
+   * Invalidates this FrameCallback and will no longer be associated with the FrameCallbackInterface.
+   * @note This method is thread-safe.
+   */
+  void Invalidate();
+
+  /**
+   * Comparison operator between a FrameCallback and a FrameCallbackInterface pointer.
+   * @param[in]  iFace  The FrameCallbackInterface pointer to compare with
+   * @return True if iFace matches our internally stored FrameCallbackInterface.
+   */
+  inline bool operator==( const FrameCallbackInterface* iFace )
+  {
+    return mFrameCallbackInterface == iFace;
+  }
+
+private:
+
+  // From PropertyOwner::Observer
+
+  /**
+   * @copydoc PropertyOwner::Observer::PropertyOwnerConnected()
+   */
+  virtual void PropertyOwnerConnected( PropertyOwner& owner ) { /* Nothing to do */ }
+
+  /**
+   * @copydoc PropertyOwner::Observer::PropertyOwnerDisconnected()
+   */
+  virtual void PropertyOwnerDisconnected( BufferIndex updateBufferIndex, PropertyOwner& owner ) { /* Nothing to do */ }
+
+  /**
+   * @copydoc PropertyOwner::Observer::PropertyOwnerDisconnected()
+   *
+   * Will use this to disconnect the frame-callback if the accompanying node is destroyed
+   */
+  virtual void PropertyOwnerDestroyed( PropertyOwner& owner );
+
+  // Construction
+
+  /**
+   * Constructor.
+   * @param[in]  frameCallbackInterface  A pointer to the FrameCallbackInterface implementation
+   */
+  FrameCallback( FrameCallbackInterface* frameCallbackInterface );
+
+private:
+
+  Mutex mMutex;
+  std::unique_ptr< UpdateProxy > mUpdateProxy{ nullptr }; ///< A unique pointer to the implementation of the UpdateProxy.
+  FrameCallbackInterface* mFrameCallbackInterface;
+};
+
+/**
+ * Checks if FrameCallback store iFace internally.
+ * @param[in]  frameCallback  Reference to the owner-pointer of frame-callback
+ * @param[in]  iFace          The FrameCallbackInterface pointer
+ * @return True if iFace matches the internally stored FrameCallbackInterface.
+ */
+inline bool operator==( const OwnerPointer< FrameCallback >& frameCallback, const FrameCallbackInterface* iFace )
+{
+  return *frameCallback == iFace;
+}
+
+} // namespace SceneGraph
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_SCENE_GRAPH_FRAME_CALLBACK_H
index f64d65e..800a65a 100644 (file)
@@ -2,7 +2,7 @@
 #define TRANSFORM_MANAGER_PROPERTY_H_
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -47,12 +47,12 @@ struct TransformManagerPropertyHandler : public AnimatablePropertyBase
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  virtual T& Get(size_t bufferIndex) = 0;
+  virtual T& Get( BufferIndex bufferIndex ) = 0;
 
   /**
    * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
    */
-  virtual const T& Get(size_t bufferIndex) const = 0;
+  virtual const T& Get( BufferIndex bufferIndex ) const = 0;
 
   /**
    * @copydoc Dali::PropertyInput::GetVector3()
@@ -63,7 +63,7 @@ struct TransformManagerPropertyHandler : public AnimatablePropertyBase
    * Retrieve a component of property
    * @param[in] component The component of the property
    */
-  virtual const float& GetFloatComponent(unsigned int component)=0;
+  virtual const float& GetFloatComponent(uint32_t component)=0;
 
   /**
    * Set the property value. This will only persist for the current frame; the property
@@ -78,7 +78,7 @@ struct TransformManagerPropertyHandler : public AnimatablePropertyBase
    * @param[in] value The new value of the component
    * @param[in] component The component of the property
    */
-  virtual void SetFloatComponent( float value, unsigned int component){}
+  virtual void SetFloatComponent( float value, uint32_t component){}
 
   /**
    * @copydoc Dali::AnimatableProperty::Bake()
@@ -90,7 +90,7 @@ struct TransformManagerPropertyHandler : public AnimatablePropertyBase
    * @param[in] value The new value of the component
    * @param[in] component The component of the property
    */
-  virtual void BakeFloatComponent( float value, unsigned int component){}
+  virtual void BakeFloatComponent( float value, uint32_t component){}
 
   /**
    * @copydoc Dali::AnimatableProperty::BakeX()
@@ -163,12 +163,12 @@ struct TransformManagerPropertyVector3 : public TransformManagerPropertyHandler<
     return Dali::PropertyTypes::Get<Vector3>();
   }
 
-  Vector3& Get(size_t bufferIndex)
+  Vector3& Get( BufferIndex bufferIndex )
   {
     return mTxManager->GetVector3PropertyValue( mId, mProperty );
   }
 
-  const Vector3& Get(size_t bufferIndex) const
+  const Vector3& Get( BufferIndex bufferIndex ) const
   {
     return mTxManager->GetVector3PropertyValue( mId, mProperty );
   }
@@ -178,7 +178,7 @@ struct TransformManagerPropertyVector3 : public TransformManagerPropertyHandler<
     return Get(bufferIndex);
   }
 
-  const float& GetFloatComponent( unsigned int component )
+  const float& GetFloatComponent( uint32_t component )
   {
     return mTxManager->GetVector3PropertyComponentValue( mId, mProperty, component );
   }
@@ -188,12 +188,12 @@ struct TransformManagerPropertyVector3 : public TransformManagerPropertyHandler<
     mTxManager->SetVector3PropertyValue( mId, mProperty, value );
   }
 
-  void SetComponent(BufferIndex bufferIndex, float value, unsigned int component)
+  void SetComponent(BufferIndex bufferIndex, float value, uint32_t component)
   {
     mTxManager->SetVector3PropertyComponentValue( mId, mProperty, value, component);
   }
 
-  void BakeComponent(BufferIndex bufferIndex, float value, unsigned int component)
+  void BakeComponent(BufferIndex bufferIndex, float value, uint32_t component)
   {
     mTxManager->BakeVector3PropertyComponentValue( mId, mProperty, value, component);
   }
@@ -218,12 +218,12 @@ struct TransformManagerPropertyVector3 : public TransformManagerPropertyHandler<
     mTxManager->BakeZVector3PropertyValue(mId, mProperty, value );
   }
 
-  void SetFloatComponent( float value, unsigned int component)
+  void SetFloatComponent( float value, uint32_t component)
   {
     mTxManager->SetVector3PropertyComponentValue( mId, mProperty, value, component);
   }
 
-  void BakeFloatComponent( float value, unsigned int component )
+  void BakeFloatComponent( float value, uint32_t component )
   {
     mTxManager->BakeVector3PropertyComponentValue( mId, mProperty, value, component);
   }
@@ -254,17 +254,17 @@ public:
     return Dali::PropertyTypes::Get<Quaternion>();
   }
 
-  Quaternion& Get(size_t bufferIndex)
+  Quaternion& Get( BufferIndex bufferIndex )
   {
     return mTxManager->GetQuaternionPropertyValue( mId );
   }
 
-  const Quaternion& Get(size_t bufferIndex) const
+  const Quaternion& Get( BufferIndex bufferIndex ) const
   {
     return mTxManager->GetQuaternionPropertyValue( mId );
   }
 
-  const float& GetFloatComponent( unsigned int component)
+  const float& GetFloatComponent( uint32_t component)
   {
     return mTxManager->GetQuaternionPropertyValue( mId ).mVector[component];
   }
@@ -392,7 +392,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  Vector3& Get(size_t bufferIndex)
+  Vector3& Get( BufferIndex bufferIndex )
   {
     ComputeTransformComponent();
     return mValue;
@@ -401,7 +401,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  const Vector3& Get(size_t bufferIndex) const
+  const Vector3& Get( BufferIndex bufferIndex ) const
   {
     ComputeTransformComponent();
     return mValue;
@@ -412,7 +412,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Vector3& operator[](size_t bufferIndex) const
+  const Vector3& operator[]( BufferIndex bufferIndex ) const
   {
     ComputeTransformComponent();
     return mValue;
@@ -545,7 +545,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  Quaternion& Get(size_t bufferIndex)
+  Quaternion& Get( BufferIndex bufferIndex )
   {
     ComputeTransformComponent();
     return mValue;
@@ -554,7 +554,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  const Quaternion& Get(size_t bufferIndex) const
+  const Quaternion& Get( BufferIndex bufferIndex ) const
   {
     ComputeTransformComponent();
     return mValue;
@@ -565,7 +565,7 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Quaternion& operator[](size_t bufferIndex) const
+  const Quaternion& operator[]( BufferIndex bufferIndex) const
   {
     ComputeTransformComponent();
     return mValue;
@@ -690,7 +690,7 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  Matrix& Get(size_t bufferIndex)
+  Matrix& Get( BufferIndex bufferIndex )
   {
     DALI_ASSERT_ALWAYS( mTxManager != 0 );
     return mTxManager->GetWorldMatrix(mId);
@@ -699,9 +699,9 @@ public:
   /**
    * @copydoc Dali::SceneGraph::PropertyInterface::Get()
    */
-  const Matrix& Get(size_t bufferIndex) const
+  const Matrix& Get( BufferIndex bufferIndex ) const
   {
-    return GetMatrix(bufferIndex);
+    return GetMatrix( bufferIndex );
   }
 
   /**
@@ -709,9 +709,9 @@ public:
    * @param[in] bufferIndex The buffer to read.
    * @return The property value.
    */
-  const Matrix& operator[](size_t bufferIndex) const
+  const Matrix& operator[]( BufferIndex bufferIndex ) const
   {
-    return GetMatrix(bufferIndex);
+    return GetMatrix( bufferIndex );
   }
 
   void Initialize( TransformManager* transformManager, TransformId id )
index b8626c7..c2cc4bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -133,7 +133,7 @@ void TransformManager::RemoveTransform(TransformId id)
 {
   //Move the last element to the gap
   mComponentCount--;
-  unsigned int index = mIds[id];
+  TransformId index = mIds[id];
   mTxComponentAnimatable[index] = mTxComponentAnimatable[mComponentCount];
   mTxComponentStatic[index] = mTxComponentStatic[mComponentCount];
   mInheritanceMode[index] = mInheritanceMode[mComponentCount];
@@ -158,7 +158,7 @@ void TransformManager::RemoveTransform(TransformId id)
 void TransformManager::SetParent( TransformId id, TransformId parentId )
 {
   DALI_ASSERT_ALWAYS( id != parentId );
-  unsigned int index = mIds[id];
+  TransformId index = mIds[id];
   mParent[ index ] = parentId;
   mComponentDirty[ index ] = true;
   mReorder = true;
@@ -176,7 +176,7 @@ Matrix& TransformManager::GetWorldMatrix( TransformId id )
 
 void TransformManager::SetInheritPosition( TransformId id, bool inherit )
 {
-  unsigned int index = mIds[id];
+  TransformId index = mIds[id];
   if( inherit )
   {
     mInheritanceMode[ index ] |= INHERIT_POSITION;
@@ -191,7 +191,7 @@ void TransformManager::SetInheritPosition( TransformId id, bool inherit )
 
 void TransformManager::SetInheritScale( TransformId id, bool inherit )
 {
-  unsigned int index = mIds[id];
+  TransformId index = mIds[id];
   if( inherit )
   {
     mInheritanceMode[ index ] |= INHERIT_SCALE;
@@ -206,7 +206,7 @@ void TransformManager::SetInheritScale( TransformId id, bool inherit )
 
 void TransformManager::SetInheritOrientation( TransformId id, bool inherit )
 {
-  unsigned int index = mIds[id];
+  TransformId index = mIds[id];
   if( inherit )
   {
     mInheritanceMode[ index ] |= INHERIT_ORIENTATION;
@@ -248,7 +248,7 @@ void TransformManager::Update()
   {
     if( DALI_LIKELY( mInheritanceMode[i] != DONT_INHERIT_TRANSFORM && mParent[i] != INVALID_TRANSFORM_ID ) )
     {
-      const unsigned int& parentIndex = mIds[mParent[i] ];
+      const TransformId& parentIndex = mIds[mParent[i] ];
       if( DALI_LIKELY( mInheritanceMode[i] == INHERIT_ALL ) )
       {
         if( mComponentDirty[i] || mLocalMatrixDirty[parentIndex])
@@ -350,7 +350,7 @@ void TransformManager::ReorderComponents()
   mOrderedComponents.Resize(mComponentCount);
 
   TransformId parentId;
-  for( size_t i(0); i<mComponentCount; ++i )
+  for( TransformId i = 0; i<mComponentCount; ++i )
   {
     mOrderedComponents[i].id = mComponentId[i];
     mOrderedComponents[i].level = 0u;
@@ -364,8 +364,8 @@ void TransformManager::ReorderComponents()
   }
 
   std::stable_sort( mOrderedComponents.Begin(), mOrderedComponents.End());
-  unsigned int previousIndex = 0;
-  for( size_t newIndex(0); newIndex<mComponentCount-1; ++newIndex )
+  TransformId previousIndex = 0;
+  for( TransformId newIndex = 0; newIndex < mComponentCount-1; ++newIndex )
   {
     previousIndex = mIds[mOrderedComponents[newIndex].id];
     if( previousIndex != newIndex )
@@ -381,31 +381,31 @@ Vector3& TransformManager::GetVector3PropertyValue( TransformId id, TransformMan
   {
     case TRANSFORM_PROPERTY_POSITION:
     {
-      unsigned int index( mIds[id] );
+      TransformId index( mIds[id] );
       mComponentDirty[ index ] = true;
       return mTxComponentAnimatable[ index ].mPosition;
     }
     case TRANSFORM_PROPERTY_SCALE:
     {
-      unsigned int index( mIds[id] );
+      TransformId index( mIds[id] );
       mComponentDirty[ index ] = true;
       return mTxComponentAnimatable[ index ].mScale;
     }
     case TRANSFORM_PROPERTY_PARENT_ORIGIN:
     {
-      unsigned int index( mIds[id] );
+      TransformId index( mIds[id] );
       mComponentDirty[ index ] = true;
       return mTxComponentStatic[ index ].mParentOrigin;
     }
     case TRANSFORM_PROPERTY_ANCHOR_POINT:
     {
-      unsigned int index( mIds[id] );
+      TransformId index( mIds[id] );
       mComponentDirty[ index ] = true;
       return mTxComponentStatic[ index ].mAnchorPoint;
     }
     case TRANSFORM_PROPERTY_SIZE:
     {
-      unsigned int index( mIds[id] );
+      TransformId index( mIds[id] );
       mComponentDirty[ index ] = true;
       return mSize[ index ];
     }
@@ -483,7 +483,7 @@ const float& TransformManager::GetVector3PropertyComponentValue(TransformId id,
 
 void TransformManager::SetVector3PropertyValue( TransformId id, TransformManagerProperty property, const Vector3& value )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
 
   switch( property )
@@ -522,7 +522,7 @@ void TransformManager::SetVector3PropertyValue( TransformId id, TransformManager
 
 void TransformManager::SetVector3PropertyComponentValue( TransformId id, TransformManagerProperty property, float value, unsigned int component )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
 
   switch( property )
@@ -561,7 +561,7 @@ void TransformManager::SetVector3PropertyComponentValue( TransformId id, Transfo
 
 void TransformManager::BakeVector3PropertyValue( TransformId id, TransformManagerProperty property, const Vector3& value )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
 
   switch( property )
@@ -600,7 +600,7 @@ void TransformManager::BakeVector3PropertyValue( TransformId id, TransformManage
 
 void TransformManager::BakeRelativeVector3PropertyValue( TransformId id, TransformManagerProperty property, const Vector3& value )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
 
   switch( property )
@@ -639,7 +639,7 @@ void TransformManager::BakeRelativeVector3PropertyValue( TransformId id, Transfo
 
 void TransformManager::BakeMultiplyVector3PropertyValue( TransformId id, TransformManagerProperty property, const Vector3& value )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
 
   switch( property )
@@ -678,7 +678,7 @@ void TransformManager::BakeMultiplyVector3PropertyValue( TransformId id, Transfo
 
 void TransformManager::BakeVector3PropertyComponentValue( TransformId id, TransformManagerProperty property, float value, unsigned int component )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
 
   switch( property )
@@ -717,7 +717,7 @@ void TransformManager::BakeVector3PropertyComponentValue( TransformId id, Transf
 
 void TransformManager::BakeXVector3PropertyValue( TransformId id, TransformManagerProperty property, float value )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
 
   switch( property )
@@ -756,7 +756,7 @@ void TransformManager::BakeXVector3PropertyValue( TransformId id, TransformManag
 
 void TransformManager::BakeYVector3PropertyValue( TransformId id, TransformManagerProperty property, float value )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
 
   switch( property )
@@ -795,7 +795,7 @@ void TransformManager::BakeYVector3PropertyValue( TransformId id, TransformManag
 
 void TransformManager::BakeZVector3PropertyValue( TransformId id, TransformManagerProperty property, float value )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
 
   switch( property )
@@ -834,7 +834,7 @@ void TransformManager::BakeZVector3PropertyValue( TransformId id, TransformManag
 
 Quaternion& TransformManager::GetQuaternionPropertyValue( TransformId id )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mComponentDirty[ index ] = true;
   return mTxComponentAnimatable[ index ].mOrientation;
 }
@@ -846,21 +846,21 @@ const Quaternion& TransformManager::GetQuaternionPropertyValue( TransformId id )
 
 void TransformManager::SetQuaternionPropertyValue( TransformId id, const Quaternion& q )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mTxComponentAnimatable[ index ].mOrientation = q;
   mComponentDirty[ index ] = true;
 }
 
 void TransformManager::BakeQuaternionPropertyValue( TransformId id, const Quaternion& q )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mTxComponentAnimatable[ index ].mOrientation = mTxComponentAnimatableBaseValue[index].mOrientation = q;
   mComponentDirty[ index ] = true;
 }
 
 void TransformManager::BakeRelativeQuaternionPropertyValue( TransformId id, const Quaternion& q )
 {
-  unsigned int index( mIds[id] );
+  TransformId index( mIds[id] );
   mTxComponentAnimatable[ index ].mOrientation = mTxComponentAnimatableBaseValue[index].mOrientation = mTxComponentAnimatable[ index ].mOrientation * q;
   mComponentDirty[ index ] = true;
 }
@@ -872,14 +872,14 @@ const Vector4& TransformManager::GetBoundingSphere( TransformId id ) const
 
 void TransformManager::GetWorldMatrixAndSize( TransformId id, Matrix& worldMatrix, Vector3& size ) const
 {
-  unsigned int index = mIds[id];
+  TransformId index = mIds[id];
   worldMatrix = mWorld[index];
   size = mSize[index];
 }
 
 void TransformManager::SetPositionUsesAnchorPoint( TransformId id, bool value )
 {
-  unsigned int index( mIds[ id ] );
+  TransformId index( mIds[ id ] );
   mComponentDirty[ index ] = true;
   mTxComponentStatic[ index ].mPositionUsesAnchorPoint = value;
 }
index f259a13..6bf9bda 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TRANSFORM_MANAGER_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -92,7 +92,7 @@ enum TransformManagerProperty
   TRANSFORM_PROPERTY_COUNT,
 };
 
-typedef unsigned int TransformId;
+typedef uint32_t TransformId; // 4,294,967,295 transforms supported
 static const TransformId INVALID_TRANSFORM_ID = -1;
 
 } //SceneGraph
@@ -220,7 +220,7 @@ public:
    * @param[in] property The property
    * param[in] component The component (0,1,2)
    */
-  const float& GetVector3PropertyComponentValue(TransformId id, TransformManagerProperty property, unsigned int component ) const;
+  const float& GetVector3PropertyComponentValue( TransformId id, TransformManagerProperty property, uint32_t component ) const;
 
   /**
    * Set the value of a Vector3 property
@@ -237,7 +237,7 @@ public:
    * @param[in] value The new value
    * param[in] component The component (0,1,2)
    */
-  void SetVector3PropertyComponentValue( TransformId id, TransformManagerProperty property, float value, unsigned int component );
+  void SetVector3PropertyComponentValue( TransformId id, TransformManagerProperty property, float value, uint32_t component );
 
   /**
    * Bakes the value of a Vector3 property
@@ -269,7 +269,7 @@ public:
    * @param[in] property The property
    * @param[in] value The new value
    */
-  void BakeVector3PropertyComponentValue( TransformId id, TransformManagerProperty property, float value, unsigned int component );
+  void BakeVector3PropertyComponentValue( TransformId id, TransformManagerProperty property, float value, uint32_t component );
 
   /**
    * Bakes the value of the x component of Vector3 property
@@ -358,7 +358,7 @@ private:
     bool operator<(const SOrderItem& item) const {return level < item.level;}
 
     TransformId  id;
-    unsigned int level;
+    uint32_t level;
   };
 
   /**
@@ -366,7 +366,7 @@ private:
    * @param[in] i Index of a component
    * @param[in] j Index of a component
    */
-  void SwapComponents( unsigned int i, unsigned int j );
+  void SwapComponents( uint32_t i, uint32_t j );
 
   /**
    * Reorders components in hierarchical order so update can iterate sequentially
@@ -374,23 +374,23 @@ private:
    */
   void ReorderComponents();
 
-  unsigned int mComponentCount;                                            ///< Total number of components
-  FreeList mIds;                                                           ///< FreeList of Ids
-  Vector< TransformComponentAnimatable > mTxComponentAnimatable;           ///< Animatable part of the components
-  Vector< TransformComponentStatic > mTxComponentStatic;                   ///< Static part of the components
-  Vector< unsigned int > mInheritanceMode;                                 ///< Inheritance mode of the components
-  Vector< TransformId > mComponentId;                                      ///< Ids of the components
-  Vector< Vector3 > mSize;                                                 ///< Size of the components
-  Vector< TransformId > mParent;                                           ///< Parent of the components
-  Vector< Matrix > mWorld;                                                 ///< Local to world transform of the components
-  Vector< Matrix > mLocal;                                                 ///< Local to parent space transform of the components
-  Vector< Vector4 > mBoundingSpheres;                                      ///< Bounding spheres. xyz is the center and w is the radius
-  Vector< TransformComponentAnimatable > mTxComponentAnimatableBaseValue;  ///< Base values for the animatable part of the components
-  Vector< Vector3 > mSizeBase;                                             ///< Base value for the size of the components
-  Vector< bool > mComponentDirty;                                          ///< 1u if some of the parts of the component has changed in this frame, 0 otherwise
-  Vector< bool > mLocalMatrixDirty;                                        ///< 1u if the local matrix has been updated in this frame, 0 otherwise
-  Vector< SOrderItem > mOrderedComponents;                                 ///< Used to reorder components when hierarchy changes
-  bool mReorder;                                                           ///< Flag to determine if the components have to reordered in the next Update
+  uint32_t mComponentCount;                                               ///< Total number of components
+  FreeList mIds;                                                          ///< FreeList of Ids
+  Vector< TransformComponentAnimatable > mTxComponentAnimatable;          ///< Animatable part of the components
+  Vector< TransformComponentStatic > mTxComponentStatic;                  ///< Static part of the components
+  Vector< uint32_t > mInheritanceMode;                                    ///< Inheritance mode of the components
+  Vector< TransformId > mComponentId;                                     ///< Ids of the components
+  Vector< Vector3 > mSize;                                                ///< Size of the components
+  Vector< TransformId > mParent;                                          ///< Parent of the components
+  Vector< Matrix > mWorld;                                                ///< Local to world transform of the components
+  Vector< Matrix > mLocal;                                                ///< Local to parent space transform of the components
+  Vector< Vector4 > mBoundingSpheres;                                     ///< Bounding spheres. xyz is the center and w is the radius
+  Vector< TransformComponentAnimatable > mTxComponentAnimatableBaseValue; ///< Base values for the animatable part of the components
+  Vector< Vector3 > mSizeBase;                                            ///< Base value for the size of the components
+  Vector< bool > mComponentDirty;                                         ///< 1u if some of the parts of the component has changed in this frame, 0 otherwise
+  Vector< bool > mLocalMatrixDirty;                                       ///< 1u if the local matrix has been updated in this frame, 0 otherwise
+  Vector< SOrderItem > mOrderedComponents;                                ///< Used to reorder components when hierarchy changes
+  bool mReorder;                                                          ///< Flag to determine if the components have to reordered in the next Update
 };
 
 } //namespace SceneGraph
index 42bd093..f76bd28 100644 (file)
@@ -70,9 +70,9 @@ void ConstrainPropertyOwner( PropertyOwner& propertyOwner, BufferIndex updateBuf
  ************************** Update node hierarchy *****************************
  ******************************************************************************/
 
-inline void UpdateRootNodeOpacity( Layer& rootNode, int nodeDirtyFlags, BufferIndex updateBufferIndex )
+inline void UpdateRootNodeOpacity( Layer& rootNode, NodePropertyFlags nodeDirtyFlags, BufferIndex updateBufferIndex )
 {
-  if ( nodeDirtyFlags & ColorFlag )
+  if ( nodeDirtyFlags & NodePropertyFlags::COLOR )
   {
     rootNode.SetWorldColor( rootNode.GetColor( updateBufferIndex ), updateBufferIndex );
   }
@@ -83,10 +83,10 @@ inline void UpdateRootNodeOpacity( Layer& rootNode, int nodeDirtyFlags, BufferIn
   }
 }
 
-inline void UpdateNodeOpacity( Node& node, int nodeDirtyFlags, BufferIndex updateBufferIndex )
+inline void UpdateNodeOpacity( Node& node, NodePropertyFlags nodeDirtyFlags, BufferIndex updateBufferIndex )
 {
   // If opacity needs to be recalculated
-  if ( nodeDirtyFlags & ColorFlag )
+  if ( nodeDirtyFlags & NodePropertyFlags::COLOR )
   {
     node.InheritWorldColor( updateBufferIndex );
   }
@@ -100,11 +100,11 @@ inline void UpdateNodeOpacity( Node& node, int nodeDirtyFlags, BufferIndex updat
 /**
  * This is called recursively for all children of the root Node
  */
-inline int UpdateNodes( Node& node,
-                        int parentFlags,
-                        BufferIndex updateBufferIndex,
-                        Layer& currentLayer,
-                        int inheritedDrawMode )
+inline NodePropertyFlags UpdateNodes( Node& node,
+                                      NodePropertyFlags parentFlags,
+                                      BufferIndex updateBufferIndex,
+                                      Layer& currentLayer,
+                                      uint32_t inheritedDrawMode )
 {
   // Apply constraints to the node
   ConstrainPropertyOwner( node, updateBufferIndex );
@@ -112,7 +112,7 @@ inline int UpdateNodes( Node& node,
   // Short-circuit for invisible nodes
   if ( !node.IsVisible( updateBufferIndex ) )
   {
-    return 0;
+    return NodePropertyFlags::NOTHING;
   }
 
   // If the node was not previously visible
@@ -124,9 +124,9 @@ inline int UpdateNodes( Node& node,
   }
 
   // Some dirty flags are inherited from parent
-  int nodeDirtyFlags( node.GetDirtyFlags() | ( parentFlags & InheritedDirtyFlags ) );
+  NodePropertyFlags nodeDirtyFlags = node.GetInheritedDirtyFlags( parentFlags );
 
-  int cumulativeDirtyFlags = nodeDirtyFlags;
+  NodePropertyFlags cumulativeDirtyFlags = nodeDirtyFlags;
 
   Layer* layer = &currentLayer;
   Layer* nodeIsLayer( node.GetLayer() );
@@ -148,8 +148,6 @@ inline int UpdateNodes( Node& node,
   // Draw mode inheritance is treated as or-ing the modes together (as they are a bit-mask).
   inheritedDrawMode |= node.GetDrawMode();
 
-  node.PrepareRender( updateBufferIndex );
-
   // if any child node has moved or had its sort modifier changed, layer is not clean and old frame cannot be reused
   // also if node has been deleted, dont reuse old render items
   if( nodeDirtyFlags & RenderableUpdateFlags )
@@ -176,7 +174,7 @@ inline int UpdateNodes( Node& node,
 /**
  * The root node is treated separately; it cannot inherit values since it has no parent
  */
-int UpdateNodeTree( Layer& rootNode,
+NodePropertyFlags UpdateNodeTree( Layer& rootNode,
                     BufferIndex updateBufferIndex )
 {
   DALI_ASSERT_DEBUG( rootNode.IsRoot() );
@@ -184,7 +182,7 @@ int UpdateNodeTree( Layer& rootNode,
   // Short-circuit for invisible nodes
   if ( DALI_UNLIKELY( !rootNode.IsVisible( updateBufferIndex ) ) ) // almost never ever true
   {
-    return 0;
+    return NodePropertyFlags::NOTHING;
   }
 
   // If the root node was not previously visible
@@ -195,9 +193,9 @@ int UpdateNodeTree( Layer& rootNode,
     rootNode.SetAllDirtyFlags();
   }
 
-  int nodeDirtyFlags( rootNode.GetDirtyFlags() );
+  NodePropertyFlags nodeDirtyFlags( rootNode.GetDirtyFlags() );
 
-  int cumulativeDirtyFlags = nodeDirtyFlags;
+  NodePropertyFlags cumulativeDirtyFlags = nodeDirtyFlags;
 
   UpdateRootNodeOpacity( rootNode, nodeDirtyFlags, updateBufferIndex );
 
index 41f95ce..c706ded 100644 (file)
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/common/buffer-index.h>
+#include <dali/internal/update/nodes/node-declarations.h>
 
 namespace Dali
 {
@@ -31,7 +32,6 @@ namespace SceneGraph
 {
 
 class Layer;
-class Node;
 class PropertyOwner;
 
 /**
@@ -49,7 +49,8 @@ void ConstrainPropertyOwner( PropertyOwner& propertyOwner, BufferIndex updateBuf
  * @param[in] renderQueue Used to query messages for the next Render.
  * @return The cumulative (ORed) dirty flags for the updated nodes
  */
-int UpdateNodeTree( Layer& rootNode, BufferIndex updateBufferIndex );
+NodePropertyFlags UpdateNodeTree( Layer& rootNode,
+                                  BufferIndex updateBufferIndex );
 
 } // namespace SceneGraph
 
index 601f401..b9bca2d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
 #include <dali/internal/update/manager/update-manager.h>
 
 // EXTERNAL INCLUDES
-#include <dali/graphics-api/graphics-api-controller.h>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/stage.h>
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/debug.h>
 #include <dali/integration-api/render-controller.h>
-#include <dali/integration-api/graphics/graphics.h>
+#include <dali/graphics-api/graphics-api-controller.h>
 
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/devel-api/threading/mutex.h>
+#include <dali/devel-api/threading/thread-pool.h>
 #include <dali/internal/common/core-impl.h>
 #include <dali/internal/common/message.h>
 #include <dali/internal/common/shader-data.h>
@@ -46,6 +46,7 @@
 #include <dali/internal/update/controllers/scene-controller-impl.h>
 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
 #include <dali/internal/update/graphics/graphics-algorithms.h>
+#include <dali/internal/update/manager/frame-callback-processor.h>
 #include <dali/internal/update/manager/render-task-processor.h>
 #include <dali/internal/update/manager/sorted-layers.h>
 #include <dali/internal/update/manager/transform-manager.h>
 
 #if ( defined( DEBUG_ENABLED ) && defined( NODE_TREE_LOGGING ) )
 #define SNAPSHOT_NODE_LOGGING \
-const int FRAME_COUNT_TRIGGER = 16;\
+const uint32_t FRAME_COUNT_TRIGGER = 16;\
 if( mImpl->frameCounter >= FRAME_COUNT_TRIGGER )\
   {\
-    if ( NULL != mImpl->root )\
+    for( auto root : mImpl->roots )
     {\
-      mImpl->frameCounter = 0;\
-      PrintNodeTree( *mImpl->root, mSceneGraphBuffers.GetUpdateBufferIndex(), "" );\
+      if ( NULL != root )\
+      {\
+        mImpl->frameCounter = 0;\
+        PrintNodeTree( *root, mSceneGraphBuffers.GetUpdateBufferIndex(), "" );\
+      }\
     }\
   }\
 mImpl->frameCounter++;
@@ -87,9 +91,11 @@ extern Debug::Filter* gRenderTaskLogFilter;
 #endif
 
 
+
 using namespace Dali::Integration;
 using Dali::Internal::Update::MessageQueue;
 
+
 namespace Dali
 {
 
@@ -101,21 +107,9 @@ namespace SceneGraph
 
 namespace
 {
-/**
- * Helper to reset animate-able objects to base values
- * @param container to iterate over
- * @param updateBufferIndex to use
- */
-template< class T >
-inline void ResetToBaseValues( OwnerContainer<T*>& container, BufferIndex updateBufferIndex )
-{
-  // Reset animatable properties to base values
-  // use reference to avoid extra copies of the iterator
-  for( auto&& iter : container )
-  {
-    iter->ResetToBaseValues( updateBufferIndex );
-  }
-}
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_UPDATE" );
+#endif
 
 /**
  * Helper to Erase an object from OwnerContainer using discard queue
@@ -160,6 +154,20 @@ void SortSiblingNodesRecursively( Node& node )
 
 } // unnamed namespace
 
+/**
+ * Structures describes a single request for texture upload
+ */
+struct TextureUploadRequest
+{
+  TextureUploadRequest( Texture* texture, const PixelDataPtr& pixelData, const Internal::Texture::UploadParams& uploadParams )
+    : texture( texture ),
+      pixelData( pixelData ),
+      uploadParams( uploadParams )
+  {}
+  Texture*                        texture;
+  PixelDataPtr                    pixelData;
+  Internal::Texture::UploadParams uploadParams;
+};
 
 /**
  * Structure to contain UpdateManager internal data
@@ -173,7 +181,7 @@ struct UpdateManager::Impl
         RenderController& renderController,
         SceneGraphBuffers& sceneGraphBuffers,
         RenderTaskProcessor& renderTaskProcessor,
-        Integration::Graphics::Graphics& graphics )
+        Graphics::Controller& graphicsController )
   : notificationManager( notificationManager ),
     transformManager(),
     animationPlaylist( animationPlaylist ),
@@ -181,47 +189,54 @@ struct UpdateManager::Impl
     discardQueue( discardQueue ),
     renderController( renderController ),
     sceneController( NULL ),
+    graphicsAlgorithms( graphicsController ),
     renderInstructions( ),
     renderTaskProcessor( renderTaskProcessor ),
-    graphics( graphics ),
+    graphicsController( graphicsController ),
     backgroundColor( Dali::Stage::DEFAULT_BACKGROUND_COLOR ),
-    taskList( /*renderMessageDispatcher*/ ),
-    systemLevelTaskList( /*renderMessageDispatcher*/ ),
-    root( NULL ),
-    systemLevelRoot( NULL ),
     renderers(),
     textureSets(),
     shaders(),
     panGestureProcessor( NULL ),
     messageQueue( renderController, sceneGraphBuffers ),
+    frameCallbackProcessor( NULL ),
     keepRenderingSeconds( 0.0f ),
-    nodeDirtyFlags( TransformFlag ), // set to TransformFlag to ensure full update the first time through Update()
+    nodeDirtyFlags( NodePropertyFlags::TRANSFORM ), // set to TransformFlag to ensure full update the first time through Update()
     frameCounter( 0 ),
+    renderingBehavior( DevelStage::Rendering::IF_REQUIRED ),
     animationFinishedDuringUpdate( false ),
     previousUpdateScene( false ),
     renderTaskWaiting( false ),
     renderersAdded( false ),
-    shaderCache( graphics.GetController() )
+    surfaceRectChanged( false ),
+    graphicsShutdown( false ),
+    shaderCache( graphicsController )
   {
     sceneController = new SceneControllerImpl( discardQueue );
 
+    /**
+     * Create thread pool with just one thread ( there may be a need to create more threads in the future ).
+     */
+
+    threadPool = std::make_unique<Dali::ThreadPool>();
+    threadPool->Initialize( 1 );
+
     // create first 'dummy' node
     nodes.PushBack(0u);
   }
 
   ~Impl()
   {
+    threadPool.reset( nullptr ); // reset now to maintain correct destruction order
+
     // Disconnect render tasks from nodes, before destroying the nodes
-    RenderTaskList::RenderTaskContainer& tasks = taskList.GetTasks();
-    for ( auto&& iter : tasks )
-    {
-      iter->SetSourceNode( NULL );
-    }
-    // ..repeat for system level RenderTasks
-    RenderTaskList::RenderTaskContainer& systemLevelTasks = systemLevelTaskList.GetTasks();
-    for ( auto&& iter : systemLevelTasks )
+    for( auto taskList : taskLists )
     {
-      iter->SetSourceNode( NULL );
+      RenderTaskList::RenderTaskContainer& tasks = taskList->GetTasks();
+      for ( auto&& task : tasks )
+      {
+        task->SetSourceNode( NULL );
+      }
     }
 
     // UpdateManager owns the Nodes. Although Nodes are pool allocated they contain heap allocated parts
@@ -234,24 +249,108 @@ struct UpdateManager::Impl
       Node::Delete(*iter);
     }
 
-    // If there is root, reset it, otherwise do nothing as rendering was never started
-    if( root )
+    for( auto root : roots )
     {
       root->OnDestroy();
+    }
+
+    delete sceneController;
+  }
 
-      Node::Delete( root );
-      root = NULL;
+  /**
+   * Lazy init for FrameCallbackProcessor.
+   * @param[in]  updateManager  A reference to the update-manager
+   */
+  FrameCallbackProcessor& GetFrameCallbackProcessor( UpdateManager& updateManager )
+  {
+    if( ! frameCallbackProcessor )
+    {
+      frameCallbackProcessor = new FrameCallbackProcessor( updateManager, transformManager );
+    }
+    return *frameCallbackProcessor;
+  }
+
+  /**
+   * Processes texture uploads
+   * @param[in] processParallel True enables parallel processing
+   * @param[in] useSingleStagingBuffer if true a single staging buffer is used for all uploads during frame
+   * @return Shared pointer to the Future object
+   */
+  Dali::SharedFuture ProcessTextureUploadRequests( bool processParallel, bool useSingleStagingBuffer )
+  {
+    if( textureUploadRequestContainer.empty() )
+    {
+      return {};
     }
 
-    if( systemLevelRoot )
+    /**
+     * Worker thread lambda function
+     */
+    auto workerFunction = [&, processParallel, useSingleStagingBuffer]( int workerThread )
     {
-      systemLevelRoot->OnDestroy();
+      textureUpdateInfoArray.clear();
+      textureUpdateSourceInfoArray.clear();
+      textureUpdateInfoArray.reserve( textureUploadRequestContainer.size() );
+      textureUpdateSourceInfoArray.reserve( textureUploadRequestContainer.size() );
 
-      Node::Delete( systemLevelRoot );
-      systemLevelRoot = NULL;
+      uint32_t sourceIndex { 0u };
+      for( auto& request : textureUploadRequestContainer )
+      {
+        auto pixelData = request.pixelData;
+
+        // Intialise texture
+        if( useSingleStagingBuffer )
+        {
+          auto info = Graphics::TextureUpdateInfo{};
+
+          // initialise texture object without allocating memory for it yet
+          if(!request.texture->GetGfxObject())
+          {
+            request.texture->CreateTextureInternal( Texture::Usage::SAMPLE, nullptr, 0u );
+          }
+
+          // prepare transfer info structure
+          info.dstTexture = request.texture->GetGfxObject();
+          info.dstOffset2D = { request.uploadParams.xOffset, request.uploadParams.yOffset };
+          info.srcOffset = 0u;
+          info.srcSize = request.pixelData->GetBufferSize();
+          info.srcReference = sourceIndex++;
+          info.srcExtent2D = { request.pixelData->GetWidth(), request.pixelData->GetHeight() };
+          textureUpdateInfoArray.emplace_back( info );
+
+          // store source
+          auto source = Graphics::TextureUpdateSourceInfo{};
+          source.sourceType = Graphics::TextureUpdateSourceInfo::Type::Memory;
+          source.memorySource.pMemory = pixelData->GetBuffer();
+          textureUpdateSourceInfoArray.emplace_back( source );
+        }
+        else
+        {
+          request.texture->UploadTexture( pixelData, request.uploadParams );
+        }
+      }
+
+      /**
+       * When using single staging buffer delegate all uploads to the controller for further processing
+       */
+      if( useSingleStagingBuffer )
+      {
+        auto controller = &graphicsController;
+        controller->UpdateTextures( textureUpdateInfoArray, textureUpdateSourceInfoArray );
+      }
+    };
+
+    if( processParallel )
+    {
+      return threadPool->SubmitTask( 0u, workerFunction );
+    }
+    else
+    {
+      // If not processing in parallel, just call lambda directly and return empty future
+      workerFunction(0);
     }
 
-    delete sceneController;
+    return {};
   }
 
   SceneGraphBuffers                    sceneGraphBuffers;             ///< Used to keep track of which buffers are being written or read
@@ -263,29 +362,26 @@ struct UpdateManager::Impl
   DiscardQueue&                        discardQueue;                  ///< Nodes are added here when disconnected from the scene-graph.
   RenderController&                    renderController;              ///< render controller
   SceneControllerImpl*                 sceneController;               ///< scene controller
-  RenderInstructionContainer           renderInstructions;            ///< Used to prepare the render instructions @todo GRAPHICS Remove
+  GraphicsAlgorithms                   graphicsAlgorithms;            ///< Graphics algorithms
+  RenderInstructionContainer           renderInstructions;            ///< List of current instructions per frame
   RenderTaskProcessor&                 renderTaskProcessor;           ///< Handles RenderTasks and RenderInstrucitons
-
-  Integration::Graphics::Graphics&     graphics;                      ///< Graphics
+  Graphics::Controller&                graphicsController;            ///< Graphics controller
 
   Vector4                              backgroundColor;               ///< The glClear color used at the beginning of each frame.
 
-  RenderTaskList                       taskList;                      ///< The list of scene graph render-tasks
-  RenderTaskList                       systemLevelTaskList;           ///< Separate render-tasks for system-level content
+  OwnerContainer<RenderTaskList*>      taskLists;                     ///< A container of scene graph render task lists
 
-  Layer*                               root;                          ///< The root node (root is a layer)
-  Layer*                               systemLevelRoot;               ///< A separate root-node for system-level content
+  OwnerContainer<Layer*>               roots;                         ///< A container of root nodes (root is a layer). The layers are not stored in the node memory pool.
 
   Vector<Node*>                        nodes;                         ///< A container of all instantiated nodes
 
-  SortedLayerPointers                  sortedLayers;                  ///< A container of Layer pointers sorted by depth
-  SortedLayerPointers                  systemLevelSortedLayers;       ///< A separate container of system-level Layers
+  std::vector<SortedLayerPointers>     sortedLayerLists;              ///< A container of lists of Layer pointers sorted by depth (one list of sorted layers per root)
 
   OwnerContainer< Camera* >            cameras;                       ///< A container of cameras
   OwnerContainer< PropertyOwner* >     customObjects;                 ///< A container of owned objects (with custom properties)
 
   OwnerContainer< PropertyResetterBase* > propertyResetters;          ///< A container of property resetters
-  AnimationContainer                   animations;                    ///< A container of owned animations
+  OwnerContainer< Animation* >         animations;                    ///< A container of owned animations
   PropertyNotificationContainer        propertyNotifications;         ///< A container of owner property notifications.
   OwnerContainer< Renderer* >          renderers;                     ///< A container of owned renderers
   OwnerContainer< TextureSet* >        textureSets;                   ///< A container of owned texture sets
@@ -300,16 +396,27 @@ struct UpdateManager::Impl
 
   MessageQueue                         messageQueue;                  ///< The messages queued from the event-thread
 
+  OwnerPointer<FrameCallbackProcessor> frameCallbackProcessor;        ///< Owned FrameCallbackProcessor, only created if required.
+
   float                                keepRenderingSeconds;          ///< Set via Dali::Stage::KeepRendering
-  int                                  nodeDirtyFlags;                ///< cumulative node dirty flags from previous frame
-  int                                  frameCounter;                  ///< Frame counter used in debugging to choose which frame to debug and which to ignore.
+  NodePropertyFlags                    nodeDirtyFlags;                ///< cumulative node dirty flags from previous frame
+  uint32_t                             frameCounter;                  ///< Frame counter used in debugging to choose which frame to debug and which to ignore.
+
+  DevelStage::Rendering                renderingBehavior;             ///< Set via DevelStage::SetRenderingBehavior
 
   bool                                 animationFinishedDuringUpdate; ///< Flag whether any animations finished during the Update()
   bool                                 previousUpdateScene;           ///< True if the scene was updated in the previous frame (otherwise it was optimized out)
   bool                                 renderTaskWaiting;             ///< A REFRESH_ONCE render task is waiting to be rendered
   bool                                 renderersAdded;                ///< Flag to keep track when renderers have been added to avoid unnecessary processing
+  bool                                 surfaceRectChanged;            ///< True if the default surface rect is changed
+  bool                                 graphicsShutdown;              ///< True if the graphics subsystem has shutdown
 
   ShaderCache                          shaderCache;
+  std::vector<TextureUploadRequest>    textureUploadRequestContainer;
+  std::unique_ptr<Dali::ThreadPool> threadPool;
+
+  std::vector<Graphics::TextureUpdateInfo> textureUpdateInfoArray;
+  std::vector<Graphics::TextureUpdateSourceInfo> textureUpdateSourceInfoArray;
 
 private:
 
@@ -323,7 +430,7 @@ UpdateManager::UpdateManager( NotificationManager&             notificationManag
                               DiscardQueue&                    discardQueue,
                               RenderController&                controller,
                               RenderTaskProcessor&             renderTaskProcessor,
-                              Integration::Graphics::Graphics& graphics )
+                              Graphics::Controller&            graphicsController )
 : mImpl( new Impl( notificationManager,
                    animationFinishedNotifier,
                    propertyNotifier,
@@ -331,7 +438,7 @@ UpdateManager::UpdateManager( NotificationManager&             notificationManag
                    controller,
                    mSceneGraphBuffers,
                    renderTaskProcessor,
-                   graphics) )
+                   graphicsController) )
 {
 }
 
@@ -341,25 +448,18 @@ UpdateManager::~UpdateManager()
 }
 
 
-void UpdateManager::InstallRoot( OwnerPointer<Layer>& layer, bool systemLevel )
+void UpdateManager::InstallRoot( OwnerPointer<Layer>& layer )
 {
   DALI_ASSERT_DEBUG( layer->IsLayer() );
   DALI_ASSERT_DEBUG( layer->GetParent() == NULL);
 
-  if ( !systemLevel )
-  {
-    DALI_ASSERT_DEBUG( mImpl->root == NULL && "Root Node already installed" );
-    mImpl->root = layer.Release();
-    mImpl->root->CreateTransform( &mImpl->transformManager );
-    mImpl->root->SetRoot(true);
-  }
-  else
-  {
-    DALI_ASSERT_DEBUG( mImpl->systemLevelRoot == NULL && "System-level Root Node already installed" );
-    mImpl->systemLevelRoot = layer.Release();
-    mImpl->systemLevelRoot->CreateTransform( &mImpl->transformManager );
-    mImpl->systemLevelRoot->SetRoot(true);
-  }
+  Layer* rootLayer = layer.Release();
+
+  DALI_ASSERT_DEBUG( std::find( mImpl->roots.begin(), mImpl->roots.end(), rootLayer ) == mImpl->roots.end() && "Root Node already installed" );
+
+  rootLayer->CreateTransform( &mImpl->transformManager );
+  rootLayer->SetRoot(true);
+  mImpl->roots.PushBack( rootLayer );
 }
 
 void UpdateManager::AddNode( OwnerPointer<Node>& node )
@@ -387,15 +487,27 @@ void UpdateManager::ConnectNode( Node* parent, Node* node )
   DALI_ASSERT_ALWAYS( NULL == node->GetParent() ); // Should not have a parent yet
 
   parent->ConnectChild( node );
+
+  // Inform the frame-callback-processor, if set, about the node-hierarchy changing
+  if( mImpl->frameCallbackProcessor )
+  {
+    mImpl->frameCallbackProcessor->NodeHierarchyChanged();
+  }
 }
 
 void UpdateManager::DisconnectNode( Node* node )
 {
   Node* parent = node->GetParent();
   DALI_ASSERT_ALWAYS( NULL != parent );
-  parent->SetDirtyFlag( ChildDeletedFlag ); // make parent dirty so that render items dont get reused
+  parent->SetDirtyFlag( NodePropertyFlags::CHILD_DELETED ); // make parent dirty so that render items dont get reused
 
   parent->DisconnectChild( mSceneGraphBuffers.GetUpdateBufferIndex(), *node );
+
+  // Inform the frame-callback-processor, if set, about the node-hierarchy changing
+  if( mImpl->frameCallbackProcessor )
+  {
+    mImpl->frameCallbackProcessor->NodeHierarchyChanged();
+  }
 }
 
 void UpdateManager::DestroyNode( Node* node )
@@ -425,10 +537,10 @@ void UpdateManager::AddCamera( OwnerPointer< Camera >& camera )
   mImpl->cameras.PushBack( camera.Release() ); // takes ownership
 }
 
-void UpdateManager::RemoveCamera( const Camera* camera )
+void UpdateManager::RemoveCamera( Camera* camera )
 {
   // Find the camera and destroy it
-  EraseUsingDiscardQueue( mImpl->cameras, const_cast<Camera*>( camera ), mImpl->discardQueue, mSceneGraphBuffers.GetUpdateBufferIndex() );
+  EraseUsingDiscardQueue( mImpl->cameras, camera, mImpl->discardQueue, mSceneGraphBuffers.GetUpdateBufferIndex() );
 }
 
 void UpdateManager::AddObject( OwnerPointer<PropertyOwner>& object )
@@ -441,6 +553,17 @@ void UpdateManager::RemoveObject( PropertyOwner* object )
   mImpl->customObjects.EraseObject( object );
 }
 
+void UpdateManager::AddRenderTaskList( OwnerPointer<RenderTaskList>& taskList )
+{
+  RenderTaskList* taskListPointer = taskList.Release();
+  mImpl->taskLists.PushBack( taskListPointer );
+}
+
+void UpdateManager::RemoveRenderTaskList( RenderTaskList* taskList )
+{
+  mImpl->taskLists.EraseObject( taskList );
+}
+
 void UpdateManager::AddAnimation( OwnerPointer< SceneGraph::Animation >& animation )
 {
   mImpl->animations.PushBack( animation.Release() );
@@ -505,7 +628,7 @@ void UpdateManager::PropertyNotificationSetNotify( PropertyNotification* propert
 
 void UpdateManager::AddShader( OwnerPointer< Shader >& shader )
 {
-  shader->Initialize( mImpl->graphics, mImpl->shaderCache );
+  shader->Initialize( mImpl->graphicsController, mImpl->shaderCache );
   mImpl->shaders.PushBack( shader.Release() );
 }
 
@@ -517,7 +640,7 @@ void UpdateManager::RemoveShader( Shader* shader )
 
 void UpdateManager::AddRenderer( OwnerPointer< Renderer >& renderer )
 {
-  renderer->Initialize( mImpl->graphics );
+  renderer->Initialize( mImpl->graphicsController );
   mImpl->renderers.PushBack( renderer.Release() );
   mImpl->renderersAdded = true;
 }
@@ -546,21 +669,7 @@ void UpdateManager::RemoveTextureSet( TextureSet* textureSet )
   mImpl->textureSets.EraseObject( textureSet );
 }
 
-RenderTaskList* UpdateManager::GetRenderTaskList( bool systemLevel )
-{
-  if ( !systemLevel )
-  {
-    // copy the list, this is only likely to happen once in application life cycle
-    return &(mImpl->taskList);
-  }
-  else
-  {
-    // copy the list, this is only likely to happen once in application life cycle
-    return &(mImpl->systemLevelTaskList);
-  }
-}
-
-unsigned int* UpdateManager::ReserveMessageSlot( std::size_t size, bool updateScene )
+uint32_t* UpdateManager::ReserveMessageSlot( uint32_t size, bool updateScene )
 {
   return mImpl->messageQueue.ReserveMessageSlot( size, updateScene );
 }
@@ -597,6 +706,12 @@ void UpdateManager::ResetProperties( BufferIndex bufferIndex )
     mImpl->propertyResetters.EraseObject( elementPtr );
   }
 
+  // Clear root dirty flags
+  for( auto&& rootLayer : mImpl->roots )
+  {
+    rootLayer->ResetDirtyFlags( bufferIndex );
+  }
+
   // Clear node dirty flags
   Vector<Node*>::Iterator iter = mImpl->nodes.Begin()+1;
   Vector<Node*>::Iterator endIter = mImpl->nodes.End();
@@ -606,7 +721,7 @@ void UpdateManager::ResetProperties( BufferIndex bufferIndex )
   }
 }
 
-bool UpdateManager::ProcessGestures( BufferIndex bufferIndex, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds )
+bool UpdateManager::ProcessGestures( BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds )
 {
   bool gestureUpdated( false );
 
@@ -622,11 +737,10 @@ bool UpdateManager::ProcessGestures( BufferIndex bufferIndex, unsigned int lastV
 
 void UpdateManager::Animate( BufferIndex bufferIndex, float elapsedSeconds )
 {
-  AnimationContainer &animations = mImpl->animations;
-  AnimationIter iter = animations.Begin();
+  auto&& iter = mImpl->animations.Begin();
   bool animationLooped = false;
 
-  while ( iter != animations.End() )
+  while ( iter != mImpl->animations.End() )
   {
     Animation* animation = *iter;
     bool finished = false;
@@ -645,7 +759,7 @@ void UpdateManager::Animate( BufferIndex bufferIndex, float elapsedSeconds )
     // Remove animations that had been destroyed but were still waiting for an update
     if (animation->GetState() == Animation::Destroyed)
     {
-      iter = animations.Erase(iter);
+      iter = mImpl->animations.Erase(iter);
     }
     else
     {
@@ -672,18 +786,14 @@ void UpdateManager::ConstrainCustomObjects( BufferIndex bufferIndex )
 
 void UpdateManager::ConstrainRenderTasks( BufferIndex bufferIndex )
 {
-  // Constrain system-level render-tasks
-  const RenderTaskList::RenderTaskContainer& systemLevelTasks = mImpl->systemLevelTaskList.GetTasks();
-  for ( auto&& task : systemLevelTasks )
-  {
-    ConstrainPropertyOwner( *task, bufferIndex );
-  }
-
   // Constrain render-tasks
-  const RenderTaskList::RenderTaskContainer& tasks = mImpl->taskList.GetTasks();
-  for ( auto&& task : tasks )
+  for( auto taskList : mImpl->taskLists )
   {
-    ConstrainPropertyOwner( *task, bufferIndex );
+    RenderTaskList::RenderTaskContainer& tasks = taskList->GetTasks();
+    for ( auto&& task : tasks )
+    {
+      ConstrainPropertyOwner( *task, bufferIndex );
+    }
   }
 }
 
@@ -714,54 +824,95 @@ void UpdateManager::UpdateRenderers( BufferIndex bufferIndex )
   for( auto i = 0u; i < rendererCount; ++i )
   {
     //Apply constraints
-    ConstrainPropertyOwner( *mImpl->renderers[i], bufferIndex );
+    auto renderer = mImpl->renderers[i];
+    ConstrainPropertyOwner( *renderer, bufferIndex );
+  }
+}
 
-    mImpl->renderers[i]->PrepareRender( bufferIndex );
+void UpdateManager::PrepareNodes( BufferIndex updateBufferIndex )
+{
+  for( auto node : mImpl->nodes )
+  {
+    if(node)
+    {
+      node->PrepareRender( updateBufferIndex );
+    }
   }
 }
 
-void UpdateManager::UpdateNodes( BufferIndex bufferIndex )
+void UpdateManager::PrepareRenderers( BufferIndex bufferIndex )
 {
-  mImpl->nodeDirtyFlags = NothingFlag;
+  // Prepare renderers. Each render item maps to a render
+  // command. There may be more than one render item per renderer if
+  // the actor containing the renderer is in more than one render
+  // task. The renderer owns the render commands.
 
-  if ( !mImpl->root )
+  const auto renderInstructionCount = mImpl->renderInstructions.Count( bufferIndex );
+  for( auto i=0u; i < renderInstructionCount; ++i )
   {
-    return;
+    auto& renderInstruction = mImpl->renderInstructions.At( bufferIndex, i);
+    const auto renderListCount = renderInstruction.RenderListCount();
+    for( auto j=0u; j < renderListCount; ++j )
+    {
+      auto renderList = renderInstruction.GetRenderList( j );
+      const auto renderItemCount = renderList->Count();
+      for( auto k=0u; k < renderItemCount; ++k )
+      {
+        auto& renderItem = renderList->GetItem( k );
+        if( renderItem.mRenderer )
+        {
+          renderItem.mRenderer->PrepareRender( bufferIndex, &renderInstruction );
+        }
+      }
+    }
   }
+}
+
+void UpdateManager::UploadTexture( Texture* texture,
+                                   PixelDataPtr pixelData,
+                                   const Internal::Texture::UploadParams& params )
+{
+  mImpl->textureUploadRequestContainer.emplace_back( texture, pixelData, params );
+}
 
-  // Prepare resources, update shaders, for each node
-  // And add the renderers to the sorted layers. Start from root, which is also a layer
-  mImpl->nodeDirtyFlags = UpdateNodeTree( *( mImpl->root ), bufferIndex );
+void UpdateManager::UpdateNodes( BufferIndex bufferIndex )
+{
+  mImpl->nodeDirtyFlags = NodePropertyFlags::NOTHING;
 
-  if ( mImpl->systemLevelRoot )
+  for( auto&& rootLayer : mImpl->roots )
   {
-    mImpl->nodeDirtyFlags |= UpdateNodeTree( *( mImpl->systemLevelRoot ), bufferIndex );
+    // Prepare resources, update shaders, for each node
+    // And add the renderers to the sorted layers. Start from root, which is also a layer
+    mImpl->nodeDirtyFlags |= UpdateNodeTree( *rootLayer,
+                                            bufferIndex );
   }
 }
 
-unsigned int UpdateManager::Update( float elapsedSeconds,
-                                    unsigned int lastVSyncTimeMilliseconds,
-                                    unsigned int nextVSyncTimeMilliseconds,
-                                    bool renderToFboEnabled,
-                                    bool isRenderingToFbo )
+uint32_t UpdateManager::Update( float elapsedSeconds,
+                                uint32_t lastVSyncTimeMilliseconds,
+                                uint32_t nextVSyncTimeMilliseconds,
+                                bool renderToFboEnabled,
+                                bool isRenderingToFbo )
 {
   const BufferIndex bufferIndex = mSceneGraphBuffers.GetUpdateBufferIndex();
 
   //Clear nodes/resources which were previously discarded
+  size_t numberOfDiscardedRenderers = mImpl->discardQueue.GetRendererCount( bufferIndex );
   mImpl->discardQueue.Clear( bufferIndex );
 
   //Process Touches & Gestures
   const bool gestureUpdated = ProcessGestures( bufferIndex, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds );
+  const bool resumed = mImpl->graphicsController.IsDrawOnResumeRequired();
 
-  bool updateScene = // The scene-graph requires an update if..
-      (mImpl->nodeDirtyFlags & RenderableUpdateFlags) ||    // ..nodes were dirty in previous frame OR
-      IsAnimationRunning()                            ||    // ..at least one animation is running OR
-      mImpl->messageQueue.IsSceneUpdateRequired()     ||    // ..a message that modifies the scene graph node tree is queued OR
-      gestureUpdated;                                       // ..a gesture property was updated
+  bool updateScene =                                   // The scene-graph requires an update if..
+    (mImpl->nodeDirtyFlags & RenderableUpdateFlags) || // ..nodes were dirty in previous frame OR
+    IsAnimationRunning()                            || // ..at least one animation is running OR
+    mImpl->messageQueue.IsSceneUpdateRequired()     || // ..a message that modifies the scene graph node tree is queued OR
+    gestureUpdated;                                    // ..a gesture property was updated
 
-
-  // Although the scene-graph may not require an update, we still need to synchronize double-buffered
-  // values if the scene was updated in the previous frame.
+  bool keepRendererRendering = false;
+  // Although the scene-graph may not require an update, we still need to synchronize
+  // double-buffered values if the scene was updated in the previous frame.
   if( updateScene || mImpl->previousUpdateScene )
   {
     //Reset properties from the previous update
@@ -769,15 +920,24 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
     mImpl->transformManager.ResetToBaseValue();
   }
 
-  // Process the queued scene messages. Note, MessageQueue::FlushQueue may be called
-  // between calling IsSceneUpdateRequired() above and here, so updateScene should
-  // be set again
+  // Process the queued scene messages. Note, MessageQueue::FlushQueue may be called between calling
+  // IsSceneUpdateRequired() above and here, so updateScene should be set again
   updateScene |= mImpl->messageQueue.ProcessMessages( bufferIndex );
+  updateScene |= resumed;
 
-  // Although the scene-graph may not require an update, we still need to synchronize double-buffered
-  // renderer lists if the scene was updated in the previous frame.
-  // We should not start skipping update steps or reusing lists until there has been two frames where nothing changes
-  if( updateScene || mImpl->previousUpdateScene )
+  // Temporarily, switch between single and multithreaded texture
+  // DALI_DISABLE_PARALLEL_TEXTURE_UPLOAD - disables running texture processing on the worker thread
+  // DALI_DISABLE_SINGLE_STAGING_BUFFER - disables allocating single staging buffer
+  auto processParallel = (getenv( "DALI_DISABLE_PARALLEL_TEXTURE_UPLOAD" ) && getenv( "DALI_DISABLE_PARALLEL_TEXTURE_UPLOAD" )[0] == '1' ) ? false : true;
+  auto singleStagingBuffer = (getenv( "DALI_DISABLE_SINGLE_STAGING_BUFFER" ) && getenv( "DALI_DISABLE_SINGLE_STAGING_BUFFER" )[0] == '1' ) ? false : true;
+
+  auto future = mImpl->ProcessTextureUploadRequests( processParallel, singleStagingBuffer  );
+
+  // Although the scene-graph may not require an update, we still need to synchronize
+  // double-buffered renderer lists if the scene was updated in the previous frame.  We should not
+  // start skipping update steps or reusing lists until there have been two frames where nothing
+  // changes.
+  if( future || updateScene || mImpl->previousUpdateScene )
   {
     //Animate
     Animate( bufferIndex, elapsedSeconds );
@@ -786,14 +946,18 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
     ConstrainCustomObjects( bufferIndex );
 
     //Clear the lists of renderers from the previous update
-    for( size_t i(0); i<mImpl->sortedLayers.size(); ++i )
+    for( auto sortedLayers : mImpl->sortedLayerLists )
     {
-      mImpl->sortedLayers[i]->ClearRenderables();
+      for( auto&& layer : sortedLayers )
+      {
+        layer->ClearRenderables();
+      }
     }
 
-    for( size_t i(0); i<mImpl->systemLevelSortedLayers.size(); ++i )
+    // Call the frame-callback-processor if set
+    if( mImpl->frameCallbackProcessor )
     {
-      mImpl->systemLevelSortedLayers[i]->ClearRenderables();
+      mImpl->frameCallbackProcessor->Update( bufferIndex, elapsedSeconds );
     }
 
     //Update node hierarchy, apply constraints and perform sorting / culling.
@@ -819,73 +983,90 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
       cameraIterator->Update( bufferIndex );
     }
 
-    auto* impl = mImpl.get();
-    impl = impl;
     //Process the RenderTasks if renderers exist. This creates the instructions for rendering the next frame.
     //reset the update buffer index and make sure there is enough room in the instruction container
     if( mImpl->renderersAdded )
     {
-      mImpl->renderInstructions.ResetAndReserve(bufferIndex,
-                                                mImpl->taskList.GetTasks().Count() +
-                                                    mImpl->systemLevelTaskList.GetTasks().Count());
+      // Calculate how many render tasks we have in total
+      VectorBase::SizeType numberOfRenderTasks = 0;
+
+      const VectorBase::SizeType taskListCount = mImpl->taskLists.Count();
+      for ( VectorBase::SizeType index = 0u; index < taskListCount; index++ )
+      {
+        numberOfRenderTasks += mImpl->taskLists[index]->GetTasks().Count();
+      }
 
-      if ( NULL != mImpl->root )
+      mImpl->renderInstructions.ResetAndReserve( bufferIndex,
+                                                 static_cast<uint32_t>( numberOfRenderTasks ) );
+
+      for ( VectorBase::SizeType index = 0u; index < taskListCount; index++ )
       {
-        mImpl->renderTaskProcessor.Process( bufferIndex,
-                                            mImpl->taskList,
-                                            *mImpl->root,
-                                            mImpl->sortedLayers,
-                                            mImpl->renderInstructions,
-                                            renderToFboEnabled,
-                                            isRenderingToFbo );
-
-        // Process the system-level RenderTasks last
-        if ( NULL != mImpl->systemLevelRoot )
+        if ( NULL != mImpl->roots[index] )
         {
-          mImpl->renderTaskProcessor.Process( bufferIndex,
-                                              mImpl->systemLevelTaskList,
-                                              *mImpl->systemLevelRoot,
-                                              mImpl->systemLevelSortedLayers,
+          keepRendererRendering |= mImpl->renderTaskProcessor.Process( bufferIndex,
+                                              *mImpl->taskLists[index],
+                                              *mImpl->roots[index],
+                                              mImpl->sortedLayerLists[index],
                                               mImpl->renderInstructions,
                                               renderToFboEnabled,
                                               isRenderingToFbo );
         }
       }
 
-      // Prepare pipelines
-
+      // Pass the total number of renderers that were discarded this frame to the graphics backend.
+      // This may trigger garbage collection.
+      if( numberOfDiscardedRenderers > 0 )
+      {
+        mImpl->graphicsController.RunGarbageCollector( numberOfDiscardedRenderers );
+      }
 
       // generate graphics objects
-
-      SubmitRenderInstructions( mImpl->graphics.GetController(), mImpl->renderInstructions, bufferIndex );
+      PrepareNodes( bufferIndex );
+      if( future )
+      {
+        future->Wait();
+        future.reset();
+      }
+      PrepareRenderers( bufferIndex );
+      mImpl->graphicsAlgorithms.SubmitRenderInstructions( mImpl->graphicsController, mImpl->renderInstructions, bufferIndex );
     }
   }
+  else
+  {
+    // Discard graphics resources
+    mImpl->graphicsAlgorithms.DiscardUnusedResources( mImpl->graphicsController );
+  }
 
-  // check the countdown and notify (note, at the moment this is only done for normal tasks, not for systemlevel tasks)
-  bool doRenderOnceNotify = false;
-  mImpl->renderTaskWaiting = false;
-  for ( auto&& renderTask : mImpl->taskList.GetTasks() )
+  for( auto taskList : mImpl->taskLists )
   {
-    renderTask->UpdateState();
+    RenderTaskList::RenderTaskContainer& tasks = taskList->GetTasks();
 
-    if( renderTask->IsWaitingToRender() &&
-        renderTask->ReadyToRender( bufferIndex ) /*avoid updating forever when source actor is off-stage*/ )
+    // check the countdown and notify
+    bool doRenderOnceNotify = false;
+    mImpl->renderTaskWaiting = false;
+    for ( auto&& renderTask : tasks )
     {
-      mImpl->renderTaskWaiting = true; // keep update/render threads alive
+      renderTask->UpdateState();
+
+      if( renderTask->IsWaitingToRender() &&
+          renderTask->ReadyToRender( bufferIndex ) /*avoid updating forever when source actor is off-stage*/ )
+      {
+        mImpl->renderTaskWaiting = true; // keep update/render threads alive
+      }
+
+      if( renderTask->HasRendered() )
+      {
+        doRenderOnceNotify = true;
+      }
     }
 
-    if( renderTask->HasRendered() )
+    if( doRenderOnceNotify )
     {
-      doRenderOnceNotify = true;
+      DALI_LOG_INFO(gRenderTaskLogFilter, Debug::General, "Notify a render task has finished\n");
+      mImpl->notificationManager.QueueCompleteNotification( taskList->GetCompleteNotificationInterface() );
     }
   }
 
-  if( doRenderOnceNotify )
-  {
-    DALI_LOG_INFO(gRenderTaskLogFilter, Debug::General, "Notify a render task has finished\n");
-    mImpl->notificationManager.QueueCompleteNotification( mImpl->taskList.GetCompleteNotificationInterface() );
-  }
-
   // Macro is undefined in release build.
   SNAPSHOT_NODE_LOGGING;
 
@@ -893,7 +1074,19 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
   mImpl->previousUpdateScene = updateScene;
 
   // Check whether further updates are required
-  unsigned int keepUpdating = KeepUpdatingCheck( elapsedSeconds );
+  uint32_t keepUpdating = KeepUpdatingCheck( elapsedSeconds );
+
+  // we need new flag to rerun update on idle and execute potential idle code
+  if( updateScene )
+  {
+    keepUpdating |= KeepUpdating::DISCARD_RESOURCES;
+  }
+
+
+  if( keepRendererRendering )
+  {
+    keepUpdating |= KeepUpdating::STAGE_KEEP_RENDERING;
+  }
 
   // tell the update manager that we're done so the queue can be given to event thread
   mImpl->notificationManager.UpdateCompleted();
@@ -901,10 +1094,24 @@ unsigned int UpdateManager::Update( float elapsedSeconds,
   // The update has finished; swap the double-buffering indices
   mSceneGraphBuffers.Swap();
 
+  mImpl->graphicsController.SwapBuffers();
+
+  // Clear texture upload requests
+  if( !mImpl->textureUploadRequestContainer.empty() )
+  {
+    if( future )
+    {
+      future->Wait();
+      future.reset();
+    }
+  }
+
+  // Clear the texture upload requests container
+  mImpl->textureUploadRequestContainer.clear();
   return keepUpdating;
 }
 
-unsigned int UpdateManager::KeepUpdatingCheck( float elapsedSeconds ) const
+uint32_t UpdateManager::KeepUpdatingCheck( float elapsedSeconds ) const
 {
   // Update the duration set via Stage::KeepRendering()
   if ( mImpl->keepRenderingSeconds > 0.0f )
@@ -912,15 +1119,17 @@ unsigned int UpdateManager::KeepUpdatingCheck( float elapsedSeconds ) const
     mImpl->keepRenderingSeconds -= elapsedSeconds;
   }
 
-  unsigned int keepUpdatingRequest = KeepUpdating::NOT_REQUESTED;
+  uint32_t keepUpdatingRequest = KeepUpdating::NOT_REQUESTED;
 
+  // If the rendering behavior is set to continuously render, then continue to render.
   // If Stage::KeepRendering() has been called, then continue until the duration has elapsed.
   // Keep updating until no messages are received and no animations are running.
   // If an animation has just finished, update at least once more for Discard end-actions.
   // No need to check for renderQueue as there is always a render after update and if that
   // render needs another update it will tell the adaptor to call update again
 
-  if ( mImpl->keepRenderingSeconds > 0.0f )
+  if ( ( mImpl->renderingBehavior == DevelStage::Rendering::CONTINUOUSLY ) ||
+       ( mImpl->keepRenderingSeconds > 0.0f ) )
   {
     keepUpdatingRequest |= KeepUpdating::STAGE_KEEP_RENDERING;
   }
@@ -936,18 +1145,25 @@ unsigned int UpdateManager::KeepUpdatingCheck( float elapsedSeconds ) const
     keepUpdatingRequest |= KeepUpdating::RENDER_TASK_SYNC;
   }
 
+  const BufferIndex bufferIndex = mSceneGraphBuffers.GetUpdateBufferIndex();
+  if( !mImpl->discardQueue.IsEmpty( bufferIndex ) ||
+      !mImpl->graphicsController.IsDiscardQueueEmpty() )
+  {
+    keepUpdatingRequest |= KeepUpdating::DISCARD_RESOURCES;
+  }
+
   return keepUpdatingRequest;
 }
 
 void UpdateManager::SetBackgroundColor( const Vector4& color )
 {
-  mImpl->taskList.GetTasks()[0]->SetClearEnabled( true );
-  mImpl->taskList.GetTasks()[0]->SetClearColor( 0, color );
-  mImpl->taskList.GetTasks()[0]->SetClearColor( 1, color );
+  // not in use
 }
 
-void UpdateManager::SetDefaultSurfaceRect( const Rect<int>& rect )
+void UpdateManager::SetDefaultSurfaceRect( const Rect<int32_t>& rect )
 {
+  mImpl->surfaceRectChanged = true;
+
   DALI_ASSERT_ALWAYS( true && "GRAPHICS: FIXME" );
 }
 
@@ -956,16 +1172,27 @@ void UpdateManager::KeepRendering( float durationSeconds )
   mImpl->keepRenderingSeconds = std::max( mImpl->keepRenderingSeconds, durationSeconds );
 }
 
-void UpdateManager::SetLayerDepths( const SortedLayerPointers& layers, bool systemLevel )
+void UpdateManager::SetRenderingBehavior( DevelStage::Rendering renderingBehavior )
 {
-  if ( !systemLevel )
-  {
-    // just copy the vector of pointers
-    mImpl->sortedLayers = layers;
-  }
-  else
+  mImpl->renderingBehavior = renderingBehavior;
+}
+
+void UpdateManager::SetLayerDepths( const SortedLayerPointers& layers, const Layer* rootLayer )
+{
+  const VectorBase::SizeType rootCount = mImpl->roots.Count();
+
+  // Make sure we reserve the correct size for the container so that
+  // we can save the sorted layers in the same order as the root layer
+  mImpl->sortedLayerLists.resize( rootCount );
+
+  for ( VectorBase::SizeType rootIndex = 0u; rootIndex < rootCount; rootIndex++ )
   {
-    mImpl->systemLevelSortedLayers = layers;
+    Layer* root = mImpl->roots[rootIndex];
+    if ( root == rootLayer )
+    {
+      mImpl->sortedLayerLists[rootIndex] = layers;
+      break;
+    }
   }
 }
 
@@ -978,12 +1205,36 @@ void UpdateManager::SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths )
     iter.node->SetDepthIndex( iter.sortedDepth );
   }
 
-  // Go through node hierarchy and rearrange siblings according to depth-index
-  SortSiblingNodesRecursively( *( mImpl->root ) );
+  for( auto root : mImpl->roots )
+  {
+    // Go through node hierarchy and rearrange siblings according to depth-index
+    SortSiblingNodesRecursively( *root );
+  }
+}
+
+bool UpdateManager::IsDefaultSurfaceRectChanged()
+{
+  bool surfaceRectChanged = mImpl->surfaceRectChanged;
+
+  // Reset the flag
+  mImpl->surfaceRectChanged = false;
+
+  return surfaceRectChanged;
+}
+
+void UpdateManager::AddFrameCallback( OwnerPointer< FrameCallback >& frameCallback, const Node* rootNode )
+{
+  mImpl->GetFrameCallbackProcessor( *this ).AddFrameCallback( frameCallback, rootNode );
+}
+
+void UpdateManager::RemoveFrameCallback( FrameCallbackInterface* frameCallback )
+{
+  mImpl->GetFrameCallbackProcessor( *this ).RemoveFrameCallback( frameCallback );
 }
 
 void UpdateManager::AddSampler( OwnerPointer< SceneGraph::Sampler >& sampler )
 {
+  sampler->Initialize( mImpl->graphicsController );
   mImpl->samplerContainer.PushBack( sampler.Release() );
 }
 
@@ -994,7 +1245,7 @@ void UpdateManager::RemoveSampler( SceneGraph::Sampler* sampler )
 
 void UpdateManager::AddPropertyBuffer( OwnerPointer< SceneGraph::PropertyBuffer >& propertyBuffer )
 {
-  propertyBuffer->Initialize( mImpl->graphics );
+  propertyBuffer->Initialize( mImpl->graphicsController );
   mImpl->propertyBufferContainer.PushBack( propertyBuffer.Release() );
 }
 
@@ -1005,7 +1256,7 @@ void UpdateManager::RemovePropertyBuffer( SceneGraph::PropertyBuffer* propertyBu
 
 void UpdateManager::AddGeometry( OwnerPointer< SceneGraph::Geometry >& geometry )
 {
-  geometry->Initialize( mImpl->graphics );
+  geometry->Initialize( mImpl->graphicsController );
   mImpl->geometryContainer.PushBack( geometry.Release() );
 }
 
@@ -1016,7 +1267,7 @@ void UpdateManager::RemoveGeometry( SceneGraph::Geometry* geometry )
 
 void UpdateManager::AddTexture( OwnerPointer< SceneGraph::Texture >& texture )
 {
-  texture->Initialize( mImpl->graphics );
+  texture->Initialize( mImpl->graphicsController );
   mImpl->textureContainer.PushBack( texture.Release() );
 }
 
@@ -1024,6 +1275,20 @@ void UpdateManager::RemoveTexture( SceneGraph::Texture* texture)
 {
   DALI_ASSERT_DEBUG( NULL != texture );
 
+  // Remove upload requests to this texture if exists ( there may be more than one )
+  if( !mImpl->textureUploadRequestContainer.empty() )
+  {
+    decltype(mImpl->textureUploadRequestContainer) newRequests;
+    for( auto& request : mImpl->textureUploadRequestContainer )
+    {
+      if( request.texture != texture )
+      {
+        newRequests.emplace_back( request );
+      }
+    }
+    mImpl->textureUploadRequestContainer = std::move( newRequests );
+  }
+
   // Find the texture, use reference to pointer so we can do the erase safely
   for ( auto&& iter : mImpl->textureContainer )
   {
@@ -1037,7 +1302,7 @@ void UpdateManager::RemoveTexture( SceneGraph::Texture* texture)
 
 void UpdateManager::AddFrameBuffer( OwnerPointer< SceneGraph::FrameBuffer>& frameBuffer )
 {
-  frameBuffer->Initialize( mImpl->graphics );
+  frameBuffer->Initialize( mImpl->graphicsController );
   mImpl->frameBufferContainer.PushBack( frameBuffer.Release() );
 }
 
@@ -1056,6 +1321,61 @@ void UpdateManager::RemoveFrameBuffer( SceneGraph::FrameBuffer* frameBuffer)
   }
 }
 
+void UpdateManager::DestroyGraphicsObjects()
+{
+  // Wait for the current frame to finish drawing
+  mImpl->graphicsController.WaitIdle();
+
+  DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Destroying graphics objects\n");
+
+  // There will be no further Update after this point. Destroy everything!
+
+  mImpl->renderInstructions.Shutdown(); //Prevent further access of dangling renderer ptrs
+
+  for( auto& renderer : mImpl->renderers )
+  {
+    renderer->DestroyGraphicsObjects();
+  }
+
+  for( auto& geometry : mImpl->geometryContainer )
+  {
+    geometry->DestroyGraphicsObjects();
+  }
+
+  for( auto& propertyBuffer : mImpl->propertyBufferContainer )
+  {
+    propertyBuffer->DestroyGraphicsObjects();
+  }
+
+  for( auto& texture : mImpl->textureContainer )
+  {
+    texture->DestroyGraphicsObjects();
+  }
+
+  for( auto& sampler : mImpl->samplerContainer )
+  {
+    sampler->DestroyGraphicsObjects();
+  }
+
+  for( auto& frameBuffer : mImpl->frameBufferContainer )
+  {
+    frameBuffer->DestroyGraphicsObjects();
+  }
+
+  for( auto& shader : mImpl->shaders )
+  {
+    shader->DestroyGraphicsObjects();
+  }
+
+  mImpl->shaderCache.DestroyGraphicsObjects();
+
+  // Ensure resources are discarded
+  mImpl->graphicsAlgorithms.DiscardUnusedResources( mImpl->graphicsController );
+
+  mImpl->graphicsShutdown = true;
+
+  DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Destruction complete\n");
+}
 
 } // namespace SceneGraph
 
index 7096f07..8ae9af3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,8 +26,8 @@
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/common/vector-wrapper.h>
 
+#include <dali/devel-api/common/stage-devel.h>
 #include <dali/internal/common/message.h>
-
 #include <dali/internal/common/type-abstraction-enums.h>
 #include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/event/rendering/texture-impl.h>
 #include <dali/internal/update/common/scene-graph-buffers.h>
 #include <dali/internal/update/common/scene-graph-property-notification.h>
 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
+#include <dali/internal/update/manager/scene-graph-frame-callback.h> // for OwnerPointer< FrameCallback >
 #include <dali/internal/update/manager/node-depths.h>
 #include <dali/internal/update/nodes/node.h>
 #include <dali/internal/update/nodes/scene-graph-layer.h>
-#include <dali/internal/update/render-tasks/scene-graph-camera.h>
 #include <dali/internal/update/rendering/scene-graph-geometry.h>
 #include <dali/internal/update/rendering/scene-graph-property-buffer.h>
 #include <dali/internal/update/rendering/scene-graph-frame-buffer.h>
 #include <dali/internal/update/rendering/scene-graph-renderer.h>    // for OwnerPointer< Renderer >
 #include <dali/internal/update/rendering/scene-graph-shader.h> // for OwnerPointer< Shader >
 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
+#include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
+
 #include <dali/graphics-api/graphics-api-controller.h>
 
 namespace Dali
 {
 
+class FrameCallbackInterface;
+
 namespace Integration
 {
 class RenderController;
-namespace Graphics
-{
-class Graphics;
-}
 } // namespace Integration
 
 namespace Internal
@@ -106,6 +106,7 @@ public:
    * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
    * @param[in] controller After messages are flushed, we request a render from the RenderController.
    * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
+   * @param[in] graphicsController The graphics backend
    */
   UpdateManager( NotificationManager& notificationManager,
                  CompleteNotificationInterface& animationPlaylist,
@@ -113,7 +114,7 @@ public:
                  DiscardQueue& discardQueue,
                  Integration::RenderController& controller,
                  RenderTaskProcessor& renderTaskProcessor,
-                 Dali::Integration::Graphics::Graphics& graphics);
+                 Graphics::Controller& graphicsController );
 
   /**
    * Destructor.
@@ -128,10 +129,9 @@ public:
    * @pre The layer is of derived Node type Layer.
    * @pre The layer does not have a parent.
    * @param[in] layer The new root node.
-   * @param[in] systemLevel True if using the system-level overlay.
    * @post The node is owned by UpdateManager.
    */
-  void InstallRoot( OwnerPointer<Layer>& layer, bool systemLevel );
+  void InstallRoot( OwnerPointer<Layer>& layer );
 
   /**
    * Add a Node; UpdateManager takes ownership.
@@ -176,7 +176,7 @@ public:
    * Remove a camera from scene
    * @param[in] camera to remove
    */
-  void RemoveCamera( const Camera* camera );
+  void RemoveCamera( Camera* camera );
 
   /**
    * Add a newly created object.
@@ -191,6 +191,19 @@ public:
    */
   void RemoveObject( PropertyOwner* object );
 
+  /**
+   * Add a newly created render task list.
+   * @param[in] taskList The render task list to add.
+   * @post The render task list is owned by UpdateManager.
+   */
+  void AddRenderTaskList( OwnerPointer<RenderTaskList>& taskList );
+
+  /**
+   * Remove a render task list.
+   * @param[in] taskList The render task list to remove.
+   */
+  void RemoveRenderTaskList( RenderTaskList* taskList );
+
   // Animations
 
   /**
@@ -325,7 +338,7 @@ public:
    * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
    * @return A pointer to the first char allocated for the message.
    */
-  unsigned int* ReserveMessageSlot( std::size_t size, bool updateScene = true );
+  uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene = true );
 
   /**
    * @return the current event-buffer index.
@@ -427,11 +440,11 @@ public:
    * @param[in] isRenderingToFbo   Whether this frame is being rendered into the Frame Buffer Object.
    * @return True if further updates are required e.g. during animations.
    */
-  unsigned int Update( float elapsedSeconds,
-                       unsigned int lastVSyncTimeMilliseconds,
-                       unsigned int nextVSyncTimeMilliseconds,
-                       bool renderToFboEnabled,
-                       bool isRenderingToFbo );
+  uint32_t Update( float elapsedSeconds,
+                   uint32_t lastVSyncTimeMilliseconds,
+                   uint32_t nextVSyncTimeMilliseconds,
+                   bool renderToFboEnabled,
+                   bool isRenderingToFbo );
 
   /**
    * Set the background color i.e. the glClear color used at the beginning of each frame.
@@ -451,11 +464,16 @@ public:
   void KeepRendering( float durationSeconds );
 
   /**
+   * @copydoc Dali::DevelStage::SetRenderingBehavior()
+   */
+  void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
+
+  /**
    * Sets the depths of all layers.
    * @param layers The layers in depth order.
-   * @param[in] systemLevel True if using the system-level overlay.
+   * @param[in] rootLayer The root layer of the sorted layers.
    */
-  void SetLayerDepths( const std::vector< Layer* >& layers, bool systemLevel );
+  void SetLayerDepths( const std::vector< Layer* >& layers, const Layer* rootLayer );
 
   /**
    * Set the depth indices of all nodes (in LayerUI's)
@@ -463,6 +481,31 @@ public:
    */
   void SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths );
 
+  /**
+   * Query wheter the default surface rect is changed or not.
+   * @return true if the default surface rect is changed.
+   */
+  bool IsDefaultSurfaceRectChanged();
+
+  /**
+   * Adds an implementation of the FrameCallbackInterface.
+   * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
+   * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
+   */
+  void AddFrameCallback( OwnerPointer< FrameCallback >& frameCallback, const Node* rootNode );
+
+  /**
+   * Removes the specified implementation of FrameCallbackInterface.
+   * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
+   */
+  void RemoveFrameCallback( FrameCallbackInterface* frameCallback );
+
+  /**
+   * The graphics implementation is about to die. Before we cleanup
+   * core, destroy all graphics objects whilst we still have a chance.
+   */
+  void DestroyGraphicsObjects();
+
 private:
 
   // Undefined
@@ -476,7 +519,7 @@ private:
    * @param[in] elapsedSeconds The time in seconds since the previous update.
    * @return True if the update-thread should keep going.
    */
-  unsigned int KeepUpdatingCheck( float elapsedSeconds ) const;
+  uint32_t KeepUpdatingCheck( float elapsedSeconds ) const;
 
   /**
    * Helper to reset all Node properties
@@ -491,7 +534,7 @@ private:
    * @param[in] nextVSyncTime  The estimated time of the next VSync in milliseconds.
    * @return true, if any properties were updated.
    */
-  bool ProcessGestures( BufferIndex bufferIndex, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
+  bool ProcessGestures( BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds );
 
   /**
    * Perform animation updates
@@ -541,6 +584,29 @@ private:
    */
   void UpdateRenderers( BufferIndex bufferIndex );
 
+  /**
+   * Ensure all nodes inform renderers of any changes to uniform maps
+   * @param[in] bufferIndex to use
+   */
+  void PrepareNodes( BufferIndex bufferIndex );
+
+  /**
+   * Prepare renderer graphics
+   * @param[in] bufferIndex to use
+   */
+  void PrepareRenderers( BufferIndex bufferIndex );
+
+public:
+
+  /**
+   * Schedules texture upload for batch upload
+   * @param[in] texture valid pointer to the texture
+   * @param[in] pixelData pixel data
+   * @param[in] params upload parameters
+   */
+  void UploadTexture( Texture* texture,
+                      PixelDataPtr pixelData,
+                      const Internal::Texture::UploadParams& params );
 private:
 
   // needs to be direct member so that getter for event buffer can be inlined
@@ -553,16 +619,16 @@ private:
 
 // Messages for UpdateManager
 
-inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& root, bool systemLevel )
+inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& root )
 {
   // Message has ownership of Layer while in transit from event -> update
-  typedef MessageValue2< UpdateManager, OwnerPointer<Layer>, bool > LocalType;
+  typedef MessageValue1< UpdateManager, OwnerPointer<Layer> > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root, systemLevel );
+  new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root );
 }
 
 inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
@@ -571,7 +637,7 @@ inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
   typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddNode, node );
@@ -586,7 +652,7 @@ inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent,
   typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
@@ -600,7 +666,7 @@ inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode
   typedef MessageValue1< UpdateManager, Node* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
@@ -614,7 +680,7 @@ inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
   typedef MessageValue1< UpdateManager, Node* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
@@ -626,7 +692,7 @@ inline void AddCameraMessage( UpdateManager& manager, OwnerPointer< Camera >& ca
   typedef MessageValue1< UpdateManager, OwnerPointer< Camera > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddCamera, camera );
@@ -634,13 +700,13 @@ inline void AddCameraMessage( UpdateManager& manager, OwnerPointer< Camera >& ca
 
 inline void RemoveCameraMessage( UpdateManager& manager, const Camera* camera )
 {
-  typedef MessageValue1< UpdateManager, const Camera* > LocalType;
+  typedef MessageValue1< UpdateManager, Camera* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::RemoveCamera, camera );
+  new (slot) LocalType( &manager, &UpdateManager::RemoveCamera, const_cast<Camera*>( camera ) );
 }
 
 inline void AddObjectMessage( UpdateManager& manager, OwnerPointer<PropertyOwner>& object )
@@ -649,21 +715,21 @@ inline void AddObjectMessage( UpdateManager& manager, OwnerPointer<PropertyOwner
   typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
 }
 
-inline void RemoveObjectMessage( UpdateManager& manager, PropertyOwner* object )
+inline void RemoveObjectMessage( UpdateManager& manager, const PropertyOwner* object )
 {
   typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::RemoveObject, object );
+  new (slot) LocalType( &manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>( object ) );
 }
 
 inline void AddAnimationMessage( UpdateManager& manager, OwnerPointer< SceneGraph::Animation >& animation )
@@ -671,7 +737,7 @@ inline void AddAnimationMessage( UpdateManager& manager, OwnerPointer< SceneGrap
   typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Animation > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
@@ -685,7 +751,7 @@ inline void StopAnimationMessage( UpdateManager& manager, const Animation& const
   typedef MessageValue1< UpdateManager, Animation* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::StopAnimation, &animation );
@@ -699,19 +765,44 @@ inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& con
   typedef MessageValue1< UpdateManager, Animation* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::RemoveAnimation, &animation );
 }
 
+inline void AddRenderTaskListMessage( UpdateManager& manager, OwnerPointer< SceneGraph::RenderTaskList >& taskList )
+{
+  typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::RenderTaskList > > LocalType;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &manager, &UpdateManager::AddRenderTaskList, taskList );
+}
+
+inline void RemoveRenderTaskListMessage( UpdateManager& manager, const RenderTaskList& constTaskList )
+{
+  // The scene-graph thread owns this object so it can safely edit it.
+  RenderTaskList& taskList = const_cast< RenderTaskList& >( constTaskList );
+
+  typedef MessageValue1< UpdateManager, RenderTaskList* > LocalType;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &manager, &UpdateManager::RemoveRenderTaskList, &taskList );
+}
+
 inline void AddPropertyNotificationMessage( UpdateManager& manager, OwnerPointer< PropertyNotification >& propertyNotification )
 {
   // Message has ownership of PropertyNotification while in transit from event -> update
   typedef MessageValue1< UpdateManager, OwnerPointer< PropertyNotification > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
@@ -725,7 +816,7 @@ inline void RemovePropertyNotificationMessage( UpdateManager& manager, const Pro
   typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
@@ -741,7 +832,7 @@ inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
   typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
@@ -752,21 +843,21 @@ inline void AddShaderMessage( UpdateManager& manager, OwnerPointer< Shader >& sh
   typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddShader, shader );
 }
 
-inline void RemoveShaderMessage( UpdateManager& manager, Shader& shader )
+inline void RemoveShaderMessage( UpdateManager& manager, const Shader* shader )
 {
   typedef MessageValue1< UpdateManager, Shader* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::RemoveShader, &shader );
+  new (slot) LocalType( &manager, &UpdateManager::RemoveShader, const_cast<Shader*>( shader ) );
 }
 
 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
@@ -774,18 +865,18 @@ inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& co
   typedef MessageValue1< UpdateManager, Vector4 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
 }
 
-inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int>& rect  )
+inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect  )
 {
-  typedef MessageValue1< UpdateManager, Rect<int> > LocalType;
+  typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
@@ -796,27 +887,38 @@ inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds
   typedef MessageValue1< UpdateManager, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
 }
 
+inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Rendering renderingBehavior )
+{
+  typedef MessageValue1< UpdateManager, DevelStage::Rendering > LocalType;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
+}
+
 /**
  * Create a message for setting the depth of a layer
  * @param[in] manager The update manager
  * @param[in] layers list of layers
- * @param[in] systemLevel True if the layers are added via the SystemOverlay API
+ * @param[in] rootLayer The rool layer
  */
-inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, bool systemLevel )
+inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, const Layer* rootLayer )
 {
-  typedef MessageValue2< UpdateManager, std::vector< Layer* >, bool > LocalType;
+  typedef MessageValue2< UpdateManager, std::vector< Layer* >, const Layer* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, systemLevel );
+  new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, rootLayer );
 }
 
 inline void AddRendererMessage( UpdateManager& manager, OwnerPointer< Renderer >& object )
@@ -824,19 +926,19 @@ inline void AddRendererMessage( UpdateManager& manager, OwnerPointer< Renderer >
   typedef MessageValue1< UpdateManager, OwnerPointer< Renderer > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddRenderer, object );
 }
 
-inline void RemoveRendererMessage( UpdateManager& manager, Renderer& object )
+inline void RemoveRendererMessage( UpdateManager& manager, const Renderer& object )
 {
   typedef MessageValue1< UpdateManager, Renderer* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::RemoveRenderer, &object );
+  new (slot) LocalType( &manager, &UpdateManager::RemoveRenderer, const_cast<Renderer*>( &object ) );
 }
 
 // The render thread can safely change the Shader
@@ -845,7 +947,7 @@ inline void AddTextureSetMessage( UpdateManager& manager, OwnerPointer< TextureS
   typedef MessageValue1< UpdateManager, OwnerPointer< TextureSet > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddTextureSet, textureSet );
@@ -856,7 +958,7 @@ inline void RemoveTextureSetMessage( UpdateManager& manager, TextureSet& texture
   typedef MessageValue1< UpdateManager, TextureSet* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::RemoveTextureSet, &textureSet );
@@ -868,7 +970,7 @@ inline void AddSamplerMessage( UpdateManager& manager, OwnerPointer< SceneGraph:
   typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Sampler > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddSampler, sampler );
@@ -879,7 +981,7 @@ inline void RemoveSamplerMessage( UpdateManager& manager, SceneGraph::Sampler& s
   typedef MessageValue1< UpdateManager, SceneGraph::Sampler* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::RemoveSampler, &sampler );
@@ -891,7 +993,7 @@ inline void AddPropertyBuffer( UpdateManager& manager, OwnerPointer< SceneGraph:
   typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::PropertyBuffer > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddPropertyBuffer, propertyBuffer );
@@ -902,7 +1004,7 @@ inline void RemovePropertyBuffer( UpdateManager& manager, SceneGraph::PropertyBu
   typedef MessageValue1< UpdateManager, SceneGraph::PropertyBuffer*  > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::RemovePropertyBuffer, &propertyBuffer );
@@ -914,7 +1016,7 @@ inline void AddGeometryMessage( UpdateManager& manager, OwnerPointer< SceneGraph
   typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Geometry > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddGeometry, geometry );
@@ -925,7 +1027,7 @@ inline void RemoveGeometryMessage( UpdateManager& manager, SceneGraph::Geometry&
   typedef MessageValue1< UpdateManager, SceneGraph::Geometry*  > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
@@ -937,7 +1039,7 @@ inline void AddTextureMessage( UpdateManager& manager, OwnerPointer< SceneGraph:
   typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Texture > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddTexture, texture );
@@ -948,7 +1050,7 @@ inline void RemoveTextureMessage( UpdateManager& manager, SceneGraph::Texture& t
   typedef MessageValue1< UpdateManager, SceneGraph::Texture*  > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::RemoveTexture, &texture );
@@ -959,7 +1061,7 @@ inline void AddFrameBufferMessage( UpdateManager& manager, OwnerPointer<SceneGra
   typedef MessageValue1< UpdateManager, OwnerPointer<SceneGraph::FrameBuffer> > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddFrameBuffer, frameBuffer );
@@ -970,7 +1072,7 @@ inline void RemoveFrameBufferMessage( UpdateManager& manager, SceneGraph::FrameB
   typedef MessageValue1< UpdateManager, SceneGraph::FrameBuffer*  > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer );
@@ -981,7 +1083,7 @@ inline void SetDepthIndicesMessage( UpdateManager& manager, OwnerPointer< NodeDe
   typedef MessageValue1< UpdateManager, OwnerPointer< NodeDepths > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::SetDepthIndices, nodeDepths );
@@ -992,12 +1094,48 @@ inline void AddResetterMessage( UpdateManager& manager, OwnerPointer<PropertyRes
   typedef MessageValue1< UpdateManager, OwnerPointer<PropertyResetterBase> > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &manager, &UpdateManager::AddPropertyResetter, resetter );
 }
 
+inline void AddFrameCallbackMessage( UpdateManager& manager, OwnerPointer< FrameCallback >& frameCallback, const Node& rootNode )
+{
+  typedef MessageValue2< UpdateManager, OwnerPointer< FrameCallback >, const Node* > LocalType;
+  // Reserve some memory inside the message queue
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode );
+}
+
+inline void RemoveFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback )
+{
+  typedef MessageValue1< UpdateManager, FrameCallbackInterface* > LocalType;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &manager, &UpdateManager::RemoveFrameCallback, &frameCallback );
+}
+
+inline void UploadTextureMessage( EventThreadServices&             eventThreadServices,
+                                  SceneGraph::Texture&             texture,
+                                  PixelDataPtr                     pixelData,
+                                  const Internal::Texture::UploadParams&  params )
+{
+  typedef MessageValue3< UpdateManager, Texture*, PixelDataPtr, Internal::Texture::UploadParams > LocalType;
+
+  auto& manager = eventThreadServices.GetUpdateManager();
+
+  // Reserve some memory inside the message queue
+  unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ), false );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &manager, &SceneGraph::UpdateManager::UploadTexture, &texture, pixelData, params );
+}
 
 } // namespace SceneGraph
 
diff --git a/dali/internal/update/manager/update-proxy-impl.cpp b/dali/internal/update/manager/update-proxy-impl.cpp
new file mode 100644 (file)
index 0000000..22b45a3
--- /dev/null
@@ -0,0 +1,289 @@
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/update/manager/update-proxy-impl.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/update/manager/update-proxy-property-modifier.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace
+{
+
+SceneGraph::Node* FindNodeInSceneGraph( uint32_t id, SceneGraph::Node& node )
+{
+  SceneGraph::Node* matchingNode = NULL;
+
+  if( node.mId == id )
+  {
+    matchingNode = &node;
+  }
+  else
+  {
+    for( auto&& i : node.GetChildren() )
+    {
+      matchingNode = FindNodeInSceneGraph( id, *i );
+      if( matchingNode )
+      {
+        break;
+      }
+    }
+  }
+
+  return matchingNode;
+}
+
+} // unnamed namespace
+
+UpdateProxy::UpdateProxy( SceneGraph::UpdateManager& updateManager, SceneGraph::TransformManager& transformManager, SceneGraph::Node& rootNode )
+: mNodeContainer(),
+  mLastCachedIdNodePair( { 0u, NULL } ),
+  mCurrentBufferIndex( 0u ),
+  mUpdateManager( updateManager ),
+  mTransformManager( transformManager ),
+  mRootNode( rootNode ),
+  mPropertyModifier( nullptr )
+{
+}
+
+UpdateProxy::~UpdateProxy()
+{
+}
+
+bool UpdateProxy::GetPosition( uint32_t id, Vector3& position ) const
+{
+  bool success = false;
+  const SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    position = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_POSITION );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::SetPosition( uint32_t id, const Vector3& position )
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    mTransformManager.SetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_POSITION, position );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::BakePosition( uint32_t id, const Vector3& position )
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    mTransformManager.BakeVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_POSITION, position );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::GetSize( uint32_t id, Vector3& size ) const
+{
+  bool success = false;
+  const SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    size = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SIZE );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::SetSize( uint32_t id, const Vector3& size )
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    mTransformManager.SetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SIZE, size );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::BakeSize( uint32_t id, const Vector3& size )
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    mTransformManager.BakeVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SIZE, size );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::GetPositionAndSize( uint32_t id, Vector3& position, Vector3& size ) const
+{
+  bool success = false;
+  const SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    position = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_POSITION );
+    size = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SIZE );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::GetScale( uint32_t id, Vector3& scale ) const
+{
+  bool success = false;
+  const SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    scale = mTransformManager.GetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SCALE );
+    success = true;
+  }
+
+  return success;
+}
+
+bool UpdateProxy::SetScale( uint32_t id, const Vector3& scale )
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    mTransformManager.SetVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SCALE, scale );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::BakeScale( uint32_t id, const Vector3& scale )
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    mTransformManager.BakeVector3PropertyValue( node->mTransformId, SceneGraph::TRANSFORM_PROPERTY_SCALE, scale );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::GetColor( uint32_t id, Vector4& color ) const
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    color = node->mColor.Get( mCurrentBufferIndex );
+    success = true;
+  }
+
+  return success;
+}
+
+bool UpdateProxy::SetColor( uint32_t id, const Vector4& color )
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    node->mColor.Set( mCurrentBufferIndex, color );
+    node->SetDirtyFlag( SceneGraph::NodePropertyFlags::COLOR );
+    AddResetter( *node, node->mColor );
+    success = true;
+  }
+  return success;
+}
+
+bool UpdateProxy::BakeColor( uint32_t id, const Vector4& color )
+{
+  bool success = false;
+  SceneGraph::Node* node = GetNodeWithId( id );
+  if( node )
+  {
+    node->mColor.Bake( mCurrentBufferIndex, color );
+    success = true;
+  }
+  return success;
+}
+
+void UpdateProxy::NodeHierarchyChanged()
+{
+  mLastCachedIdNodePair = { 0u, NULL };
+  mNodeContainer.clear();
+  mPropertyModifier.reset();
+}
+
+SceneGraph::Node* UpdateProxy::GetNodeWithId( uint32_t id ) const
+{
+  SceneGraph::Node* node = NULL;
+
+  // Cache the last accessed node so we don't have to traverse
+  if( mLastCachedIdNodePair.node && mLastCachedIdNodePair.id == id )
+  {
+    node = mLastCachedIdNodePair.node;
+  }
+  else
+  {
+    // Find node in vector
+    for( auto&& pair : mNodeContainer )
+    {
+      if( pair.id == id )
+      {
+        node = pair.node;
+        mLastCachedIdNodePair = pair;
+        break;
+      }
+    }
+
+    if( ! node )
+    {
+      // Node not in vector, find in scene-graph
+      node = FindNodeInSceneGraph( id, mRootNode );
+      if( node )
+      {
+        mNodeContainer.push_back( { id, node } );
+        mLastCachedIdNodePair = *mNodeContainer.rbegin();
+      }
+    }
+  }
+
+  return node;
+}
+
+void UpdateProxy::AddResetter( SceneGraph::Node& node, SceneGraph::PropertyBase& propertyBase )
+{
+  if( ! mPropertyModifier )
+  {
+    mPropertyModifier = PropertyModifierPtr( new PropertyModifier( mUpdateManager ) );
+  }
+  mPropertyModifier->AddResetter( node, propertyBase );
+}
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/update/manager/update-proxy-impl.h b/dali/internal/update/manager/update-proxy-impl.h
new file mode 100644 (file)
index 0000000..88fefbb
--- /dev/null
@@ -0,0 +1,209 @@
+#ifndef DALI_INTERNAL_UPDATE_PROXY_IMPL_H
+#define DALI_INTERNAL_UPDATE_PROXY_IMPL_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <cstdint>
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/math/matrix.h>
+#include <dali/public-api/math/vector3.h>
+#include <dali/internal/common/buffer-index.h>
+#include <dali/internal/update/manager/transform-manager.h>
+#include <dali/internal/update/nodes/node.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace SceneGraph
+{
+class UpdateManager;
+}
+
+/**
+ * @brief The implementation of Dali::UpdateProxy.
+ *
+ * Ref-counting is not required for this object.
+ *
+ * @see Dali::UpdateProxy
+ */
+class UpdateProxy
+{
+public:
+
+  /**
+   * @brief Constructor.
+   * @param[in]  updateManager      Ref to the UpdateManager in order to add property resetters
+   * @param[in]  transformManager   Ref to the TransformManager in order to set/get transform properties of nodes
+   * @param[in]  rootNode           The root node for this proxy
+   */
+  UpdateProxy( SceneGraph::UpdateManager& updateManager, SceneGraph::TransformManager& transformManager, SceneGraph::Node& rootNode );
+
+  /**
+   * @brief Destructor.
+   */
+  ~UpdateProxy();
+
+  // Movable but not copyable
+
+  UpdateProxy( const UpdateProxy& )            = delete;  ///< Deleted copy constructor.
+  UpdateProxy( UpdateProxy&& )                 = default; ///< Default move constructor.
+  UpdateProxy& operator=( const UpdateProxy& ) = delete;  ///< Deleted copy assignment operator.
+  UpdateProxy& operator=( UpdateProxy&& )      = default; ///< Default move assignment operator.
+
+  /**
+   * @copydoc Dali::UpdateProxy::GetPosition()
+   */
+  bool GetPosition( uint32_t id, Vector3& position) const;
+
+  /**
+   * @copydoc Dali::UpdateProxy::SetPosition()
+   */
+  bool SetPosition( uint32_t id, const Vector3& position );
+
+  /**
+   * @copydoc Dali::UpdateProxy::BakePosition()
+   */
+  bool BakePosition( uint32_t id, const Vector3& position );
+
+  /**
+   * @copydoc Dali::UpdateProxy::GetSize()
+   */
+  bool GetSize( uint32_t id, Vector3& size ) const;
+
+  /**
+   * @copydoc Dali::UpdateProxy::SetSize()
+   */
+  bool SetSize( uint32_t id, const Vector3& size );
+
+  /**
+   * @copydoc Dali::UpdateProxy::BakeSize()
+   */
+  bool BakeSize( uint32_t id, const Vector3& size );
+
+  /**
+   * @copydoc Dali::UpdateProxy::GetPositionAndSize()
+   */
+  bool GetPositionAndSize( uint32_t id, Vector3& position, Vector3& size ) const;
+
+  /**
+   * @copydoc Dali::UpdateProxy::GetScale()
+   */
+  bool GetScale( uint32_t id, Vector3& scale ) const;
+
+  /**
+   * @copydoc Dali::UpdateProxy::SetScale()
+   */
+  bool SetScale( uint32_t id, const Vector3& scale );
+
+  /**
+   * @copydoc Dali::UpdateProxy::BakeScale()
+   */
+  bool BakeScale( uint32_t id, const Vector3& scale );
+
+  /**
+   * @copydoc Dali::UpdateProxy::GetColor()
+   */
+  bool GetColor( uint32_t id, Vector4& color ) const;
+
+  /**
+   * @copydoc Dali::UpdateProxy::SetColor()
+   */
+  bool SetColor( uint32_t id, const Vector4& color );
+
+  /**
+   * @copydoc Dali::UpdateProxy::BakeColor()
+   */
+  bool BakeColor( uint32_t id, const Vector4& color );
+
+  /**
+   * @brief Retrieves the root-node used by this class
+   * @return The root node used by this class.
+   */
+  SceneGraph::Node& GetRootNode() const
+  {
+    return mRootNode;
+  }
+
+  /**
+   * @brief Sets the buffer index to use when processing the next callback.
+   * @param[in]  bufferIndex  The current buffer index
+   */
+  void SetCurrentBufferIndex( BufferIndex bufferIndex )
+  {
+    mCurrentBufferIndex = bufferIndex;
+  }
+
+  /**
+   * @brief Informs the update-proxy that the node hierarchy has changed.
+   */
+  void NodeHierarchyChanged();
+
+private:
+
+  /**
+   * @brief Retrieves the node with the specified ID.
+   * @param[in]  id  The ID of the node required
+   * @return A pointer to the required node if found.
+   * @note This caches the last accessed node.
+   */
+  SceneGraph::Node* GetNodeWithId( uint32_t id ) const;
+
+  /**
+   * @brief Adds a property-resetter for non-transform properties so that they can be reset to their base value every frame.
+   * @param[in]  node          The node the property belongs to
+   * @param[in]  propertyBase  The property itself
+   */
+  void AddResetter( SceneGraph::Node& node, SceneGraph::PropertyBase& propertyBase );
+
+private:
+
+  /**
+   * Structure to store the ID & Node pair
+   */
+  struct IdNodePair
+  {
+    uint32_t id; ///< The ID of the node
+    SceneGraph::Node* node; ///< The node itself
+  };
+
+  class PropertyModifier;
+  using PropertyModifierPtr = std::unique_ptr< PropertyModifier >;
+
+  mutable std::vector< IdNodePair > mNodeContainer; ///< Used to store cached pointers to already searched for Nodes.
+  mutable IdNodePair mLastCachedIdNodePair; ///< Used to cache the last retrieved id-node pair.
+  BufferIndex mCurrentBufferIndex;
+
+  SceneGraph::UpdateManager& mUpdateManager; ///< Reference to the Update Manager.
+  SceneGraph::TransformManager& mTransformManager; ///< Reference to the Transform Manager.
+  SceneGraph::Node& mRootNode; ///< The root node of this update proxy.
+
+  PropertyModifierPtr mPropertyModifier; ///< To ensure non-transform property modifications reset to base values.
+};
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_UPDATE_PROXY_IMPL_H
diff --git a/dali/internal/update/manager/update-proxy-property-modifier.h b/dali/internal/update/manager/update-proxy-property-modifier.h
new file mode 100644 (file)
index 0000000..1ac572d
--- /dev/null
@@ -0,0 +1,201 @@
+#ifndef DALI_INTERNAL_UPDATE_PROXY_PROPERTY_MODIFIER_H
+#define DALI_INTERNAL_UPDATE_PROXY_PROPERTY_MODIFIER_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/common/owner-pointer.h>
+#include <dali/internal/update/common/property-resetter.h>
+#include <dali/internal/update/manager/update-manager.h>
+#include <dali/internal/update/manager/update-proxy-impl.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace SceneGraph
+{
+class Node;
+class PropertyBase;
+}
+
+/**
+ * Keeps track of any non-transform manager properties that are modified by the UpdateProxy.
+ *
+ * This is required so the Update Manager can then reset the value to the base at the start of every frame.
+ */
+class UpdateProxy::PropertyModifier final
+{
+public:
+
+  using Resetter = SceneGraph::Resetter< PropertyModifier >;
+
+  /**
+   * Observer to determine when the animator is no longer present
+   */
+  class LifecycleObserver
+  {
+  public:
+
+    /**
+     * Called shortly before the animator is destroyed.
+     */
+    virtual void ObjectDestroyed() = 0;
+
+  protected:
+
+    /**
+     * Virtual destructor, no deletion through this interface
+     */
+    virtual ~LifecycleObserver() = default;
+  };
+
+  /**
+   * Default Constructor.
+   * @param[in]  updateManager  A reference to the update-manager
+   */
+  PropertyModifier( SceneGraph::UpdateManager& updateManager )
+  : mProperties(),
+    mLifecycleObservers(),
+    mUpdateManager( &updateManager )
+  {
+  }
+
+  /**
+   * Non-virtual destructor.
+   */
+  ~PropertyModifier()
+  {
+    for( auto& observer : mLifecycleObservers )
+    {
+      observer->ObjectDestroyed();
+    }
+  }
+
+  // Movable but not copyable
+
+  PropertyModifier( const PropertyModifier& )            = delete;  ///< Deleted copy constructor.
+  PropertyModifier& operator=( const PropertyModifier& ) = delete;  ///< Deleted assignment operator.
+
+  /**
+   * Move constructor.
+   */
+  PropertyModifier( PropertyModifier&& other )
+  : mProperties( std::move( other.mProperties ) ),
+    mLifecycleObservers( std::move( other.mLifecycleObservers ) ),
+    mUpdateManager( std::move( other.mUpdateManager ) )
+  {
+    // Clear other so that it does not remove any resetters unintentionally
+    other.mLifecycleObservers.clear();
+  }
+
+  /**
+   * Move assignment operator.
+   */
+  PropertyModifier& operator=( PropertyModifier&& other )
+  {
+    if( this != &other )
+    {
+      mProperties = std::move( other.mProperties );
+      mLifecycleObservers = std::move( other.mLifecycleObservers );
+      mUpdateManager = std::move( other.mUpdateManager );
+
+      // Clear other so that it does not remove any resetters unintentionally
+      other.mLifecycleObservers.clear();
+    }
+    return *this;
+  }
+
+  /**
+   * Allows Resetter to track the life-cycle of this object.
+   * @param[in]  observer  The observer to add.
+   */
+  void AddLifecycleObserver( LifecycleObserver& observer )
+  {
+    mLifecycleObservers.push_back( &observer );
+  }
+
+  /**
+   * The Resetter no longer needs to track the life-cycle of this object.
+   * @param[in]  observer  The observer that to remove.
+   */
+  void RemoveLifecycleObserver( LifecycleObserver& observer )
+  {
+    std::remove( mLifecycleObservers.begin(), mLifecycleObservers.end(), &observer );
+  }
+
+  /**
+   * Adds a resetter to the given node and property if it hasn't already been added previously.
+   * @param[in]  node          The associated Node
+   * @param[in]  propertyBase  The associated PropertyBase
+   */
+  void AddResetter( SceneGraph::Node& node, SceneGraph::PropertyBase& propertyBase )
+  {
+    // Check if we've already added a resetter for this node and property to the update-manager
+    NodePropertyPair pair{ &node, &propertyBase };
+    if( mUpdateManager &&
+        ( mProperties.end() == std::find( mProperties.begin(), mProperties.end(), pair ) ) )
+    {
+      // We haven't, add the pair to our container to ensure we don't add it again
+      // Then create a Resetter which will observe the life of this object
+      // Finally, add the resetter to the Update-Manager
+      // When this object is destroyed, the resetter will be informed and will automatically be removed
+
+      mProperties.emplace_back( std::move( pair ) );
+      OwnerPointer< SceneGraph::PropertyResetterBase > resetter( Resetter::New( node, propertyBase, *this ) );
+      mUpdateManager->AddPropertyResetter( resetter );
+    }
+  }
+
+public:
+
+  /**
+   * Structure to store the Node & property-base pair
+   */
+  struct NodePropertyPair
+  {
+    SceneGraph::Node* node;
+    SceneGraph::PropertyBase* propertyBase;
+
+    NodePropertyPair( const NodePropertyPair& )            = delete;  ///< Deleted copy constructor.
+    NodePropertyPair( NodePropertyPair&& )                 = default; ///< Default move constructor.
+    NodePropertyPair& operator=( const NodePropertyPair& ) = delete;  ///< Deleted assignment operator.
+    NodePropertyPair& operator=( NodePropertyPair&& )      = default; ///< Default move assignment operator.
+
+    /**
+     * Comparison operator
+     */
+    bool operator==( const NodePropertyPair& other )
+    {
+      return ( other.node == node ) &&
+             ( other.propertyBase == propertyBase );
+    }
+  };
+
+  std::vector< NodePropertyPair > mProperties;
+  std::vector< LifecycleObserver* > mLifecycleObservers;
+  SceneGraph::UpdateManager* mUpdateManager;
+};
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_UPDATE_PROXY_PROPERTY_MODIFIER_H
index 131ba19..0c288f8 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_NODE_DECLARATIONS_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-vector.h>
+#include <dali/devel-api/common/bitwise-enum.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/internal/common/owner-pointer.h>
 
@@ -38,10 +39,27 @@ typedef Dali::Vector< Node* > NodeContainer;
 typedef NodeContainer::Iterator NodeIter;
 typedef NodeContainer::ConstIterator NodeConstIter;
 
+/**
+ * Flag whether property has changed, during the Update phase.
+ */
+enum class NodePropertyFlags : uint8_t
+// 8 bits is enough for 4 flags (compiler will check it)
+{
+  NOTHING          = 0x000,
+  TRANSFORM        = 0x001,
+  VISIBLE          = 0x002,
+  COLOR            = 0x004,
+  CHILD_DELETED    = 0x008,
+  ALL = ( CHILD_DELETED << 1 ) - 1 // all the flags
+};
+
 } // namespace SceneGraph
 
 } // namespace Internal
 
+// specialization has to be done in the same namespace
+template<> struct EnableBitMaskOperators< Internal::SceneGraph::NodePropertyFlags > { static const bool ENABLE = true; };
+
 } // namespace Dali
 
 #endif // __DALI_INTERNAL_SCENE_GRAPH_NODE_DECLARATIONS_H__
index af3cf6d..df7e628 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_NODE_MESSAGES_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -87,7 +87,7 @@ public:
                     typename ParameterType< P >::PassingType value )
   {
     // Reserve some memory inside the message queue
-    unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( NodePropertyMessage ) );
+    uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( NodePropertyMessage ) );
 
     // Construct message in the message queue memory; note that delete should not be called on the return value
     new (slot) NodePropertyMessage( eventThreadServices.GetUpdateManager(), node, property, member, value );
@@ -168,7 +168,7 @@ public:
                     float value )
   {
     // Reserve some memory inside the message queue
-    unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( NodePropertyComponentMessage ) );
+    uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( NodePropertyComponentMessage ) );
 
     // Construct message in the message queue memory; note that delete should not be called on the return value
     new (slot) NodePropertyComponentMessage( eventThreadServices.GetUpdateManager(), node, property, member, value );
@@ -247,7 +247,7 @@ public:
                     const P& value )
   {
     // Reserve some memory inside the message queue
-    unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( NodeTransformPropertyMessage ) );
+    uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( NodeTransformPropertyMessage ) );
 
     // Construct message in the message queue memory; note that delete should not be called on the return value
     new (slot) NodeTransformPropertyMessage( eventThreadServices.GetUpdateManager(), node, property, member, value );
@@ -326,7 +326,7 @@ public:
                     float value )
   {
     // Reserve some memory inside the message queue
-    unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( NodeTransformComponentMessage ) );
+    uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( NodeTransformComponentMessage ) );
 
     // Construct message in the message queue memory; note that delete should not be called on the return value
     new (slot) NodeTransformComponentMessage( eventThreadServices.GetUpdateManager(), node, property, member, value );
old mode 100644 (file)
new mode 100755 (executable)
index 088c3c8..c89e2cf
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/common/constants.h>
 
-namespace //Unnamed namespace
+namespace
 {
 //Memory pool used to allocate new nodes. Memory used by this pool will be released when process dies
 // or DALI library is unloaded
 Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::Node> gNodeMemoryPool;
 #ifdef DEBUG_ENABLED
-// keep track of nodes created / deleted, to ensure we have 0 when the process exits or DALi library is unloaded
-int gNodeCount =0;
+// keep track of nodes alive, to ensure we have 0 when the process exits or DALi library is unloaded
+int32_t gNodeCount = 0;
 
 // Called when the process is about to exit, Node count should be zero at this point.
 void __attribute__ ((destructor)) ShutDown(void)
@@ -40,7 +40,7 @@ void __attribute__ ((destructor)) ShutDown(void)
 DALI_ASSERT_DEBUG( (gNodeCount == 0) && "Node memory leak");
 }
 #endif
-}
+} // Unnamed namespace
 
 namespace Dali
 {
@@ -51,13 +51,13 @@ namespace Internal
 namespace SceneGraph
 {
 
-const PositionInheritanceMode Node::DEFAULT_POSITION_INHERITANCE_MODE( INHERIT_PARENT_POSITION );
 const ColorMode Node::DEFAULT_COLOR_MODE( USE_OWN_MULTIPLY_PARENT_ALPHA );
 
+uint32_t Node::mNodeCounter = 0;        ///< A counter to provide unique node ids, up-to 4 billion
 
 Node* Node::New()
 {
-  return new ( gNodeMemoryPool.AllocateRawThreadSafe() ) Node();
+  return new ( gNodeMemoryPool.AllocateRawThreadSafe() ) Node;
 }
 
 void Node::Delete( Node* node )
@@ -88,6 +88,7 @@ Node::Node()
   mOrientation(),                                                                 // Initialized to identity by default
   mScale( TRANSFORM_PROPERTY_SCALE ),
   mVisible( true ),
+  mCulled( false ),
   mColor( Color::WHITE ),
   mWorldPosition( TRANSFORM_PROPERTY_WORLD_POSITION, Vector3( 0.0f,0.0f,0.0f ) ), // Zero initialized by default
   mWorldScale( TRANSFORM_PROPERTY_WORLD_SCALE, Vector3( 1.0f,1.0f,1.0f ) ),
@@ -95,14 +96,15 @@ Node::Node()
   mWorldMatrix(),
   mWorldColor( Color::WHITE ),
   mClippingSortModifier( 0u ),
+  mId( ++mNodeCounter ),
   mParent( NULL ),
   mExclusiveRenderTask( NULL ),
   mChildren(),
   mClippingDepth( 0u ),
   mScissorDepth( 0u ),
   mDepthIndex( 0u ),
+  mDirtyFlags( NodePropertyFlags::ALL ),
   mRegenerateUniformMap( 0 ),
-  mDirtyFlags( AllFlags ),
   mDrawMode( DrawMode::NORMAL ),
   mColorMode( DEFAULT_COLOR_MODE ),
   mClippingMode( ClippingMode::DISABLED ),
@@ -133,6 +135,11 @@ void Node::OnDestroy()
   PropertyOwner::Destroy();
 }
 
+uint32_t Node::GetId() const
+{
+  return mId;
+}
+
 void Node::CreateTransform( SceneGraph::TransformManager* transformManager )
 {
   //Create a new transform
@@ -239,31 +246,32 @@ void Node::DisconnectChild( BufferIndex updateBufferIndex, Node& childNode )
 
 void Node::AddRenderer( Renderer* renderer )
 {
-  // Check that it has not been already added.
-  unsigned int rendererCount( mRenderer.Size() );
-  for( unsigned int i(0); i < rendererCount; ++i )
-  {
-    if( mRenderer[i] == renderer )
-    {
-      // Renderer is already in the list.
-      return;
-    }
-  }
-
   // If it is the first renderer added, make sure the world transform will be calculated
   // in the next update as world transform is not computed if node has no renderers.
-  if( rendererCount == 0 )
+  if( mRenderer.Empty() )
+  {
+    mDirtyFlags |= NodePropertyFlags::TRANSFORM;
+  }
+  else
   {
-    mDirtyFlags |= TransformFlag;
+    // Check that it has not been already added.
+    for( auto&& existingRenderer : mRenderer )
+    {
+      if( existingRenderer == renderer )
+      {
+        // Renderer is already in the list.
+        return;
+      }
+    }
   }
 
   mRenderer.PushBack( renderer );
 }
 
-void Node::RemoveRenderer( Renderer* renderer )
+void Node::RemoveRenderer( const Renderer* renderer )
 {
-  unsigned int rendererCount( mRenderer.Size() );
-  for( unsigned int i(0); i<rendererCount; ++i )
+  RendererContainer::SizeType rendererCount( mRenderer.Size() );
+  for( RendererContainer::SizeType i = 0; i < rendererCount; ++i )
   {
     if( mRenderer[i] == renderer )
     {
@@ -273,29 +281,39 @@ void Node::RemoveRenderer( Renderer* renderer )
   }
 }
 
-int Node::GetDirtyFlags() const
+NodePropertyFlags Node::GetDirtyFlags() const
 {
   // get initial dirty flags, they are reset ResetDefaultProperties, but setters may have made the node dirty already
-  int flags = mDirtyFlags;
+  NodePropertyFlags flags = mDirtyFlags;
 
   // Check whether the visible property has changed
   if ( !mVisible.IsClean() )
   {
-    flags |= VisibleFlag;
+    flags |= NodePropertyFlags::VISIBLE;
   }
 
   // Check whether the color property has changed
   if ( !mColor.IsClean() )
   {
-    flags |= ColorFlag;
+    flags |= NodePropertyFlags::COLOR;
   }
 
   return flags;
 }
 
+NodePropertyFlags Node::GetInheritedDirtyFlags( NodePropertyFlags parentFlags ) const
+{
+  // Size is not inherited. VisibleFlag is inherited
+  static const NodePropertyFlags InheritedDirtyFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::VISIBLE | NodePropertyFlags::COLOR;
+  using UnderlyingType = typename std::underlying_type<NodePropertyFlags>::type;
+
+  return static_cast<NodePropertyFlags>( static_cast<UnderlyingType>( mDirtyFlags ) |
+                                         ( static_cast<UnderlyingType>( parentFlags ) & static_cast<UnderlyingType>( InheritedDirtyFlags ) ) );
+}
+
 void Node::ResetDirtyFlags( BufferIndex updateBufferIndex )
 {
-  mDirtyFlags = NothingFlag;
+  mDirtyFlags = NodePropertyFlags::NOTHING;
 }
 
 void Node::SetParent( Node& parentNode )
@@ -340,22 +358,6 @@ void Node::RecursiveDisconnectFromSceneGraph( BufferIndex updateBufferIndex )
 
 } // namespace SceneGraph
 
-template <>
-void OwnerPointer<Dali::Internal::SceneGraph::Node>::Reset()
-{
-  if( mObject != NULL )
-  {
-    Dali::Internal::SceneGraph::Node::Delete( mObject );
-    mObject = NULL;
-  }
-}
-
 } // namespace Internal
 
-template <>
-void OwnerContainer<Dali::Internal::SceneGraph::Node*>::Delete(Dali::Internal::SceneGraph::Node* pointer)
-{
-  Dali::Internal::SceneGraph::Node::Delete( pointer );
-}
-
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index 4482777..8091a75
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_NODE_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/update/common/animatable-property.h>
 #include <dali/internal/update/common/property-owner.h>
-#include <dali/internal/update/common/property-vector3.h>
 #include <dali/internal/update/common/scene-graph-buffers.h>
 #include <dali/internal/update/common/inherited-property.h>
 #include <dali/internal/update/manager/transform-manager.h>
 #include <dali/internal/update/manager/transform-manager-property.h>
 #include <dali/internal/update/nodes/node-declarations.h>
-#include <dali/internal/update/rendering/data-providers/node-data-provider.h>
-
-//#include <dali/internal/update/rendering/scene-graph-renderer.h>
 
 
 namespace Dali
@@ -48,7 +44,6 @@ namespace Internal
 
 // Value types used by messages.
 template <> struct ParameterType< ColorMode > : public BasicType< ColorMode > {};
-template <> struct ParameterType< PositionInheritanceMode > : public BasicType< PositionInheritanceMode > {};
 template <> struct ParameterType< ClippingMode::Type > : public BasicType< ClippingMode::Type > {};
 
 namespace SceneGraph
@@ -63,30 +58,9 @@ class Renderer;
 using RendererContainer = Dali::Vector<Renderer*>;
 
 
-/**
- * Flag whether property has changed, during the Update phase.
- */
-enum NodePropertyFlags
-{
-  NothingFlag          = 0x000,
-  TransformFlag        = 0x001,
-  VisibleFlag          = 0x002,
-  ColorFlag            = 0x004,
-  SizeFlag             = 0x008,
-  OverlayFlag          = 0x010,
-  SortModifierFlag     = 0x020,
-  ChildDeletedFlag     = 0x040,
-};
-
-static const int AllFlags = ( ChildDeletedFlag << 1 ) - 1; // all the flags
-
-/**
- * Size is not inherited. VisibleFlag is inherited
- */
-static const int InheritedDirtyFlags = TransformFlag | VisibleFlag | ColorFlag | OverlayFlag;
 
 // Flags which require the scene renderable lists to be updated
-static const int RenderableUpdateFlags = TransformFlag | SortModifierFlag | ChildDeletedFlag;
+static NodePropertyFlags RenderableUpdateFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::CHILD_DELETED;
 
 /**
  * Node is the base class for all nodes in the Scene Graph.
@@ -101,7 +75,6 @@ class Node : public PropertyOwner
 public:
 
   // Defaults
-  static const PositionInheritanceMode DEFAULT_POSITION_INHERITANCE_MODE;
   static const ColorMode DEFAULT_COLOR_MODE;
 
   // Creation methods
@@ -121,6 +94,11 @@ public:
    */
   void OnDestroy();
 
+  /**
+   * @return the unique ID of the node
+   */
+  uint32_t GetId() const;
+
   // Layer interface
 
   /**
@@ -229,13 +207,13 @@ public:
    * Remove a renderer from the node
    * @param[in] renderer The renderer to be removed
    */
-  void RemoveRenderer( Renderer* renderer );
+  void RemoveRenderer( const Renderer* renderer );
 
   /*
    * Get the renderer at the given index
    * @param[in] index
    */
-  Renderer* GetRendererAt( unsigned int index ) const
+  Renderer* GetRendererAt( uint32_t index ) const
   {
     return mRenderer[index];
   }
@@ -243,9 +221,9 @@ public:
   /**
    * Retrieve the number of renderers for the node
    */
-  unsigned int GetRendererCount()
+  uint32_t GetRendererCount() const
   {
-    return mRenderer.Size();
+    return static_cast<uint32_t>( mRenderer.Size() );
   }
 
   // Containment methods
@@ -287,6 +265,14 @@ public:
   }
 
   /**
+   * @return true if the node is connected to SceneGraph
+   */
+  bool ConnectedToScene()
+  {
+    return IsRoot() || GetParent();
+  }
+
+  /**
    * Connect a node to the scene-graph.
    * @pre A node cannot be added to itself.
    * @pre The parent node is connected to the scene-graph.
@@ -328,7 +314,7 @@ public:
    * Flag that one of the node values has changed in the current frame.
    * @param[in] flag The flag to set.
    */
-  void SetDirtyFlag(NodePropertyFlags flag)
+  void SetDirtyFlag( NodePropertyFlags flag )
   {
     mDirtyFlags |= flag;
   }
@@ -338,14 +324,22 @@ public:
    */
   void SetAllDirtyFlags()
   {
-    mDirtyFlags = AllFlags;
+    mDirtyFlags = NodePropertyFlags::ALL;
   }
 
   /**
    * Query whether a node is dirty.
    * @return The dirty flags
    */
-  int GetDirtyFlags() const;
+  NodePropertyFlags GetDirtyFlags() const;
+
+  /**
+   * Query inherited dirty flags.
+   *
+   * @param The parentFlags to or with
+   * @return The inherited dirty flags
+   */
+  NodePropertyFlags GetInheritedDirtyFlags( NodePropertyFlags parentFlags ) const;
 
   /**
    * Retrieve the parent-origin of the node.
@@ -591,11 +585,11 @@ public:
    * or inherits its parent color.
    * @param[in] colorMode The new color mode.
    */
-  void SetColorMode(ColorMode colorMode)
+  void SetColorMode( ColorMode colorMode )
   {
     mColorMode = colorMode;
 
-    SetDirtyFlag(ColorFlag);
+    SetDirtyFlag( NodePropertyFlags::COLOR );
   }
 
   /**
@@ -727,13 +721,19 @@ public:
    * @brief Sets the sibling order of the node
    * @param[in] order The new order
    */
-  void SetDepthIndex( unsigned int depthIndex ){ mDepthIndex = depthIndex; }
+  void SetDepthIndex( uint32_t depthIndex )
+  {
+    mDepthIndex = depthIndex;
+  }
 
   /**
    * @brief Get the depth index of the node
    * @return Current depth index
    */
-  unsigned int GetDepthIndex(){ return mDepthIndex; }
+  uint32_t GetDepthIndex() const
+  {
+    return mDepthIndex;
+  }
 
   /**
    * @brief Sets the boolean which states whether the position should use the anchor-point.
@@ -748,6 +748,26 @@ public:
     }
   }
 
+  /**
+   * @brief Sets whether the node is culled or not.
+   * @param[in] bufferIndex The buffer to read from.
+   * @param[in] culled True if the node is culled.
+   */
+  void SetCulled( BufferIndex bufferIndex, bool culled )
+  {
+    mCulled[bufferIndex] = culled;
+  }
+
+  /**
+   * @brief Retrieves whether the node is culled or not.
+   * @param[in] bufferIndex The buffer to read from.
+   * @return True if the node is culled.
+   */
+  bool IsCulled( BufferIndex bufferIndex ) const
+  {
+    return mCulled[bufferIndex];
+  }
+
 public:
   /**
    * @copydoc UniformMap::Add
@@ -810,9 +830,9 @@ private: // from NodeDataProvider
   /**
    * @copydoc NodeDataProvider::GetModelMatrix
    */
-  virtual const Matrix& GetModelMatrix( unsigned int bufferId ) const
+  virtual const Matrix& GetModelMatrix( BufferIndex bufferIndex ) const
   {
-    return GetWorldMatrix( bufferId );
+    return GetWorldMatrix( bufferIndex );
   }
 
   /**
@@ -842,14 +862,15 @@ public: // Default properties
 
   TransformManager*                  mTransformManager;
   TransformId                        mTransformId;
-  TransformManagerPropertyVector3    mParentOrigin;           ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed
-  TransformManagerPropertyVector3    mAnchorPoint;            ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed
+  TransformManagerPropertyVector3    mParentOrigin;           ///< Local transform; the position is relative to this. Sets the Transform flag dirty when changed
+  TransformManagerPropertyVector3    mAnchorPoint;            ///< Local transform; local center of rotation. Sets the Transform flag dirty when changed
   TransformManagerPropertyVector3    mSize;                   ///< Size is provided for layouting
   TransformManagerPropertyVector3    mPosition;               ///< Local transform; distance between parent-origin & anchor-point
   TransformManagerPropertyQuaternion mOrientation;            ///< Local transform; rotation relative to parent node
   TransformManagerPropertyVector3    mScale;                  ///< Local transform; scale relative to parent node
 
   AnimatableProperty<bool>           mVisible;                ///< Visibility can be inherited from the Node hierachy
+  AnimatableProperty<bool>           mCulled;                 ///< True if the node is culled. This is not animatable. It is just double-buffered.
   AnimatableProperty<Vector4>        mColor;                  ///< Color can be inherited from the Node hierarchy
 
   // Inherited properties; read-only from public API
@@ -861,9 +882,12 @@ public: // Default properties
   InheritedColor                     mWorldColor;             ///< Full inherited color
 
   uint32_t                           mClippingSortModifier;   ///< Contains bit-packed clipping information for quick access when sorting
+  const uint32_t                     mId;                     ///< The Unique ID of the node.
 
 protected:
 
+  static uint32_t                    mNodeCounter;            ///< count of total nodes, used for unique ids
+
   Node*                              mParent;                 ///< Pointer to parent node (a child is owned by its parent)
   RenderTask*                        mExclusiveRenderTask;    ///< Nodes can be marked as exclusive to a single RenderTask
 
@@ -878,14 +902,15 @@ protected:
   uint32_t                           mDepthIndex;             ///< Depth index of the node
 
   // flags, compressed to bitfield
-  unsigned int                       mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
-  int                                mDirtyFlags:8;           ///< A composite set of flags for each of the Node properties
-  DrawMode::Type                     mDrawMode:2;             ///< How the Node and its children should be drawn
-  ColorMode                          mColorMode:2;            ///< Determines whether mWorldColor is inherited, 2 bits is enough
-  ClippingMode::Type                 mClippingMode:2;         ///< The clipping mode of this node
+  NodePropertyFlags                  mDirtyFlags;             ///< Dirty flags for each of the Node properties
+  uint32_t                           mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
+  DrawMode::Type                     mDrawMode:3;             ///< How the Node and its children should be drawn
+  ColorMode                          mColorMode:3;            ///< Determines whether mWorldColor is inherited, 2 bits is enough
+  ClippingMode::Type                 mClippingMode:3;         ///< The clipping mode of this node
   bool                               mIsRoot:1;               ///< True if the node cannot have a parent
   bool                               mIsLayer:1;              ///< True if the node is a layer
   bool                               mPositionUsesAnchorPoint:1; ///< True if the node should use the anchor-point when calculating the position
+
   // Changes scope, should be at end of class
   DALI_LOG_OBJECT_STRING_DECLARATION;
 };
@@ -897,7 +922,7 @@ inline void SetInheritOrientationMessage( EventThreadServices& eventThreadServic
   typedef MessageValue1< Node, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetInheritOrientation, inherit );
@@ -908,7 +933,7 @@ inline void SetParentOriginMessage( EventThreadServices& eventThreadServices, co
   typedef MessageValue1< Node, Vector3 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetParentOrigin, origin );
@@ -919,7 +944,7 @@ inline void SetAnchorPointMessage( EventThreadServices& eventThreadServices, con
   typedef MessageValue1< Node, Vector3 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetAnchorPoint, anchor );
@@ -930,7 +955,7 @@ inline void SetInheritPositionMessage( EventThreadServices& eventThreadServices,
   typedef MessageValue1< Node, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetInheritPosition, inherit );
@@ -941,7 +966,7 @@ inline void SetInheritScaleMessage( EventThreadServices& eventThreadServices, co
   typedef MessageValue1< Node, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetInheritScale, inherit );
@@ -952,7 +977,7 @@ inline void SetColorModeMessage( EventThreadServices& eventThreadServices, const
   typedef MessageValue1< Node, ColorMode > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetColorMode, colorMode );
@@ -963,40 +988,40 @@ inline void SetDrawModeMessage( EventThreadServices& eventThreadServices, const
   typedef MessageValue1< Node, DrawMode::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetDrawMode, drawMode );
 }
 
-inline void AddRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
+inline void AttachRendererMessage( EventThreadServices& eventThreadServices, const Node& node, const Renderer& renderer )
 {
   typedef MessageValue1< Node, Renderer* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &node, &Node::AddRenderer, renderer );
+  new (slot) LocalType( &node, &Node::AddRenderer, const_cast<Renderer*>( &renderer ) );
 }
 
-inline void RemoveRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
+inline void DetachRendererMessage( EventThreadServices& eventThreadServices, const Node& node, const Renderer& renderer )
 {
-  typedef MessageValue1< Node, Renderer* > LocalType;
+  typedef MessageValue1< Node, const Renderer* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &node, &Node::RemoveRenderer, renderer );
+  new (slot) LocalType( &node, &Node::RemoveRenderer, &renderer );
 }
 
-inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, unsigned int depthIndex )
+inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, uint32_t depthIndex )
 {
-  typedef MessageValue1< Node, unsigned int > LocalType;
+  typedef MessageValue1< Node, uint32_t > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetDepthIndex, depthIndex );
@@ -1007,7 +1032,7 @@ inline void SetClippingModeMessage( EventThreadServices& eventThreadServices, co
   typedef MessageValue1< Node, ClippingMode::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetClippingMode, clippingMode );
@@ -1018,7 +1043,7 @@ inline void SetPositionUsesAnchorPointMessage( EventThreadServices& eventThreadS
   typedef MessageValue1< Node, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &node, &Node::SetPositionUsesAnchorPoint, positionUsesAnchorPoint );
@@ -1028,14 +1053,22 @@ inline void SetPositionUsesAnchorPointMessage( EventThreadServices& eventThreadS
 
 // Template specialisation for OwnerPointer<Node>, because delete is protected
 template <>
-void OwnerPointer<Dali::Internal::SceneGraph::Node>::Reset();
-
+inline void OwnerPointer<Dali::Internal::SceneGraph::Node>::Reset()
+{
+  if (mObject != NULL)
+  {
+    Dali::Internal::SceneGraph::Node::Delete(mObject);
+    mObject = NULL;
+  }
+}
 } // namespace Internal
 
 // Template specialisations for OwnerContainer<Node*>, because delete is protected
 template <>
-void OwnerContainer<Dali::Internal::SceneGraph::Node*>::Delete( Dali::Internal::SceneGraph::Node* pointer );
-
+inline void OwnerContainer<Dali::Internal::SceneGraph::Node*>::Delete( Dali::Internal::SceneGraph::Node* pointer )
+{
+  Dali::Internal::SceneGraph::Node::Delete(pointer);
+}
 } // namespace Dali
 
 #endif // DALI_INTERNAL_SCENE_GRAPH_NODE_H
old mode 100644 (file)
new mode 100755 (executable)
index 46bb14c..d6f3815
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,10 +39,11 @@ SceneGraph::Layer* Layer::New()
 }
 
 Layer::Layer()
-: mSortFunction( Internal::Layer::ZValue ),
+: Node(),
+  mSortFunction( Internal::Layer::ZValue ),
   mClippingBox( 0,0,0,0 ),
   mLastCamera( NULL ),
-  mBehavior( Dali::Layer::LAYER_2D ),
+  mBehavior( Dali::Layer::LAYER_UI ),
   mIsClipping( false ),
   mDepthTestDisabled( true ),
   mIsDefaultSortFunction( true )
@@ -113,15 +114,6 @@ void Layer::ClearRenderables()
 
 } // namespace SceneGraph
 
-template <>
-void OwnerPointer<Dali::Internal::SceneGraph::Layer>::Reset()
-{
-  if( mObject != NULL )
-  {
-    Dali::Internal::SceneGraph::Node::Delete( mObject );
-    mObject = NULL;
-  }
-}
 } // namespace Internal
 
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index f56bdd3..c49f84f
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_LAYER_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -82,6 +82,11 @@ public:
   static SceneGraph::Layer* New();
 
   /**
+   * Virtual destructor
+   */
+  virtual ~Layer();
+
+  /**
    * From Node, to convert a node to a layer.
    * @return The layer.
    */
@@ -212,11 +217,6 @@ private:
   // Undefined
   Layer(const Layer&);
 
-  /**
-   * Virtual destructor
-   */
-  virtual ~Layer();
-
   // Undefined
   Layer& operator=(const Layer& rhs);
 
@@ -255,7 +255,7 @@ inline void SetSortFunctionMessage( EventThreadServices& eventThreadServices, co
   typedef MessageValue1< Layer, Dali::Layer::SortFunctionType > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &layer, &Layer::SetSortFunction, function );
@@ -271,7 +271,7 @@ inline void SetClippingMessage( EventThreadServices& eventThreadServices, const
   typedef MessageValue1< Layer, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &layer, &Layer::SetClipping, enabled );
@@ -287,7 +287,7 @@ inline void SetClippingBoxMessage( EventThreadServices& eventThreadServices, con
   typedef MessageValue1< Layer, Dali::ClippingBox > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &layer, &Layer::SetClippingBox, clippingbox );
@@ -305,7 +305,7 @@ inline void SetBehaviorMessage( EventThreadServices& eventThreadServices,
   typedef MessageValue1< Layer, Dali::Layer::Behavior > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &layer, &Layer::SetBehavior, behavior );
@@ -324,7 +324,7 @@ inline void SetDepthTestDisabledMessage( EventThreadServices& eventThreadService
   typedef MessageValue1< Layer, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &layer, &Layer::SetDepthTestDisabled, disable );
@@ -334,8 +334,14 @@ inline void SetDepthTestDisabledMessage( EventThreadServices& eventThreadService
 
 // Template specialisation for OwnerPointer<Layer>, because delete is protected
 template <>
-void OwnerPointer<Dali::Internal::SceneGraph::Layer>::Reset();
-
+inline void OwnerPointer<Dali::Internal::SceneGraph::Layer>::Reset()
+{
+  if (mObject != NULL)
+  {
+    Dali::Internal::SceneGraph::Node::Delete(mObject);
+    mObject = NULL;
+  }
+}
 } // namespace Internal
 
 } // namespace Dali
index c8fab1e..0609a4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -153,7 +153,7 @@ void MessageQueue::EventProcessingStarted()
 }
 
 // Called from event thread
-unsigned int* MessageQueue::ReserveMessageSlot( unsigned int requestedSize, bool updateScene )
+uint32_t* MessageQueue::ReserveMessageSlot( uint32_t requestedSize, bool updateScene )
 {
   DALI_ASSERT_DEBUG( 0 != requestedSize );
 
index e03d3f2..1fc3d61 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_UPDATE_MESSAGE_QUEUE_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -74,7 +74,7 @@ public:
    * @param[in] updateScene If set to true, denotes that the message will cause the scene graph node tree to require an update
    * @return A pointer to the first char allocated for the message
    */
-  unsigned int* ReserveMessageSlot( unsigned int size, bool updateScene );
+  uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene );
 
   /**
    * Flushes the message queue
@@ -114,8 +114,9 @@ private:
 private:
 
   // Not copyable:
-  MessageQueue ( const MessageQueue& rhs );
-  MessageQueue& operator=( const MessageQueue& rhs );
+  MessageQueue() = delete;
+  MessageQueue ( const MessageQueue& rhs ) = delete;
+  MessageQueue& operator=( const MessageQueue& rhs ) = delete;
 
 private:
 
index 56e6b9e..f6ecce5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,8 +29,8 @@
 
 namespace // unnamed namespace
 {
-const unsigned int UPDATE_COUNT        = 2u;  // Update projection or view matrix this many frames after a change
-const unsigned int COPY_PREVIOUS_MATRIX = 1u; // Copy view or projection matrix from previous frame
+const uint32_t UPDATE_COUNT        = 2u;  // Update projection or view matrix this many frames after a change
+const uint32_t COPY_PREVIOUS_MATRIX = 1u; // Copy view or projection matrix from previous frame
 }
 
 namespace Dali
@@ -45,6 +45,12 @@ namespace SceneGraph
 namespace
 {
 
+template< typename T >
+T Sign( T value )
+{
+  return T( T(0) < value ) - T( value < T(0) );
+}
+
 void LookAt(Matrix& result, const Vector3& eye, const Vector3& target, const Vector3& up)
 {
   Vector3 vZ = target - eye;
@@ -59,7 +65,6 @@ void LookAt(Matrix& result, const Vector3& eye, const Vector3& target, const Vec
   result.SetInverseTransformComponents(vX, vY, vZ, eye);
 }
 
-
 void Frustum(Matrix& result, float left, float right, float bottom, float top, float near, float far, bool invertYAxis)
 {
   float deltaZ = far - near;
@@ -91,13 +96,12 @@ void Frustum(Matrix& result, float left, float right, float bottom, float top, f
   m[12] = m[13] = m[15] = 0.0f;
 }
 
-void Perspective(Matrix& result, float fovy, float aspect, float near, float far, bool invertYAxis, const Vector2& stereoBias )
+void Perspective(Matrix& result, float fovy, float aspect, float near, float far, bool invertYAxis )
 {
   float frustumH = tanf( fovy * 0.5f ) * near;
   float frustumW = frustumH * aspect;
-  Vector2 bias = stereoBias * 0.5f;
 
-  Frustum(result, -(frustumW + bias.x), frustumW - bias.x, -(frustumH + bias.y), frustumH - bias.y, near, far, invertYAxis);
+  Frustum(result, -frustumW, frustumW, -frustumH, frustumH, near, far, invertYAxis);
 }
 
 void Orthographic(Matrix& result, float left, float right, float bottom, float top, float near, float far, bool invertYAxis)
@@ -139,7 +143,7 @@ void Orthographic(Matrix& result, float left, float right, float bottom, float t
 const Dali::Camera::Type Camera::DEFAULT_TYPE( Dali::Camera::FREE_LOOK );
 const Dali::Camera::ProjectionMode Camera::DEFAULT_MODE( Dali::Camera::PERSPECTIVE_PROJECTION );
 const bool  Camera::DEFAULT_INVERT_Y_AXIS( false );
-const float Camera::DEFAULT_FIELD_OF_VIEW( 45.0f*(M_PI/180.0f) );
+const float Camera::DEFAULT_FIELD_OF_VIEW( 45.0f*(Math::PI/180.0f) );
 const float Camera::DEFAULT_ASPECT_RATIO( 4.0f/3.0f );
 const float Camera::DEFAULT_LEFT_CLIPPING_PLANE(-240.0f);
 const float Camera::DEFAULT_RIGHT_CLIPPING_PLANE(240.0f);
@@ -147,7 +151,6 @@ const float Camera::DEFAULT_TOP_CLIPPING_PLANE(-400.0f);
 const float Camera::DEFAULT_BOTTOM_CLIPPING_PLANE(400.0f);
 const float Camera::DEFAULT_NEAR_CLIPPING_PLANE( 800.0f ); // default height of the screen
 const float Camera::DEFAULT_FAR_CLIPPING_PLANE( DEFAULT_NEAR_CLIPPING_PLANE + 2.f * DEFAULT_NEAR_CLIPPING_PLANE );
-const Vector2 Camera::DEFAULT_STEREO_BIAS( 0.0f, 0.0f );
 const Vector3 Camera::DEFAULT_TARGET_POSITION( 0.0f, 0.0f, 0.0f );
 
 
@@ -166,7 +169,6 @@ Camera::Camera()
   mBottomClippingPlane( DEFAULT_BOTTOM_CLIPPING_PLANE ),
   mNearClippingPlane( DEFAULT_NEAR_CLIPPING_PLANE ),
   mFarClippingPlane( DEFAULT_FAR_CLIPPING_PLANE ),
-  mStereoBias( DEFAULT_STEREO_BIAS ),
   mTargetPosition( DEFAULT_TARGET_POSITION ),
   mViewMatrix(),
   mProjectionMatrix(),
@@ -217,12 +219,6 @@ void Camera::SetAspectRatio( float aspectRatio )
   mUpdateProjectionFlag = UPDATE_COUNT;
 }
 
-void Camera::SetStereoBias( const Vector2& stereoBias )
-{
-  mStereoBias = stereoBias;
-  mUpdateProjectionFlag = UPDATE_COUNT;
-}
-
 void Camera::SetLeftClippingPlane( float leftClippingPlane )
 {
   mLeftClippingPlane = leftClippingPlane;
@@ -297,7 +293,7 @@ void Camera::Update( BufferIndex updateBufferIndex )
   {
     mUpdateViewFlag = UPDATE_COUNT;
   }
-  if( mNode->GetDirtyFlags() & VisibleFlag )
+  if( mNode->GetDirtyFlags() & NodePropertyFlags::VISIBLE )
   {
     // If the visibility changes, the projection matrix needs to be re-calculated.
     // It may happen the first time an actor is rendered it's rendered only once and becomes invisible,
@@ -307,8 +303,8 @@ void Camera::Update( BufferIndex updateBufferIndex )
   }
 
   // if either matrix changed, we need to recalculate the inverse matrix for hit testing to work
-  unsigned int viewUpdateCount = UpdateViewMatrix( updateBufferIndex );
-  unsigned int projectionUpdateCount = UpdateProjection( updateBufferIndex );
+  uint32_t viewUpdateCount = UpdateViewMatrix( updateBufferIndex );
+  uint32_t projectionUpdateCount = UpdateProjection( updateBufferIndex );
 
   // if model or view matrix changed we need to either recalculate the inverse VP or copy previous
   if( viewUpdateCount > COPY_PREVIOUS_MATRIX || projectionUpdateCount > COPY_PREVIOUS_MATRIX )
@@ -334,9 +330,9 @@ bool Camera::ViewMatrixUpdated()
   return 0u != mUpdateViewFlag;
 }
 
-unsigned int Camera::UpdateViewMatrix( BufferIndex updateBufferIndex )
+uint32_t Camera::UpdateViewMatrix( BufferIndex updateBufferIndex )
 {
-  unsigned int retval( mUpdateViewFlag );
+  uint32_t retval( mUpdateViewFlag );
   if( 0u != mUpdateViewFlag )
   {
     if( COPY_PREVIOUS_MATRIX == mUpdateViewFlag )
@@ -424,7 +420,7 @@ void Camera::UpdateFrustum( BufferIndex updateBufferIndex, bool normalize )
 
   if ( normalize )
   {
-    for ( unsigned int i = 0; i < 6; ++i )
+    for ( uint32_t i = 0; i < 6; ++i )
     {
       // Normalize planes to ensure correct bounding distance checking
       Plane& plane = planes.mPlanes[ i ];
@@ -437,7 +433,7 @@ void Camera::UpdateFrustum( BufferIndex updateBufferIndex, bool normalize )
   }
   else
   {
-    for ( unsigned int i = 0; i < 6; ++i )
+    for ( uint32_t i = 0; i < 6; ++i )
     {
       planes.mSign[i] = Vector3( Sign(planes.mPlanes[ i ].mNormal.x), Sign(planes.mPlanes[ i ].mNormal.y), Sign(planes.mPlanes[ i ].mNormal.z) );
     }
@@ -473,9 +469,9 @@ bool Camera::CheckAABBInFrustum( BufferIndex bufferIndex, const Vector3& origin,
   return true;
 }
 
-unsigned int Camera::UpdateProjection( BufferIndex updateBufferIndex )
+uint32_t Camera::UpdateProjection( BufferIndex updateBufferIndex )
 {
-  unsigned int retval( mUpdateProjectionFlag );
+  uint32_t retval( mUpdateProjectionFlag );
   // Early-exit if no update required
   if ( 0u != mUpdateProjectionFlag )
   {
@@ -496,8 +492,7 @@ unsigned int Camera::UpdateProjection( BufferIndex updateBufferIndex )
                        mAspectRatio,
                        mNearClippingPlane,
                        mFarClippingPlane,
-                       mInvertYAxis,
-                       mStereoBias );
+                       mInvertYAxis );
           break;
         }
         case Dali::Camera::ORTHOGRAPHIC_PROJECTION:
index 44b7518..d17120f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_CAMERA_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -124,11 +124,6 @@ public:
    */
   void SetAspectRatio( float aspectRatio );
 
-  /**
-   * @copydoc Dali::Internal::CameraActor::SetStereoBias
-   */
-  void SetStereoBias(const Vector2& stereoBias);
-
    /**
    * @copydoc Dali::Internal::CameraActor::SetLeftClippingPlane
    */
@@ -251,14 +246,14 @@ private:
    * @param[in] bufferIndex The current update buffer index.
    * @return count how many frames ago the matrix was changed.
    */
-  unsigned int UpdateViewMatrix( BufferIndex updateBufferIndex );
+  uint32_t UpdateViewMatrix( BufferIndex updateBufferIndex );
 
   /**
    * Recalculates the projection matrix.
    * @param[in] bufferIndex The current update buffer index.
    * @return count how many frames ago the matrix was changed.
    */
-  unsigned int UpdateProjection( BufferIndex updateBufferIndex );
+  uint32_t UpdateProjection( BufferIndex updateBufferIndex );
 
 private:
 
@@ -270,8 +265,8 @@ private:
    */
   void UpdateFrustum( BufferIndex updateBufferIndex, bool normalize = true );
 
-  unsigned int                  mUpdateViewFlag;       ///< This is non-zero if the view matrix requires an update
-  unsigned int                  mUpdateProjectionFlag; ///< This is non-zero if the projection matrix requires an update
+  uint32_t                  mUpdateViewFlag;       ///< This is non-zero if the view matrix requires an update
+  uint32_t                  mUpdateProjectionFlag; ///< This is non-zero if the projection matrix requires an update
   const Node*                   mNode;                 ///< The node this scene graph camera belongs to
 
 public:  // PROPERTIES
@@ -287,7 +282,6 @@ public:  // PROPERTIES
   float                         mBottomClippingPlane;
   float                         mNearClippingPlane;
   float                         mFarClippingPlane;
-  Vector2                       mStereoBias;
   Vector3                       mTargetPosition;
 
   InheritedMatrix mViewMatrix;           ///< The viewMatrix; this is double buffered for input handling.
@@ -305,7 +299,7 @@ inline void SetTypeMessage( EventThreadServices& eventThreadServices, const Came
   typedef MessageValue1< Camera, Dali::Camera::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetType, parameter );
@@ -316,7 +310,7 @@ inline void SetProjectionModeMessage( EventThreadServices& eventThreadServices,
   typedef MessageValue1< Camera, Dali::Camera::ProjectionMode > LocalProjectionMode;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalProjectionMode ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalProjectionMode ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalProjectionMode( &camera, &Camera::SetProjectionMode, parameter );
@@ -327,7 +321,7 @@ inline void SetFieldOfViewMessage( EventThreadServices& eventThreadServices, con
   typedef MessageValue1< Camera, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetFieldOfView, parameter );
@@ -338,29 +332,18 @@ inline void SetAspectRatioMessage( EventThreadServices& eventThreadServices, con
   typedef MessageValue1< Camera, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetAspectRatio, parameter );
 }
 
-inline void SetStereoBiasMessage( EventThreadServices& eventThreadServices, const Camera& camera, const Vector2& parameter )
-{
-  typedef MessageValue1< Camera, Vector2 > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &camera, &Camera::SetStereoBias, parameter );
-}
-
 inline void SetLeftClippingPlaneMessage( EventThreadServices& eventThreadServices, const Camera& camera, float parameter )
 {
   typedef MessageValue1< Camera, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetLeftClippingPlane, parameter );
@@ -371,7 +354,7 @@ inline void SetRightClippingPlaneMessage( EventThreadServices& eventThreadServic
   typedef MessageValue1< Camera, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetRightClippingPlane, parameter );
@@ -382,7 +365,7 @@ inline void SetTopClippingPlaneMessage( EventThreadServices& eventThreadServices
   typedef MessageValue1< Camera, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetTopClippingPlane, parameter );
@@ -393,7 +376,7 @@ inline void SetBottomClippingPlaneMessage( EventThreadServices& eventThreadServi
   typedef MessageValue1< Camera, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetBottomClippingPlane, parameter );
@@ -404,7 +387,7 @@ inline void SetNearClippingPlaneMessage( EventThreadServices& eventThreadService
   typedef MessageValue1< Camera, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetNearClippingPlane, parameter );
@@ -415,7 +398,7 @@ inline void SetFarClippingPlaneMessage( EventThreadServices& eventThreadServices
   typedef MessageValue1< Camera, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetFarClippingPlane, parameter );
@@ -426,7 +409,7 @@ inline void SetTargetPositionMessage( EventThreadServices& eventThreadServices,
   typedef MessageValue1< Camera, Vector3 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetTargetPosition, parameter );
@@ -437,7 +420,7 @@ inline void SetInvertYAxisMessage( EventThreadServices& eventThreadServices, con
   typedef MessageValue1< Camera, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &camera, &Camera::SetInvertYAxis, parameter );
old mode 100644 (file)
new mode 100755 (executable)
index adcaf05..fb642cd
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_DEBUG_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -30,14 +30,12 @@ Debug::Filter* gRenderTaskLogFilter = Debug::Filter::New(Debug::NoLogging, false
 
 #define TASK_LOG(level)                                              \
   DALI_LOG_INFO(gRenderTaskLogFilter, level, "SceneGraph::RenderTask::%s: this:%p\n", __FUNCTION__, this)
-#define TASK_LOG_FMT(level, format, args...) \
-  DALI_LOG_INFO(gRenderTaskLogFilter, level, "SceneGraph::RenderTask::%s: this:%p " format, __FUNCTION__, this, ## args)
-
+#define TASK_LOG_FMT(level, format, ...) \
+  DALI_LOG_INFO(gRenderTaskLogFilter, level, "SceneGraph::RenderTask::%s: this:%p " format, __FUNCTION__, this, ## __VA_ARGS__)
 #else
 
 #define TASK_LOG(level)
-#define TASK_LOG_FMT(level, format, args...)
-
+#define TASK_LOG_FMT(level, format, ...)
 #endif
 
 #endif // __DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_DEBUG_H__
index 069b73c..9a0decb 100644 (file)
 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/update/render-tasks/scene-graph-render-task.h>
+#include <dali/internal/common/memory-pool-object-allocator.h>
+
+namespace //Unnamed namespace
+{
+
+//Memory pool used to allocate new RenderTaskLists. Memory used by this pool will be released when shutting down DALi
+Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::RenderTaskList> gRenderTaskListMemoryPool;
+
+} // unnamed namespace
 
 namespace Dali
 {
@@ -30,9 +38,13 @@ namespace Internal
 namespace SceneGraph
 {
 
-RenderTaskList::RenderTaskList( /*RenderMessageDispatcher& renderMessageDispatcher*/ )
+RenderTaskList* RenderTaskList::New()
+{
+  return new ( gRenderTaskListMemoryPool.AllocateRawThreadSafe() ) RenderTaskList();
+}
+
+RenderTaskList::RenderTaskList()
 : mNotificationObject( NULL )
-  //,mRenderMessageDispatcher( renderMessageDispatcher )
 {
 }
 
@@ -40,11 +52,16 @@ RenderTaskList::~RenderTaskList()
 {
 }
 
+void RenderTaskList::operator delete( void* ptr )
+{
+  gRenderTaskListMemoryPool.FreeThreadSafe( static_cast<RenderTaskList*>( ptr ) );
+}
+
 void RenderTaskList::AddTask( OwnerPointer< RenderTask >& newTask )
 {
   DALI_ASSERT_DEBUG( newTask != NULL && "SceneGraph RenderTask is null");
 
-  newTask->Initialize( /*mRenderMessageDispatcher*/ );
+  newTask->Initialize();
   // mRenderTasks container takes ownership
   mRenderTasks.PushBack( newTask.Release() );
 }
@@ -64,6 +81,11 @@ void RenderTaskList::RemoveTask( RenderTask* task )
   }
 }
 
+uint32_t RenderTaskList::GetTaskCount()
+{
+  return static_cast<uint32_t>( mRenderTasks.Count() );
+}
+
 RenderTaskList::RenderTaskContainer& RenderTaskList::GetTasks()
 {
   return mRenderTasks;
index b950a4e..dd4ce57 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/internal/common/message.h>
 #include <dali/internal/event/common/event-thread-services.h>
+#include <dali/internal/update/render-tasks/scene-graph-render-task.h>
 
 namespace Dali
 {
@@ -46,10 +47,10 @@ public:
   typedef OwnerContainer< RenderTask* > RenderTaskContainer;
 
   /**
-   * Constructor
-   * @param renderMessageDispatcher to send messages
+   * Construct a new RenderTaskList.
+   * @return A new RenderTaskList
    */
-  RenderTaskList( /*RenderMessageDispatcher& renderMessageDispatcher*/ );
+  static RenderTaskList* New();
 
   /**
    * Destructor
@@ -57,6 +58,12 @@ public:
   ~RenderTaskList();
 
   /**
+   * Overriden delete operator
+   * Deletes the RenderTaskList from its global memory pool
+   */
+  void operator delete( void* ptr );
+
+  /**
    * Add a new RenderTask to the list.
    * @param[in] newTask The RenderTaskList takes ownership of this task.
    */
@@ -69,6 +76,12 @@ public:
   void RemoveTask( RenderTask* task );
 
   /**
+   * Retrieve the count of RenderTasks.
+   * @return The count.
+   */
+  uint32_t GetTaskCount();
+
+  /**
    * Retrieve the container of RenderTasks.
    * @return The container.
    */
@@ -91,6 +104,13 @@ public:
    */
   CompleteNotificationInterface* GetCompleteNotificationInterface();
 
+protected:
+
+  /**
+   * Protected constructor. See New()
+   */
+  RenderTaskList();
+
 private:
 
   // Undefined
@@ -107,19 +127,19 @@ private:
 
 // Messages for RenderTaskList
 
-inline void AddTaskMessage( EventThreadServices& eventThreadServices, RenderTaskList& list, OwnerPointer< RenderTask >& task )
+inline void AddTaskMessage( EventThreadServices& eventThreadServices, const RenderTaskList& list, OwnerPointer< RenderTask >& task )
 {
   // Message has ownership of the RenderTask while in transit from event -> update
   typedef MessageValue1< RenderTaskList, OwnerPointer< RenderTask > > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &list, &RenderTaskList::AddTask, task );
 }
 
-inline void RemoveTaskMessage( EventThreadServices& eventThreadServices, RenderTaskList& list, const RenderTask& constTask )
+inline void RemoveTaskMessage( EventThreadServices& eventThreadServices, const RenderTaskList& list, const RenderTask& constTask )
 {
   // Scene graph thread can destroy this object.
   RenderTask& task = const_cast< RenderTask& >( constTask );
@@ -127,7 +147,7 @@ inline void RemoveTaskMessage( EventThreadServices& eventThreadServices, RenderT
   typedef MessageValue1< RenderTaskList, RenderTask* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &list, &RenderTaskList::RemoveTask, &task );
index 135b0e7..f319583 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@
 // CLASS HEADER
 #include <dali/internal/update/render-tasks/scene-graph-render-task.h>
 
+
 // INTERNAL INCLUDES
 #include <dali/public-api/math/matrix.h>
 
@@ -42,14 +43,18 @@ RenderTask* RenderTask::New()
 
 RenderTask::~RenderTask()
 {
-  // Remove exclusive flag from source node
-  if( mExclusive )
+  if ( mSourceNode )
   {
-    if( mSourceNode && (this == mSourceNode->GetExclusiveRenderTask() ) )
+    mSourceNode->RemoveObserver( *this );
+    if( mExclusive )
     {
-      mSourceNode->SetExclusiveRenderTask( NULL );
+      mSourceNode->SetExclusiveRenderTask( nullptr );
     }
   }
+  if ( mCameraNode )
+  {
+    mCameraNode->RemoveObserver( *this );
+  }
   // @todo remove any hard sync object
 }
 
@@ -59,19 +64,27 @@ void RenderTask::Initialize()
 
 void RenderTask::SetSourceNode( Node* node )
 {
-  // Remove exclusive flag from the old node, if necessary
-  if ( mSourceNode &&
-       this == mSourceNode->GetExclusiveRenderTask() )
+  // Stop observing the old node (if we were)
+  if ( mSourceNode )
   {
-    mSourceNode->SetExclusiveRenderTask( NULL );
+    mSourceNode->RemoveObserver( *this );
+    if( this == mSourceNode->GetExclusiveRenderTask() )
+    {
+      mSourceNode->SetExclusiveRenderTask( nullptr );
+    }
   }
 
   mSourceNode = node;
 
-  if ( mSourceNode && mExclusive )
+  if ( mSourceNode )
   {
-    mSourceNode->SetExclusiveRenderTask( this );
+    mSourceNode->AddObserver( *this );
+    if( mExclusive )
+    {
+      mSourceNode->SetExclusiveRenderTask( this );
+    }
   }
+  SetActiveStatus();
 }
 
 Node* RenderTask::GetSourceNode() const
@@ -91,7 +104,7 @@ void RenderTask::SetExclusive( bool exclusive )
     }
     else if ( this == mSourceNode->GetExclusiveRenderTask() )
     {
-      mSourceNode->SetExclusiveRenderTask( NULL );
+      mSourceNode->SetExclusiveRenderTask( nullptr );
     }
   }
 }
@@ -103,8 +116,19 @@ bool RenderTask::IsExclusive() const
 
 void RenderTask::SetCamera( Node* cameraNode, Camera* camera )
 {
+  if ( mCameraNode )
+  {
+    mCameraNode->RemoveObserver( *this );
+  }
+
   mCameraNode = cameraNode;
   mCamera = camera;
+
+  if ( mCameraNode )
+  {
+    mCameraNode->AddObserver( *this );
+  }
+  SetActiveStatus();
 }
 
 void RenderTask::SetFrameBuffer( SceneGraph::FrameBuffer* frameBuffer )
@@ -124,10 +148,10 @@ bool RenderTask::QueryViewport( BufferIndex bufferIndex, Viewport& viewport ) co
     return false;
   }
 
-  viewport.x = mViewportPosition[bufferIndex].x;
-  viewport.y = mViewportPosition[bufferIndex].y;
-  viewport.width = mViewportSize[bufferIndex].width;
-  viewport.height = mViewportSize[bufferIndex].height;
+  viewport.x = static_cast<int>( mViewportPosition[bufferIndex].x ); // truncated
+  viewport.y = static_cast<int>( mViewportPosition[bufferIndex].y ); // truncated
+  viewport.width = static_cast<int>( mViewportSize[bufferIndex].width ); // truncated
+  viewport.height = static_cast<int>( mViewportSize[bufferIndex].height ); // truncated
 
   return true;
 }
@@ -167,7 +191,7 @@ bool RenderTask::GetCullMode() const
   return mCullMode;
 }
 
-void RenderTask::SetRefreshRate( unsigned int refreshRate )
+void RenderTask::SetRefreshRate( uint32_t refreshRate )
 {
   DALI_LOG_TRACE_METHOD_FMT(gRenderTaskLogFilter, "this:%p RefreshRate:%d\n", this, refreshRate);
 
@@ -187,37 +211,14 @@ void RenderTask::SetRefreshRate( unsigned int refreshRate )
   mFrameCounter = 0u;
 }
 
-unsigned int RenderTask::GetRefreshRate() const
+uint32_t RenderTask::GetRefreshRate() const
 {
   return mRefreshRate;
 }
 
 bool RenderTask::ReadyToRender( BufferIndex updateBufferIndex )
 {
-  // If the source node of the render task is invisible we should still render
-  // We want the render task to complete and possible clear colors to happen
-
-  // Check the source node.
-  if( NULL == mSourceNode ||
-      ( !mSourceNode->IsRoot() && NULL == mSourceNode->GetParent() ) )
-  {
-    TASK_LOG_FMT( Debug::General, " Source actor not on stage.  Frame counter: %d\n", mFrameCounter );
-
-    // The source node is missing or disconnected.
-    return false;
-  }
-
-  // Check camera node
-  if( NULL == mCameraNode ||
-      NULL == mCameraNode->GetParent() ||
-      NULL == mCamera )
-  {
-    // The camera node is missing or disconnected.
-    TASK_LOG_FMT(Debug::General, " =F  No Camera  FC:%d\n", mFrameCounter );
-    return false;
-  }
-
-  return true;
+  return mActive;
 }
 
 bool RenderTask::IsRenderRequired()
@@ -297,6 +298,7 @@ void RenderTask::UpdateState()
       }
       else
       {
+        mWaitingToRender = false;
         mNotifyTrigger = true;
       }
     }
@@ -331,51 +333,52 @@ bool RenderTask::HasRendered()
   return notify;
 }
 
-unsigned int RenderTask::GetRenderedOnceCounter() const
+uint32_t RenderTask::GetRenderedOnceCounter() const
 {
   return mRenderedOnceCounter;
 }
 
-
 const Matrix& RenderTask::GetViewMatrix( BufferIndex bufferIndex ) const
 {
-  DALI_ASSERT_DEBUG( NULL != mCamera );
+  DALI_ASSERT_DEBUG( nullptr != mCamera );
 
   return mCamera->GetViewMatrix( bufferIndex );
 }
 
 SceneGraph::Camera& RenderTask::GetCamera() const
 {
-  DALI_ASSERT_DEBUG( NULL != mCamera );
+  DALI_ASSERT_DEBUG( nullptr != mCamera );
   return *mCamera;
 }
 
 const Matrix& RenderTask::GetProjectionMatrix( BufferIndex bufferIndex ) const
 {
-  DALI_ASSERT_DEBUG( NULL != mCamera );
+  DALI_ASSERT_DEBUG( nullptr != mCamera );
 
   return mCamera->GetProjectionMatrix( bufferIndex );
 }
 
-void RenderTask::PrepareRenderInstruction( RenderInstruction& instruction, BufferIndex updateBufferIndex )
+RenderInstruction& RenderTask::PrepareRenderInstruction( BufferIndex updateBufferIndex )
 {
-  DALI_ASSERT_DEBUG( NULL != mCamera );
+  DALI_ASSERT_DEBUG( nullptr != mCamera );
 
   TASK_LOG(Debug::General);
 
   Viewport viewport;
   bool viewportSet = QueryViewport( updateBufferIndex, viewport );
 
-  instruction.Reset( mCamera,
-                     GetFrameBuffer(),
-                     viewportSet ? &viewport : NULL,
-                     mClearEnabled ? &GetClearColor( updateBufferIndex ) : NULL );
+  mRenderInstruction[updateBufferIndex].Reset( mCamera,
+                                               GetFrameBuffer(),
+                     viewportSet ? &viewport : nullptr,
+                     mClearEnabled ? &GetClearColor( updateBufferIndex ) : nullptr );
 
   if( mRequiresSync &&
       mRefreshRate == Dali::RenderTask::REFRESH_ONCE )
   {
     // Perform a hard synchronization after render instruction has executed.
   }
+
+  return mRenderInstruction[updateBufferIndex];
 }
 
 bool RenderTask::ViewMatrixUpdated()
@@ -436,29 +439,61 @@ void RenderTask::SetSyncRequired( bool requiresSync )
   mRequiresSync = requiresSync;
 }
 
+void RenderTask::PropertyOwnerConnected( PropertyOwner& owner )
+{
+  // check if we've gone from inactive to active
+  SetActiveStatus();
+}
+
+void RenderTask::PropertyOwnerDisconnected( BufferIndex /*updateBufferIndex*/, PropertyOwner& owner )
+{
+  mActive = false; // if either source or camera disconnected, we're no longer active
+}
+
+void RenderTask::PropertyOwnerDestroyed( PropertyOwner& owner )
+{
+  if( static_cast<PropertyOwner*>( mSourceNode ) == &owner )
+  {
+    mSourceNode = nullptr;
+  }
+  else if( static_cast<PropertyOwner*>( mCameraNode ) == &owner )
+  {
+    mCameraNode = nullptr;
+  }
+}
 
 RenderTask::RenderTask()
 : mViewportPosition( Vector2::ZERO),
   mViewportSize( Vector2::ZERO),
   mClearColor( Dali::RenderTask::DEFAULT_CLEAR_COLOR ),
   //mRenderSyncTracker( NULL ),
-  mSourceNode( NULL ),
-  mCameraNode( NULL ),
-  mCamera( NULL ),
+  mSourceNode( nullptr ),
+  mCameraNode( nullptr ),
+  mCamera( nullptr ),
   mFrameBuffer(0),
+  mRefreshRate( Dali::RenderTask::DEFAULT_REFRESH_RATE ),
+  mFrameCounter( 0u ),
+  mRenderedOnceCounter( 0u ),
+  mState( (Dali::RenderTask::DEFAULT_REFRESH_RATE == Dali::RenderTask::REFRESH_ALWAYS)
+          ? RENDER_CONTINUOUSLY
+          : RENDER_ONCE_WAITING_FOR_RESOURCES ),
+  mRequiresSync( false ),
+  mActive( false ),
   mWaitingToRender( false ),
   mNotifyTrigger( false ),
   mExclusive( Dali::RenderTask::DEFAULT_EXCLUSIVE ),
   mClearEnabled( Dali::RenderTask::DEFAULT_CLEAR_ENABLED ),
-  mCullMode( Dali::RenderTask::DEFAULT_CULL_MODE ),
-  mState( (Dali::RenderTask::DEFAULT_REFRESH_RATE == Dali::RenderTask::REFRESH_ALWAYS)
-          ? RENDER_CONTINUOUSLY
-          : RENDER_ONCE_WAITING_FOR_RESOURCES ),
-  mRefreshRate( Dali::RenderTask::DEFAULT_REFRESH_RATE ),
-  mFrameCounter( 0u ),
-  mRenderedOnceCounter( 0u ),
-  mRequiresSync( false )
+  mCullMode( Dali::RenderTask::DEFAULT_CULL_MODE )
+{
+}
+
+void RenderTask::SetActiveStatus()
 {
+  // must have a source and camera both connected to scene
+  mActive = ( mSourceNode && mSourceNode->ConnectedToScene() &&
+              mCameraNode && mCameraNode->ConnectedToScene() && mCamera );
+  TASK_LOG_FMT( Debug::General, " Source node(%x) active %d.  Frame counter: %d\n", mSourceNode, mSourceNode && mSourceNode->ConnectedToScene(), mFrameCounter );
+  TASK_LOG_FMT( Debug::General, " Camera node(%x) active %d\n", mCameraNode, mCameraNode && mCameraNode->ConnectedToScene() );
 }
 
 } // namespace SceneGraph
index 429c5f9..f953664 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_RENDER_TASK_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
 #include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/common/animatable-property.h>
 #include <dali/internal/update/rendering/scene-graph-frame-buffer.h>
+#include <dali/internal/update/rendering/render-instruction.h>
 
 namespace Dali
 {
@@ -42,11 +43,11 @@ class RenderInstruction;
 /**
  * RenderTasks describe how the Dali scene should be rendered.
  */
-class RenderTask : public PropertyOwner
+class RenderTask : public PropertyOwner, public PropertyOwner::Observer
 {
 public:
 
-  enum State
+  enum State : uint8_t
   {
     RENDER_CONTINUOUSLY,               ///< mRefreshRate > 0
     RENDER_ONCE_WAITING_FOR_RESOURCES, ///< mRefreshRate = REFRESH_ONCE
@@ -224,13 +225,13 @@ public:
    * Set the refresh-rate of the RenderTask.
    * @param[in] refreshRate The new refresh rate.
    */
-  void SetRefreshRate( unsigned int refreshRate );
+  void SetRefreshRate( uint32_t refreshRate );
 
   /**
    * Retrieve the refresh-rate of the RenderTask.
    * @return The refresh rate.
    */
-  unsigned int GetRefreshRate() const;
+  uint32_t GetRefreshRate() const;
 
   /**
    * Check if the render task is ready for rendering.
@@ -269,7 +270,7 @@ public:
   /**
    * @return The number of times we have transited from RENDERED_ONCE to RENDERED_ONCE_AND_NOTIFIED state.
    */
-  unsigned int GetRenderedOnceCounter() const;
+  uint32_t GetRenderedOnceCounter() const;
 
   /**
    * Retrieve the view-matrix; this is double buffered for input handling.
@@ -299,13 +300,13 @@ public:
    * Prepares the render-instruction buffer to be populated with instructions.
    *
    * If the render task is a render-once framebuffer backed by a native image,
-   * then this method will ensure that a GL sync object is created to track
+   * then this method will ensure that a Graphics Sync object is created to track
    * when the rendering has finished.
    *
-   * @param[out] instruction to prepare
    * @param[in] updateBufferIndex The current update buffer index.
+   * @return instruction to prepare
    */
-  void PrepareRenderInstruction( RenderInstruction& instruction, BufferIndex updateBufferIndex );
+  RenderInstruction& PrepareRenderInstruction( BufferIndex updateBufferIndex );
 
   /**
    * @return true if the view matrix has been updated during this or last frame
@@ -313,24 +314,45 @@ public:
   bool ViewMatrixUpdated();
 
   /**
-   * Indicate whether GL sync is required for native render target.
-   * @param[in] requiresSync whether GL sync is required for native render target
+   * Indicate whether a Graphics Sync is required for native render target.
+   * @param[in] requiresSync whether Graphics sync is required for native render target
    */
   void SetSyncRequired( bool requiresSync );
 
+  RenderInstruction& GetRenderInstruction( BufferIndex updateBufferIndex )
+  {
+    return mRenderInstruction[updateBufferIndex];
+  }
+
+private: // from PropertyOwner::Observer
+
+  /**
+   * @copydoc PropertyOwner::Observer::PropertyOwnerConnected( PropertyOwner& owner )
+   */
+  void PropertyOwnerConnected( PropertyOwner& owner );
+
+  /**
+   * @copydoc PropertyOwner::Observer::PropertyOwnerDisconnected( BufferIndex updateBufferIndex, PropertyOwner& owner )
+   */
+  void PropertyOwnerDisconnected( BufferIndex updateBufferIndex, PropertyOwner& owner );
+
+  /**
+   * @copydoc PropertyOwner::Observer::PropertyOwnerDestroyed( PropertyOwner& owner )
+   */
+  void PropertyOwnerDestroyed( PropertyOwner& owner );
+
 private:
 
+  void SetActiveStatus();
+
   /**
-   * Protected constructor.
+   * Constructor.
    */
   RenderTask();
 
   // Undefined
-  RenderTask(const RenderTask&);
-
-  // Undefined
-  RenderTask& operator=(const RenderTask&);
-
+  RenderTask(const RenderTask&) = delete;
+  RenderTask& operator=(const RenderTask&) = delete;
 
 public: // Animatable Properties
   AnimatableProperty< Vector2 >   mViewportPosition;    ///< viewportPosition
@@ -343,39 +365,42 @@ private:
   SceneGraph::Camera* mCamera;
   SceneGraph::FrameBuffer* mFrameBuffer;
 
-  bool mWaitingToRender:1; ///< True when an render once to FBO is waiting
-  bool mNotifyTrigger:1; ///< True if a render once render task has finished renderering
-  bool mExclusive: 1; ///< Whether the render task has exclusive access to the source actor (node in the scene graph implementation).
-  bool mClearEnabled: 1; ///< Whether previous results are cleared.
-  bool mCullMode: 1; ///< Whether renderers should be frustum culled
+  RenderInstruction mRenderInstruction[2]; ///< Owned double buffered render instruction. (Double buffered because this owns render commands for the currently drawn frame)
+
+  uint32_t mRefreshRate;   ///< REFRESH_ONCE, REFRESH_ALWAYS or render every N frames
+  uint32_t mFrameCounter;  ///< counter for rendering every N frames
+  uint32_t mRenderedOnceCounter;///< Incremented whenever state changes to RENDERED_ONCE_AND_NOTIFIED
 
-  State mState;                     ///< Render state.
-  unsigned int mRefreshRate;        ///< REFRESH_ONCE, REFRESH_ALWAYS or render every N frames
-  unsigned int mFrameCounter;       ///< counter for rendering every N frames
+  State mState;           ///< Render state.
 
-  unsigned int mRenderedOnceCounter;  ///< Incremented whenever state changes to RENDERED_ONCE_AND_NOTIFIED
-  bool mRequiresSync;              ///< Whether sync is needed to track the render
+  bool mRequiresSync:1;   ///< Whether sync is needed to track the render
+  bool mActive:1;         ///< True when the task is active, i.e. has valid source and camera
+  bool mWaitingToRender:1;///< True when an render once to FBO is waiting
+  bool mNotifyTrigger:1;  ///< True if a render once render task has finished renderering
+  bool mExclusive:1;      ///< Whether the render task has exclusive access to the source actor (node in the scene graph).
+  bool mClearEnabled:1;   ///< Whether previous results are cleared.
+  bool mCullMode:1;       ///< Whether renderers should be frustum culled
 
 };
 
 // Messages for RenderTask
-inline void SetFrameBufferMessage( EventThreadServices& eventThreadServices, RenderTask& task, SceneGraph::FrameBuffer* frameBuffer )
+inline void SetFrameBufferMessage( EventThreadServices& eventThreadServices, const RenderTask& task, SceneGraph::FrameBuffer* frameBuffer )
 {
   typedef MessageValue1< RenderTask, SceneGraph::FrameBuffer*> LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::SetFrameBuffer, frameBuffer );
 }
 
-inline void SetClearColorMessage( EventThreadServices& eventThreadServices, RenderTask& task, const Vector4& value )
+inline void SetClearColorMessage( EventThreadServices& eventThreadServices, const RenderTask& task, const Vector4& value )
 {
   typedef MessageDoubleBuffered1< RenderTask, Vector4 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::SetClearColor, value );
@@ -386,46 +411,46 @@ inline void BakeClearColorMessage( EventThreadServices& eventThreadServices, con
   typedef MessageDoubleBuffered1< RenderTask, Vector4 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::BakeClearColor, value );
 }
 
-inline void SetClearEnabledMessage( EventThreadServices& eventThreadServices, RenderTask& task, bool enabled )
+inline void SetClearEnabledMessage( EventThreadServices& eventThreadServices, const RenderTask& task, bool enabled )
 {
   typedef MessageValue1< RenderTask, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::SetClearEnabled, enabled );
 }
 
-inline void SetCullModeMessage( EventThreadServices& eventThreadServices, RenderTask& task, bool mode )
+inline void SetCullModeMessage( EventThreadServices& eventThreadServices, const RenderTask& task, bool mode )
 {
   typedef MessageValue1< RenderTask, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::SetCullMode, mode );
 }
 
-inline void SetRefreshRateMessage( EventThreadServices& eventThreadServices, RenderTask& task, unsigned int refreshRate )
+inline void SetRefreshRateMessage( EventThreadServices& eventThreadServices, const RenderTask& task, uint32_t refreshRate )
 {
-  typedef MessageValue1< RenderTask, unsigned int > LocalType;
+  typedef MessageValue1< RenderTask, uint32_t > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::SetRefreshRate, refreshRate );
 }
 
-inline void SetSourceNodeMessage( EventThreadServices& eventThreadServices, RenderTask& task, const Node* constNode )
+inline void SetSourceNodeMessage( EventThreadServices& eventThreadServices, const RenderTask& task, const Node* constNode )
 {
   // Scene graph thread can destroy this object.
   Node* node = const_cast< Node* >( constNode );
@@ -433,42 +458,42 @@ inline void SetSourceNodeMessage( EventThreadServices& eventThreadServices, Rend
   typedef MessageValue1< RenderTask, Node* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::SetSourceNode, node );
 }
 
-inline void SetCameraMessage( EventThreadServices& eventThreadServices, RenderTask& task, const Node* constNode, const Camera* constCamera )
+inline void SetCameraMessage( EventThreadServices& eventThreadServices, const RenderTask& task, const Node* constNode, const Camera* constCamera )
 {
   typedef MessageValue2< RenderTask, Node*, Camera* > LocalType;
 
   Node* node = const_cast< Node* >( constNode );
   Camera* camera = const_cast< Camera* >( constCamera );
   // Reserve memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::SetCamera, node, camera );
 }
 
-inline void SetExclusiveMessage( EventThreadServices& eventThreadServices, RenderTask& task, bool exclusive )
+inline void SetExclusiveMessage( EventThreadServices& eventThreadServices, const RenderTask& task, bool exclusive )
 {
   typedef MessageValue1< RenderTask, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::SetExclusive, exclusive );
 }
 
-inline void SetSyncRequiredMessage(EventThreadServices& eventThreadServices, RenderTask& task, bool requiresSync )
+inline void SetSyncRequiredMessage(EventThreadServices& eventThreadServices, const RenderTask& task, bool requiresSync )
 {
   typedef MessageValue1< RenderTask, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::SetSyncRequired, requiresSync );
@@ -479,7 +504,7 @@ inline void BakeViewportPositionMessage( EventThreadServices& eventThreadService
   typedef MessageDoubleBuffered1< RenderTask, Vector2 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::BakeViewportPosition, value );
@@ -490,7 +515,7 @@ inline void BakeViewportSizeMessage( EventThreadServices& eventThreadServices, c
   typedef MessageDoubleBuffered1< RenderTask, Vector2 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &task, &RenderTask::BakeViewportSize, value );
diff --git a/dali/internal/update/rendering/data-providers/node-data-provider.h b/dali/internal/update/rendering/data-providers/node-data-provider.h
deleted file mode 100644 (file)
index 5eef50d..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef __DALI_INTERNAL_SCENE_GRAPH_NODE_DATA_PROVIDER_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_NODE_DATA_PROVIDER_H__
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/internal/update/rendering/data-providers/uniform-map-data-provider.h>
-
-namespace Dali
-{
-struct Vector4;
-class Matrix;
-
-namespace Internal
-{
-namespace SceneGraph
-{
-
-/**
- * An interface to provide data for a Renderer
- */
-class NodeDataProvider : UniformMapDataProvider
-{
-public:
-
-  /**
-   * Constructor. Nothing to do as a pure interface.
-   */
-  NodeDataProvider() { }
-
-  /**
-   * @param bufferId to use
-   * @return a reference to the model matrix
-   */
-  virtual const Matrix& GetModelMatrix( unsigned int bufferId ) const = 0;
-
-  /**
-   * @param bufferId to use
-   * @return a reference to the color
-   */
-  virtual const Vector4& GetRenderColor( unsigned int bufferId ) const = 0;
-
-  /**
-   * @copydoc Dali::Internal::SceneGraph::UniformMapDataProvider::GetUniformMapChanged()
-   */
-  virtual bool GetUniformMapChanged( BufferIndex bufferIndex ) const = 0;
-
-  /**
-   * @copydoc Dali::Internal::SceneGraph::UniformMapDataProvider::GetUniformMap()
-   */
-  virtual const CollectedUniformMap& GetUniformMap( BufferIndex bufferIndex ) const = 0;
-
-protected:
-  /**
-   * Virtual destructor, this is an interface, no deletion through this interface
-   */
-  virtual ~NodeDataProvider() { }
-};
-
-} // SceneGraph
-} // Internal
-} // Dali
-
-#endif // __DALI_INTERNAL_SCENE_GRAPH_NODE_DATA_PROVIDER_H__
diff --git a/dali/internal/update/rendering/data-providers/property-buffer-data-provider.h b/dali/internal/update/rendering/data-providers/property-buffer-data-provider.h
deleted file mode 100644 (file)
index 57dfe42..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-#ifndef DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
-#define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/object/property.h>
-#include <dali/internal/common/buffer-index.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace SceneGraph
-{
-
-class PropertyBufferDataProvider
-{
-public:
-
-  /**
-   * Type for the data contained in the buffer
-   */
-  typedef Dali::Vector< char > BufferType;
-
-public:
-  /**
-   * Constructor
-   */
-  PropertyBufferDataProvider()
-  {
-  }
-
-  /**
-   * Get the number of attributes
-   * @param[in] bufferIndex Index to access double buffered values
-   * @return the number of attributes
-   */
-  virtual unsigned int GetAttributeCount( BufferIndex bufferIndex ) const = 0;
-
-  /**
-   * Get the name of an attribute
-   * @param[in] bufferIndex Index to access double buffered values
-   * @param[in] index Index of the attribute
-   * @return the name of the attribute
-   */
-  virtual const std::string& GetAttributeName( BufferIndex bufferIndex, unsigned int index ) const = 0;
-
-  /**
-   * Get the byte size of an attribute
-   * @param[in] bufferIndex Index to access double buffered values
-   * @param[in] index Index of the attribute
-   * @return the byte size of the attribute
-   */
-  virtual size_t GetAttributeSize( BufferIndex bufferIndex, unsigned int index ) const = 0;
-
-  /**
-   * Get the type of an attribute
-   * @param[in] bufferIndex Index to access double buffered values
-   * @param[in] index Index of the attribute
-   * @return the type of the attribute
-   */
-  virtual Property::Type GetAttributeType( BufferIndex bufferIndex, unsigned int index ) const = 0;
-
-  /**
-   * Get the byte offset of an attribute
-   * @param[in] bufferIndex Index to access double buffered values
-   * @param[in] index Index of the attribute
-   * @return the byte offset of the attribute
-   */
-  virtual size_t GetAttributeOffset( BufferIndex bufferIndex, unsigned int index ) const = 0;
-
-  /**
-   * Get the property buffer data
-   * @param[in] bufferIndex Index to access double buffered values
-   * @return the property buffer's data array
-   */
-  virtual const BufferType& GetData( BufferIndex bufferIndex ) const = 0;
-
-  /**
-   * Get the size of the property buffer in bytes
-   * @param[in] bufferIndex Index to access double buffered values
-   * @return the size in bytes
-   */
-  virtual size_t GetDataSize( BufferIndex bufferIndex ) const = 0;
-
-  /**
-   * Get the size of an element of the buffer in bytes
-   * @param[in] bufferIndex Index to access double buffered values
-   * @return the element size in bytes
-   */
-  virtual size_t GetElementSize( BufferIndex bufferIndex ) const = 0;
-
-  /**
-   * Get the number of elements
-   * @param[in] bufferIndex Index to access double buffered values
-   * @return the number of elements
-   */
-  virtual unsigned int GetElementCount( BufferIndex bufferIndex ) const = 0;
-
-  /**
-   * Get Id of the GPU buffer associated with this propertyBuffer
-   * @param[in] bufferIndex Index to access double buffered values
-   * @return the Id
-   */
-  virtual unsigned int GetGpuBufferId( BufferIndex bufferIndex ) const = 0;
-
-  /**
-   * Checks if data in the PropertyBuffer has changed repect previous frame
-   * @param[in] bufferIndex Index to access double buffered values
-   * @return true if data has changed, false otherwise
-   */
-  virtual bool HasDataChanged( BufferIndex bufferIndex ) const = 0;
-
-protected:
-  /**
-   * No deletion through this interface
-   */
-  virtual ~PropertyBufferDataProvider()
-  {
-  }
-};
-
-} // namespace SceneGraph
-} // namespace Internal
-} // namespace Dali
-
-#endif // DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
diff --git a/dali/internal/update/rendering/data-providers/render-data-provider.cpp b/dali/internal/update/rendering/data-providers/render-data-provider.cpp
deleted file mode 100644 (file)
index 06480f0..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/internal/update/rendering/data-providers/render-data-provider.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace SceneGraph
-{
-
-RenderDataProvider::RenderDataProvider( AnimatableProperty< float >& opacity )
-: mUniformMapDataProvider( NULL ),
-  mShader( NULL ),
-  mOpacity( opacity )
-{
-}
-
-RenderDataProvider::~RenderDataProvider()
-{
-}
-
-void RenderDataProvider::SetUniformMap(const UniformMapDataProvider& uniformMapDataProvider)
-{
-  mUniformMapDataProvider = &uniformMapDataProvider;
-}
-
-const UniformMapDataProvider& RenderDataProvider::GetUniformMap() const
-{
-  return *mUniformMapDataProvider;
-}
-
-void RenderDataProvider::SetShader( Shader& shader )
-{
-  mShader = &shader;
-}
-
-Shader& RenderDataProvider::GetShader() const
-{
-  return *mShader;
-}
-
-RenderDataProvider::Samplers& RenderDataProvider::GetSamplers()
-{
-  return mSamplers;
-}
-
-std::vector<SceneGraph::Texture*>& RenderDataProvider::GetTextures()
-{
-  return mTextures;
-}
-
-float RenderDataProvider::GetOpacity( BufferIndex bufferIndex )
-{
-  return mOpacity[bufferIndex];
-}
-
-} // SceneGraph
-} // Internal
-} // Dali
diff --git a/dali/internal/update/rendering/data-providers/render-data-provider.h b/dali/internal/update/rendering/data-providers/render-data-provider.h
deleted file mode 100644 (file)
index 7dbbde2..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#ifndef __DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_H__
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/rendering/renderer.h>
-#include <dali/internal/update/rendering/data-providers/node-data-provider.h>
-#include <dali/internal/update/rendering/data-providers/property-buffer-data-provider.h>
-#include <dali/internal/update/rendering/data-providers/uniform-map-data-provider.h>
-#include <dali/internal/update/rendering/scene-graph-sampler.h>
-#include <dali/internal/update/rendering/scene-graph-texture.h>
-#include <dali/internal/update/common/animatable-property.h>
-
-namespace Dali
-{
-namespace Internal
-{
-
-struct BlendingOptions;
-
-
-namespace SceneGraph
-{
-class PropertyBuffer;
-class Shader;
-
-/**
- * Wraps all the data providers for the renderer. This allows the
- * individual providers to change connections in the update thread without affecting
- * the current render. It essentially provides double buffering of the
- * provider accessor through the message system. It does not take ownership
- * of any objects.
- */
-class RenderDataProvider
-{
-public:
-  typedef Dali::Vector< const PropertyBufferDataProvider* > VertexBuffers;
-  typedef std::vector< SceneGraph::Sampler* > Samplers;
-
-  /**
-   * Constructor.
-   * The RendererAttachment that creates this object will initialize the members
-   * directly.
-   */
-  RenderDataProvider( AnimatableProperty< float >& opacity );
-
-  /**
-   * Destructor
-   */
-  ~RenderDataProvider();
-
-public:
-
-  /**
-   * Set the uniform map data provider
-   * @param[in] uniformMapDataProvider The uniform map data provider
-   */
-  void SetUniformMap(const UniformMapDataProvider& uniformMapDataProvider);
-
-  /**
-   * Get the uniform map data provider
-   */
-  const UniformMapDataProvider& GetUniformMap() const;
-
-  /**
-   * Set the shader data provider
-   * @param[in] shader The shader data provider
-   */
-  void SetShader( Shader& shader );
-
-  /**
-   * Returns the shader
-   * @return The shader
-   */
-  Shader& GetShader() const;
-
-  /**
-   * Returns the list of samplers
-   * @return The list of samplers
-   */
-  Samplers& GetSamplers();
-
-  /**
-   * Returns the list of Textures
-   * @return The list of Textures
-   */
-  std::vector<SceneGraph::Texture*>& GetTextures();
-
-  /**
-   * Get the opacity
-   * @return The opacity
-   */
-  float GetOpacity( BufferIndex bufferIndex );
-
-private:
-
-  const UniformMapDataProvider*    mUniformMapDataProvider;
-  Shader*                          mShader;
-  std::vector<SceneGraph::Texture*>   mTextures;
-  Samplers                         mSamplers;
-  AnimatableProperty< float >&     mOpacity;
-
-  // Give Renderer access to our private data to reduce copying vectors on construction.
-  friend class Renderer;
-};
-
-} // SceneGraph
-} // Internal
-} // Dali
-
-#endif // __DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_H__
diff --git a/dali/internal/update/rendering/data-providers/uniform-map-data-provider.h b/dali/internal/update/rendering/data-providers/uniform-map-data-provider.h
deleted file mode 100644 (file)
index 58f0e71..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef DALI_INTERNAL_SCENE_GRAPH_UNIFORM_MAP_DATA_PROVIDER_H
-#define DALI_INTERNAL_SCENE_GRAPH_UNIFORM_MAP_DATA_PROVIDER_H
-
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <dali/public-api/common/dali-vector.h>
-#include <dali/internal/common/buffer-index.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace SceneGraph
-{
-class UniformMap;
-class UniformPropertyMapping;
-
-typedef Dali::Vector< const UniformPropertyMapping* > CollectedUniformMap;
-
-/**
- * This class maps uniform names to property value pointers.
- */
-class UniformMapDataProvider
-{
-public:
-  /**
-   * Constructor
-   */
-  UniformMapDataProvider()
-  {
-  }
-
-  /**
-   * Return true if the uniform map has been changed this frame
-   * Note, this only informs if the uniform mappings have changed,
-   * not if any actual property value has changed.
-   *
-   * @param[in] bufferIndex The buffer index
-   * @return true if the uniform map has changed
-   */
-  virtual bool GetUniformMapChanged( BufferIndex bufferIndex ) const = 0;
-
-  /**
-   * Get the complete map of uniforms to property value addresses
-   * (The map is double buffered - it can be retrieved through this interface)
-   *
-   * @param[in] bufferIndex The bufferIndex
-   * @return the uniform map
-   */
-  virtual const CollectedUniformMap& GetUniformMap( BufferIndex bufferIndex ) const = 0;
-
-protected:
-  /**
-   * No deletion through this interface
-   */
-  virtual ~UniformMapDataProvider()
-  {
-  }
-};
-
-} // namespace SceneGraph
-} // namespace Internal
-} // namespace Dali
-
-#endif // DALI_INTERNAL_SCENE_GRAPH_UNIFORM_MAP_DATA_PROVIDER_H
diff --git a/dali/internal/update/rendering/render-command-container.h b/dali/internal/update/rendering/render-command-container.h
new file mode 100644 (file)
index 0000000..1f7dc4e
--- /dev/null
@@ -0,0 +1,143 @@
+#ifndef DALI_INTERNAL_SCENE_GRAPH_RENDER_COMMAND_CONTAINER_H
+#define DALI_INTERNAL_SCENE_GRAPH_RENDER_COMMAND_CONTAINER_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/internal/update/rendering/render-command.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace SceneGraph
+{
+class RenderInstruction;
+
+struct IndexedRenderCommand
+{
+  IndexedRenderCommand()
+  : renderInstruction(nullptr),
+    mRenderCommand{new RenderCommand()},
+    updateBufferIndex(0)
+  {
+  }
+
+  const RenderInstruction* renderInstruction; // Key
+  std::unique_ptr<RenderCommand> mRenderCommand;
+  BufferIndex updateBufferIndex;
+};
+
+class RenderCommandContainer
+{
+public:
+
+  RenderCommand& AllocRenderCommand( RenderInstruction* renderInstruction,
+                                     Graphics::Controller& controller,
+                                     BufferIndex updateBufferIndex )
+  {
+    RenderCommand* renderCommand;
+    if( !Find( renderInstruction, renderCommand, updateBufferIndex ) )
+    {
+      IndexedRenderCommand indexedRenderCommand;
+      indexedRenderCommand.renderInstruction = renderInstruction;
+      indexedRenderCommand.mRenderCommand = std::make_unique< RenderCommand >();
+      indexedRenderCommand.updateBufferIndex = updateBufferIndex;
+
+      mRenderCommands.emplace_back( std::move( indexedRenderCommand ) );
+      renderCommand = mRenderCommands.back().mRenderCommand.get();
+    }
+    // renderCommand is set to the render command. Ensure the graphics render command is also allocated:
+    renderCommand->AllocateGfxRenderCommand( controller, updateBufferIndex );
+    return *renderCommand;
+  }
+
+  RenderCommand& GetRenderCommand( RenderInstruction* renderInstruction,
+                                   BufferIndex updateBufferIndex )
+  {
+    RenderCommand* renderCommand;
+    if( !Find( renderInstruction, renderCommand, updateBufferIndex ) )
+    {
+      DALI_ASSERT_DEBUG( 0 && "Can't find render command for render instruction" );
+    }
+
+    return *renderCommand;
+  }
+
+  void BindTextures( std::vector<Graphics::RenderCommand::TextureBinding>& textureBindings )
+  {
+    for( auto& elem : mRenderCommands )
+    {
+      elem.mRenderCommand->BindTextures( textureBindings );
+    }
+  }
+
+  void ClearUniformBindings()
+  {
+    for( auto& elem : mRenderCommands )
+    {
+      elem.mRenderCommand->mUboBindings.clear();
+    }
+  }
+
+  void DestroyRenderCommand( RenderInstruction* renderInstruction )
+  {
+    for( auto iter = mRenderCommands.begin(); iter != mRenderCommands.end() ; ++iter )
+    {
+      if( iter->renderInstruction == renderInstruction )
+      {
+        mRenderCommands.erase(iter);
+        break;
+      }
+    }
+  }
+
+  /**
+   * Find a render command for the given render instruction
+   * @param[in] renderInstruction
+   * @return An iterator to the requested render command, or the end() of the vector
+   */
+  bool Find( RenderInstruction* renderInstruction, RenderCommand*& renderCommand, BufferIndex updateBufferIndex )
+  {
+    for( auto& element : mRenderCommands )
+    {
+      if( element.renderInstruction == renderInstruction && element.updateBufferIndex == updateBufferIndex )
+      {
+        renderCommand = element.mRenderCommand.get();
+        return true;
+      }
+    }
+
+    renderCommand = nullptr;
+    return false;
+  }
+
+  void DestroyAll()
+  {
+    mRenderCommands.clear();
+  }
+
+private:
+  std::vector<IndexedRenderCommand> mRenderCommands;
+};
+
+} // namespace SceneGraph
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif //DALI_INTERNAL_SCENE_GRAPH_RENDER_COMMAND_CONTAINER_H
diff --git a/dali/internal/update/rendering/render-command.h b/dali/internal/update/rendering/render-command.h
new file mode 100644 (file)
index 0000000..b20a66b
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef DALI_INTERNAL_SCENEGRAPH_RENDER_COMMAND_H
+#define DALI_INTERNAL_SCENEGRAPH_RENDER_COMMAND_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/internal/common/buffer-index.h>
+#include <dali/graphics-api/graphics-api-render-command.h>
+#include <dali/graphics-api/graphics-api-pipeline.h>
+#include <dali/graphics-api/graphics-api-controller.h>
+#include <memory>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace SceneGraph
+{
+
+struct RenderCommand
+{
+  RenderCommand()
+  : mGfxRenderCommand{ nullptr },
+    mGfxPipeline{ nullptr },
+    mUboBindings{ {}, {} }
+  {
+  }
+
+  Graphics::RenderCommand& AllocateGfxRenderCommand( Graphics::Controller& controller,
+                                                          BufferIndex updateBufferIndex )
+  {
+    if (!mGfxRenderCommand)
+    {
+      mGfxRenderCommand = controller.AllocateRenderCommand();
+    }
+    return *mGfxRenderCommand.get();
+  }
+
+  Graphics::RenderCommand& GetGfxRenderCommand( BufferIndex bufferIndex )
+  {
+    DALI_ASSERT_ALWAYS( mGfxRenderCommand != nullptr );
+    return *mGfxRenderCommand.get();
+  }
+
+  void BindPipeline( std::unique_ptr<Graphics::Pipeline> pipeline, BufferIndex updateBufferIndex )
+  {
+    mGfxPipeline = std::move(pipeline);
+    mGfxRenderCommand->BindPipeline( mGfxPipeline.get() );
+  }
+
+  std::unique_ptr<Graphics::Pipeline> ReleaseGraphicsPipeline( BufferIndex updateBufferIndex )
+  {
+    return std::move( mGfxPipeline );
+  }
+
+  void BindTextures( std::vector<Graphics::RenderCommand::TextureBinding>& textureBindings,
+                     BufferIndex updateBufferIndex )
+  {
+    if( !mGfxRenderCommand->GetTextureBindings() )
+    {
+      mGfxRenderCommand->BindTextures( &textureBindings );
+    }
+  }
+
+  void BindTextures( std::vector<Graphics::RenderCommand::TextureBinding>& textureBindings )
+  {
+    if( mGfxRenderCommand )
+    {
+      mGfxRenderCommand->BindTextures( &textureBindings );
+    }
+  }
+
+  std::unique_ptr<Graphics::RenderCommand> mGfxRenderCommand;
+  std::unique_ptr<Graphics::Pipeline> mGfxPipeline;
+  std::vector<Graphics::RenderCommand::UniformBufferBinding> mUboBindings;
+};
+
+} // namespace SceneGraph
+} // namespace Internal
+} // namespace Dali
+
+#endif //DALI_INTERNAL_SCENEGRAPH_RENDER_COMMAND_H_H
index a8993b8..64dea48 100644 (file)
@@ -18,6 +18,8 @@
 // CLASS HEADER
 #include <dali/internal/update/rendering/render-instruction-container.h>
 
+// EXTERNAL INCLUDES
+
 // INTERNAL INCLUDES
 #include <dali/internal/update/rendering/render-instruction.h>
 
@@ -31,58 +33,57 @@ namespace SceneGraph
 {
 
 RenderInstructionContainer::RenderInstructionContainer()
+: mInstructions{}
 {
-  // array initialisation in ctor initializer list not supported until C++ 11
-  mIndex[ 0 ] = 0u;
-  mIndex[ 1 ] = 0u;
 }
 
 RenderInstructionContainer::~RenderInstructionContainer()
 {
-  // OwnerContainer deletes the instructions
 }
 
-void RenderInstructionContainer::ResetAndReserve( BufferIndex bufferIndex, size_t capacityRequired )
+void RenderInstructionContainer::ResetAndReserve( BufferIndex bufferIndex, uint32_t capacityRequired )
 {
-  mIndex[ bufferIndex ] = 0u;
-  size_t oldcapacity = mInstructions[ bufferIndex ].Capacity();
-  if( oldcapacity < capacityRequired )
+  // Only re-allocate if necessary.
+  uint32_t oldCapacity = static_cast<uint32_t>( mInstructions[ bufferIndex ].size() ); // uint32_t is large enough in practice
+  if( oldCapacity < capacityRequired )
   {
-    mInstructions[ bufferIndex ].Reserve( capacityRequired );
-    // add N new elements
-    for( ; oldcapacity < capacityRequired; ++oldcapacity )
-    {
-      mInstructions[ bufferIndex ].PushBack( new RenderInstruction );
-    }
+    mInstructions[bufferIndex].reserve( capacityRequired );
   }
-  // Note that we may have spare elements in the list, we don't remove them as that would
-  // decrease the capacity of our container and lead to possibly reallocating, which we hate
-  // RenderInstruction holds a lot of data so we keep them and recycle instead of new & delete
+  mInstructions[bufferIndex].clear();
 }
 
-size_t RenderInstructionContainer::Count( BufferIndex bufferIndex )
+uint32_t RenderInstructionContainer::Count( BufferIndex bufferIndex )
 {
-  // mIndex contains the number of instructions that have been really prepared and updated
-  // (from UpdateManager through GetNextInstruction)
-  return mIndex[ bufferIndex ];
+  return static_cast<uint32_t>( mInstructions[bufferIndex].size() );
 }
 
-RenderInstruction& RenderInstructionContainer::GetNextInstruction( BufferIndex bufferIndex )
+RenderInstruction& RenderInstructionContainer::At( BufferIndex bufferIndex, uint32_t index )
 {
-  // At protects against running out of space
-  return At( bufferIndex, mIndex[ bufferIndex ]++ );
+  DALI_ASSERT_DEBUG( index < mInstructions[bufferIndex].size() );
+
+  return *mInstructions[bufferIndex][ index ];
 }
 
-RenderInstruction& RenderInstructionContainer::At( BufferIndex bufferIndex, size_t index )
+void RenderInstructionContainer::PushBack( BufferIndex index, RenderInstruction* renderInstruction )
 {
-  DALI_ASSERT_DEBUG( index < mInstructions[ bufferIndex ].Count() );
+  mInstructions[index].push_back( renderInstruction );
+}
 
-  return *mInstructions[ bufferIndex ][ index ];
+void RenderInstructionContainer::DiscardCurrentInstruction( BufferIndex updateBufferIndex )
+{
+  mInstructions[updateBufferIndex].pop_back();
 }
 
-void RenderInstructionContainer::DiscardCurrentInstruction( BufferIndex bufferIndex )
+void RenderInstructionContainer::Shutdown()
 {
-  mIndex[ bufferIndex ]--;
+  for( auto instructionPtr : mInstructions[0] )
+  {
+    instructionPtr->Shutdown();
+  }
+  for( auto instructionPtr : mInstructions[1] )
+  {
+    instructionPtr->Shutdown();
+  }
 }
 
 } // namespace SceneGraph
index f6859de..7bfc2c0 100644 (file)
@@ -21,6 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/internal/common/buffer-index.h>
+#include <dali/public-api/common/vector-wrapper.h>
 
 namespace Dali
 {
@@ -33,7 +34,8 @@ namespace SceneGraph
 class RenderInstruction;
 
 /**
- * Class to encapsulate double buffered render instruction data
+ * Class to hold ordered list of current frame's render instructions. Does
+ * not own the instructions.
  */
 class RenderInstructionContainer
 {
@@ -54,40 +56,41 @@ public:
    * @param bufferIndex to reset
    * @param capacityRequired in the container
    */
-  void ResetAndReserve( BufferIndex bufferIndex, size_t capacityRequired );
+  void ResetAndReserve( BufferIndex bufferIndex, uint32_t capacityRequired );
 
   /**
    * Return the count of instructions in the container
    * @param bufferIndex to use
    * @return the count of elements
    */
-  size_t Count( BufferIndex bufferIndex );
+  uint32_t Count( BufferIndex bufferIndex );
 
   /**
-   * Get a reference to the next instruction
+   * Get a reference to the instruction at index
    * @param bufferIndex to use
+   * @param index to use
    */
-  RenderInstruction& GetNextInstruction( BufferIndex bufferIndex );
+  RenderInstruction& At( BufferIndex bufferIndex, uint32_t index );
 
   /**
-   * Get a reference to the instruction at index
+   * Add an instruction to the end of the container
    * @param bufferIndex to use
-   * @param index to use
    */
-  RenderInstruction& At( BufferIndex bufferIndex, size_t index );
+  void PushBack( BufferIndex index, RenderInstruction* renderInstruction );
 
   /**
-   * Discard the current container index
-   * @param bufferIndex to reset
+   * Discard an instruction from the end of the container
+   * @param bufferIndex to use
    */
-  void DiscardCurrentInstruction( BufferIndex bufferIndex );
+  void DiscardCurrentInstruction( BufferIndex updateBufferIndex );
 
-private:
-
-  unsigned int mIndex[ 2 ]; ///< count of the elements that have been added
-  typedef OwnerContainer< RenderInstruction* > InstructionContainer;
-  InstructionContainer mInstructions[ 2 ]; /// Double buffered instruction lists
+  /**
+   * System is shutting down. Don't need to force destroy unowned resources
+   */
+  void Shutdown();
 
+private:
+  std::vector<RenderInstruction*> mInstructions[2u];
 };
 
 } // namespace SceneGraph
index c4ecaaa..8fd024b 100644 (file)
 // INTERNAL INCLUDES
 #include <dali/public-api/common/constants.h> // for Color::BLACK
 #include <dali/internal/update/rendering/render-tracker.h>
+#include <dali/internal/update/rendering/scene-graph-renderer.h>
 #include <dali/integration-api/debug.h>
 
+namespace
+{
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_RENDER_INSTRUCTIONS" );
+#endif
+}
+
 namespace Dali
 {
 
@@ -37,6 +45,7 @@ RenderInstruction::RenderInstruction()
   mIsViewportSet( false ),
   mIsClearColorSet( false ),
   mIgnoreRenderToFbo( false ),
+  mShuttingDown( false ),
   mFrameBuffer( 0 ),
   mCamera( 0 ),
   mNextFreeRenderList( 0 )
@@ -46,7 +55,11 @@ RenderInstruction::RenderInstruction()
 }
 
 RenderInstruction::~RenderInstruction()
-{ // pointer container releases the renderlists
+{
+  // Ensure renderers remove this from the list of owned render commands
+  FreeRenderCommands();
+
+  // pointer container releases the renderlists
 }
 
 RenderList& RenderInstruction::GetNextFreeRenderList( size_t capacityRequired )
@@ -128,6 +141,39 @@ void RenderInstruction::Reset( Camera*                  camera,
   }
 }
 
+// @todo This needs cleaning up / removing. Find a better way of managing render command ownership
+void RenderInstruction::FreeRenderCommands()
+{
+  if( !mShuttingDown )
+  {
+    DALI_LOG_INFO(gLogFilter, Debug::General, "RenderInstruction(%p)::FreeRenderCommands()\n", this);
+
+    // Ensure renderers remove this from the list of owned render commands
+    for( auto renderList : mRenderLists )
+    {
+      const auto renderItemCount = renderList->Count();
+      for( auto renderItemIndex=0u; renderItemIndex < renderItemCount; ++renderItemIndex )
+      {
+        auto& renderItem = renderList->GetItem( renderItemIndex );
+
+        // On shutdown, renderer may have already been destroyed, and this becomes a
+        // dangling pointer, in which case, can't use it.
+        if( renderItem.mRenderer )
+        {
+          renderItem.mRenderer->FreeRenderCommand( this );
+        }
+      }
+    }
+  }
+}
+
+void RenderInstruction::Shutdown()
+{
+  DALI_LOG_INFO(gLogFilter, Debug::General, "Shutting down render instruction %p\n", this);
+
+  mShuttingDown = true;
+}
+
 } // namespace SceneGraph
 
 } // namespace Internal
index 4ca1385..96a6903 100644 (file)
@@ -117,6 +117,17 @@ public:
     return &mCamera->GetProjectionMatrix( index );
   }
 
+  /**
+   * Frees render commands associated with this render instruction. Only call if the system
+   * is not being shutdown (e.g. if the render task is disabled/removed by app)
+   */
+  void FreeRenderCommands();
+
+  /**
+   * Signls that the system is being shutdown
+   */
+  void Shutdown();
+
 private:
 
   // Undefined
@@ -131,6 +142,7 @@ public: // Data
   bool     mIsViewportSet:1;            ///< Flag to determine whether the viewport is set
   bool     mIsClearColorSet:1;          ///< Flag to determine whether the clearColor is set
   bool     mIgnoreRenderToFbo:1;        ///< Whether to ignore the render to FBO option (used to measure the performance above 60 fps)
+  bool     mShuttingDown:1;             ///< True if the system is being shutdown
 
   SceneGraph::FrameBuffer* mFrameBuffer;
 
index ec68f09..e90a4bd 100644 (file)
@@ -45,8 +45,8 @@ RenderItem::RenderItem()
 : mModelMatrix( false ),
   mModelViewMatrix( false ),
   mSize(),
-  //mRenderer( NULL ),
   mNode( NULL ),
+  mRenderer( NULL ),
   mTextureSet( NULL ),
   mDepthIndex( 0 ),
   mIsOpaque( true )
@@ -102,12 +102,15 @@ ClippingBox RenderItem::CalculateViewportSpaceAABB( const int viewportWidth, con
 
   // Return the AABB in screen-space pixels (x, y, width, height).
   // Note: This is a algebraic simplification of: ( viewport.x - aabb.width ) / 2 - ( ( aabb.width / 2 ) + aabb.x ) per axis.
-  Vector4 aabbInScreen( ( viewportWidth / 2 ) - aabb.z, ( viewportHeight / 2 ) - aabb.w, ( viewportWidth / 2 ) - aabb.x, ( viewportHeight / 2 ) - aabb.y );
-
-  int x = static_cast< int >( round( aabbInScreen.x ) );
-  int y = static_cast< int >( round( aabbInScreen.y ) );
-  int z = static_cast< int >( round( aabbInScreen.z ) );
-  int w = static_cast< int >( round( aabbInScreen.w ) );
+  Vector4 aabbInScreen( static_cast<float>( viewportWidth )  * 0.5f - aabb.z,
+                        static_cast<float>( viewportHeight ) * 0.5f - aabb.w,
+                        static_cast<float>( viewportWidth )  * 0.5f - aabb.x,
+                        static_cast<float>( viewportHeight ) * 0.5f - aabb.y );
+
+  int x = static_cast< int >( roundf( aabbInScreen.x ) );
+  int y = static_cast< int >( roundf( aabbInScreen.y ) );
+  int z = static_cast< int >( roundf( aabbInScreen.z ) );
+  int w = static_cast< int >( roundf( aabbInScreen.w ) );
 
   return ClippingBox( x, y, z - x, w - y );
 }
index 1c1fbd3..29d37dd 100644 (file)
@@ -75,6 +75,7 @@ struct RenderItem
   Matrix            mModelViewMatrix;
   Vector3           mSize;
   Node*             mNode;
+  Renderer*         mRenderer;
   const void*       mTextureSet;        //< Used for sorting only
   int               mDepthIndex;
   bool              mIsOpaque:1;
index d26e54e..35bdc3e 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/math/rect.h>
 #include <dali/devel-api/common/owner-container.h>
@@ -117,7 +120,7 @@ public:
   /**
    * Get item at a given position in the list
    */
-  RenderItem& GetItem( RenderItemContainer::SizeType index ) const
+  RenderItem& GetItem( uint32_t index ) const
   {
     DALI_ASSERT_DEBUG( index < GetCachedItemCount() );
     return *mItems[ index ];
@@ -128,7 +131,7 @@ public:
    * Because of caching, the actual size may be bit more
    * @return The number of items
    */
-  RenderItemContainer::SizeType Count() const
+  uint32_t Count() const
   {
     return mNextFree;
   }
@@ -136,9 +139,9 @@ public:
   /**
    * @return the number of items cached by the list
    */
-  RenderItemContainer::SizeType GetCachedItemCount() const
+  uint32_t GetCachedItemCount() const
   {
-    return mItems.Count();
+    return static_cast<uint32_t>( mItems.Count() );
   }
 
   /**
@@ -146,7 +149,7 @@ public:
    */
   void ReuseCachedItems()
   {
-    mNextFree = mItems.Count();
+    mNextFree = static_cast<uint32_t>( mItems.Count() );
   }
 
   /**
@@ -250,7 +253,7 @@ private:
   const RenderList& operator=( const RenderList& rhs );
 
   RenderItemContainer mItems; ///< Each item is a renderer and matrix pair
-  RenderItemContainer::SizeType mNextFree;              ///< index for the next free item to use
+  uint32_t mNextFree;         ///< index for the next free item to use
 
   ClippingBox* mClippingBox;               ///< The clipping box, in window coordinates, when clipping is enabled
   Layer*       mSourceLayer;              ///< The originating layer where the renderers are from
index 7560457..91b3556 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,9 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/update/rendering/scene-graph-texture.h>
+#include <dali/graphics-api/graphics-api-texture-details.h>
+#include <dali/graphics-api/graphics-api-framebuffer.h>
+#include <dali/graphics-api/graphics-api-framebuffer-factory.h>
 
 namespace Dali
 {
@@ -28,23 +31,37 @@ namespace SceneGraph
 {
 
 FrameBuffer::FrameBuffer( unsigned int width, unsigned int height, unsigned int attachments )
-: mGraphics( nullptr ),
+: mGraphicsController( nullptr ),
+  mGraphicsFramebuffer( nullptr ),
   mWidth( width ),
   mHeight( height )
 {
 }
 
-FrameBuffer::~FrameBuffer()
+FrameBuffer::~FrameBuffer() = default;
+
+void FrameBuffer::Initialize( Graphics::Controller& graphicsController )
 {
+  mGraphicsController = &graphicsController;
+  // Defer creation of framebuffer until a render instruction uses it
 }
 
-void FrameBuffer::Initialize( Integration::Graphics::Graphics& graphics )
+void FrameBuffer::AttachColorTexture( SceneGraph::Texture* texture, unsigned int mipmapLevel, unsigned int layer )
 {
-  mGraphics = &graphics;
+  mColorAttachment.texture = texture;
+  mColorAttachment.mipmapLevel = mipmapLevel;
+  mColorAttachment.layer = layer;
 }
 
-void FrameBuffer::AttachColorTexture( SceneGraph::Texture* texture, unsigned int mipmapLevel, unsigned int layer )
+void FrameBuffer::AttachDepthStencilTexture( SceneGraph::Texture* texture,
+                                             Dali::FrameBuffer::Attachment::Mask format,
+                                             unsigned int mipmapLevel,
+                                             unsigned int layer )
 {
+  mDepthAttachment.texture = texture;
+  mDepthAttachment.format = format;
+  mDepthAttachment.mipmapLevel = mipmapLevel;
+  mDepthAttachment.layer = layer;
 }
 
 unsigned int FrameBuffer::GetWidth() const
@@ -57,6 +74,84 @@ unsigned int FrameBuffer::GetHeight() const
   return mHeight;
 }
 
+void FrameBuffer::PrepareFramebuffer()
+{
+  // @todo Check if the color attachments or depth attachments have changed since the graphics object was created
+  if( !mGraphicsFramebuffer )
+  {
+    auto& factory = mGraphicsController->GetFramebufferFactory();
+    factory.SetSize( Graphics::Extent2D{ mWidth, mHeight } );
+
+    /**
+     * If the framebuffer has a color attachment without a graphics object, create one
+     */
+    if( mColorAttachment.texture != nullptr )
+    {
+      auto graphicsTexture = mColorAttachment.texture->GetGfxObject();
+      //@todo check if the texture has the right creation flags - if it's already been uploaded, it
+      // needs the layout & usage changing appropriately.
+      if( !graphicsTexture )
+      {
+        mColorAttachment.texture->CreateTexture( Texture::Usage::COLOR_ATTACHMENT );
+        graphicsTexture = mColorAttachment.texture->GetGfxObject();
+      }
+
+      factory.SetColorAttachment( 0, // index of attachment (could have multiple attachments)
+                                  *graphicsTexture, mColorAttachment.mipmapLevel, mColorAttachment.layer );
+    }
+
+    if( mDepthAttachment.texture != nullptr )
+    {
+      auto graphicsTexture = mDepthAttachment.texture->GetGfxObject();
+      if( graphicsTexture )
+      {
+        auto depthStencilFormat = Graphics::TextureDetails::DepthStencilFlag::NONE;
+        switch( mDepthAttachment.format )
+        {
+          case Dali::FrameBuffer::Attachment::NONE:
+          case Dali::FrameBuffer::Attachment::COLOR:
+          {
+            depthStencilFormat = Graphics::TextureDetails::DepthStencilFlag::NONE;
+            break;
+          }
+          case Dali::FrameBuffer::Attachment::COLOR_DEPTH:
+          case Dali::FrameBuffer::Attachment::DEPTH:
+          {
+            depthStencilFormat = Graphics::TextureDetails::DepthStencilFlag::DEPTH;
+            break;
+          }
+          case Dali::FrameBuffer::Attachment::COLOR_STENCIL:
+          case Dali::FrameBuffer::Attachment::STENCIL:
+          {
+            depthStencilFormat = Graphics::TextureDetails::DepthStencilFlag::STENCIL;
+            break;
+          }
+          case Dali::FrameBuffer::Attachment::COLOR_DEPTH_STENCIL:
+          case Dali::FrameBuffer::Attachment::DEPTH_STENCIL:
+          {
+            depthStencilFormat = Graphics::TextureDetails::DepthStencilFlag::DEPTH_STENCIL;
+            break;
+          }
+        }
+
+        factory.SetDepthStencilAttachment( *graphicsTexture, mDepthAttachment.mipmapLevel, mDepthAttachment.layer,
+                                           depthStencilFormat );
+      }
+    }
+
+    mGraphicsFramebuffer = mGraphicsController->CreateFramebuffer( factory );
+  }
+}
+
+const Graphics::Framebuffer* FrameBuffer::GetGfxObject() const
+{
+  return mGraphicsFramebuffer.get();
+}
+
+void FrameBuffer::DestroyGraphicsObjects()
+{
+  mGraphicsFramebuffer.reset();
+}
 
 } //Render
 
index a16b217..04c2ee4 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_FRAME_BUFFER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/rendering/frame-buffer.h>
 #include <dali/internal/update/rendering/scene-graph-texture.h>
+#include <dali/graphics-api/graphics-api-controller.h>
+#include <dali/graphics-api/graphics-api-framebuffer.h>
 
 namespace Dali
 {
@@ -51,11 +53,10 @@ public:
    *
    * @param[in] graphics The Graphics API
    */
-  void Initialize( Integration::Graphics::Graphics& graphics );
+  void Initialize( Graphics::Controller& graphics );
 
   /**
    * @brief Attach a texture for color rendering. Valid only for Framebuffers with COLOR attachments.
-   * param[in] context The GL context
    * @param[in] texture The texture that will be used as output when rendering
    * @param[in] mipmapLevel The mipmap of the texture to be attached
    * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
@@ -63,6 +64,18 @@ public:
   void AttachColorTexture( SceneGraph::Texture* texture, unsigned int mipmapLevel, unsigned int layer );
 
   /**
+   * @brief Attach a texture for depth/stencil rendering.
+   * @param[in] texture The texture that will be used as output when rendering
+   * @param[in] format Whether the buffer is for depth and/or stencil channels
+   * @param[in] mipmapLevel The mipmap of the texture to be attached
+   * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
+   */
+  void AttachDepthStencilTexture( SceneGraph::Texture* texture,
+                                  Dali::FrameBuffer::Attachment::Mask format,
+                                  unsigned int mipmapLevel,
+                                  unsigned int layer );
+
+  /**
    * @brief Get the width of the FrameBuffer
    * @return The width of the framebuffer
    */
@@ -74,8 +87,43 @@ public:
    */
   unsigned int GetHeight() const;
 
+  /**
+   * Prepare the Graphics API framebuffer object when it's required
+   */
+  void PrepareFramebuffer();
+
+  /**
+   * Get the graphics object associated with this framebuffer
+   */
+  const Graphics::Framebuffer* GetGfxObject() const;
+
+  /**
+   * Destroy any graphics objects owned by this scene graph object
+   */
+  void DestroyGraphicsObjects();
+
 private:
-  Integration::Graphics::Graphics* mGraphics; ///< Graphics interface object
+  Graphics::Controller* mGraphicsController;
+  std::unique_ptr<Graphics::Framebuffer> mGraphicsFramebuffer;
+
+  struct Attachment
+  {
+    Attachment()
+    : texture( nullptr ),
+      format( Dali::FrameBuffer::Attachment::NONE ),
+      mipmapLevel( 0u ),
+      layer( 0u )
+    {
+    }
+
+    SceneGraph::Texture* texture;
+    Dali::FrameBuffer::Attachment::Mask format;
+    unsigned int mipmapLevel;
+    unsigned int layer;
+  };
+
+  Attachment mColorAttachment;
+  Attachment mDepthAttachment; // Should also specify depth/stencil choice in DALi API.
 
   unsigned int mWidth;
   unsigned int mHeight;
index 1a9baee..d5d32ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ namespace SceneGraph
 {
 
 Geometry::Geometry()
-: mGraphics( nullptr ),
+: mGraphicsController( nullptr ),
   mIndexBuffer{ nullptr },
   mIndexBufferElementCount( 0 ),
   mGeometryType( Dali::Geometry::TRIANGLES ),
@@ -47,9 +47,9 @@ Geometry::~Geometry()
 {
 }
 
-void Geometry::Initialize( Integration::Graphics::Graphics& graphics )
+void Geometry::Initialize( Graphics::Controller& graphics )
 {
-  mGraphics = &graphics;
+  mGraphicsController = &graphics;
 }
 
 void Geometry::AddPropertyBuffer( SceneGraph::PropertyBuffer* propertyBuffer )
@@ -61,20 +61,16 @@ void Geometry::AddPropertyBuffer( SceneGraph::PropertyBuffer* propertyBuffer )
 void Geometry::SetIndexBuffer( Dali::Vector<unsigned short>& indices )
 {
   // set new index buffer
-  auto& mController = mGraphics->GetController();
-
-  // create index buffer]
   auto sizeInBytes = uint32_t(indices.Size() * sizeof(indices[0]));
-  auto indexBuffer = mController.CreateBuffer(
-                        mController.GetBufferFactory()
-                                 .SetSize( uint32_t(indices.Size() * sizeof(indices[0])) )
-                                 .SetUsage( Graphics::API::Buffer::UsageHint::INDEX_BUFFER )
+  auto indexBuffer = mGraphicsController->CreateBuffer( mGraphicsController->GetBufferFactory()
+                                                        .SetSize( uint32_t(indices.Size() * sizeof(indices[0])) )
+                                                        .SetUsageFlags( 0u | Graphics::BufferUsage::INDEX_BUFFER )
   );
 
   // transfer data
-  indexBuffer.Get().Write( indices.begin(), sizeInBytes, 0u );
+  indexBuffer->Write( indices.begin(), sizeInBytes, 0u );
 
-  mIndexBuffer = indexBuffer;
+  mIndexBuffer = std::move(indexBuffer);
 
   mIndexBufferElementCount = uint32_t(indices.Size());
 
index c7e647b..74b18e0 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_GEOMETRY_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
 #include <dali/public-api/rendering/geometry.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali/graphics-api/graphics-api-controller.h>
-#include <dali/integration-api/graphics/graphics.h>
 #include <dali/internal/common/message.h>
 #include <dali/internal/common/owner-pointer.h>
 #include <dali/internal/common/buffer-index.h>
@@ -56,7 +55,7 @@ public:
    *
    * @param[in] graphics The Graphics API
    */
-  void Initialize( Integration::Graphics::Graphics& graphics );
+  void Initialize( Graphics::Controller& graphics );
 
   /**
    * Adds a property buffer to the geometry
@@ -114,9 +113,9 @@ public:
     return mVertexBuffers;
   }
 
-  Graphics::API::Accessor<Graphics::API::Buffer> GetIndexBuffer()
+  Graphics::Buffer* GetIndexBuffer()
   {
-    return mIndexBuffer;
+    return mIndexBuffer.get();
   }
 
   bool HasIndexBuffer() const
@@ -129,19 +128,17 @@ public:
     return mIndexBufferElementCount;
   }
 
-  /*
-  const Dali::Vector< unsigned short>& GetIndices() const
+  void DestroyGraphicsObjects()
   {
-    return mIndices;
+    mIndexBuffer.reset();
   }
-   */
 
 private:
-  Integration::Graphics::Graphics* mGraphics; ///< Graphics interface object
+  Graphics::Controller* mGraphicsController; ///< Graphics interface object
 
   // PropertyBuffers
   Vector< SceneGraph::PropertyBuffer* > mVertexBuffers;
-  Graphics::API::Accessor<Graphics::API::Buffer> mIndexBuffer;
+  std::unique_ptr<Graphics::Buffer> mIndexBuffer;
   uint32_t mIndexBufferElementCount;
   Type mGeometryType;
 
index 708e17e..fd33297 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,13 +32,13 @@ namespace SceneGraph
 {
 
 PropertyBuffer::PropertyBuffer()
-: mGraphics( nullptr ),
+: mGraphicsController( nullptr ),
   mFormat( nullptr ),
   mData( nullptr ),
   mSize(0),
   mDataChanged(true),
   mGraphicsBuffer{ nullptr },
-  mGraphicsBufferUsage{ Graphics::API::Buffer::UsageHint::ATTRIBUTES }
+  mGraphicsBufferUsage{ 0u | Graphics::BufferUsage::VERTEX_BUFFER }
 {
 }
 
@@ -46,14 +46,9 @@ PropertyBuffer::~PropertyBuffer()
 {
 }
 
-void PropertyBuffer::Initialize( Integration::Graphics::Graphics& graphics )
+void PropertyBuffer::Initialize( Graphics::Controller& graphicsController )
 {
-  mGraphics = &graphics;
-}
-
-void PropertyBuffer::SetUsage( Graphics::API::Buffer::UsageHint usage )
-{
-  mGraphicsBufferUsage = usage;
+  mGraphicsController = &graphicsController;
 }
 
 void PropertyBuffer::SetFormat( OwnerPointer< PropertyBuffer::Format >& format )
@@ -62,23 +57,21 @@ void PropertyBuffer::SetFormat( OwnerPointer< PropertyBuffer::Format >& format )
   mDataChanged = true;
 }
 
-void PropertyBuffer::SetData( OwnerPointer< Dali::Vector<char> >& data, size_t size )
+void PropertyBuffer::SetData( OwnerPointer< Dali::Vector<uint8_t> >& data, uint32_t size )
 {
   mData.Swap( data );
   mSize = size;
   mDataChanged = true;
 
-  if( mGraphics )
+  if( mGraphicsController )
   {
-    auto& controller = mGraphics->GetController();
-    mGraphicsBuffer = controller.CreateBuffer( controller.GetBufferFactory()
-                                           .SetSize( uint32_t( mFormat->size * size) )
-                                           .SetUsage(Graphics::API::Buffer::UsageHint::ATTRIBUTES ));
-
+    mGraphicsBuffer = mGraphicsController->CreateBuffer( mGraphicsController->GetBufferFactory()
+                                                         .SetSize( uint32_t( mFormat->size * size) )
+                                                         .SetUsageFlags( 0u | Graphics::BufferUsage::VERTEX_BUFFER ));
   }
 }
 
-bool PropertyBuffer::Update( Dali::Graphics::API::Controller& controller )
+bool PropertyBuffer::Update( Dali::Graphics::Controller& controller )
 {
   if( !mData || !mFormat || !mSize )
   {
@@ -89,13 +82,13 @@ bool PropertyBuffer::Update( Dali::Graphics::API::Controller& controller )
   {
     if( !mGraphicsBuffer )
     {
-      mGraphicsBuffer = controller.CreateBuffer( controller.GetBufferFactory()
-                                                      .SetUsage( mGraphicsBufferUsage )
-                                                      .SetSize( mSize ) );
+      mGraphicsBuffer = mGraphicsController->CreateBuffer( mGraphicsController->GetBufferFactory()
+                                                           .SetUsageFlags( mGraphicsBufferUsage )
+                                                           .SetSize( mSize ) );
     }
 
     // schedule deferred write
-    mGraphicsBuffer.Get().Write( mData.Get()->begin(), GetDataSize(), 0u );
+    mGraphicsBuffer->Write( mData.Get()->begin(), GetDataSize(), 0u );
 
     mDataChanged = false;
   }
@@ -103,6 +96,7 @@ bool PropertyBuffer::Update( Dali::Graphics::API::Controller& controller )
   return true;
 }
 
+
 } //Render
 } //Internal
 } //Dali
index 5028a76..d93a4f9 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+// INTERNAL INCLUDES
 #include <dali/public-api/actors/sampling.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/rendering/sampler.h>
-#include <dali/graphics-api/graphics-api-accessor.h>
 #include <dali/graphics-api/graphics-api-buffer.h>
-#include <dali/integration-api/graphics/graphics.h>
+#include <dali/graphics-api/graphics-api-controller.h>
 #include <dali/internal/common/message.h>
 #include <dali/internal/common/owner-pointer.h>
 #include <dali/internal/event/common/event-thread-services.h>
@@ -48,10 +49,10 @@ public:
 
   struct Component
   {
-    std::string     name;
-    unsigned int    offset;
-    unsigned int    size;
-    Property::Type  type;
+    std::string    name;
+    uint32_t       offset;
+    uint32_t       size;
+    Property::Type type;
   };
 
   /**
@@ -60,7 +61,7 @@ public:
   struct Format
   {
     std::vector<Component> components;
-    unsigned int           size;
+    uint32_t               size;
   };
 
   /**
@@ -78,7 +79,7 @@ public:
    *
    * @param[in] graphics The Graphics API
    */
-  void Initialize( Integration::Graphics::Graphics& graphics );
+  void Initialize( Graphics::Controller& graphics );
 
   /**
    * @brief Set the format of the buffer
@@ -97,29 +98,29 @@ public:
    * @param[in] data The new data of the PropertyBuffer
    * @param[in] size The new size of the buffer
    */
-  void SetData( OwnerPointer< Dali::Vector<char> >& data, size_t size );
+  void SetData( OwnerPointer< Dali::Vector<uint8_t> >& data, uint32_t size );
 
   /**
    * @brief Set the number of elements
    * @param[in] size The number of elements
    */
-  void SetSize( unsigned int size );
+  void SetSize( uint32_t size );
 
   /**
    * Perform the upload of the buffer only when required
    * @param[in] controller
    * @return
    */
-  bool Update( Dali::Graphics::API::Controller& controller );
+  bool Update( Dali::Graphics::Controller& controller );
 
   /**
    * Get the number of attributes present in the buffer
    * @return The number of attributes stored in this buffer
    */
-  inline unsigned int GetAttributeCount() const
+  inline uint32_t GetAttributeCount() const
   {
     DALI_ASSERT_DEBUG( mFormat && "Format should be set ");
-    return mFormat->components.size();
+    return static_cast<uint32_t>( mFormat->components.size() );
   }
 
   /**
@@ -127,7 +128,7 @@ public:
    * @param[in] index The index of the attribute
    * @return The name of the attribute
    */
-  inline const std::string& GetAttributeName(unsigned int index ) const
+  inline const std::string& GetAttributeName( uint32_t index ) const
   {
     DALI_ASSERT_DEBUG( mFormat && "Format should be set ");
     return mFormat->components[index].name;
@@ -137,7 +138,7 @@ public:
    * Retrieve the size of the buffer in bytes
    * @return The total size of the buffer
    */
-  inline std::size_t GetDataSize() const
+  inline uint32_t GetDataSize() const
   {
     DALI_ASSERT_DEBUG( mFormat && "Format should be set ");
     return mFormat->size * mSize;
@@ -147,7 +148,7 @@ public:
    * Retrieve the size of one element of the buffer
    * @return The size of one element
    */
-  inline std::size_t GetElementSize() const
+  inline uint32_t GetElementSize() const
   {
     DALI_ASSERT_DEBUG( mFormat && "Format should be set ");
     return mFormat->size;
@@ -157,7 +158,7 @@ public:
    * Retrieve the number of elements in the buffer
    * @return The total number of elements
    */
-  inline unsigned int GetElementCount() const
+  inline uint32_t GetElementCount() const
   {
     return mSize;
   }
@@ -166,24 +167,27 @@ public:
   {
     return mFormat.Get();
   }
-  inline Graphics::API::Accessor<Graphics::API::Buffer> GetGfxObject() const
+  inline Graphics::Buffer* GetGfxObject() const
   {
-    return mGraphicsBuffer;
+    return mGraphicsBuffer.get();
   }
 
-  void SetUsage( Graphics::API::Buffer::UsageHint usage );
+  inline void DestroyGraphicsObjects()
+  {
+    mGraphicsBuffer.reset();
+  }
 
 private:
-  Integration::Graphics::Graphics*        mGraphics;  ///< Graphics interface object
+  Graphics::Controller* mGraphicsController;  ///< Graphics controller
   OwnerPointer< PropertyBuffer::Format >  mFormat;    ///< Format of the buffer
-  OwnerPointer< Dali::Vector< char > >    mData;      ///< Data
+  OwnerPointer< Dali::Vector< uint8_t > > mData;      ///< Data
 
-  size_t mSize;       ///< Number of Elements in the buffer
+  uint32_t mSize;       ///< Number of Elements in the buffer
   bool mDataChanged;  ///< Flag to know if data has changed in a frame
 
   // GRAPHICS
-  Graphics::API::Accessor<Graphics::API::Buffer> mGraphicsBuffer;
-  Graphics::API::Buffer::UsageHint mGraphicsBufferUsage;
+  std::unique_ptr<Graphics::Buffer> mGraphicsBuffer;
+  Graphics::BufferUsageFlags mGraphicsBufferUsage;
 };
 
 
@@ -199,10 +203,10 @@ inline void SetPropertyBufferFormatMessage( EventThreadServices& eventThreadServ
   new (slot) LocalType( &propertyBuffer, &PropertyBuffer::SetFormat, format );
 }
 
-inline void SetPropertyBufferDataMessage( EventThreadServices& eventThreadServices, SceneGraph::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<char> >& data, size_t size )
+inline void SetPropertyBufferDataMessage( EventThreadServices& eventThreadServices, SceneGraph::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
 {
   // Message has ownership of PropertyBuffer data while in transit from event -> update
-  typedef MessageValue2< SceneGraph::PropertyBuffer, OwnerPointer< Vector<char> >, size_t  > LocalType;
+  typedef MessageValue2< SceneGraph::PropertyBuffer, OwnerPointer< Vector<uint8_t> >, uint32_t  > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ), false );
index acbf549..94a750b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  */
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-variable"
-#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
-#pragma GCC diagnostic ignored "-Wunused-function"
-
 // CLASS HEADER
 #include "scene-graph-renderer.h"
 
 #include <dali/internal/common/internal-constants.h>
 #include <dali/internal/common/memory-pool-object-allocator.h>
 #include <dali/internal/update/nodes/node.h>
-#include <dali/internal/update/rendering/data-providers/node-data-provider.h>
+#include <dali/internal/update/rendering/render-instruction.h>
 #include <dali/internal/update/rendering/scene-graph-geometry.h>
 #include <dali/internal/update/rendering/scene-graph-property-buffer.h>
 #include <dali/internal/update/rendering/scene-graph-shader.h>
 #include <dali/internal/update/rendering/scene-graph-sampler.h>
 #include <dali/internal/update/rendering/scene-graph-texture.h>
 #include <dali/internal/update/rendering/scene-graph-texture-set.h>
+#include <dali/internal/update/graphics/graphics-buffer-manager.h>
 
 #include <dali/graphics-api/graphics-api-controller.h>
 #include <dali/graphics-api/graphics-api-render-command.h>
 #include <dali/graphics-api/graphics-api-shader.h>
 #include <dali/graphics-api/graphics-api-shader-details.h>
 #include <dali/graphics-api/graphics-api-pipeline-factory.h>
+#include <dali/graphics-api/graphics-api-sampler.h>
+#include <dali/graphics-api/graphics-api-sampler-factory.h>
 
 #include <cstring>
+#include <dali/integration-api/debug.h>
 
+namespace Dali
+{
+namespace Internal
+{
+namespace SceneGraph
+{
 namespace // unnamed namespace
 {
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gVulkanFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_VULKAN_UNIFORMS");
+Debug::Filter* gTextureFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TEXTURE");
 #endif
 
 
-const unsigned int UNIFORM_MAP_READY      = 0;
-const unsigned int COPY_UNIFORM_MAP       = 1;
-const unsigned int REGENERATE_UNIFORM_MAP = 2;
+const uint32_t UNIFORM_MAP_READY      = 0;
+const uint32_t COPY_UNIFORM_MAP       = 1;
+const uint32_t REGENERATE_UNIFORM_MAP = 2;
 
 //Memory pool used to allocate new renderers. Memory used by this pool will be released when shutting down DALi
-Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::Renderer> gRendererMemoryPool;
+MemoryPoolObjectAllocator<Renderer> gRendererMemoryPool;
 
-void AddMappings( Dali::Internal::SceneGraph::CollectedUniformMap& localMap, const Dali::Internal::SceneGraph::UniformMap& uniformMap )
+void AddMappings( CollectedUniformMap& localMap, const UniformMap& uniformMap )
 {
   // Iterate thru uniformMap.
   //   Any maps that aren't in localMap should be added in a single step
-  Dali::Internal::SceneGraph::CollectedUniformMap newUniformMappings;
+  CollectedUniformMap newUniformMappings;
 
-  for( unsigned int i=0, count = uniformMap.Count(); i<count; ++i )
+  for( UniformMap::SizeType i = 0, count=uniformMap.Count(); i<count; ++i )
   {
-    Dali::Internal::SceneGraph::UniformPropertyMapping::Hash nameHash = uniformMap[i].uniformNameHash;
+    UniformPropertyMapping::Hash nameHash = uniformMap[i].uniformNameHash;
     bool found = false;
 
     for( auto map : localMap )
@@ -96,14 +102,17 @@ void AddMappings( Dali::Internal::SceneGraph::CollectedUniformMap& localMap, con
   }
 }
 
-} // Anonymous namespace
-
-namespace Dali
-{
-namespace Internal
-{
-namespace SceneGraph
+/**
+ * Helper function computing correct alignment of data for uniform buffers
+ * @param dataSize size of uniform buffer
+ * @return aligned offset of data
+ */
+inline uint32_t GetUniformBufferDataAlignment( uint32_t dataSize )
 {
+  return ( (dataSize / 256u) + ( (dataSize % 256u) ? 1u : 0u ) ) * 256u;
+}
+
+} // Anonymous namespace
 
 Renderer* Renderer::New()
 {
@@ -111,7 +120,7 @@ Renderer* Renderer::New()
 }
 
 Renderer::Renderer()
-: mGraphics( nullptr ),
+: mGraphicsController( nullptr ),
   mTextureSet( NULL ),
   mGeometry( NULL ),
   mShader( NULL ),
@@ -126,8 +135,10 @@ Renderer::Renderer()
   mBlendMode( BlendMode::AUTO ),
   mDepthWriteMode( DepthWriteMode::AUTO ),
   mDepthTestMode( DepthTestMode::AUTO ),
+  mRenderingBehavior( DevelRenderer::Rendering::IF_REQUIRED ),
   mPremultipledAlphaEnabled( false ),
-  mGfxRenderCommand(),
+  mRenderCommands{},
+  mTextureBindings{},
   mOpacity( 1.0f ),
   mDepthIndex( 0 )
 {
@@ -154,21 +165,21 @@ void Renderer::operator delete( void* ptr )
   gRendererMemoryPool.FreeThreadSafe( static_cast<Renderer*>( ptr ) );
 }
 
-void Renderer::Initialize( Integration::Graphics::Graphics& graphics )
+void Renderer::Initialize( Graphics::Controller& graphicsController )
 {
-  mGraphics = &graphics;
+  mGraphicsController = &graphicsController;
 
   mRegenerateUniformMap = REGENERATE_UNIFORM_MAP;
 }
 
 void Renderer::UpdateUniformMap( BufferIndex updateBufferIndex, Node& node )
 {
-  // Called every frame.
+  // Called every frame. Well, it is now...
   CollectedUniformMap& localMap = mCollectedUniformMap[ updateBufferIndex ];
 
   // See if we need to update the collected map:
   if( mRegenerateUniformMap == REGENERATE_UNIFORM_MAP || // renderer or shader's uniform map has changed
-      node.GetUniformMapChanged( updateBufferIndex ) ) // node's uniform map has change
+      node.GetUniformMapChanged( updateBufferIndex ) )   // node's uniform map has change
   {
     localMap.Resize(0);
 
@@ -190,7 +201,7 @@ void Renderer::UpdateUniformMap( BufferIndex updateBufferIndex, Node& node )
 
     localMap.Resize( oldMap.Count() );
 
-    unsigned int index=0;
+      uint32_t index=0;
     for( CollectedUniformMap::Iterator iter = oldMap.Begin(), end = oldMap.End() ; iter != end ; ++iter, ++index )
     {
       localMap[index] = *iter;
@@ -203,22 +214,24 @@ void Renderer::UpdateUniformMap( BufferIndex updateBufferIndex, Node& node )
   }
 }
 
-void Renderer::PrepareRender( BufferIndex updateBufferIndex )
+void Renderer::FreeRenderCommand( RenderInstruction* renderInstruction )
 {
-  using namespace Dali::Graphics::API;
 
-  auto &controller = mGraphics->GetController();
+  mRenderCommands.DestroyRenderCommand( renderInstruction );
+}
 
-  // prepare all stuff
-  auto gfxShader                   = mShader->GetGfxObject();
+RenderCommand& Renderer::GetRenderCommand( RenderInstruction* renderInstruction,
+                                           BufferIndex updateBufferIndex )
+{
+  return mRenderCommands.GetRenderCommand( renderInstruction, updateBufferIndex );
+}
 
-  if (!mGfxRenderCommand)
-  {
-    mGfxRenderCommand = controller.AllocateRenderCommand();
-  }
+void Renderer::PrepareRender( BufferIndex updateBufferIndex, RenderInstruction* renderInstruction )
+{
+  auto& renderCmd = mRenderCommands.AllocRenderCommand( renderInstruction, *mGraphicsController, updateBufferIndex );
+  auto& cmd = renderCmd.GetGfxRenderCommand( updateBufferIndex );
 
-  if (!mShader->GetGfxObject()
-              .Exists())
+  if (!mShader->GetGfxObject())
   {
     return;
   }
@@ -226,132 +239,262 @@ void Renderer::PrepareRender( BufferIndex updateBufferIndex )
   /**
    * Prepare vertex attribute buffer bindings
    */
-  std::vector<Graphics::API::Accessor<Graphics::API::Buffer>> vertexBuffers{};
+  std::vector<const Graphics::Buffer*> vertexBuffers{};
 
   for(auto&& vertexBuffer : mGeometry->GetVertexBuffers())
   {
     vertexBuffers.push_back( vertexBuffer->GetGfxObject() );
   }
 
-  auto &shader = mShader->GetGfxObject().Get();
-  auto uboCount = shader.GetUniformBlockCount();
+  auto& shader = *mShader->GetGfxObject();
+
+  /**
+   * Prepare textures
+   */
+  auto samplers = shader.GetSamplers();
+  if(mTextureSet)
+  {
+    if (!samplers.empty())
+    {
+      mTextureBindings.clear();
+      for (auto i = 0u; i < mTextureSet->GetTextureCount(); ++i)
+      {
+        auto texture = mTextureSet->GetTexture(i);
+        if( texture )
+        {
+          auto sampler = mTextureSet->GetTextureSampler( i );
+
+          if( sampler && sampler->mIsDirty )
+          {
+            // if default sampler
+            if( sampler->mMagnificationFilter == FilterMode::DEFAULT && sampler->mMinificationFilter == FilterMode::DEFAULT &&
+                sampler->mSWrapMode == WrapMode::DEFAULT &&
+                sampler->mTWrapMode == WrapMode::DEFAULT &&
+                sampler->mRWrapMode == WrapMode::DEFAULT )
+            {
+              sampler->mGfxSampler.reset( nullptr );
+            }
+            else
+            {
+              // reinitialize sampler
+              sampler->Initialize( *mGraphicsController );
+            }
+            sampler->mIsDirty = false;
+          }
+
+          texture->PrepareTexture(); // Ensure that a native texture is ready to be drawn
+
+          auto binding    = Graphics::RenderCommand::TextureBinding{}
+            .SetBinding(samplers[i].binding)
+            .SetTexture(texture->GetGfxObject())
+            .SetSampler(sampler ? sampler->GetGfxObject() : nullptr);
+
+          mTextureBindings.emplace_back(binding);
+        }
+      }
+      renderCmd.BindTextures( mTextureBindings, updateBufferIndex );
+    }
+  }
+
+
+  // Build render command
+  // todo: this may be deferred until all render items are sorted, otherwise
+  // certain optimisations cannot be done
+
+  const auto &vb = mGeometry->GetVertexBuffers()[0];
+
+  // set optional index buffer
+  bool usesIndexBuffer{false};
+  if ((usesIndexBuffer = mGeometry->HasIndexBuffer()))
+  {
+    cmd.BindIndexBuffer(Graphics::RenderCommand::IndexBufferBinding()
+                        .SetBuffer(mGeometry->GetIndexBuffer())
+                        .SetOffset(0)
+    );
+  }
+
+  cmd.BindVertexBuffers(std::move(vertexBuffers) );
 
-  auto pushConstantsBindings = Graphics::API::RenderCommand::NewPushConstantsBindings(uboCount);
+  if(usesIndexBuffer)
+  {
+    cmd.Draw(std::move(Graphics::RenderCommand::DrawCommand{}
+                                        .SetFirstIndex( uint32_t(mIndexedDrawFirstElement) )
+                                        .SetDrawType( Graphics::RenderCommand::DrawType::INDEXED_DRAW )
+                                        .SetFirstInstance( 0u )
+                                        .SetIndicesCount(
+                                          mIndexedDrawElementsCount ?
+                                            uint32_t( mIndexedDrawElementsCount ) :
+                                            mGeometry->GetIndexBufferElementCount() )
+                                        .SetInstanceCount( 1u )));
+  }
+  else
+  {
+    cmd.Draw(std::move(Graphics::RenderCommand::DrawCommand{}
+                                        .SetFirstVertex(0u)
+                                        .SetDrawType(Graphics::RenderCommand::DrawType::VERTEX_DRAW)
+                                        .SetFirstInstance(0u)
+                                        .SetVertexCount(vb->GetElementCount())
+                                        .SetInstanceCount(1u)));
+  }
 
-  // allocate new command ( may be not necessary at all )
-  // mGfxRenderCommand = Graphics::API::RenderCommandBuilder().Build();
+  DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose,  "done\n" );
+}
 
-  // see if we need to reallocate memory for each UBO
-  // todo: do it only when shader has changed
-  if (mUboMemory.size() != uboCount)
+void Renderer::WriteUniform( GraphicsBuffer& ubo, const std::vector<Graphics::RenderCommand::UniformBufferBinding>& bindings, const std::string& name, size_t hash, const void* data, uint32_t size )
+{
+  if( !mShader->GetGfxObject() )
+  {
+    // Invalid pipeline
+    return;
+  }
+  auto uniformInfo = Graphics::ShaderDetails::UniformInfo{};
+  if( mShader->GetUniform( name, hash, uniformInfo ) )
   {
-    mUboMemory.resize(uboCount);
+    ubo.Write( data, size, bindings[uniformInfo.bufferIndex].offset + uniformInfo.offset, false );
   }
+}
 
-  for (auto i = 0u; i < uboCount; ++i)
+void Renderer::WriteUniform( GraphicsBuffer& ubo, const std::vector<Graphics::RenderCommand::UniformBufferBinding>& bindings, const Graphics::ShaderDetails::UniformInfo& uniformInfo, const void* data, uint32_t size )
+{
+  if( !mShader->GetGfxObject() )
+  {
+    // Invalid pipeline
+    return;
+  }
+
+  ubo.Write( data, size, bindings[uniformInfo.bufferIndex].offset + uniformInfo.offset, false );
+}
+
+bool Renderer::UpdateUniformBuffers( RenderInstruction& instruction,
+                                     GraphicsBuffer& ubo,
+                                     std::vector<Graphics::RenderCommand::UniformBufferBinding>*& outBindings,
+                                     uint32_t& offset,
+                                     BufferIndex updateBufferIndex )
+{
+  int updates( 0u );
+
+  const UniformMap& rendererUniformMap = PropertyOwner::GetUniformMap();
+  const auto& collectedMap = mCollectedUniformMap[updateBufferIndex];
+  if( collectedMap.Count() < rendererUniformMap.Count() )
+  {
+    DALI_LOG_ERROR("%p, i:%u - FAILED TO REGENERATE UNIFORM MAP", this, updateBufferIndex );
+  }
+
+  auto uboCount = mShader->GetGfxObject()->GetUniformBlockCount();
+  auto gfxShader = mShader->GetGfxObject();
+
+  RenderCommand* renderCommand;
+  if( !mRenderCommands.Find( &instruction, renderCommand, updateBufferIndex ) )
   {
-    Graphics::API::ShaderDetails::UniformBlockInfo ubInfo;
+    DALI_ASSERT_DEBUG( 0 && "Can't find render command for this instruction" );
+    return false;
+  }
+
+  auto& currentUboBindings = renderCommand->mUboBindings;
 
-    DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose, sizeof(ubInfo) );
 
-    shader.GetUniformBlock(i, ubInfo);
+  if(currentUboBindings.size() != uboCount )
+  {
+    currentUboBindings.resize( uboCount );
+    ++updates;
+  }
 
-    if (mUboMemory[i].size() != ubInfo.size)
+  // setup bindings
+  uint32_t dataOffset = offset;
+  for (auto i = 0u; i < uboCount; ++i)
+  {
+    currentUboBindings[i].dataSize = gfxShader->GetUniformBlockSize(i);
+    currentUboBindings[i].binding = gfxShader->GetUniformBlockBinding(i);
+
+    if( currentUboBindings[i].offset != dataOffset )
     {
-      mUboMemory[i].resize(ubInfo.size);
+      currentUboBindings[i].offset = dataOffset;
+      ++updates;
     }
 
-    // Set push constant bindings
-    auto &pushBinding = pushConstantsBindings[i];
-    pushBinding.data    = mUboMemory[i].data();
-    pushBinding.size    = uint32_t(mUboMemory[i].size());
-    pushBinding.binding = ubInfo.binding;
-  }
+    dataOffset += GetUniformBufferDataAlignment( currentUboBindings[i].dataSize );
 
-  // add built-in uniforms
+    if( currentUboBindings[i].buffer != ubo.GetBuffer() )
+    {
+      currentUboBindings[i].buffer = ubo.GetBuffer();
+      ++updates;
+    }
+  }
 
   // write to memory
   for (auto&& uniformMap : mCollectedUniformMap[updateBufferIndex])
   {
-    std::string uniformName(uniformMap->uniformName);
-    int         arrayIndex       = 0;
-    auto        arrayLeftBracket = uniformMap->uniformName .find('[');
-    if (arrayLeftBracket != std::string::npos)
-    {
-      auto arrayRightBracket = uniformMap->uniformName.find(']');
-      arrayIndex = std::atoi(&uniformName.c_str()[arrayLeftBracket + 1]);
-      DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose,  "UNIFORM NAME: " << uniformMap->uniformName << ", index: " << arrayIndex );
-      uniformName = uniformName.substr(0, arrayLeftBracket);
-    }
+    // Convert uniform name into hash value
+    auto uniformInfo = Graphics::ShaderDetails::UniformInfo{};
 
-    auto uniformInfo = Graphics::API::ShaderDetails::UniformInfo{};
-    if (shader.GetNamedUniform(uniformName, uniformInfo))
+    // test for array ( special case )
+    // @todo This means parsing the uniform string every frame. Instead, store the array index if present.
+    int arrayIndex = uniformMap->arrayIndex;
+
+    auto uniformFound = mShader->GetUniform( uniformMap->uniformName,
+                                             uniformMap->uniformNameHashNoArray ?
+                                             uniformMap->uniformNameHashNoArray :
+                                             uniformMap->uniformNameHash, uniformInfo );
+
+    if( uniformFound )
     {
-      // write into correct uniform buffer
-      auto dst = (mUboMemory[uniformInfo.bufferIndex].data() + uniformInfo.offset);
+      auto dst = currentUboBindings[uniformInfo.bufferIndex].offset + uniformInfo.offset;
 
       switch (uniformMap->propertyPtr->GetType())
       {
-
         case Property::Type::FLOAT:
         case Property::Type::INTEGER:
         case Property::Type::BOOLEAN:
         {
-          DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose,  uniformInfo.name << ":[" << uniformInfo.bufferIndex << "]: " << "Writing 32bit offset: "
-                           << uniformInfo.offset << ", size: " << sizeof(float) );
-
-          dst += sizeof(float) * arrayIndex;
-          memcpy(dst, &uniformMap->propertyPtr->GetFloat(updateBufferIndex), sizeof(float));
+          ubo.Write( &uniformMap->propertyPtr->GetFloat(updateBufferIndex),
+                     sizeof(float),
+                     dst + static_cast<uint32_t>(sizeof(Vector4)) * arrayIndex,
+                     false );
           break;
         }
         case Property::Type::VECTOR2:
         {
-          DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose,  uniformInfo.name << ":[" << uniformInfo.bufferIndex << "]: " << "Writing vec2 offset: "
-                           << uniformInfo.offset << ", size: " << sizeof(Vector2) ) ;
-          dst += /* sizeof(Vector2) * */arrayIndex * 16; // todo: use array stride from spirv
-          memcpy(dst, &uniformMap->propertyPtr->GetVector2(updateBufferIndex), sizeof(Vector2));
+          ubo.Write( &uniformMap->propertyPtr->GetVector2(updateBufferIndex),
+                     sizeof(Vector2),
+                     dst + static_cast<uint32_t>(sizeof(Vector4)) * arrayIndex,
+                     false );
           break;
         }
         case Property::Type::VECTOR3:
         {
-          DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose,  uniformInfo.name << ":[" << uniformInfo.bufferIndex << "]: " << "Writing vec3 offset: "
-                  << uniformInfo.offset << ", size: " << sizeof(Vector3) );
-          dst += sizeof(Vector3) * arrayIndex;
-          memcpy(dst, &uniformMap->propertyPtr->GetVector3(updateBufferIndex), sizeof(Vector3));
+          ubo.Write( &uniformMap->propertyPtr->GetVector3(updateBufferIndex),
+                     sizeof(Vector3),
+                     dst + static_cast<uint32_t>(sizeof(Vector4)) * arrayIndex,
+                     false );
           break;
         }
         case Property::Type::VECTOR4:
         {
-          DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose,  uniformInfo.name << ":[" << uniformInfo.bufferIndex << "]: " << "Writing vec4 offset: "
-                           << uniformInfo.offset << ", size: " << sizeof(Vector4) );
-
-          dst += sizeof(float) * arrayIndex;
-          memcpy(dst, &uniformMap->propertyPtr->GetVector4(updateBufferIndex), sizeof(Vector4));
+          ubo.Write( &uniformMap->propertyPtr->GetVector4(updateBufferIndex),
+                     sizeof(Vector4),
+                     dst + static_cast<uint32_t>(sizeof(Vector4)) * arrayIndex,
+                     false );
           break;
         }
         case Property::Type::MATRIX:
         {
-          DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose,  uniformInfo.name << ":[" << uniformInfo.bufferIndex << "]: " << "Writing mat4 offset: "
-                           << uniformInfo.offset << ", size: " << sizeof(Matrix)  );
-          dst += sizeof(Matrix) * arrayIndex;
-          memcpy(dst, &uniformMap->propertyPtr->GetMatrix(updateBufferIndex), sizeof(Matrix));
+          ubo.Write( &uniformMap->propertyPtr->GetMatrix(updateBufferIndex),
+                     sizeof(Matrix),
+                     dst + static_cast<uint32_t>(sizeof(Matrix)) * arrayIndex,
+                     false );
           break;
         }
         case Property::Type::MATRIX3:
         {
-          DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose,  uniformInfo.name << ":[" << uniformInfo.bufferIndex << "]: " << "Writing mat3 offset: "
-                           << uniformInfo.offset << ", size: " << sizeof(Matrix3) );
-          dst += sizeof(Matrix3) * arrayIndex;
-
-          auto& matrix = uniformMap->propertyPtr->GetMatrix3(updateBufferIndex);
+          const auto& matrix = uniformMap->propertyPtr->GetMatrix3(updateBufferIndex);
+          for( int i = 0; i < 3; ++i )
+          {
+            ubo.Write( &matrix.AsFloat()[i*3],
+                       sizeof(float)*3,
+                       dst + (i * static_cast<uint32_t>(sizeof(Vector4))),
+                       false );
+          }
 
-          float* values = reinterpret_cast<float*>(dst);
-          std::fill( values, values+12, 10.0f );
-          std::memcpy( &values[0], matrix.AsFloat(), sizeof(float)*3 );
-          std::memcpy( &values[4], &matrix.AsFloat()[3], sizeof(float)*3 );
-          std::memcpy( &values[8], &matrix.AsFloat()[6], sizeof(float)*3 );
-
-          memcpy(dst, values, sizeof(float)*12);
           break;
         }
         default:
@@ -361,90 +504,16 @@ void Renderer::PrepareRender( BufferIndex updateBufferIndex )
     }
   }
 
+  // write output bindings
+  outBindings = &currentUboBindings;
 
-  /**
-   * Prepare textures
-   */
-  auto textureBindings = Graphics::API::RenderCommand::NewTextureBindings();
-  auto samplers        = shader.GetSamplers();
-
-  if (mTextureSet)
-  {
-    if (!samplers.empty())
-    {
-      for (auto i = 0u; i < mTextureSet->GetTextureCount(); ++i)
-      {
-
-        auto texture    = mTextureSet->GetTexture(i);
-        auto gfxTexture = texture->GetGfxObject();
-        auto binding    = Graphics::API::RenderCommand::TextureBinding{}
-          .SetBinding(samplers[i].binding)
-          .SetTexture(texture->GetGfxObject())
-          .SetSampler(nullptr);
-
-        textureBindings.emplace_back(binding);
-      }
-    }
-  }
-
-  // Build render command
-  // todo: this may be deferred until all render items are sorted, otherwise
-  // certain optimisations cannot be done
-
-  const auto &vb = mGeometry->GetVertexBuffers()[0];
-
-  // set optional index buffer
-  bool usesIndexBuffer{false};
-  if ((usesIndexBuffer = mGeometry->HasIndexBuffer()))
-  {
-    mGfxRenderCommand->BindIndexBuffer(Graphics::API::RenderCommand::IndexBufferBinding()
-                                         .SetBuffer(mGeometry->GetIndexBuffer())
-                                         .SetOffset(0)
-    );
-  }
-
-  mGfxRenderCommand->PushConstants( std::move(pushConstantsBindings) );
-  mGfxRenderCommand->BindVertexBuffers( std::move( vertexBuffers ) );
-  mGfxRenderCommand->BindTextures( std::move(textureBindings) );
-
-  if(usesIndexBuffer)
-  {
-    mGfxRenderCommand->Draw(std::move(Graphics::API::RenderCommand::DrawCommand{}
-                                        .SetFirstIndex( uint32_t(mIndexedDrawFirstElement) )
-                                        .SetDrawType(Graphics::API::RenderCommand::DrawType::INDEXED_DRAW)
-                                        .SetFirstInstance(0u)
-                                        .SetIndicesCount( mGeometry->GetIndexBufferElementCount() )
-                                        .SetInstanceCount(1u)));
-  }
-  else
-  {
-    mGfxRenderCommand->Draw(std::move(Graphics::API::RenderCommand::DrawCommand{}
-                                        .SetFirstVertex(0u)
-                                        .SetDrawType(Graphics::API::RenderCommand::DrawType::VERTEX_DRAW)
-                                        .SetFirstInstance(0u)
-                                        .SetVertexCount(vb->GetElementCount())
-                                        .SetInstanceCount(1u)));
-  }
-  DALI_LOG_STREAM( gVulkanFilter, Debug::Verbose,  "done\n" );
-}
+  // update offset
+  offset = dataOffset;
 
-void Renderer::WriteUniform( const std::string& name, const void* data, uint32_t size )
-{
-  if( !mShader->GetGfxObject().Exists() )
-  {
-    // Invalid pipeline
-    return;
-  }
-  auto& gfxShader = mShader->GetGfxObject().Get();
-  auto uniformInfo = Graphics::API::ShaderDetails::UniformInfo{};
-  if( gfxShader.GetNamedUniform( name, uniformInfo ) )
-  {
-    auto dst = (mUboMemory[uniformInfo.bufferIndex].data()+uniformInfo.offset);
-    memcpy( dst, data, size );
-  }
+  // return update status
+  return (0 != updates);
 }
 
-
 void Renderer::SetTextures( TextureSet* textureSet )
 {
   DALI_ASSERT_DEBUG( textureSet != NULL && "Texture set pointer is NULL" );
@@ -456,6 +525,15 @@ void Renderer::SetTextures( TextureSet* textureSet )
 
   mTextureSet = textureSet;
   mTextureSet->AddObserver( this );
+
+  // Rebind textures to make sure old data won't be used. Ensure this
+  // occurs for both buffers.
+  mRenderCommands.BindTextures( mTextureBindings );
+
+  DALI_LOG_INFO( gTextureFilter, Debug::General, "SG::Renderer(%p)::SetTextures( SG::TS:%p )\n"
+                 "  SG:Texture:%p  GfxTexture:%p\n", this, textureSet,
+                 textureSet?textureSet->GetTexture(0):nullptr,
+                 textureSet?(textureSet->GetTexture(0)?textureSet->GetTexture(0)->GetGfxObject():nullptr):nullptr );
 }
 
 void Renderer::SetShader( Shader* shader )
@@ -469,6 +547,7 @@ void Renderer::SetShader( Shader* shader )
 
   mShader = shader;
   mShader->AddConnectionObserver( *this );
+  mRenderCommands.ClearUniformBindings();
   mRegenerateUniformMap = REGENERATE_UNIFORM_MAP;
 }
 
@@ -552,22 +631,22 @@ const Vector4& Renderer::GetBlendColor() const
   return Color::TRANSPARENT;
 }
 
-void Renderer::SetIndexedDrawFirstElement( size_t firstElement )
+void Renderer::SetIndexedDrawFirstElement( uint32_t firstElement )
 {
   mIndexedDrawFirstElement = firstElement;
 }
 
-size_t Renderer::GetIndexedDrawFirstElement() const
+uint32_t Renderer::GetIndexedDrawFirstElement() const
 {
   return mIndexedDrawFirstElement;
 }
 
-void Renderer::SetIndexedDrawElementsCount( size_t elementsCount )
+void Renderer::SetIndexedDrawElementsCount( uint32_t elementsCount )
 {
   mIndexedDrawElementsCount = elementsCount;
 }
 
-size_t Renderer::GetIndexedDrawElementsCount() const
+uint32_t Renderer::GetIndexedDrawElementsCount() const
 {
   return mIndexedDrawElementsCount;
 }
@@ -666,6 +745,17 @@ float Renderer::GetOpacity( BufferIndex updateBufferIndex ) const
 {
   return mOpacity[updateBufferIndex];
 }
+void Renderer::SetRenderingBehavior( DevelRenderer::Rendering::Type renderingBehavior )
+{
+  mRenderingBehavior = renderingBehavior;
+}
+
+DevelRenderer::Rendering::Type Renderer::GetRenderingBehavior() const
+{
+  return mRenderingBehavior;
+}
+
+
 
 Renderer::OpacityType Renderer::GetOpacityType( BufferIndex updateBufferIndex, const Node& node ) const
 {
@@ -753,8 +843,11 @@ void Renderer::ObservedObjectDestroyed(PropertyOwner& owner)
   }
 }
 
+void Renderer::DestroyGraphicsObjects()
+{
+  mRenderCommands.DestroyAll();
+}
+
 } // namespace SceneGraph
 } // namespace Internal
 } // namespace Dali
-
-#pragma GCC diagnostic pop
old mode 100644 (file)
new mode 100755 (executable)
index 7230030..31ac768
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_RENDERER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
 
 #include <dali/public-api/rendering/geometry.h>
 #include <dali/public-api/rendering/renderer.h> // Dali::Renderer
-#include <dali/integration-api/graphics/graphics.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/internal/common/blending-options.h>
 #include <dali/internal/common/type-abstraction-enums.h>
 #include <dali/internal/event/common/event-thread-services.h>
 #include <dali/internal/update/common/property-owner.h>
 #include <dali/internal/update/common/uniform-map.h>
 #include <dali/internal/update/common/scene-graph-connection-change-propagator.h>
-#include <dali/internal/update/rendering/data-providers/uniform-map-data-provider.h>
+#include <dali/internal/update/rendering/render-command-container.h>
 #include <dali/internal/update/rendering/stencil-parameters.h>
-#include <dali/graphics-api/graphics-api-render-command.h>
-#include <dali/graphics-api/graphics-api-pipeline.h>
 #include <dali/graphics-api/graphics-api-controller.h>
+#include <dali/graphics-api/graphics-api-pipeline.h>
+#include <dali/graphics-api/graphics-api-render-command.h>
 #include <cstring>
 
 namespace Dali
@@ -46,12 +46,14 @@ class Geometry;
 class SceneController;
 class TextureSet;
 class Shader;
-
+class GraphicsBuffer;
+class RenderInstruction;
 class Renderer;
 typedef Dali::Vector< Renderer* > RendererContainer;
 typedef RendererContainer::Iterator RendererIter;
 typedef RendererContainer::ConstIterator RendererConstIter;
 
+typedef Dali::Vector< const UniformPropertyMapping* > CollectedUniformMap;
 
 class Renderer : public PropertyOwner,
                  public UniformMap::Observer,
@@ -87,7 +89,7 @@ public:
    *
    * @param[in] graphics The Graphics API
    */
-  void Initialize( Integration::Graphics::Graphics& graphics );
+  void Initialize( Graphics::Controller& graphics );
 
   /**
    * Set the texture set for the renderer
@@ -177,7 +179,7 @@ public:
    * Set the blending options. This should only be called from the update thread.
    * @param[in] options A bitmask of blending options.
    */
-  void SetBlendingOptions( unsigned int options );
+  void SetBlendingOptions( uint32_t options );
 
   /**
    * Set the blending options. This should only be called from the update thread.
@@ -206,25 +208,25 @@ public:
    * Set the index of first element for indexed draw
    * @param[in] firstElement index of first element to draw
    */
-  void SetIndexedDrawFirstElement( size_t firstElement );
+  void SetIndexedDrawFirstElement( uint32_t firstElement );
 
   /**
    * Get the index of first element for indexed draw
    * @return The index of first element for indexed draw
    */
-  size_t GetIndexedDrawFirstElement() const;
+  uint32_t GetIndexedDrawFirstElement() const;
 
   /**
    * Set the number of elements to draw by indexed draw
    * @param[in] elementsCount number of elements to draw
    */
-  void SetIndexedDrawElementsCount( size_t elementsCount );
+  void SetIndexedDrawElementsCount( uint32_t elementsCount );
 
   /**
    * Get the number of elements to draw by indexed draw
    * @return The number of elements to draw by indexed draw
    */
-  size_t GetIndexedDrawElementsCount() const;
+  uint32_t GetIndexedDrawElementsCount() const;
 
   /**
    * @brief Set whether the Pre-multiplied Alpha Blending is required
@@ -350,45 +352,78 @@ public:
   void UpdateUniformMap( BufferIndex bufferIndex, Node& node );
 
   /**
+   * Sets the rendering behavior
+   * @param[in] renderingBehavior The rendering behavior required.
+   */
+  void SetRenderingBehavior( DevelRenderer::Rendering::Type renderingBehavior );
+
+  /**
+   * Gets the rendering behavior
+   * @return The rendering behavior
+   */
+  DevelRenderer::Rendering::Type GetRenderingBehavior() const;
+
+  /**
    * Prepare the object for rendering.
    * This is called by the UpdateManager when an object is due to be rendered in the current frame.
    * @param[in] updateBufferIndex The current update buffer index.
+   * @param[in] renderInstruction The render instruction for this render command
    */
-  void PrepareRender( BufferIndex updateBufferIndex );
+  void PrepareRender( BufferIndex updateBufferIndex, RenderInstruction* renderInstruction );
 
   /**
-   * AB: preparing the command data
-   * @param controller
-   * @param updateBufferIndex
+   * Frees all the render commands and associated data for the given render instruction
+   * @param[in] renderInstruction The render instruction for this render command
    */
-  void PrepareRender( Graphics::API::Controller& controller, BufferIndex updateBufferIndex );
+  void FreeRenderCommand( RenderInstruction* renderInstruction );
 
-  Graphics::API::RenderCommand& GetGfxRenderCommand()
+  /**
+   * Gets the render command associated with the render instruction
+   * @param[in] renderInstruction The render instruction for this render command
+   * @param[in] updateBufferIndex The current update buffer index.
+   */
+  RenderCommand& GetRenderCommand( RenderInstruction* renderInstruction, BufferIndex updateBufferIndex );
+
+  template<class T>
+  void WriteUniform( GraphicsBuffer& ubo, const std::vector<Graphics::RenderCommand::UniformBufferBinding>& bindings, const std::string& name, size_t hash, const T& data )
   {
-    return *mGfxRenderCommand.get();
+    WriteUniform( ubo, bindings, name, hash, &data, sizeof(T) );
   }
 
   template<class T>
-  void WriteUniform( const std::string& name, const T& data )
+  void WriteUniform( GraphicsBuffer& ubo, const std::vector<Graphics::RenderCommand::UniformBufferBinding>& bindings, const Graphics::ShaderDetails::UniformInfo& uniformInfo, const T& data )
   {
-    WriteUniform( name, &data, sizeof(T) );
+    WriteUniform( ubo, bindings, uniformInfo, &data, sizeof(T) );
   }
 
-  void WriteUniform( const std::string& name, const Matrix3& data )
+  void WriteUniform( GraphicsBuffer& ubo, const std::vector<Graphics::RenderCommand::UniformBufferBinding>& bindings, const std::string& name, size_t hash, const Matrix3& data )
   {
     // Matrix3 has to take stride in account ( 16 )
     float values[12];
-    std::fill( values, values+12, 10.0f );
 
+    // todo: optimise this case, ideally by stopping using Matrix3
     std::memcpy( &values[0], data.AsFloat(), sizeof(float)*3 );
     std::memcpy( &values[4], &data.AsFloat()[3], sizeof(float)*3 );
     std::memcpy( &values[8], &data.AsFloat()[6], sizeof(float)*3 );
 
-    WriteUniform( name, &values, sizeof(float)*12 );
+    WriteUniform( ubo, bindings, name, hash, &values, sizeof(float)*12 );
   }
 
-  void WriteUniform( const std::string& name, const void* data, uint32_t size );
+  void WriteUniform( GraphicsBuffer& ubo, const std::vector<Graphics::RenderCommand::UniformBufferBinding>& bindings, const Graphics::ShaderDetails::UniformInfo& uniformInfo, const Matrix3& data )
+  {
+    // Matrix3 has to take stride in account ( 16 )
+    float values[12];
 
+    // todo: optimise this case, ideally by stopping using Matrix3
+    std::memcpy( &values[0], data.AsFloat(), sizeof(float)*3 );
+    std::memcpy( &values[4], &data.AsFloat()[3], sizeof(float)*3 );
+    std::memcpy( &values[8], &data.AsFloat()[6], sizeof(float)*3 );
+
+    WriteUniform( ubo, bindings, uniformInfo, &values, sizeof(float)*12 );
+  }
+
+  void WriteUniform( GraphicsBuffer& ubo, const std::vector<Graphics::RenderCommand::UniformBufferBinding>& bindings, const std::string& name, size_t hash, const void* data, uint32_t size );
+  void WriteUniform( GraphicsBuffer& ubo, const std::vector<Graphics::RenderCommand::UniformBufferBinding>& bindings, const Graphics::ShaderDetails::UniformInfo& uniformInfo, const void* data, uint32_t size );
 
   /**
    * Query whether the renderer is fully opaque, fully transparent or transparent.
@@ -398,6 +433,20 @@ public:
   OpacityType GetOpacityType( BufferIndex updateBufferIndex, const Node& node ) const;
 
   /**
+   * Updates uniform buffer at index. Writes uniforms into given memory address
+   * @param[in,out] ubo Target uniform buffer object
+   * @param[out] outBindings output bindings vector
+   * @param[out] offset output offset of the next uniform buffer memory address
+   * @param[in] updateBufferIndex update buffer index
+   * @return true whether uniform buffer has been updated
+   */
+  bool UpdateUniformBuffers( RenderInstruction& instruction,
+                             GraphicsBuffer& ubo,
+                             std::vector<Graphics::RenderCommand::UniformBufferBinding>*& outBindings,
+                             uint32_t& offset,
+                             BufferIndex updateBufferIndex );
+
+  /**
    * Called by the TextureSet to notify to the renderer that it has changed
    */
   void TextureSetChanged();
@@ -407,12 +456,23 @@ public:
    */
   void TextureSetDeleted();
 
-  void BindPipeline( std::unique_ptr<Graphics::API::Pipeline> pipeline )
+  void BindPipeline( std::unique_ptr<Graphics::Pipeline> pipeline, BufferIndex updateBufferIndex, RenderInstruction* renderInstruction )
   {
-    mGfxPipeline = std::move(pipeline);
-    mGfxRenderCommand->BindPipeline( *mGfxPipeline.get() );
+    GetRenderCommand( renderInstruction, updateBufferIndex ).BindPipeline( std::move(pipeline), updateBufferIndex );
   }
 
+  std::unique_ptr<Graphics::Pipeline> ReleaseGraphicsPipeline( BufferIndex updateBufferIndex, RenderInstruction* renderInstruction )
+  {
+    return GetRenderCommand( renderInstruction, updateBufferIndex ) .ReleaseGraphicsPipeline( updateBufferIndex );
+  }
+
+  void CheckRenderCommandCount(BufferIndex bufferIndex);
+
+  /**
+   * Destroy all graphics objects
+   */
+  void DestroyGraphicsObjects();
+
 public: // Implementation of ConnectionChangePropagator
   /**
    * @copydoc ConnectionChangePropagator::AddObserver
@@ -460,9 +520,8 @@ private:
    */
   Renderer();
 
-
 private:
-  Integration::Graphics::Graphics* mGraphics; ///< Graphics interface object
+  Graphics::Controller*        mGraphicsController;               ///< Graphics controller
 
   CollectedUniformMap          mCollectedUniformMap[2];           ///< Uniform maps collected by the renderer
   TextureSet*                  mTextureSet;                       ///< The texture set this renderer uses. (Not owned)
@@ -472,30 +531,31 @@ private:
 
   StencilParameters            mStencilParameters;                ///< Struct containing all stencil related options
 
-  size_t                       mIndexedDrawFirstElement;          ///< first element index to be drawn using indexed draw
-  size_t                       mIndexedDrawElementsCount;         ///< number of elements to be drawn using indexed draw
+  uint32_t                     mIndexedDrawFirstElement;          ///< first element index to be drawn using indexed draw
+  uint32_t                     mIndexedDrawElementsCount;         ///< number of elements to be drawn using indexed draw
 
-  unsigned int                 mRegenerateUniformMap;             ///< 2 if the map should be regenerated, 1 if it should be copied.
-  unsigned int                 mResendFlag;                       ///< Indicate whether data should be resent to the renderer
+  uint32_t                     mRegenerateUniformMap;             ///< 2 if the map should be regenerated, 1 if it should be copied.
+  uint32_t                     mResendFlag;                       ///< Indicate whether data should be resent to the renderer
 
   BlendingOptions              mBlendOptions;                     ///< The blending options
 
-  DepthFunction::Type          mDepthFunction:3;                  ///< Local copy of the depth function
-  FaceCullingMode::Type        mFaceCullingMode:2;                ///< Local copy of the mode of face culling
+  DepthFunction::Type          mDepthFunction:4;                  ///< Local copy of the depth function
+  FaceCullingMode::Type        mFaceCullingMode:3;                ///< Local copy of the mode of face culling
 
-  BlendMode::Type              mBlendMode:2;                      ///< Local copy of the mode of blending
+  BlendMode::Type              mBlendMode:3;                      ///< Local copy of the mode of blending
 
-  DepthWriteMode::Type         mDepthWriteMode:2;                 ///< Local copy of the depth write mode
-  DepthTestMode::Type          mDepthTestMode:2;                  ///< Local copy of the depth test mode
+  DepthWriteMode::Type         mDepthWriteMode:3;                 ///< Local copy of the depth write mode
+  DepthTestMode::Type          mDepthTestMode:3;                  ///< Local copy of the depth test mode
+  DevelRenderer::Rendering::Type mRenderingBehavior:2;            ///< The rendering behavior
 
   bool                         mPremultipledAlphaEnabled:1;       ///< Flag indicating whether the Pre-multiplied Alpha Blending is required
 
-  std::vector<std::vector<char>> mUboMemory;                      ///< Transient memory allocated for each UBO
-  std::unique_ptr<Graphics::API::RenderCommand> mGfxRenderCommand;
-  std::unique_ptr<Graphics::API::Pipeline> mGfxPipeline;
+  RenderCommandContainer       mRenderCommands;
+  std::vector<Graphics::RenderCommand::TextureBinding> mTextureBindings;
+
 public:
   AnimatableProperty< float >  mOpacity;                          ///< The opacity value
-  int                          mDepthIndex;                       ///< Used only in PrepareRenderInstructions
+  int32_t                      mDepthIndex;                       ///< Used only in PrepareRenderInstructions
 };
 
 
@@ -505,7 +565,7 @@ inline void SetTexturesMessage( EventThreadServices& eventThreadServices, const
   typedef MessageValue1< Renderer, TextureSet* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &renderer, &Renderer::SetTextures, const_cast<TextureSet*>(&textureSet) );
@@ -516,21 +576,21 @@ inline void SetGeometryMessage( EventThreadServices& eventThreadServices, const
   typedef MessageValue1< Renderer, SceneGraph::Geometry* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &renderer, &Renderer::SetGeometry, const_cast<SceneGraph::Geometry*>(&geometry) );
 }
 
-inline void SetShaderMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, Shader& shader )
+inline void SetShaderMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, const Shader& shader )
 {
   typedef MessageValue1< Renderer, Shader* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &renderer, &Renderer::SetShader, &shader );
+  new (slot) LocalType( &renderer, &Renderer::SetShader, const_cast<Shader*>( &shader ) );
 }
 
 inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, int depthIndex )
@@ -538,7 +598,7 @@ inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, cons
   typedef MessageValue1< Renderer, int > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &renderer, &Renderer::SetDepthIndex, depthIndex );
@@ -549,7 +609,7 @@ inline void SetFaceCullingModeMessage( EventThreadServices& eventThreadServices,
   typedef MessageValue1< Renderer, FaceCullingMode::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetFaceCullingMode, faceCullingMode );
 }
@@ -559,17 +619,17 @@ inline void SetBlendModeMessage( EventThreadServices& eventThreadServices, const
   typedef MessageValue1< Renderer, BlendMode::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetBlendMode, blendingMode );
 }
 
-inline void SetBlendingOptionsMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, unsigned int options )
+inline void SetBlendingOptionsMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, uint32_t options )
 {
-  typedef MessageValue1< Renderer, unsigned int > LocalType;
+  typedef MessageValue1< Renderer, uint32_t > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetBlendingOptions, options );
 }
@@ -579,27 +639,27 @@ inline void SetBlendColorMessage( EventThreadServices& eventThreadServices, cons
   typedef MessageValue1< Renderer, Vector4 > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetBlendColor, blendColor );
 }
 
-inline void SetIndexedDrawFirstElementMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, size_t firstElement )
+inline void SetIndexedDrawFirstElementMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, uint32_t firstElement )
 {
-  typedef MessageValue1< Renderer, size_t > LocalType;
+  typedef MessageValue1< Renderer, uint32_t > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetIndexedDrawFirstElement, firstElement );
 }
 
-inline void SetIndexedDrawElementsCountMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, size_t elementsCount )
+inline void SetIndexedDrawElementsCountMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, uint32_t elementsCount )
 {
-  typedef MessageValue1< Renderer, size_t > LocalType;
+  typedef MessageValue1< Renderer, uint32_t > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetIndexedDrawElementsCount, elementsCount );
 }
@@ -609,7 +669,7 @@ inline void SetEnablePreMultipliedAlphaMessage( EventThreadServices& eventThread
   typedef MessageValue1< Renderer, bool > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::EnablePreMultipliedAlpha, preMultiplied );
 }
@@ -619,7 +679,7 @@ inline void SetDepthWriteModeMessage( EventThreadServices& eventThreadServices,
   typedef MessageValue1< Renderer, DepthWriteMode::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetDepthWriteMode, depthWriteMode );
 }
@@ -629,7 +689,7 @@ inline void SetDepthTestModeMessage( EventThreadServices& eventThreadServices, c
   typedef MessageValue1< Renderer, DepthTestMode::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetDepthTestMode, depthTestMode );
 }
@@ -639,7 +699,7 @@ inline void SetDepthFunctionMessage( EventThreadServices& eventThreadServices, c
   typedef MessageValue1< Renderer, DepthFunction::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetDepthFunction, depthFunction );
 }
@@ -649,7 +709,7 @@ inline void SetRenderModeMessage( EventThreadServices& eventThreadServices, cons
   typedef MessageValue1< Renderer, RenderMode::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetRenderMode, mode );
 }
@@ -659,7 +719,7 @@ inline void SetStencilFunctionMessage( EventThreadServices& eventThreadServices,
   typedef MessageValue1< Renderer, StencilFunction::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetStencilFunction, stencilFunction );
 }
@@ -669,7 +729,7 @@ inline void SetStencilFunctionMaskMessage( EventThreadServices& eventThreadServi
   typedef MessageValue1< Renderer, int > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetStencilFunctionMask, mask );
 }
@@ -679,7 +739,7 @@ inline void SetStencilFunctionReferenceMessage( EventThreadServices& eventThread
   typedef MessageValue1< Renderer, int > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetStencilFunctionReference, stencilFunctionReference );
 }
@@ -689,7 +749,7 @@ inline void SetStencilMaskMessage( EventThreadServices& eventThreadServices, con
   typedef MessageValue1< Renderer, int > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetStencilMask, stencilMask );
 }
@@ -699,7 +759,7 @@ inline void SetStencilOperationOnFailMessage( EventThreadServices& eventThreadSe
   typedef MessageValue1< Renderer, StencilOperation::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetStencilOperationOnFail, stencilOperation );
 }
@@ -709,7 +769,7 @@ inline void SetStencilOperationOnZFailMessage( EventThreadServices& eventThreadS
   typedef MessageValue1< Renderer, StencilOperation::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetStencilOperationOnZFail, stencilOperation );
 }
@@ -719,7 +779,7 @@ inline void SetStencilOperationOnZPassMessage( EventThreadServices& eventThreadS
   typedef MessageValue1< Renderer, StencilOperation::Type > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::SetStencilOperationOnZPass, stencilOperation );
 }
@@ -729,11 +789,21 @@ inline void BakeOpacityMessage( EventThreadServices& eventThreadServices, const
   typedef MessageDoubleBuffered1< Renderer, float > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   new (slot) LocalType( &renderer, &Renderer::BakeOpacity, opacity );
 }
 
+inline void SetRenderingBehaviorMessage( EventThreadServices& eventThreadServices, const Renderer& renderer, DevelRenderer::Rendering::Type renderingBehavior )
+{
+  using LocalType = MessageValue1< Renderer, DevelRenderer::Rendering::Type >;
+
+  // Reserve some memory inside the message queue
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+
+  new (slot) LocalType( &renderer, &Renderer::SetRenderingBehavior, renderingBehavior );
+}
+
 } // namespace SceneGraph
 } // namespace Internal
 } // namespace Dali
index de72672..0acacc1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_SAMPLER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <dali/public-api/rendering/sampler.h>
 #include <dali/internal/common/message.h>
 #include <dali/internal/event/common/event-thread-services.h>
+#include <dali/graphics-api/graphics-api-controller.h>
+#include <dali/graphics-api/graphics-api-types.h>
+
+#include <memory>
+
 
 namespace Dali
 {
@@ -39,11 +44,14 @@ struct Sampler
    * Constructor
    */
   Sampler()
-  :mMinificationFilter(FilterMode::DEFAULT),
-   mMagnificationFilter(FilterMode::DEFAULT),
-   mSWrapMode(WrapMode::DEFAULT),
-   mTWrapMode(WrapMode::DEFAULT),
-   mRWrapMode(WrapMode::DEFAULT)
+  : mGraphicsController( nullptr ),
+    mGfxSampler( nullptr ),
+    mMinificationFilter(FilterMode::DEFAULT),
+    mMagnificationFilter(FilterMode::DEFAULT),
+    mSWrapMode(WrapMode::DEFAULT),
+    mTWrapMode(WrapMode::DEFAULT),
+    mRWrapMode(WrapMode::DEFAULT),
+    mIsDirty(true)
   {}
 
   /**
@@ -52,7 +60,6 @@ struct Sampler
   ~Sampler()
   {}
 
-
   /**
    * Sets the filter modes for an existing sampler
    * @param[in] sampler The sampler
@@ -63,6 +70,7 @@ struct Sampler
   {
     mMinificationFilter = static_cast<Dali::FilterMode::Type>(minFilterMode);
     mMagnificationFilter = static_cast<Dali::FilterMode::Type>(magFilterMode );
+    mIsDirty = true;
   }
 
   /**
@@ -77,6 +85,7 @@ struct Sampler
     mRWrapMode = static_cast<Dali::WrapMode::Type>(rWrapMode);
     mSWrapMode = static_cast<Dali::WrapMode::Type>(sWrapMode);
     mTWrapMode = static_cast<Dali::WrapMode::Type>(tWrapMode);
+    mIsDirty = true;
   }
 
   bool operator==(const Sampler& rhs) const
@@ -93,11 +102,83 @@ struct Sampler
     return !(*this == rhs);
   }
 
+  /**
+   * Returns Graphics API sampler object
+   * @return Pointer to API sampler or nullptr
+   */
+  const Dali::Graphics::Sampler* GetGfxObject() const
+  {
+    return mGfxSampler.get();
+  }
+
+  void DestroyGraphicsObjects()
+  {
+    mGfxSampler.reset();
+  }
+
+  inline Graphics::SamplerAddressMode GetGfxSamplerAddressMode( WrapMode mode ) const
+  {
+    switch(mode)
+    {
+      case WrapMode::REPEAT: return Graphics::SamplerAddressMode::REPEAT;
+      case WrapMode::MIRRORED_REPEAT: return Graphics::SamplerAddressMode::MIRRORED_REPEAT;
+      case WrapMode::CLAMP_TO_EDGE: return Graphics::SamplerAddressMode::CLAMP_TO_EDGE;
+      case WrapMode::DEFAULT: return Graphics::SamplerAddressMode::CLAMP_TO_EDGE;
+    }
+    return {};
+  }
+
+  inline Graphics::SamplerMipmapMode GetGfxSamplerMipmapMode( FilterMode mode ) const
+  {
+    switch(mode)
+    {
+      case FilterMode::LINEAR_MIPMAP_LINEAR: return Graphics::SamplerMipmapMode::LINEAR;
+      case FilterMode::NEAREST_MIPMAP_LINEAR: return Graphics::SamplerMipmapMode::LINEAR;
+      case FilterMode::NEAREST_MIPMAP_NEAREST: return Graphics::SamplerMipmapMode::NEAREST;
+      case FilterMode::LINEAR_MIPMAP_NEAREST: return Graphics::SamplerMipmapMode::NEAREST;
+      case FilterMode::DEFAULT: return Graphics::SamplerMipmapMode::LINEAR;
+      default: return {};
+    }
+    return {};
+  }
+
+  inline Graphics::SamplerFilter GetGfxFilter( FilterMode mode ) const
+  {
+    switch(mode)
+    {
+      case FilterMode::LINEAR: return Graphics::SamplerFilter::LINEAR;
+      case FilterMode::NEAREST: return Graphics::SamplerFilter::NEAREST;
+      case FilterMode::DEFAULT: return Graphics::SamplerFilter::LINEAR;
+      case FilterMode::NONE: return Graphics::SamplerFilter::NEAREST;
+      default: return {};
+    }
+    return {};
+  }
+
+  void Initialize( Graphics::Controller& graphicsController )
+  {
+    mGraphicsController = &graphicsController;
+    mGfxSampler.reset( nullptr );
+    mGfxSampler = graphicsController.CreateSampler(
+                    graphicsController.GetSamplerFactory()
+                    .SetMinFilter( GetGfxFilter( mMinificationFilter ) )
+                    .SetMagFilter( GetGfxFilter( mMagnificationFilter ) )
+                    .SetAddressModeU( GetGfxSamplerAddressMode( mSWrapMode ) )
+                    .SetAddressModeV( GetGfxSamplerAddressMode( mTWrapMode ) )
+                    .SetAddressModeW( GetGfxSamplerAddressMode( mRWrapMode ) )
+                    .SetMipmapMode( GetGfxSamplerMipmapMode( mMinificationFilter ) )
+                    );
+  }
+
+  Graphics::Controller* mGraphicsController;   ///< Graphics interface
+  std::unique_ptr<Dali::Graphics::Sampler> mGfxSampler; ///< Graphics Sampler object, default sampler is nullptr
+
   FilterMode  mMinificationFilter   : 4;    ///< The minify filter
   FilterMode  mMagnificationFilter  : 4;    ///< The magnify filter
   WrapMode    mSWrapMode            : 4;    ///< The horizontal wrap mode
   WrapMode    mTWrapMode            : 4;    ///< The vertical wrap mode
   WrapMode    mRWrapMode            : 4;    ///< The vertical wrap mode
+  bool        mIsDirty              : 1;    ///< The 'dirty' flag
 };
 
 
index a54665d..e655281 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // CLASS HEADER
 #include <dali/internal/update/rendering/scene-graph-shader.h>
+#include <dali/graphics-api/graphics-api-shader-details.h>
+
+#include <tuple>
+#include <map>
 
 namespace Dali
 {
@@ -27,8 +31,27 @@ namespace Internal
 namespace SceneGraph
 {
 
+/**
+ * List of all default uniforms used for quicker lookup
+ */
+namespace
+{
+
+std::array<size_t, 8> DEFAULT_UNIFORM_HASHTABLE = {
+  CalculateHash( std::string("uModelMatrix") ),
+  CalculateHash( std::string("uMvpMatrix") ),
+  CalculateHash( std::string("uViewMatrix") ),
+  CalculateHash( std::string("uModelView") ),
+  CalculateHash( std::string("uNormalMatrix") ),
+  CalculateHash( std::string("uProjection") ),
+  CalculateHash( std::string("uSize") ),
+  CalculateHash( std::string("uColor") )
+};
+
+}
+
 Shader::Shader( Dali::Shader::Hint::Value& hints )
-: mGraphics( nullptr ),
+: mGraphicsController( nullptr ),
   mGraphicsShader( nullptr ),
   mShaderCache( nullptr ),
   mHints( hints ),
@@ -42,23 +65,22 @@ Shader::~Shader()
   mConnectionObservers.Destroy( *this );
 }
 
-void Shader::Initialize( Integration::Graphics::Graphics& graphics, ShaderCache& shaderCache )
+void Shader::Initialize( Graphics::Controller& graphicsController, ShaderCache& shaderCache )
 {
-  mGraphics = &graphics;
+  mGraphicsController = &graphicsController;
   mShaderCache = &shaderCache;
 }
 
-const Graphics::API::Accessor<Graphics::API::Shader>& Shader::GetGfxObject() const
+const Graphics::Shader* Shader::GetGfxObject() const
 {
   return mGraphicsShader;
 }
 
-Graphics::API::Accessor<Graphics::API::Shader>& Shader::GetGfxObject()
+Graphics::Shader* Shader::GetGfxObject()
 {
   return mGraphicsShader;
 }
 
-
 void Shader::AddConnectionObserver( ConnectionChangePropagator::Observer& observer )
 {
   mConnectionObservers.Add(observer);
@@ -78,16 +100,142 @@ void Shader::UniformMappingsChanged( const UniformMap& mappings )
 
 void Shader::SetShaderProgram( Internal::ShaderDataPtr shaderData, bool modifiesGeometry )
 {
-  // TODO: for now we will use hardcoded binary SPIRV shaders which will replace anything
-  // that is passed by the caller
+  // @todo: we should handle non-binary shaders as well in the future
   if (shaderData->GetType() == ShaderData::Type::BINARY)
   {
-    mGraphicsShader = mShaderCache->GetShader(
-      Graphics::API::ShaderDetails::ShaderSource(shaderData->GetShaderForStage(ShaderData::ShaderStage::VERTEX)),
-      Graphics::API::ShaderDetails::ShaderSource(shaderData->GetShaderForStage(ShaderData::ShaderStage::FRAGMENT)));
+    mGraphicsShader = &mShaderCache->GetShader(
+      Graphics::ShaderDetails::ShaderSource(shaderData->GetShaderForStage(ShaderData::ShaderStage::VERTEX)),
+      Graphics::ShaderDetails::ShaderSource(shaderData->GetShaderForStage(ShaderData::ShaderStage::FRAGMENT)));
+  }
+
+  if( mGraphicsShader )
+  {
+    BuildReflection();
+  }
+}
+
+void Shader::DestroyGraphicsObjects()
+{
+  mGraphicsShader = nullptr;
+}
+
+void Shader::BuildReflection()
+{
+  if( mGraphicsShader )
+  {
+    mReflectionDefaultUniforms.clear();
+    mReflectionDefaultUniforms.resize( DEFAULT_UNIFORM_HASHTABLE.size() );
+
+    auto uniformBlockCount = mGraphicsShader->GetUniformBlockCount();
+
+    // add uniform block fields
+    for( auto i = 0u; i < uniformBlockCount; ++i )
+    {
+      Graphics::ShaderDetails::UniformBlockInfo uboInfo;
+      mGraphicsShader->GetUniformBlock( i, uboInfo );
+
+      // for each member store data
+      for( const auto& item : uboInfo.members )
+      {
+        auto hashValue = CalculateHash( item.name );
+        mReflection.emplace_back( ReflectionUniformInfo{ hashValue, false, mGraphicsShader, item } );
+
+        // update buffer index
+        mReflection.back().uniformInfo.bufferIndex = i;
+
+        // Update default uniforms
+        for( auto i = 0u; i < DEFAULT_UNIFORM_HASHTABLE.size(); ++i )
+        {
+          if( hashValue == DEFAULT_UNIFORM_HASHTABLE[i] )
+          {
+            mReflectionDefaultUniforms[i] = mReflection.back();
+            break;
+          }
+        }
+      }
+    }
+
+    // add samplers
+    auto samplers = mGraphicsShader->GetSamplers();
+    for( const auto& sampler : samplers )
+    {
+      mReflection.emplace_back( ReflectionUniformInfo{ CalculateHash( sampler.name ), false, mGraphicsShader, sampler } );
+    }
+
+    // check for potential collisions
+    std::map<size_t, bool> hashTest;
+    bool hasCollisions( false );
+    for( auto&& item : mReflection )
+    {
+      if( hashTest.find( item.hashValue ) == hashTest.end() )
+      {
+        hashTest[ item.hashValue ] = false;
+      }
+      else
+      {
+        hashTest[ item.hashValue ] = true;
+        hasCollisions = true;
+      }
+    }
+
+    // update collision flag for further use
+    if( hasCollisions )
+    {
+      for( auto&& item : mReflection )
+      {
+        item.hasCollision = hashTest[ item.hashValue ];
+      }
+    }
   }
 }
 
+bool Shader::GetUniform( const std::string& name, size_t hashedName, Graphics::ShaderDetails::UniformInfo& out ) const
+{
+  if( mReflection.empty() )
+  {
+    return false;
+  }
+
+  hashedName = !hashedName ? CalculateHash( name ) : hashedName;
+
+  for( const ReflectionUniformInfo& item : mReflection )
+  {
+    if( item.hashValue == hashedName )
+    {
+      if( !item.hasCollision || item.uniformInfo.name == name )
+      {
+        out = item.uniformInfo;
+        return true;
+      }
+      else
+      {
+        return false;
+      }
+    }
+  }
+  return false;
+}
+
+bool Shader::GetDefaultUniform( DefaultUniformIndex defaultUniformIndex, Graphics::ShaderDetails::UniformInfo& out ) const
+{
+  auto& value = mReflectionDefaultUniforms[static_cast<uint32_t>(defaultUniformIndex)];
+  if( !value.graphicsShader )
+  {
+    return false;
+  }
+  out = value.uniformInfo;
+  return true;
+}
+
+const Graphics::ShaderDetails::UniformInfo* Shader::GetDefaultUniform( DefaultUniformIndex defaultUniformIndex ) const
+{
+  const auto value = &mReflectionDefaultUniforms[static_cast<uint32_t>(defaultUniformIndex)];
+  if( !value->graphicsShader )
+  {
+    return nullptr;
+  }
+  return &value->uniformInfo;
+}
 
 } // namespace SceneGraph
 
index 7ca7f93..2fc38c3 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_SCENE_GRAPH_SHADER_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 // INTERNAL INCLUDES
 #include <dali/graphics-api/graphics-api-controller.h>
-#include <dali/graphics-api/graphics-api-accessor.h>
 #include <dali/graphics-api/graphics-api-shader.h>
 
-#include <dali/integration-api/graphics/graphics.h>
-
 #include <dali/internal/common/message.h>
 #include <dali/internal/common/shader-data.h>
 #include <dali/internal/event/common/event-thread-services.h>
@@ -52,6 +49,21 @@ class Shader : public PropertyOwner, public UniformMap::Observer
 public:
 
   /**
+   * Indices of default uniforms
+   */
+  enum class DefaultUniformIndex
+  {
+    MODEL_MATRIX = 0,
+    MVP_MATRIX,
+    VIEW_MATRIX,
+    MODEL_VIEW_MATRIX,
+    NORMAL_MATRIX,
+    PROJECTION_MATRIX,
+    SIZE,
+    COLOR
+  };
+
+  /**
    * Devel constructor
    * @param hints
    */
@@ -68,7 +80,7 @@ public:
    * @param[in] graphics The Graphics API
    * @param[in] shaderCache A cache
    */
-  void Initialize( Integration::Graphics::Graphics& graphics, ShaderCache& shaderCache );
+  void Initialize( Graphics::Controller& graphics, ShaderCache& shaderCache );
 
   /**
    * Query whether a shader hint is set.
@@ -93,13 +105,47 @@ public:
    * Get the graphics shader object
    * @return the graphics shader object
    */
-  const Graphics::API::Accessor<Graphics::API::Shader>& GetGfxObject() const;
+  const Graphics::Shader* GetGfxObject() const;
 
   /**
    * Get the graphics shader object
    * @return the graphics shader object
    */
-  Graphics::API::Accessor<Graphics::API::Shader>& GetGfxObject();
+  Graphics::Shader* GetGfxObject();
+
+  /**
+   * Destroy any graphics objects owned by this scene graph object
+   */
+  void DestroyGraphicsObjects();
+
+  /**
+   * Retrieves uniform data.
+   * The lookup tries to minimise string comparisons. Ideally, when the hashedName is known
+   * and there are no hash collisions in the reflection it's the most optimal case.
+   *
+   * @param name Name of uniform
+   * @param hashedName Hash value from name or 0 if unknown
+   * @param arrayIndex Index within array elements or 0 if the uniform is not an array
+   * @param out Reference to output structure
+   *
+   * @return False when uniform is not found or due to hash collision the result is ambiguous
+   */
+  bool GetUniform( const std::string& name, size_t hashedName, Graphics::ShaderDetails::UniformInfo& out ) const;
+
+  /**
+   * Retrieves default uniform
+   * @param[in] defaultUniformIndex index of the uniform
+   * @param[out] outputUniformInfo the reference to UniformInfo object
+   * @return True is uniform found, false otherwise
+   */
+  bool GetDefaultUniform( DefaultUniformIndex defaultUniformIndex, Graphics::ShaderDetails::UniformInfo& outputUniformInfo ) const;
+
+  /**
+   * Retrievs default uniform
+   * @param[in] defaultUniformIndex index of the uniform
+   * @return Valid pointer to the UniformInfo object or nullptr
+   */
+  const Graphics::ShaderDetails::UniformInfo* GetDefaultUniform( DefaultUniformIndex defaultUniformIndex ) const;
 
 public: // Messages
   /**
@@ -128,13 +174,36 @@ public: // UniformMap::Observer
    */
   virtual void UniformMappingsChanged( const UniformMap& mappings );
 
+private:
+
+  /**
+   * Struct ReflectionUniformInfo
+   * Contains details of a single uniform buffer field and/or sampler.
+   */
+  struct ReflectionUniformInfo
+  {
+    size_t                               hashValue { 0 };
+    bool                                 hasCollision { false };
+    Graphics::Shader*                    graphicsShader { nullptr };
+    Graphics::ShaderDetails::UniformInfo uniformInfo {};
+  };
+
+  /**
+   * Build optimized shader reflection of uniforms
+   */
+  void BuildReflection();
 
 private: // Data
-  Integration::Graphics::Graphics*               mGraphics; ///< Graphics interface object
-  Graphics::API::Accessor<Graphics::API::Shader> mGraphicsShader; ///< The graphics object
-  ShaderCache*                                   mShaderCache;
-  Dali::Shader::Hint::Value                      mHints; ///< Hints for the shader
-  ConnectionChangePropagator                     mConnectionObservers; ///< Watch for connection changes
+  Graphics::Controller*           mGraphicsController; ///< Graphics interface object
+  Graphics::Shader*               mGraphicsShader; ///< The graphics object ( owned by cache )
+  ShaderCache*                    mShaderCache;
+  Dali::Shader::Hint::Value       mHints; ///< Hints for the shader
+  ConnectionChangePropagator      mConnectionObservers; ///< Watch for connection changes
+
+  using UniformReflectionContainer = std::vector< ReflectionUniformInfo >;
+
+  UniformReflectionContainer      mReflection; ///< Contains reflection build per shader
+  UniformReflectionContainer      mReflectionDefaultUniforms; ///< Contains default uniforms
 };
 
 
index dd200f9..d466cbc 100644 (file)
 #include <dali/internal/common/memory-pool-object-allocator.h>
 #include <dali/internal/update/rendering/scene-graph-renderer.h>
 #include <dali/internal/update/rendering/scene-graph-texture.h>
+#include <dali/integration-api/debug.h>
 
 namespace //Unnamed namespace
 {
 //Memory pool used to allocate new texture sets. Memory used by this pool will be released when shutting down DALi
 Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::TextureSet> gTextureSetMemoryPool;
+
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gTextureFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TEXTURE");
+#endif
 }
 
 namespace Dali
@@ -52,10 +57,9 @@ TextureSet::TextureSet()
 
 TextureSet::~TextureSet()
 {
-  size_t rendererCount = mRenderers.Size();
-  for( size_t i(0); i<rendererCount; ++i )
+  for( auto&& renderer : mRenderers )
   {
-    mRenderers[i]->TextureSetDeleted();
+    renderer->TextureSetDeleted();
   }
 }
 
@@ -64,13 +68,13 @@ void TextureSet::operator delete( void* ptr )
   gTextureSetMemoryPool.FreeThreadSafe( static_cast<TextureSet*>( ptr ) );
 }
 
-void TextureSet::SetSampler( size_t index, SceneGraph::Sampler* sampler )
+void TextureSet::SetSampler( uint32_t index, SceneGraph::Sampler* sampler )
 {
-  size_t samplerCount( mSamplers.Size() );
+  const uint32_t samplerCount = static_cast<uint32_t>( mSamplers.Size() );
   if( samplerCount < index + 1 )
   {
     mSamplers.Resize( index + 1 );
-    for( size_t i(samplerCount); i<=index; ++i )
+    for( uint32_t i(samplerCount); i<=index; ++i )
     {
       mSamplers[i] = NULL;
     }
@@ -80,9 +84,12 @@ void TextureSet::SetSampler( size_t index, SceneGraph::Sampler* sampler )
   NotifyChangeToRenderers();
 }
 
-void TextureSet::SetTexture( size_t index, SceneGraph::Texture* texture )
+void TextureSet::SetTexture( uint32_t index, SceneGraph::Texture* texture )
 {
-  const size_t textureCount( mTextures.Size() );
+  DALI_LOG_INFO( gTextureFilter, Debug::General, "SG::TS(%p)::SetTexture( SG::T:%p )\n  GfxTexture:%p\n",
+                 this, texture, texture?texture->GetGfxObject():nullptr );
+
+  const uint32_t textureCount = static_cast<uint32_t>( mTextures.Size() );
   if( textureCount < index + 1 )
   {
     mTextures.Resize( index + 1 );
@@ -94,7 +101,7 @@ void TextureSet::SetTexture( size_t index, SceneGraph::Texture* texture )
       samplerExist = false;
     }
 
-    for( size_t i(textureCount); i<=index; ++i )
+    for( uint32_t i(textureCount); i<=index; ++i )
     {
       mTextures[i] = 0;
 
@@ -121,10 +128,9 @@ bool TextureSet::HasAlpha() const
 
 void TextureSet::AddObserver( Renderer* renderer )
 {
-  size_t rendererCount( mRenderers.Size() );
-  for( size_t i(0); i<rendererCount; ++i )
+  for( auto&& element : mRenderers )
   {
-    if( mRenderers[i] == renderer )
+    if( element == renderer )
     {
       //Renderer already in the list
       return;
@@ -136,12 +142,11 @@ void TextureSet::AddObserver( Renderer* renderer )
 
 void TextureSet::RemoveObserver( Renderer* renderer )
 {
-  size_t rendererCount( mRenderers.Size() );
-  for( size_t i(0); i<rendererCount; ++i )
+  for( auto&& iter = mRenderers.Begin(), end = mRenderers.End(); iter != end; ++iter )
   {
-    if( mRenderers[i] == renderer )
+    if( *iter == renderer )
     {
-      mRenderers.Remove( mRenderers.Begin() + i );
+      mRenderers.Remove( iter );
       return;
     }
   }
@@ -149,10 +154,9 @@ void TextureSet::RemoveObserver( Renderer* renderer )
 
 void TextureSet::NotifyChangeToRenderers()
 {
-  size_t rendererCount = mRenderers.Size();
-  for( size_t i(0); i<rendererCount; ++i )
+  for( auto&& element : mRenderers )
   {
-    mRenderers[i]->TextureSetChanged();
+    element->TextureSetChanged();
   }
 }
 
index 96445f0..ba30ac6 100644 (file)
@@ -44,9 +44,9 @@ public:
   static TextureSet* New();
 
   /**
-   * Destructor
+   * Destructor. Not virtual as not a base class and not inheriting anything
    */
-  virtual ~TextureSet();
+  ~TextureSet();
 
   /**
    * Overriden delete operator
@@ -59,14 +59,14 @@ public:
    * @param[in] index The index of the texture
    * @param[in] sampler The sampler to be used by the texture
    */
-  void SetSampler( size_t index, SceneGraph::Sampler* sampler );
+  void SetSampler( uint32_t index, SceneGraph::Sampler* sampler );
 
   /**
    * Set the texture at position "index"
    * @param[in] index The index of the texture
    * @param[in] texture The texture
    */
-  void SetTexture( size_t index, SceneGraph::Texture* texture );
+  void SetTexture( uint32_t index, SceneGraph::Texture* texture );
 
   /**
    * Return whether any texture in the texture set has an alpha channel
@@ -94,7 +94,7 @@ public:
    * @param[in] index The index of the texture in the textures array
    * @return the sampler used by the texture
    */
-  SceneGraph::Sampler* GetTextureSampler( size_t index )
+  SceneGraph::Sampler* GetTextureSampler( uint32_t index )
   {
     return mSamplers[index];
   }
@@ -103,9 +103,9 @@ public:
    * Get the number of Textures in the texture set
    * @return The number of Textures
    */
-  size_t GetTextureCount()
+  uint32_t GetTextureCount()
   {
-    return mTextures.Size();
+    return static_cast<uint32_t>( mTextures.Size() );
   }
 
   /**
@@ -113,7 +113,7 @@ public:
    * @param[in] index The index of the texture in the textures array
    * @return the pointer to the Texture in that position
    */
-  SceneGraph::Texture* GetTexture( size_t index )
+  SceneGraph::Texture* GetTexture( uint32_t index )
   {
     return mTextures[index];
   }
@@ -135,27 +135,27 @@ private: // Data
 
   Vector< SceneGraph::Sampler* >  mSamplers;  ///< List of samplers used by each texture. Not owned
   Vector< SceneGraph::Texture* >  mTextures;  ///< List of Textures. Not owned
-  Vector<Renderer*>               mRenderers; ///< List of renderers using the TextureSet
-  bool                            mHasAlpha;  ///< if any of the textures has an alpha channel
+  Vector<Renderer*>               mRenderers;                   ///< List of renderers using the TextureSet
+  bool                            mHasAlpha;                    ///< if any of the textures has an alpha channel
 };
 
-inline void SetTextureMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, size_t index, SceneGraph::Texture* texture )
+inline void SetTextureMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, uint32_t index, SceneGraph::Texture* texture )
 {
-  typedef MessageValue2< TextureSet, size_t, SceneGraph::Texture* > LocalType;
+  typedef MessageValue2< TextureSet, uint32_t, SceneGraph::Texture* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &textureSet, &TextureSet::SetTexture, index, texture );
 }
 
-inline void SetSamplerMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, size_t index, SceneGraph::Sampler* sampler )
+inline void SetSamplerMessage( EventThreadServices& eventThreadServices, const TextureSet& textureSet, uint32_t index, SceneGraph::Sampler* sampler )
 {
-  typedef MessageValue2< TextureSet, size_t, SceneGraph::Sampler* > LocalType;
+  typedef MessageValue2< TextureSet, uint32_t, SceneGraph::Sampler* > LocalType;
 
   // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+  uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
   new (slot) LocalType( &textureSet, &TextureSet::SetSampler, index, sampler );
index a7921ed..f659d95 100644 (file)
 #include <dali/public-api/images/image-operations.h> // Dali::ImageDimensions
 #include <dali/public-api/rendering/sampler.h>
 #include <dali/public-api/rendering/texture.h>
+#include <dali/devel-api/images/native-image-interface-extension.h>
 #include <dali/integration-api/debug.h>
 #include <dali/internal/event/rendering/texture-impl.h>
 #include <dali/internal/update/rendering/scene-graph-sampler.h>
-#include <dali/graphics-api/graphics-api-accessor.h>
 #include <dali/graphics-api/graphics-api-controller.h>
 #include <dali/graphics-api/graphics-api-texture.h>
 #include <dali/graphics-api/graphics-api-texture-details.h>
@@ -41,6 +41,9 @@ namespace SceneGraph
 
 namespace
 {
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gTextureFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TEXTURE");
+#endif
 
 /**
  * @brief Whether specified pixel format is compressed.
@@ -120,15 +123,156 @@ bool IsCompressedFormat(Pixel::Format pixelFormat)
 
   return false;
 }
+
+/**
+ * Converts DALi pixel format to Graphics::Format
+ * @param format
+ * @return
+ */
+constexpr Graphics::Format ConvertPixelFormat( Pixel::Format format )
+{
+  switch( format )
+  {
+    case Pixel::INVALID:
+      return Graphics::Format::UNDEFINED;
+    case Pixel::A8:
+      return Graphics::Format::R8_UNORM;
+    case Pixel::L8:
+      return Graphics::Format::L8;
+    case Pixel::LA88:
+      return Graphics::Format::L8A8;
+    case Pixel::RGB565:
+      return Graphics::Format::R5G6B5_UNORM_PACK16;
+    case Pixel::BGR565:
+      return Graphics::Format::B5G6R5_UNORM_PACK16;
+    case Pixel::RGBA4444:
+      return Graphics::Format::R4G4B4A4_UNORM_PACK16;
+    case Pixel::BGRA4444:
+      return Graphics::Format::B4G4R4A4_UNORM_PACK16;
+    case Pixel::RGBA5551:
+      return Graphics::Format::R5G5B5A1_UNORM_PACK16;
+    case Pixel::BGRA5551:
+      return Graphics::Format::B5G5R5A1_UNORM_PACK16;
+    case Pixel::RGB888:
+      return Graphics::Format::R8G8B8_UNORM;
+    case Pixel::RGB8888:
+      return Graphics::Format::R8G8B8A8_UNORM;
+    case Pixel::BGR8888:
+      return Graphics::Format::B8G8R8A8_UNORM;
+    case Pixel::RGBA8888:
+      return Graphics::Format::R8G8B8A8_UNORM;
+    case Pixel::BGRA8888:
+      return Graphics::Format::B8G8R8A8_UNORM;
+
+    // EAC
+    case Pixel::COMPRESSED_R11_EAC:
+      return Graphics::Format::EAC_R11_UNORM_BLOCK;
+    case Pixel::COMPRESSED_SIGNED_R11_EAC:
+      return Graphics::Format::EAC_R11_SNORM_BLOCK;
+    case Pixel::COMPRESSED_RG11_EAC:
+      return Graphics::Format::EAC_R11G11_UNORM_BLOCK;
+    case Pixel::COMPRESSED_SIGNED_RG11_EAC:
+      return Graphics::Format::EAC_R11G11_SNORM_BLOCK;
+
+    // ETC
+    case Pixel::COMPRESSED_RGB8_ETC2:
+      return Graphics::Format::ETC2_R8G8B8_UNORM_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ETC2:
+      return Graphics::Format::ETC2_R8G8B8_SRGB_BLOCK;
+
+    case Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+      return Graphics::Format::ETC2_R8G8B8A1_UNORM_BLOCK; // no 'punchthrough' format
+
+    case Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+      return Graphics::Format::ETC2_R8G8B8A1_SRGB_BLOCK; // no 'punchthrough' format
+
+    case Pixel::COMPRESSED_RGBA8_ETC2_EAC:
+      return Graphics::Format::ETC2_R8G8B8_UNORM_BLOCK; // doesn't seem to map onto any format
+
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
+      return Graphics::Format::ETC2_R8G8B8A8_SRGB_BLOCK; // doesn't seem to map onto any format
+
+    case Pixel::COMPRESSED_RGB8_ETC1:
+      return Graphics::Format::ETC2_R8G8B8_UNORM_BLOCK; // doesn't seem to be supported at all
+
+    case Pixel::COMPRESSED_RGB_PVRTC_4BPPV1:
+      return Graphics::Format::PVRTC1_4BPP_UNORM_BLOCK_IMG; // or SRGB?
+
+    // ASTC
+    case Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR:
+      return Graphics::Format::ASTC_4x4_UNORM_BLOCK; // or SRGB?
+    case Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR:
+      return Graphics::Format::ASTC_5x4_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR:
+      return Graphics::Format::ASTC_5x5_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR:
+      return Graphics::Format::ASTC_6x5_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR:
+      return Graphics::Format::ASTC_6x6_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR:
+      return Graphics::Format::ASTC_8x5_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR:
+      return Graphics::Format::ASTC_8x6_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR:
+      return Graphics::Format::ASTC_8x8_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR:
+      return Graphics::Format::ASTC_10x5_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR:
+      return Graphics::Format::ASTC_10x6_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR:
+      return Graphics::Format::ASTC_10x8_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR:
+      return Graphics::Format::ASTC_10x10_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR:
+      return Graphics::Format::ASTC_12x10_UNORM_BLOCK;
+    case Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR:
+      return Graphics::Format::ASTC_12x12_UNORM_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
+
+      return Graphics::Format::ASTC_4x4_SRGB_BLOCK; // not type with alpha, but likely to use SRGB
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
+      return Graphics::Format::ASTC_5x4_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
+      return Graphics::Format::ASTC_5x5_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
+      return Graphics::Format::ASTC_6x5_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
+      return Graphics::Format::ASTC_6x6_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
+      return Graphics::Format::ASTC_8x5_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
+      return Graphics::Format::ASTC_8x6_UNORM_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
+      return Graphics::Format::ASTC_8x8_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
+      return Graphics::Format::ASTC_10x5_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
+      return Graphics::Format::ASTC_10x6_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
+      return Graphics::Format::ASTC_10x8_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
+      return Graphics::Format::ASTC_10x10_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
+      return Graphics::Format::ASTC_12x10_SRGB_BLOCK;
+    case Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
+      return Graphics::Format::ASTC_12x12_SRGB_BLOCK;
+    case Pixel::RGB16F:
+      return Graphics::Format::R16G16B16_SFLOAT;
+    case Pixel::RGB32F:
+      return Graphics::Format::R32G32B32_SFLOAT;
+  }
+  return Graphics::Format::UNDEFINED;
+}
+
 } //Unnamed namespace
 
 
 Texture::Texture( Type type, Pixel::Format format, ImageDimensions size )
-: mGraphics( nullptr ),
+: mGraphicsController( nullptr ),
   mGraphicsTexture( nullptr ),
   mNativeImage(),
   mSampler(),
-  mId( 0 ),
+  mFormat( format ),
   mWidth( size.GetWidth() ),
   mHeight( size.GetHeight() ),
   mMaxMipMapLevel( 0 ),
@@ -139,13 +283,13 @@ Texture::Texture( Type type, Pixel::Format format, ImageDimensions size )
 }
 
 Texture::Texture( NativeImageInterfacePtr nativeImageInterface )
-: mGraphics( nullptr ),
+: mGraphicsController( nullptr ),
   mGraphicsTexture( nullptr ),
   mNativeImage( nativeImageInterface ),
   mSampler(),
-  mId( 0 ),
-  mWidth( nativeImageInterface->GetWidth() ),
-  mHeight( nativeImageInterface->GetHeight() ),
+  mFormat( Pixel::RGBA8888 ),
+  mWidth( uint16_t(nativeImageInterface->GetWidth()) ),
+  mHeight( uint16_t(nativeImageInterface->GetHeight()) ),
   mMaxMipMapLevel( 0 ),
   mType( TextureType::TEXTURE_2D ),
   mHasAlpha( nativeImageInterface->RequiresBlending() ),
@@ -153,43 +297,117 @@ Texture::Texture( NativeImageInterfacePtr nativeImageInterface )
 {
 }
 
-Texture::~Texture()
-{}
+Texture::~Texture() = default;
 
-void Texture::Initialize( Integration::Graphics::Graphics& graphics )
+void Texture::Initialize( Graphics::Controller& graphicsController )
 {
-  mGraphics = &graphics;
+  mGraphicsController = &graphicsController;
+  if (mNativeImage)
+  {
+    CreateTexture( Usage::SAMPLE );
+  }
 }
 
-const Graphics::API::Accessor<Graphics::API::Texture>& Texture::GetGfxObject() const
+Graphics::Texture* Texture::GetGfxObject() const
 {
-  return mGraphicsTexture;
+  DALI_LOG_INFO( gTextureFilter, Debug::General, "SC::Texture(%p)::GetGfxObject() = %p\n", this, mGraphicsTexture.get() );
+
+  return mGraphicsTexture.get();
 }
 
 void Texture::UploadTexture( PixelDataPtr pixelData, const Internal::Texture::UploadParams& params )
 {
-  if( mGraphics )
+  if( !mGraphicsTexture )
+  {
+    CreateTextureInternal( Usage::SAMPLE, nullptr, 0u );
+  }
+
+  // schedule upload
+  mGraphicsTexture->CopyMemory( pixelData->GetBuffer(),
+                                pixelData->GetBufferSize(),
+                                { params.width, params.height },
+                                { params.xOffset, params.yOffset },
+                                params.layer,
+                                params.mipmap,
+                                {} );
+
+  DALI_LOG_INFO( gTextureFilter, Debug::General, "SC::Texture(%p)::UploadTexture() GfxTexture: %p\n", this, mGraphicsTexture.get() );
+}
+
+void Texture::CreateTexture( Usage usage )
+{
+  if( ! mGraphicsTexture )
   {
-    auto& controller = mGraphics->GetController();
+    CreateTextureInternal( usage, nullptr, 0 );
+  }
+  DALI_LOG_INFO( gTextureFilter, Debug::General, "SC::Texture(%p)::CreateTexture(Usage:%s) GfxTexture: %p\n", this, (usage==Usage::COLOR_ATTACHMENT?"ColorAttachment":(usage==Usage::DEPTH_ATTACHMENT?"DepthAttachment":"SAMPLE")), mGraphicsTexture.get() );
+}
 
-    auto format = Graphics::API::TextureDetails::Format::RGBA8;
-    auto pixelFormat = pixelData->GetPixelFormat();
-    if( pixelFormat == Dali::Pixel::Format::L8 )
+void Texture::CreateTextureInternal( Usage usage, unsigned char* buffer, unsigned int bufferSize )
+{
+  if( mGraphicsController )
+  {
+    Graphics::TextureDetails::Usage graphicsUsage{};
+    switch( usage )
     {
-      format = Graphics::API::TextureDetails::Format::L8;
+      case Usage::SAMPLE:
+      {
+        graphicsUsage = Graphics::TextureDetails::Usage::SAMPLE;
+        break;
+      }
+      case Usage::COLOR_ATTACHMENT:
+      {
+        graphicsUsage = Graphics::TextureDetails::Usage::COLOR_ATTACHMENT;
+        break;
+      }
+      case Usage::DEPTH_ATTACHMENT:
+      {
+        graphicsUsage = Graphics::TextureDetails::Usage::DEPTH_ATTACHMENT;
+        break;
+      }
     }
 
+    // Convert DALi format to Graphics API format
+    mGraphicsTexture = mGraphicsController->CreateTexture( mGraphicsController->GetTextureFactory()
+                                                           .SetFormat( ConvertPixelFormat( mFormat ) )
+                                                           .SetUsage( graphicsUsage )
+                                                           .SetSize( { mWidth, mHeight } )
+                                                           .SetType( Graphics::TextureDetails::Type::TEXTURE_2D )
+                                                           .SetMipMapFlag( Graphics::TextureDetails::MipMapFlag::DISABLED )
+                                                           .SetData( buffer )
+                                                           .SetDataSize( bufferSize )
+                                                           .SetNativeImage( mNativeImage )
+                                                           .SetTiling( Graphics::TextureTiling::LINEAR ));
+  }
+}
 
-    mGraphicsTexture = controller.CreateTexture( controller.GetTextureFactory()
-                                                 .SetFormat( format )
-                                                 .SetSize( { pixelData->GetWidth(), pixelData->GetHeight() } )
-                                                 .SetType( Graphics::API::TextureDetails::Type::TEXTURE_2D )
-                                                 .SetMipMapFlag( Graphics::API::TextureDetails::MipMapFlag::DISABLED )
-                                                 .SetData( pixelData->GetBuffer() )
-                                                 .SetDataSize( pixelData->GetBufferSize() )
-                                                 );
-
-    mId = static_cast< uint32_t >( mGraphicsTexture.GetHandle() );
+void Texture::PrepareTexture()
+{
+  if( mNativeImage )
+  {
+    //TODO : use NativeImageInterface::Extension::IsSetSource for Native Surface
+    NativeImageInterface::Extension* extension = mNativeImage->GetExtension();
+    if ( extension != NULL )
+    {
+      if ( extension->IsSetSource() )
+      {
+        // When native image is changed, are the width and height changed?
+        mGraphicsTexture.reset();
+        mWidth = uint16_t(mNativeImage->GetWidth());
+        mHeight = uint16_t(mNativeImage->GetHeight());
+        mHasAlpha= mNativeImage->RequiresBlending();
+        mGraphicsTexture = mGraphicsController->CreateTexture( mGraphicsController->GetTextureFactory()
+                                                               .SetFormat( ConvertPixelFormat( mFormat ) )
+                                                               .SetUsage( Graphics::TextureDetails::Usage::SAMPLE )
+                                                               .SetSize( { mWidth, mHeight } )
+                                                               .SetType( Graphics::TextureDetails::Type::TEXTURE_2D )
+                                                               .SetMipMapFlag( Graphics::TextureDetails::MipMapFlag::DISABLED )
+                                                               .SetData( nullptr )
+                                                               .SetDataSize( 0 )
+                                                               .SetNativeImage( mNativeImage ));
+      }
+    }
+    mNativeImage->PrepareTexture();
   }
 }
 
@@ -205,6 +423,10 @@ void Texture::GenerateMipmaps()
   //@todo Implement with GraphicsAPI
 }
 
+void Texture::DestroyGraphicsObjects()
+{
+  mGraphicsTexture.reset();
+}
 
 } // namespace SceneGraph
 } // namespace Internal
index 39ec7f3..1d8a61d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_TEXTURE_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,9 +24,8 @@
 #include <dali/public-api/images/image-operations.h> // Dali::ImageDimensions
 #include <dali/public-api/rendering/sampler.h>
 #include <dali/public-api/rendering/texture.h>
-#include <dali/graphics-api/graphics-api-accessor.h>
+#include <dali/graphics-api/graphics-api-controller.h>
 #include <dali/graphics-api/graphics-api-texture.h>
-#include <dali/integration-api/graphics/graphics.h>
 #include <dali/internal/common/message.h>
 #include <dali/internal/event/rendering/texture-impl.h>
 #include <dali/internal/update/rendering/scene-graph-sampler.h>
@@ -47,6 +46,13 @@ class Texture
 public:
   typedef Dali::TextureType::Type Type;
 
+  enum class Usage
+  {
+    SAMPLE,
+    COLOR_ATTACHMENT,
+    DEPTH_ATTACHMENT
+  };
+
   /**
    * Constructor
    * @param[in] type The type of the texture
@@ -71,7 +77,7 @@ public:
    *
    * @param[in] graphics The Graphics API
    */
-  void Initialize( Integration::Graphics::Graphics& graphics );
+  void Initialize( Graphics::Controller& graphics );
 
   /**
    * Retrieve wheter the texture has an alpha channel
@@ -101,15 +107,12 @@ public:
    * Get the Graphics object associated with this texture
    * @return The graphics object.
    */
-  const Graphics::API::Accessor<Graphics::API::Texture>& GetGfxObject() const;
+  Graphics::Texture* GetGfxObject() const;
 
   /**
-   * Get the texture id associated with the graphics texture
+   * Destroy any graphics objects owned by this scene graph object
    */
-  uint32_t GetId()
-  {
-    return mId;
-  }
+  void DestroyGraphicsObjects();
 
 public: // From messages
   /**
@@ -124,14 +127,30 @@ public: // From messages
    */
   void GenerateMipmaps();
 
+  /**
+   * Create a graphics texture using the parameters defined in this object
+   */
+  void CreateTexture(Usage usage);
+
+  /**
+   * Called when the texture is about to be used for drawing.
+   */
+  void PrepareTexture();
+
+public:
+  /**
+   * Creates a texture with the specified buffer and buffer size.
+   * Buffer may be null.
+   */
+  void CreateTextureInternal( Usage usage, unsigned char* buffer, unsigned int bufferSize );
 
 private:
-  Integration::Graphics::Graphics* mGraphics; ///< Graphics interface object
-  Graphics::API::Accessor<Graphics::API::Texture> mGraphicsTexture; ///< Graphics texture
+  Graphics::Controller*   mGraphicsController; ///< Graphics interface object
+  std::unique_ptr<Graphics::Texture> mGraphicsTexture; ///< Graphics texture
 
   NativeImageInterfacePtr mNativeImage;      ///< Pointer to native image
   SceneGraph::Sampler     mSampler;          ///< The current sampler state
-  uint32_t                mId;               ///< The Graphics texture handle
+  Pixel::Format           mFormat;           ///< The pixel format of the texture
   uint16_t                mWidth;            ///< Width of the texture
   uint16_t                mHeight;           ///< Height of the texture
   uint16_t                mMaxMipMapLevel;   ///< Maximum mipmap level
@@ -140,18 +159,6 @@ private:
   bool                    mIsCompressed : 1; ///< Whether the format is compressed
 };
 
-
-inline void UploadTextureMessage( EventThreadServices& eventThreadServices, SceneGraph::Texture& texture, PixelDataPtr pixelData, const Internal::Texture::UploadParams& params )
-{
-  typedef MessageValue2< SceneGraph::Texture, PixelDataPtr, Internal::Texture::UploadParams > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ), false );
-
-  // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &texture, &SceneGraph::Texture::UploadTexture, pixelData, params );
-}
-
 inline void GenerateMipmapsMessage( EventThreadServices& eventThreadServices, SceneGraph::Texture& texture )
 {
   typedef Message< SceneGraph::Texture > LocalType;
index bf7f66b..0275746 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,32 +24,39 @@ namespace Internal
 namespace SceneGraph
 {
 
-ShaderCache::ShaderCache( Dali::Graphics::API::Controller& controller )
+ShaderCache::ShaderCache( Dali::Graphics::Controller& controller )
 : mController( controller )
 {
 }
 
-Dali::Graphics::API::Accessor<Dali::Graphics::API::Shader> ShaderCache::GetShader(
-  const Dali::Graphics::API::ShaderDetails::ShaderSource& vsh,
-  const Dali::Graphics::API::ShaderDetails::ShaderSource& fsh )
+Dali::Graphics::Shader& ShaderCache::GetShader(
+  const Dali::Graphics::ShaderDetails::ShaderSource& vsh,
+  const Dali::Graphics::ShaderDetails::ShaderSource& fsh )
 {
   for( auto&& item : mItems )
   {
     if( item.vertexSource == vsh && item.fragmentSource == fsh )
     {
-      return item.shader;
+      return *item.shader.get();
     }
   }
-  auto shaderRef =
+  auto shader =
     mController.CreateShader( mController.GetShaderFactory()
-                              .SetShaderModule( Graphics::API::ShaderDetails::PipelineStage::VERTEX,
-                                                Graphics::API::ShaderDetails::Language::SPIRV_1_0,
+                              .SetShaderModule( Graphics::ShaderDetails::PipelineStage::VERTEX,
+                                                Graphics::ShaderDetails::Language::SPIRV_1_0,
                                                 vsh )
-                              .SetShaderModule( Graphics::API::ShaderDetails::PipelineStage::FRAGMENT,
-                                                Graphics::API::ShaderDetails::Language::SPIRV_1_0,
+                              .SetShaderModule( Graphics::ShaderDetails::PipelineStage::FRAGMENT,
+                                                Graphics::ShaderDetails::Language::SPIRV_1_0,
                                                 fsh ) );
-  mItems.emplace_back( Item() = { shaderRef, vsh, fsh } );
-  return shaderRef;
+
+  auto retval = shader.get();
+  mItems.emplace_back( std::move(shader), vsh, fsh );
+  return *retval;
+}
+
+void ShaderCache::DestroyGraphicsObjects()
+{
+  mItems.clear();
 }
 
 } // namespace SceneGraph
index ae204fc..0cc7472 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_UPDATE_RENDERING_SHADER_CACHE_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  */
 
-#include <dali/integration-api/graphics/graphics.h>
-#include <dali/graphics-api/graphics-api-accessor.h>
+#include <dali/graphics-api/graphics-api-controller.h>
 #include <dali/graphics-api/graphics-api-shader.h>
 #include <dali/graphics-api/graphics-api-shader-details.h>
+#include <memory>
 
 namespace Dali
 {
@@ -37,10 +37,22 @@ struct ShaderCache
   struct Item
   {
     Item() = default;
+    Item( const Item& ) = delete;
+    Item( Item&& ) = default;
+
+    Item( std::unique_ptr<Dali::Graphics::Shader> _shader,
+          Dali::Graphics::ShaderDetails::ShaderSource _vertexSource,
+          Dali::Graphics::ShaderDetails::ShaderSource _fragmentSource )
+    : shader(std::move(_shader)),
+      vertexSource( _vertexSource ),
+      fragmentSource( _fragmentSource )
+    {}
+
     ~Item() = default;
-    Dali::Graphics::API::Accessor<Dali::Graphics::API::Shader> shader{ nullptr };
-    Dali::Graphics::API::ShaderDetails::ShaderSource           vertexSource{""};
-    Dali::Graphics::API::ShaderDetails::ShaderSource           fragmentSource{""};
+
+    std::unique_ptr<Dali::Graphics::Shader>               shader{ nullptr };
+    Dali::Graphics::ShaderDetails::ShaderSource           vertexSource{""};
+    Dali::Graphics::ShaderDetails::ShaderSource           fragmentSource{""};
   };
 
   /**
@@ -48,18 +60,23 @@ struct ShaderCache
    *
    * @param[in] controller The graphics controller
    */
-  explicit ShaderCache( Dali::Graphics::API::Controller& controller );
+  explicit ShaderCache( Dali::Graphics::Controller& controller );
 
   /**
    * Get a shader from it's source code
    */
-  Dali::Graphics::API::Accessor<Dali::Graphics::API::Shader> GetShader(
-    const Dali::Graphics::API::ShaderDetails::ShaderSource& vsh,
-    const Dali::Graphics::API::ShaderDetails::ShaderSource& fsh );
+  Dali::Graphics::Shader& GetShader(
+    const Dali::Graphics::ShaderDetails::ShaderSource& vsh,
+    const Dali::Graphics::ShaderDetails::ShaderSource& fsh );
+
+  /**
+   * Destroy any graphics objects owned by this scene graph object
+   */
+  void DestroyGraphicsObjects();
 
 private:
   std::vector<Item> mItems;
-  Dali::Graphics::API::Controller& mController;
+  Dali::Graphics::Controller& mController;
 };
 
 } // namespace SceneGraph
diff --git a/dali/public-api/CMakeLists.txt b/dali/public-api/CMakeLists.txt
deleted file mode 100644 (file)
index 59b2839..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-#
-# Add public-api source files here
-#
-SET(SOURCES ${SOURCES}
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/actor.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/camera-actor.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/custom-actor.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/custom-actor-impl.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/layer.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/animation.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/alpha-function.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/constraint.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/constraint-source.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/key-frames.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/linear-constrainer.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/path.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/time-period.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/constants.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/dali-common.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/dali-vector.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/extents.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/stage.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/gesture.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/gesture-detector.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/hover-event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/key-event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/long-press-gesture.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/long-press-gesture-detector.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/wheel-event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pan-gesture.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pan-gesture-detector.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pinch-gesture.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pinch-gesture-detector.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/tap-gesture.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/tap-gesture-detector.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-point.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-event.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-data.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/image.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/pixel.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/pixel-data.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/buffer-image.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/frame-buffer-image.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/encoded-buffer-image.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/resource-image.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/native-image.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/compile-time-math.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/degree.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/matrix.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/matrix3.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/quaternion.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/vector2.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/vector3.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/vector4.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/any.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/base-handle.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/handle.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/base-object.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/object-registry.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-array.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-conditions.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-input.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-key.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-map.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-notification.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-types.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-value.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/ref-object.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/render-tasks/render-task.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/render-tasks/render-task-list.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/frame-buffer.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/geometry.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/property-buffer.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/texture.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/texture-set.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderer.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/sampler.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/shader.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/callback.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/connection-tracker.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/connection-tracker-interface.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/signal-slot-connections.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/signal-slot-observers.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/base-signal.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/functor-delegate.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/type-info.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/type-registry.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/weak-handle.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/dali-core-version.cpp
-
-  PARENT_SCOPE )
-
-#
-# Add public header files here
-#
-SET(PUBLIC_API_HEADERS
-  ${CMAKE_CURRENT_SOURCE_DIR}/dali-core.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/dali-core-version.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/actor.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/actor-enumerations.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/camera-actor.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/custom-actor.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/custom-actor-impl.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/draw-mode.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/layer.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/actors/sampling.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/alpha-function.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/animation.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/constraint.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/constraints.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/constraint-source.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/key-frames.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/linear-constrainer.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/path.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/animation/time-period.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/compile-time-assert.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/constants.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/dali-common.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/dali-vector.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/extents.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/intrusive-ptr.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/loading-state.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/stage.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/type-traits.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/vector-wrapper.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/common/view-mode.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/device.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/gesture.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/gesture-detector.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/hover-event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/key-event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/long-press-gesture.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/long-press-gesture-detector.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/wheel-event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pan-gesture.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pan-gesture-detector.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pinch-gesture.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/pinch-gesture-detector.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/point-state.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/tap-gesture.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/tap-gesture-detector.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-point.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-event.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/events/touch-data.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/buffer-image.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/encoded-buffer-image.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/frame-buffer-image.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/image.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/image-operations.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/pixel.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/pixel-data.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/resource-image.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/native-image.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/images/native-image-interface.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/angle-axis.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/compile-time-math.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/degree.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/math-utils.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/matrix.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/matrix3.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/quaternion.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/radian.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/random.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/rect.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/uint-16-pair.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/vector2.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/vector3.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/vector4.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/math/viewport.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/any.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/base-handle.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/base-object.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/handle.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/object-registry.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-array.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-conditions.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-index-ranges.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-input.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-key.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-map.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-notification-declarations.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-notification.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-types.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property-value.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/property.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/ref-object.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/type-info.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/type-registry.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/type-registry-helper.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/object/weak-handle.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/render-tasks/render-task.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/render-tasks/render-task-list.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/frame-buffer.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/geometry.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/property-buffer.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/texture.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/texture-set.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/renderer.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/sampler.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/rendering/shader.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/size-negotiation/relayout-container.h
-
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/base-signal.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/callback.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/connection-tracker-interface.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/connection-tracker.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/dali-signal.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/functor-delegate.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/signal-slot-connections.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/signal-slot-observers.h
-  ${CMAKE_CURRENT_SOURCE_DIR}/signals/slot-delegate.h
-
-  PARENT_SCOPE )
index 3d15ba0..829b791 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_ACTOR_ENUMERATIONS_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,19 +41,6 @@ enum ColorMode
 };
 
 /**
- * @DEPRECATED_1_1.24 Use SetInheritPosition instead
- * @brief Enumeration for Actor position inheritance mode.
- * @SINCE_1_0.0
- */
-enum PositionInheritanceMode
-{
-  INHERIT_PARENT_POSITION,                 ///< Actor will inherit its parent position. This is the default @SINCE_1_0.0
-  USE_PARENT_POSITION,                     ///< Actor will copy its parent position. This is useful if many actors are stacked together in the same place. This option ignores parent origin and anchor point. @SINCE_1_0.0
-  USE_PARENT_POSITION_PLUS_LOCAL_POSITION, ///< Actor will copy its parent position and add local position. This is useful if many actors are stacked together in the same place with an offset.  This option ignores parent origin and anchor point. @SINCE_1_0.0
-  DONT_INHERIT_POSITION                    ///< Actor will not inherit position. Local position is treated as world position. This is useful if a constraint is used to override local position or if an actor is positioned globally. This option ignores parent origin, anchor point and local position. @SINCE_1_0.0
-};
-
-/**
  * @brief Enumeration for layout Dimensions.
  * @SINCE_1_0.0
  */
index 0cd89e1..4357059 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -75,7 +75,7 @@ void Actor::SetName(const std::string& name)
   GetImplementation(*this).SetName(name);
 }
 
-unsigned int Actor::GetId() const
+uint32_t Actor::GetId() const
 {
   return GetImplementation(*this).GetId();
 }
@@ -115,12 +115,12 @@ void Actor::Unparent()
   GetImplementation(*this).Unparent();
 }
 
-unsigned int Actor::GetChildCount() const
+uint32_t Actor::GetChildCount() const
 {
   return GetImplementation(*this).GetChildCount();
 }
 
-Actor Actor::GetChildAt(unsigned int index) const
+Actor Actor::GetChildAt( uint32_t index ) const
 {
   Internal::ActorPtr child = GetImplementation(*this).GetChildAt( index );
   return Actor( child.Get() );
@@ -132,7 +132,7 @@ Actor Actor::FindChildByName(const std::string& actorName)
   return Actor( child.Get() );
 }
 
-Actor Actor::FindChildById(const unsigned int id)
+Actor Actor::FindChildById( const uint32_t id )
 {
   Internal::ActorPtr child = GetImplementation(*this).FindChildById( id );
   return Actor( child.Get() );
@@ -245,20 +245,6 @@ Vector3 Actor::GetCurrentWorldPosition() const
   return GetImplementation(*this).GetCurrentWorldPosition();
 }
 
-void Actor::SetPositionInheritanceMode( PositionInheritanceMode mode )
-{
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetPositionInheritanceMode() is deprecated and will be removed from next release. Use SetInheritPosition() instead.\n" );
-
-  GetImplementation(*this).SetPositionInheritanceMode( mode );
-}
-
-PositionInheritanceMode Actor::GetPositionInheritanceMode() const
-{
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetPositionInheritanceMode() is deprecated and will be removed from next release. Use IsPositionInherited() instead.\n" );
-
-  return GetImplementation(*this).GetPositionInheritanceMode();
-}
-
 void Actor::SetOrientation(const Radian& angle, const Vector3& axis)
 {
   GetImplementation(*this).SetOrientation(angle, axis);
@@ -563,7 +549,7 @@ Vector2 Actor::GetMaximumSize()
   return Vector2( impl.GetMaximumSize( Dimension::WIDTH ), impl.GetMaximumSize( Dimension::HEIGHT ) );
 }
 
-int Actor::GetHierarchyDepth()
+int32_t Actor::GetHierarchyDepth()
 {
   return GetImplementation(*this).GetHierarchyDepth();
 }
@@ -600,17 +586,17 @@ Actor::OffStageSignalType& Actor::OffStageSignal()
   return GetImplementation(*this).OffStageSignal();
 }
 
-unsigned int Actor::AddRenderer( Renderer& renderer )
+uint32_t Actor::AddRenderer( Renderer& renderer )
 {
   return GetImplementation(*this).AddRenderer( GetImplementation( renderer ) );
 }
 
-unsigned int Actor::GetRendererCount() const
+uint32_t Actor::GetRendererCount() const
 {
   return GetImplementation(*this).GetRendererCount();
 }
 
-Renderer Actor::GetRendererAt( unsigned int index )
+Renderer Actor::GetRendererAt( uint32_t index )
 {
   Internal::RendererPtr renderer = GetImplementation(*this).GetRendererAt( index );
   return Renderer( renderer.Get() );
@@ -621,7 +607,7 @@ void Actor::RemoveRenderer( Renderer& renderer )
   GetImplementation(*this).RemoveRenderer( GetImplementation( renderer ) );
 }
 
-void Actor::RemoveRenderer( unsigned int index )
+void Actor::RemoveRenderer( uint32_t index )
 {
   GetImplementation(*this).RemoveRenderer( index );
 }
index ebb7a19..6931948 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_ACTOR_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/actors/actor-enumerations.h>
@@ -29,6 +30,8 @@
 #include <dali/public-api/object/property-index-ranges.h>
 #include <dali/public-api/signals/dali-signal.h>
 
+#undef SIZE_WIDTH // Defined in later versions of cstdint but is used in this header
+
 namespace Dali
 {
 /**
@@ -295,7 +298,7 @@ public:
       INHERIT_ORIENTATION,                                ///< name "inheritOrientation",    type bool        @SINCE_1_0.0
       INHERIT_SCALE,                                      ///< name "inheritScale",          type bool        @SINCE_1_0.0
       COLOR_MODE,                                         ///< name "colorMode",             type std::string @SINCE_1_0.0
-      POSITION_INHERITANCE,                               ///< name "positionInheritance",   type std::string @DEPRECATED_1_1.24 Use INHERIT_POSITION instead
+      RESERVED_PROPERTY_01,                               ///< name "reservedProperty01", This property is removed because it's deprecated.
       DRAW_MODE,                                          ///< name "drawMode",              type std::string @SINCE_1_0.0
       SIZE_MODE_FACTOR,                                   ///< name "sizeModeFactor",        type Vector3     @SINCE_1_0.0
       WIDTH_RESIZE_POLICY,                                ///< name "widthResizePolicy",     type String      @SINCE_1_0.0
@@ -417,7 +420,7 @@ public:
    * @return The ID
    * @pre The Actor has been initialized.
    */
-  unsigned int GetId() const;
+  uint32_t GetId() const;
 
   // Containment
 
@@ -503,7 +506,7 @@ public:
    * @return The number of children
    * @pre The Actor has been initialized.
    */
-  unsigned int GetChildCount() const;
+  uint32_t GetChildCount() const;
 
   /**
    * @brief Retrieve and child actor by index.
@@ -513,7 +516,7 @@ public:
    * @return The actor for the given index or empty handle if children not initialized
    * @pre The Actor has been initialized.
    */
-  Actor GetChildAt(unsigned int index) const;
+  Actor GetChildAt( uint32_t index ) const;
 
   /**
    * @brief Search through this actor's hierarchy for an actor with the given name.
@@ -535,7 +538,7 @@ public:
    * @return A handle to the actor if found, or an empty handle if not
    * @pre The Actor has been initialized.
    */
-  Actor FindChildById(const unsigned int id);
+  Actor FindChildById( const uint32_t id );
 
   /**
    * @brief Retrieves the actor's parent.
@@ -654,6 +657,7 @@ public:
    * @return The actor's target size
    * @pre The actor has been initialized.
    * @note This return is the value that was set using SetSize or the target size of an animation.
+   *       It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimum size is set.
    */
   Vector3 GetTargetSize() const;
 
@@ -780,19 +784,6 @@ public:
   Vector3 GetCurrentWorldPosition() const;
 
   /**
-   * @DEPRECATED_1_1.24 Use SetInheritPosition instead
-   * @brief Sets the actors position inheritance mode.
-   *
-   * The default is to inherit.
-   * Switching this off means that using SetPosition() sets the actor's world position.
-   * @SINCE_1_0.0
-   * @param[in] mode to use
-   * @pre The Actor has been initialized.
-   * @see PositionInheritanceMode
-   */
-  void SetPositionInheritanceMode( PositionInheritanceMode mode ) DALI_DEPRECATED_API;
-
-  /**
    * @brief Sets whether a child actor inherits it's parent's position.
    *
    * Default is to inherit.
@@ -808,16 +799,6 @@ public:
   }
 
   /**
-   * @DEPRECATED_1_1.24 Use IsPositionInherited
-   * @brief Returns the actors position inheritance mode.
-   *
-   * @SINCE_1_0.0
-   * @return Return the position inheritance mode
-   * @pre The Actor has been initialized.
-   */
-  PositionInheritanceMode GetPositionInheritanceMode() const DALI_DEPRECATED_API;
-
-  /**
    * @brief Returns whether the actor inherits its parent's position.
    *
    * @SINCE_1_1.24
@@ -1458,7 +1439,7 @@ public:
    * @SINCE_1_0.0
    * @return The current depth in the hierarchy of the actor, or @c -1 if actor is not in the hierarchy
    */
-  int GetHierarchyDepth();
+  int32_t GetHierarchyDepth();
 
 public: // Renderer
 
@@ -1471,7 +1452,7 @@ public: // Renderer
    * @pre The renderer must be initialized.
    *
    */
-  unsigned int AddRenderer( Renderer& renderer );
+  uint32_t AddRenderer( Renderer& renderer );
 
   /**
    * @brief Gets the number of renderers on this actor.
@@ -1479,7 +1460,7 @@ public: // Renderer
    * @SINCE_1_0.0
    * @return The number of renderers on this actor
    */
-  unsigned int GetRendererCount() const;
+  uint32_t GetRendererCount() const;
 
   /**
    * @brief Gets a Renderer by index.
@@ -1490,7 +1471,7 @@ public: // Renderer
    * @pre The index must be between 0 and GetRendererCount()-1
    *
    */
-  Renderer GetRendererAt( unsigned int index );
+  Renderer GetRendererAt( uint32_t index );
 
   /**
    * @brief Removes a renderer from the actor.
@@ -1508,7 +1489,7 @@ public: // Renderer
    * @pre The index must be between 0 and GetRendererCount()-1
    *
    */
-  void RemoveRenderer( unsigned int index );
+  void RemoveRenderer( uint32_t index );
 
 public: // Signals
 
index 401a0e1..36cfeef 100644 (file)
@@ -135,7 +135,8 @@ public:
   /**
    * @brief Creates a CameraActor object.
    *
-   * Sets the default camera perspective projection for the stage's size. @see SetPerspectiveProjection().
+   * @note No default camera perspective projection is set by this method. @see SetPerspectiveProjection().
+   *
    * @SINCE_1_0.0
    * @return The newly created camera actor
    */
@@ -332,12 +333,9 @@ public:
    * and the Z position of the actor based on the canvas size so that 1 unit in
    * XY (z=0) plane is 1 pixel on screen.
    *
-   * If the canvas size is ZERO, it sets the default camera perspective
-   * projection for the stage's size.
-   *
    * @SINCE_1_0.0
    * @param[in] size The canvas size
-   * @pre If size is non ZERO, \e width and \e height must be greater than zero.
+   * @pre The canvas size must be greater than zero.
    *
    */
   void SetPerspectiveProjection( const Size& size );
index d834606..2293ecd 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_CUSTOM_ACTOR_IMPL_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/property.h>
 #include <dali/public-api/object/ref-object.h>
@@ -88,7 +91,6 @@ public:
    *
    * When an actor is connected, it will be directly or indirectly parented to the root Actor.
    * @SINCE_1_0.0
-   * @param[in] depth The depth in the hierarchy for the actor
    *
    * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected.
    * When the parent of a set of actors is connected to the stage, then all of the children
@@ -106,7 +108,7 @@ public:
    * @endcode
    * @param[in] depth The depth in the hierarchy for the actor
    */
-  virtual void OnStageConnection( int depth ) = 0;
+  virtual void OnStageConnection( int32_t depth ) = 0;
 
   /**
    * @brief Called after the actor has been disconnected from Stage.
@@ -327,7 +329,6 @@ protected: // For derived classes
    */
   enum ActorFlags
   {
-    ACTOR_BEHAVIOUR_NONE          = 0,          ///< Use if no change to default behaviour is needed. @DEPRECATED_1_2_10
     ACTOR_BEHAVIOUR_DEFAULT       = 0,          ///< Use to provide default behaviour (size negotiation is on, event callbacks are not called). @SINCE_1_2_10
     DISABLE_SIZE_NEGOTIATION      = 1 << 0,     ///< True if control does not need size negotiation, i.e. it can be skipped in the algorithm @SINCE_1_0.0
     REQUIRES_TOUCH_EVENTS         = 1 << 1,     ///< True if the OnTouchEvent() callback is required. @SINCE_1_0.0
@@ -337,7 +338,7 @@ protected: // For derived classes
     LAST_ACTOR_FLAG                             ///< Special marker for last actor flag @SINCE_1_0.0
   };
 
-  static const int ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1;      ///< Value for deriving classes to continue on the flag enum
+  static const int32_t ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1;      ///< Value for deriving classes to continue on the flag enum
 
   /**
    * @brief Creates a CustomActorImpl.
index ae31d67..941885c 100644 (file)
@@ -94,7 +94,6 @@ public:
    *
    * @SINCE_1_0.0
    * @param[in] implementation The implementation for this custom actor
-   * @return A handle to a newly allocated Dali resource
    */
   CustomActor(CustomActorImpl& implementation);
 
index 68190d9..79f312c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_DRAW_MODE_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,11 @@ namespace Dali
  * @{
  */
 
+/**
+ * @brief DrawMode to determine how the Actor and its children will be drawn.
+ *
+ * @SINCE_1_0.0
+ */
 namespace DrawMode
 {
 
@@ -39,8 +44,7 @@ namespace DrawMode
 enum Type
 {
   NORMAL     = 0, ///< @brief binary 00. The default draw-mode @SINCE_1_0.0
-  OVERLAY_2D = 1, ///< @brief binary 01. Draw the actor and its children as an overlay @SINCE_1_0.0
-  STENCIL    = 3  ///< @DEPRECATED_1_1.31 Will be replaced by separate ClippingMode enum @brief binary 11. Draw the actor and its children into the stencil buffer @SINCE_1_0.0
+  OVERLAY_2D = 1  ///< @brief binary 01. Draw the actor and its children as an overlay @SINCE_1_0.0
 };
 
 } // namespace DrawMode
index 029ee45..5e31ff7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ Layer& Layer::operator=(const Layer& rhs)
   return *this;
 }
 
-unsigned int Layer::GetDepth() const
+uint32_t Layer::GetDepth() const
 {
   return GetImplementation(*this).GetDepth();
 }
@@ -123,7 +123,7 @@ bool Layer::IsClipping() const
   return GetImplementation(*this).IsClipping();
 }
 
-void Layer::SetClippingBox(int x, int y, int width, int height)
+void Layer::SetClippingBox(int32_t x, int32_t y, int32_t width, int32_t height)
 {
   GetImplementation(*this).SetClippingBox(x, y, width, height);
 }
index c21e32f..f22a9a8 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_LAYER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/actors/actor.h>
@@ -43,7 +46,7 @@ class Layer;
  * @SINCE_1_0.0
  * @see Dali::Layer::SetClippingBox()
  */
-typedef Rect<int> ClippingBox;
+typedef Rect<int32_t> ClippingBox;
 
 /**
  * @brief Layers provide a mechanism for overlaying groups of actors on top of each other.
@@ -58,10 +61,10 @@ typedef Rect<int> ClippingBox;
  * need for it based on the layer's contents; actors in lower layers cannot
  * obscure actors in higher layers.
  *
- * A layer has either LAYER_2D or LAYER_3D mode. LAYER_2D has better
+ * A layer has either LAYER_UI or LAYER_3D mode. LAYER_UI has better
  * performance, the depth test is disabled, and a child actor hides its
  * parent actor.  LAYER_3D uses the depth test, thus a close actor hides a
- * farther one.  LAYER_2D is the default mode and recommended for general
+ * farther one.  LAYER_UI is the default mode and recommended for general
  * cases.  See Layer::Behavior and SetBehavior() for more information.
  *
  * Layer is a type of Actor, thus can have parent or children actors.  A
@@ -101,7 +104,7 @@ public:
     enum
     {
       CLIPPING_ENABLE = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, ///< name "clippingEnable",   type bool @SINCE_1_0.0
-      CLIPPING_BOX,                                                 ///< name "clippingBox",      type Rect<int> @SINCE_1_0.0
+      CLIPPING_BOX,                                                 ///< name "clippingBox",      type Rect<int32_t> @SINCE_1_0.0
       BEHAVIOR,                                                     ///< name "behavior",         type String @SINCE_1_0.0
     };
   };
@@ -115,14 +118,6 @@ public:
   enum Behavior
   {
     /**
-     * @DEPRECATED_1_1.45, use LAYER_UI instead
-     * @brief UI control rendering mode.
-     * @SINCE_1_0.0
-     * @see LAYER_UI
-     */
-    LAYER_2D,
-
-    /**
      * @brief UI control rendering mode (default mode).
      *
      * This mode is designed for UI controls that can overlap. In this
@@ -152,7 +147,7 @@ public:
      *
      * @SINCE_1_1.45
      */
-    LAYER_UI = LAYER_2D,
+    LAYER_UI,
 
     /**
      * @brief Layer will use depth test.
@@ -263,7 +258,7 @@ public:
    * @pre Layer is on the stage.
    * If layer is not added to the stage, returns 0.
    */
-  unsigned int GetDepth() const;
+  uint32_t GetDepth() const;
 
   /**
    * @brief Increments the depth of the layer.
@@ -391,7 +386,7 @@ public:
    * @param[in] width The width of the box
    * @param[in] height The height of the box
    */
-  void SetClippingBox(int x, int y, int width, int height);
+  void SetClippingBox(int32_t x, int32_t y, int32_t width, int32_t height);
 
   /**
    * @brief Sets the clipping box of a layer in window coordinates.
index b4baa69..48d4a3e 100755 (executable)
@@ -98,6 +98,13 @@ enum Type
 
 } //namespace FilterMode
 
+/**
+ * @brief WrapMode for textures.
+ *
+ * @details Wrap mode determines how texture is sampled when texture coordinates are outside
+ * of the typical 0 to 1 range.
+ * @SINCE_1_0.0
+ */
 namespace WrapMode
 {
 /**
old mode 100644 (file)
new mode 100755 (executable)
index 7ce7db5..28f7c41
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 namespace Dali
 {
 
+namespace
+{
+constexpr uint32_t BitMaskOfN( uint32_t bits )
+{
+  return ( 1 << bits ) - 1;
+}
+
+} // unnamed namespace
+
 AlphaFunction::AlphaFunction()
 :mBezierControlPoints(Vector4::ZERO),
  mCustom(0),
@@ -65,12 +74,12 @@ AlphaFunctionPrototype AlphaFunction::GetCustomFunction() const
 
 AlphaFunction::BuiltinFunction AlphaFunction::GetBuiltinFunction() const
 {
-  return mBuiltin;
+  return static_cast<AlphaFunction::BuiltinFunction>( mBuiltin & BitMaskOfN( Log<COUNT>::value + 1 ) );
 }
 
 AlphaFunction::Mode AlphaFunction::GetMode() const
 {
-  return mMode;
+  return static_cast<AlphaFunction::Mode>( mMode & BitMaskOfN( 2 ) );
 }
 
 } // namespace Dali
old mode 100644 (file)
new mode 100755 (executable)
index 5f92d43..ad4416c
@@ -89,7 +89,6 @@ public:
    * @brief Default constructor.
    * Creates an alpha function object with the default built-in alpha function.
    * @SINCE_1_0.0
-   * @return The alpha function
    */
   AlphaFunction();
 
@@ -99,7 +98,6 @@ public:
    * to the constructor.
    * @SINCE_1_0.0
    * @param[in] function One of the built-in alpha functions
-   * @return The alpha function
    */
   AlphaFunction( BuiltinFunction function);
 
@@ -109,7 +107,6 @@ public:
    * to the constructor.
    * @SINCE_1_0.0
    * @param[in] function A pointer to an alpha function
-   * @return The alpha function
    */
   AlphaFunction( AlphaFunctionPrototype function);
 
@@ -121,7 +118,6 @@ public:
    * @SINCE_1_0.0
    * @param[in] controlPoint0 A Vector2 which will be used as the first control point of the curve
    * @param[in] controlPoint1 A Vector2 which will be used as the second control point of the curve
-   * @return The alpha function
    * @note The x components of the control points will be clamped to the range [0,1] to prevent
    * non monotonic curves.
    */
index 980223d..bd3ce98 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -79,17 +79,17 @@ void Animation::SetLooping(bool looping)
   GetImplementation(*this).SetLooping(looping);
 }
 
-void Animation::SetLoopCount(int count)
+void Animation::SetLoopCount(int32_t count)
 {
   GetImplementation(*this).SetLoopCount(count);
 }
 
-int Animation::GetLoopCount()
+int32_t Animation::GetLoopCount()
 {
   return GetImplementation(*this).GetLoopCount();
 }
 
-int Animation::GetCurrentLoop()
+int32_t Animation::GetCurrentLoop()
 {
   return GetImplementation(*this).GetCurrentLoop();
 }
index 50fb999..2fb2606 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/key-frames.h>
@@ -267,7 +270,7 @@ public:
    * @SINCE_1_1.20
    * @param[in] count The number of times to loop
    */
-  void SetLoopCount(int count);
+  void SetLoopCount(int32_t  count);
 
   /**
    * @brief Gets the loop count.
@@ -278,7 +281,7 @@ public:
    * @SINCE_1_1.20
    * @return The number of times to loop
    */
-  int GetLoopCount();
+  int32_t  GetLoopCount();
 
   /**
    * @brief Gets the current loop count.
@@ -288,7 +291,7 @@ public:
    * @SINCE_1_1.20
    * @return The current number of loops that have occured
    */
-  int GetCurrentLoop();
+  int32_t  GetCurrentLoop();
 
   /**
    * @brief Queries whether the animation will loop.
index 31f6fdc..4951c7e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -104,12 +104,12 @@ Constraint::RemoveAction Constraint::GetRemoveAction() const
   return GetImplementation(*this).GetRemoveAction();
 }
 
-void Constraint::SetTag( const unsigned int tag )
+void Constraint::SetTag( uint32_t tag )
 {
   GetImplementation(*this).SetTag( tag );
 }
 
-unsigned int Constraint::GetTag() const
+uint32_t Constraint::GetTag() const
 {
   return GetImplementation(*this).GetTag();
 }
index eaf4509..c2722fb 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/animation/constraint-source.h>
 #include <dali/public-api/common/dali-vector.h>
@@ -499,7 +502,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] tag An integer to identify the constraint
    */
-  void SetTag( const unsigned int tag );
+  void SetTag( uint32_t tag );
 
   /**
    * @brief Gets the tag.
@@ -507,7 +510,7 @@ public:
    * @SINCE_1_0.0
    * @return The tag
    */
-  unsigned int GetTag() const;
+  uint32_t GetTag() const;
 
 public: // Not intended for use by Application developers
 
index da34a19..f3f875f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -82,12 +82,12 @@ void Path::Sample( float progress, Vector3& position, Vector3& tangent ) const
 
 Vector3& Path::GetPoint( size_t index )
 {
-  return GetImplementation(*this).GetPoint(index);
+  return GetImplementation(*this).GetPoint( static_cast<uint32_t>( index ) );
 }
 
 Vector3& Path::GetControlPoint( size_t index )
 {
-  return GetImplementation(*this).GetControlPoint(index);
+  return GetImplementation(*this).GetControlPoint( static_cast<uint32_t>( index ) );
 }
 
 size_t Path::GetPointCount() const
index 14e362b..42d1331 100644 (file)
@@ -38,7 +38,7 @@ namespace Dali
 
 namespace
 {
-const int MAX_NUM_STACK_FRAMES = 25;
+const int32_t MAX_NUM_STACK_FRAMES = 25;
 }
 
 std::string Demangle(const char* symbol)
@@ -74,7 +74,7 @@ std::string Demangle(const char* symbol)
         mangledSymbol[tokenLength] = '\0';
 
         size_t size;
-        int    status;
+        int32_t    status;
         char*  demangled=NULL;
         demangled = abi::__cxa_demangle( mangledSymbol, NULL, &size, &status );
         if( demangled != NULL )
@@ -111,9 +111,9 @@ DALI_CORE_API DaliException::DaliException( const char* location, const char* co
   DALI_LOG_ERROR_NOFN("Backtrace:\n");
 
   void* frameArray[MAX_NUM_STACK_FRAMES];
-  int nSize = backtrace(frameArray, MAX_NUM_STACK_FRAMES);
+  int32_t nSize = backtrace(frameArray, MAX_NUM_STACK_FRAMES);
   char** symbols = backtrace_symbols(frameArray, nSize);
-  for(int i=1; i< nSize; i++)
+  for(int32_t i=1; i< nSize; i++)
   {
     std::string demangled_symbol = Demangle(symbols[i]);
     DALI_LOG_ERROR_NOFN("[%02d]   %s\n", i, demangled_symbol.c_str() );
index 4b7c4aa..cc73979 100755 (executable)
 #    define DALI_INTERNAL   __attribute__ ((visibility ("hidden")))
 #  endif
 #else
-/** Visibility attribute to show method definitions */
+#ifdef WIN32
+ /** Visibility attribute to show declarations */
+#  define DALI_EXPORT_API __declspec(dllexport)
+
+#ifdef BUILDING_DALI_CORE
+ /** Visibility attribute to hide declarations */
+#  define DALI_CORE_API __declspec(dllexport)
+#else
+/** Visibility attribute to hide declarations */
+#  define DALI_CORE_API __declspec(dllimport)
+#endif
+
+#else
+ /** Visibility attribute to show declarations */
 #  define DALI_EXPORT_API
 /** Visibility attribute to show declarations */
 #  define DALI_IMPORT_API
 /** Visibility attribute to show declarations */
 #  define DALI_CORE_API
+#endif
 /** Visibility attribute to hide declarations */
 #  define DALI_INTERNAL
 #endif
  * DALI_UNLIKELY should be used when a branch is almost never taken.
  * @SINCE_1_0.0
  */
+#ifdef __GNUC
 #define DALI_LIKELY(expression)   __builtin_expect( !!(expression), 1 )
 #define DALI_UNLIKELY(expression) __builtin_expect( !!(expression), 0 )
+#else
+#define DALI_LIKELY(expression)   !!(expression)
+#define DALI_UNLIKELY(expression) !!(expression)
+#endif
 
 /**
  * @brief The DALi namespace.
index 2e2bd8f..bae8522 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -51,8 +51,7 @@ void VectorBase::Release()
   {
     // adjust pointer to real beginning
     SizeType* metadata = reinterpret_cast< SizeType* >( mData );
-    // TODO would be nice to memset to a bitpattern to catch illegal use of container after release
-    // but that would require knowledge of the itemsize
+
     delete [] ( metadata - 2u );
     mData = 0u;
   }
@@ -75,7 +74,7 @@ void VectorBase::Reserve( SizeType capacity, SizeType elementSize )
   if( capacity > oldCapacity )
   {
     const SizeType wholeAllocation = sizeof(SizeType) * 2u + capacity * elementSize;
-    void* wholeData = reinterpret_cast< void* >( new unsigned char[ wholeAllocation ] );
+    void* wholeData = reinterpret_cast< void* >( new uint8_t[ wholeAllocation ] );
     DALI_ASSERT_ALWAYS( wholeData && "VectorBase::Reserve - Memory allocation failed" );
 
 #if defined( DEBUG_ENABLED )
@@ -121,8 +120,8 @@ void VectorBase::Erase( char* address, SizeType elementSize )
   // erase can be called on an unallocated vector
   if( mData )
   {
-    char* startAddress = address + elementSize;
-    const char* endAddress = reinterpret_cast< char* >( mData ) + Count() * elementSize;
+    uint8_t* startAddress = reinterpret_cast< uint8_t* >( address ) + elementSize;
+    const uint8_t* endAddress = reinterpret_cast< uint8_t* >( mData ) + Count() * elementSize;
     SizeType numberOfBytes = endAddress - startAddress;
     // addresses overlap so use memmove
     memmove( address, startAddress, numberOfBytes );
@@ -136,8 +135,8 @@ char* VectorBase::Erase( char* first, char* last, SizeType elementSize )
 
   if( mData )
   {
-    char* startAddress = last;
-    const char* endAddress = reinterpret_cast< char* >( mData ) + Count() * elementSize;
+    uint8_t* startAddress = reinterpret_cast< uint8_t* >( last );
+    const uint8_t* endAddress = reinterpret_cast< uint8_t* >( mData ) + Count() * elementSize;
     SizeType numberOfBytes = endAddress - startAddress;
     // addresses overlap so use memmove
     memmove( first, startAddress, numberOfBytes );
index 4140049..0efb790 100755 (executable)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <cstddef>
 #include <algorithm>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -209,7 +210,7 @@ protected: // for Derived classes
 
 private:
 
-  // not copiable as it does not know the size of elements
+  // not copyable as it does not know the size of elements
   VectorBase( const VectorBase& ); ///< Undefined @SINCE_1_0.0
   VectorBase& operator=( const VectorBase& ); ///< Undefined @SINCE_1_0.0
 
@@ -320,9 +321,9 @@ protected: // API for deriving classes
    * @param[in] address Address to erase from
    * @param[in] elementSize Size to erase
    */
-  void Erase( char* address, SizeType elementSize )
+  void Erase( uint8_t* address, SizeType elementSize )
   {
-    VectorBase::Erase( address, elementSize );
+    VectorBase::Erase( reinterpret_cast< char* >( address ), elementSize );
   }
 
   /**
@@ -334,9 +335,9 @@ protected: // API for deriving classes
    * @param[in] elementSize Size of one of the elements to be erased
    * @return Address pointing to the next element of the last one
    */
-  char* Erase( char* first, char* last, SizeType elementSize )
+  uint8_t* Erase( uint8_t* first, uint8_t* last, SizeType elementSize )
   {
-    return VectorBase::Erase( first, last, elementSize );
+    return reinterpret_cast< uint8_t* >( VectorBase::Erase( reinterpret_cast< char* >( first ), reinterpret_cast< char *>( last ), elementSize ) );
   }
 
   /**
@@ -348,7 +349,7 @@ protected: // API for deriving classes
    * @param[in] to Address to the last element to be inserted
    * @param[in] elementSize Size of one of the elements to be inserted
    */
-  void Insert( char* at, char* from, char* to, SizeType elementSize )
+  void Insert( uint8_t* at, uint8_t* from, uint8_t* to, SizeType elementSize )
   {
     const SizeType size = to - from;
     const SizeType count = Count();
@@ -357,24 +358,24 @@ protected: // API for deriving classes
     if( newCount > Capacity() )
     {
       // Calculate the at offset as the pointer is invalid after the Reserve() call.
-      std::size_t offset = at - reinterpret_cast<char*>( mData );
+      std::size_t offset = at - reinterpret_cast<uint8_t*>( mData );
 
       // need more space
-      Reserve( NextPowerOfTwo( newCount ), elementSize ); // reserve enough space to store at least the next power of two elements of the new required size.
+      Reserve( NextPowerOfTwo( static_cast<uint32_t>( newCount ) ), elementSize ); // reserve enough space to store at least the next power of two elements of the new required size.
 
       // Set the new at pointer.
-      at = reinterpret_cast<char*>( mData ) + offset;
+      at = reinterpret_cast<uint8_t*>( mData ) + offset;
     }
     // set new count first as otherwise the debug assert will hit us
     SetCount( newCount );
 
     // Move current items to a new position inside the vector.
-    CopyMemory( at + size,
-                at,
-                ( reinterpret_cast<char*>( mData ) + count * elementSize ) - at );
+    CopyMemory( reinterpret_cast< char* >( at + size ),
+                reinterpret_cast< const char* >( at ),
+                ( reinterpret_cast<uint8_t*>( mData ) + count * elementSize ) - at );
 
     // Copy the given items.
-    CopyMemory( at, from, size );
+    CopyMemory( reinterpret_cast< char* >( at ), reinterpret_cast< const char* >( from ), size );
   }
 };
 
@@ -584,8 +585,8 @@ public: // API
   {
     DALI_ASSERT_VECTOR( ( at <= End() ) && ( at >= Begin() ) && "Iterator not inside vector" );
     const SizeType size = sizeof( ItemType );
-    char* address = const_cast<char*>( reinterpret_cast<const char*>( &element ) );
-    VectorAlgorithms<BaseType>::Insert( reinterpret_cast< char* >( at ),
+    uint8_t* address = const_cast<uint8_t*>( reinterpret_cast<const uint8_t*>( &element ) );
+    VectorAlgorithms<BaseType>::Insert( reinterpret_cast< uint8_t* >( at ),
                                         address,
                                         address + size,
                                         size );
@@ -620,9 +621,9 @@ public: // API
       return;
     }
 
-    VectorAlgorithms<BaseType>::Insert( reinterpret_cast< char* >( at ),
-                                        reinterpret_cast< char* >( from ),
-                                        reinterpret_cast< char* >( to ),
+    VectorAlgorithms<BaseType>::Insert( reinterpret_cast< uint8_t* >( at ),
+                                        reinterpret_cast< uint8_t* >( from ),
+                                        reinterpret_cast< uint8_t* >( to ),
                                         sizeof( ItemType ) );
   }
 
@@ -693,7 +694,7 @@ public: // API
     DALI_ASSERT_VECTOR( (iterator < End()) && (iterator >= Begin()) && "Iterator not inside vector" );
     if( iterator < ( End() - 1u ) )
     {
-      VectorAlgorithms<BaseType>::Erase( reinterpret_cast< char* >( iterator ), sizeof( ItemType ) );
+      VectorAlgorithms<BaseType>::Erase( reinterpret_cast< uint8_t* >( iterator ), sizeof( ItemType ) );
     }
     else
     {
@@ -734,8 +735,8 @@ public: // API
     }
     else
     {
-      nextElement = reinterpret_cast<Iterator>( VectorAlgorithms<BaseType>::Erase( reinterpret_cast< char* >( first ),
-                                                                                   reinterpret_cast< char* >( last ),
+      nextElement = reinterpret_cast<Iterator>( VectorAlgorithms<BaseType>::Erase( reinterpret_cast< uint8_t* >( first ),
+                                                                                   reinterpret_cast< uint8_t* >( last ),
                                                                                    sizeof( ItemType ) ) );
     }
 
index 13825ff..cf5c03a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -90,12 +90,12 @@ Vector2 Stage::GetSize() const
   return GetImplementation(*this).GetSize();
 }
 
-unsigned int Stage::GetLayerCount() const
+uint32_t Stage::GetLayerCount() const
 {
   return GetImplementation(*this).GetLayerCount();
 }
 
-Layer Stage::GetLayer(unsigned int depth) const
+Layer Stage::GetLayer(uint32_t depth) const
 {
   return GetImplementation(*this).GetLayer(depth);
 }
index 6625bee..0764749 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/signals/dali-signal.h>
@@ -198,7 +201,7 @@ public:
    * @SINCE_1_0.0
    * @return The number of layers
    */
-  unsigned int GetLayerCount() const;
+  uint32_t GetLayerCount() const;
 
   /**
    * @brief Retrieves the layer at a specified depth.
@@ -208,7 +211,7 @@ public:
    * @return The layer found at the given depth
    * @pre Depth is less than layer count; see GetLayerCount().
    */
-  Layer GetLayer(unsigned int depth) const;
+  Layer GetLayer(uint32_t depth) const;
 
   /**
    * @brief Returns the Stage's Root Layer.
index 05d6b6c..accc2db 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __VECTOR_WRAPPER_H__
-#define __VECTOR_WRAPPER_H__
+#ifndef DALI_VECTOR_WRAPPER_H
+#define DALI_VECTOR_WRAPPER_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  *
  */
 
-// EXTERNAL INCLUDES
-#include <cstddef>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-
 #ifndef HIDE_DALI_INTERNALS
 
 #include <vector>
 
 #else
 
-// ensure that default visibility is used with any class that is used as an exception type
+// Ensure that default visibility is used with any class that is used as an exception type
 #include <memory>
 #include <new>
 #include <stdexcept>
 
 #include <bits/c++config.h>
 #undef _GLIBCXX_VISIBILITY_ATTR
+#undef _GLIBCXX_VISIBILITY
 #define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ ("hidden")))
+#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ ("hidden")))
 #include <vector>
 #undef _GLIBCXX_VISIBILITY_ATTR
+#undef _GLIBCXX_VISIBILITY
 #define _GLIBCXX_VISIBILITY_ATTR(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY_ATTR`
+#define _GLIBCXX_VISIBILITY(V) __attribute__ ((__visibility__ (#V))) // restore `_GLIBCXX_VISIBILITY`
 
-#endif //ifdef __clang__
+#endif // #ifdef __clang__
 
-#endif //ifndef HIDE_DALI_INTERNALS
+#endif // #ifndef HIDE_DALI_INTERNALS
 
-#endif /* __VECTOR_WRAPPER__H__ */
+#endif // DALI_VECTOR_WRAPPER_H
index 2a0c452..c80daed 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_VIEW_MODE_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,9 +32,8 @@ namespace Dali
 enum ViewMode
 {
   MONO,              ///< Monoscopic (single camera). This is the default @SINCE_1_0.0
-  STEREO_HORIZONTAL, ///< Stereoscopic. Frame buffer is split horizontally with the left and right camera views in their respective sides. @SINCE_1_0.0
-  STEREO_VERTICAL,   ///< Stereoscopic. Frame buffer is split vertically with the left camera view at the top and the right camera view at the bottom. @SINCE_1_0.0
-  STEREO_INTERLACED  ///< @DEPRECATED_1_1.19 @brief Stereoscopic. Left/Right camera views are rendered into the framebuffer on alternate frames. @SINCE_1_0.0
+  STEREO_HORIZONTAL, ///< @DEPRECATED_1_3_39 Stereoscopic. Frame buffer is split horizontally with the left and right camera views in their respective sides. @SINCE_1_0.0
+  STEREO_VERTICAL    ///< @DEPRECATED_1_3_39 Stereoscopic. Frame buffer is split vertically with the left camera view at the top and the right camera view at the bottom. @SINCE_1_0.0
 };
 
 /**
index 70a2031..76e8cb2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -26,9 +26,9 @@
 namespace Dali
 {
 
-const unsigned int CORE_MAJOR_VERSION = 1;
-const unsigned int CORE_MINOR_VERSION = 3;
-const unsigned int CORE_MICRO_VERSION = 26;
+const uint32_t CORE_MAJOR_VERSION = 1;
+const uint32_t CORE_MINOR_VERSION = 4;
+const uint32_t CORE_MICRO_VERSION = 16;
 const char * const CORE_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 5872984..e8658bb 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 
 namespace Dali
 {
-DALI_CORE_API extern const unsigned int CORE_MAJOR_VERSION; ///< The major version number of the Core library.
-DALI_CORE_API extern const unsigned int CORE_MINOR_VERSION; ///< The minor version number of the Core library.
-DALI_CORE_API extern const unsigned int CORE_MICRO_VERSION; ///< The micro version number of the Core library.
+DALI_CORE_API extern const uint32_t CORE_MAJOR_VERSION; ///< The major version number of the Core library.
+DALI_CORE_API extern const uint32_t CORE_MINOR_VERSION; ///< The minor version number of the Core library.
+DALI_CORE_API extern const uint32_t CORE_MICRO_VERSION; ///< The micro version number of the Core library.
 DALI_CORE_API extern const char * const CORE_BUILD_DATE;    ///< The date/time the Core library was built.
 } // namespace Dali
 
index ccbb290..66c5f80 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_CORE_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,7 +46,6 @@
 #include <dali/public-api/common/loading-state.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/common/view-mode.h>
 
 #include <dali/public-api/events/gesture-detector.h>
 #include <dali/public-api/events/gesture.h>
index 08f1999..b866818 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/handle.h>
 
 namespace Dali
index bf93789..2696f7b 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 
@@ -112,7 +115,7 @@ struct DALI_CORE_API Gesture
   /**
    * @brief The time the gesture took place.
    */
-  unsigned int time;
+  uint32_t time;
 
 protected: // Creation
 
index 395a569..69f02e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,12 +38,12 @@ HoverEvent::~HoverEvent()
 {
 }
 
-unsigned int HoverEvent::GetPointCount() const
+uint32_t HoverEvent::GetPointCount() const
 {
-  return points.size();
+  return static_cast<uint32_t>( points.size() );
 }
 
-const TouchPoint& HoverEvent::GetPoint(unsigned int point) const
+const TouchPoint& HoverEvent::GetPoint( uint32_t point ) const
 {
   DALI_ASSERT_ALWAYS( point < points.size() && "No point at index" );
   return points[point];
index ff7d719..e5c9f48 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/events/touch-point.h>
@@ -82,7 +85,7 @@ struct DALI_CORE_API HoverEvent
    * @SINCE_1_0.0
    * @return Total number of Points
    */
-  unsigned int GetPointCount() const;
+  uint32_t GetPointCount() const;
 
   /**
    * @brief Returns a touch point at the index requested.
@@ -95,7 +98,7 @@ struct DALI_CORE_API HoverEvent
    * @note "point" should be less than the value returned by GetPointCount().
    *       If out of range, then program asserts.
    */
-  const TouchPoint& GetPoint(unsigned int point) const;
+  const TouchPoint& GetPoint( uint32_t point) const;
 };
 
 /**
index 74463fb..30a1323 100755 (executable)
@@ -26,10 +26,10 @@ namespace Dali
 
 namespace
 {
-const unsigned int MODIFIER_SHIFT = 0x1;
-const unsigned int MODIFIER_CTRL  = 0x2;
-const unsigned int MODIFIER_ALT   = 0x4;
-const int KEY_INVALID_CODE = -1;
+const uint32_t MODIFIER_SHIFT = 0x1;
+const uint32_t MODIFIER_CTRL  = 0x2;
+const uint32_t MODIFIER_ALT   = 0x4;
+const int32_t KEY_INVALID_CODE = -1;
 }
 
 KeyEvent::KeyEvent()
@@ -43,7 +43,7 @@ KeyEvent::KeyEvent()
   new Internal::KeyEventImpl( this );
 }
 
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier,unsigned long timeStamp, const State& keyState)
+KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, int32_t keyCode, int32_t keyModifier,unsigned long timeStamp, const State& keyState)
 : keyPressedName(keyName),
   keyPressed(keyString),
   keyCode(keyCode),
index 8aaadad..336e737 100755 (executable)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstdint> // int32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -79,7 +80,7 @@ struct DALI_CORE_API KeyEvent
    * @param[in] timeStamp The time (in ms) that the key event occurred
    * @param[in] keyState The state of the key event
    */
-  KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier, unsigned long timeStamp, const State& keyState);
+  KeyEvent(const std::string& keyName, const std::string& keyString, int32_t keyCode, int32_t keyModifier, unsigned long timeStamp, const State& keyState);
 
   /**
    * @brief Copy constructor.
@@ -180,12 +181,12 @@ struct DALI_CORE_API KeyEvent
    * platform-specific key code. You need to use IsKey() to know what a key event means
    * instead of direct comparison of key code value.
    */
-  int  keyCode;
+  int32_t keyCode;
 
   /**
    * @brief special keys like shift, alt and control which modify the next key pressed.
    */
-  int  keyModifier;
+  int32_t keyModifier;
 
   /**
    * @brief The time (in ms) that the key event occurred.
index d49e9b9..98c7ed3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,14 +40,14 @@ LongPressGestureDetector LongPressGestureDetector::New()
   return LongPressGestureDetector(internal.Get());
 }
 
-LongPressGestureDetector LongPressGestureDetector::New(unsigned int touchesRequired)
+LongPressGestureDetector LongPressGestureDetector::New(uint32_t touchesRequired)
 {
   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(touchesRequired);
 
   return LongPressGestureDetector(internal.Get());
 }
 
-LongPressGestureDetector LongPressGestureDetector::New(unsigned int minTouches, unsigned int maxTouches)
+LongPressGestureDetector LongPressGestureDetector::New(uint32_t minTouches, uint32_t maxTouches)
 {
   Internal::LongPressGestureDetectorPtr internal = Internal::LongPressGestureDetector::New(minTouches, maxTouches);
 
@@ -74,22 +74,22 @@ LongPressGestureDetector& LongPressGestureDetector::operator=(const LongPressGes
   return *this;
 }
 
-void LongPressGestureDetector::SetTouchesRequired(unsigned int touches)
+void LongPressGestureDetector::SetTouchesRequired(uint32_t touches)
 {
   GetImplementation(*this).SetTouchesRequired(touches);
 }
 
-void LongPressGestureDetector::SetTouchesRequired(unsigned int minTouches, unsigned int maxTouches)
+void LongPressGestureDetector::SetTouchesRequired(uint32_t minTouches, uint32_t maxTouches)
 {
   GetImplementation(*this).SetTouchesRequired(minTouches, maxTouches);
 }
 
-unsigned int LongPressGestureDetector::GetMinimumTouchesRequired() const
+uint32_t LongPressGestureDetector::GetMinimumTouchesRequired() const
 {
   return GetImplementation(*this).GetMinimumTouchesRequired();
 }
 
-unsigned int LongPressGestureDetector::GetMaximumTouchesRequired() const
+uint32_t LongPressGestureDetector::GetMaximumTouchesRequired() const
 {
   return GetImplementation(*this).GetMaximumTouchesRequired();
 }
index 111bbf2..3696df0 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/events/gesture-detector.h>
 #include <dali/public-api/signals/dali-signal.h>
@@ -92,7 +95,7 @@ public: // Creation & Destruction
    * @param[in] touchesRequired The number of touches required
    * @return A handle to a newly allocated Dali resource
    */
-  static LongPressGestureDetector New(unsigned int touchesRequired);
+  static LongPressGestureDetector New(uint32_t touchesRequired);
 
   /**
    * @brief Creates an initialized LongPressGestureDetector with the minimum and maximum number of touches required.
@@ -104,7 +107,7 @@ public: // Creation & Destruction
    * @param[in] maxTouches The maximum number of touches required
    * @return A handle to a newly allocated Dali resource
    */
-  static LongPressGestureDetector New(unsigned int minTouches, unsigned int maxTouches);
+  static LongPressGestureDetector New(uint32_t minTouches, uint32_t maxTouches);
 
   /**
    * @brief Downcasts a handle to LongPressGestureDetector handle.
@@ -156,7 +159,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default is '1'.
    */
-  void SetTouchesRequired(unsigned int touches);
+  void SetTouchesRequired(uint32_t touches);
 
   /**
    * @brief Sets the minimum and maximum touches required.
@@ -170,7 +173,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default is '1'.
    */
-  void SetTouchesRequired(unsigned int minTouches, unsigned int maxTouches);
+  void SetTouchesRequired(uint32_t minTouches, uint32_t maxTouches);
 
 public: // Getters
 
@@ -181,7 +184,7 @@ public: // Getters
    * @return The minimum number of touches required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMinimumTouchesRequired() const;
+  uint32_t GetMinimumTouchesRequired() const;
 
   /**
    * @brief Retrieves the maximum number of touches required.
@@ -190,7 +193,7 @@ public: // Getters
    * @return The maximum number of touches required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMaximumTouchesRequired() const;
+  uint32_t GetMaximumTouchesRequired() const;
 
 public: // Signals
 
index 414cc06..d994ea5 100644 (file)
@@ -79,7 +79,7 @@ struct DALI_CORE_API LongPressGesture : public Gesture
    * @brief The number of touch points in this long press gesture, i.e. the number of fingers the user had
    * on the screen to generate the long press gesture.
    */
-  unsigned int numberOfTouches;
+  uint32_t numberOfTouches;
 
   /**
    * @brief This is the point, in screen coordinates, where the long press occurred.
old mode 100644 (file)
new mode 100755 (executable)
similarity index 51%
rename from dali/graphics/vulkan/vulkan-debug.h
rename to dali/public-api/events/mouse-button.h
index 140bd5b..12f18a7
@@ -1,5 +1,5 @@
-#ifndef DALI_GRAPHICS_VULKAN_DEBUG_H
-#define DALI_GRAPHICS_VULKAN_DEBUG_H
+#ifndef DALI_MOUSE_BUTTON_H
+#define DALI_MOUSE_BUTTON_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ *
  */
 
-#if defined(DEBUG_ENABLED)
-
-#include <iostream>
-
-
-extern const char* LOG_VULKAN;
+namespace Dali
+{
+/**
+ * @addtogroup dali_core_events
+ * @{
+ */
 
-#define DALI_LOG_STREAM( filter, level, stream )  \
-  if( nullptr != LOG_VULKAN)                      \
-  {                                               \
-    std::cout << stream << std::endl;             \
-  }
+/**
+ * @brief Mouse Button Type
+ * @SINCE_1_3_31
+ */
+namespace MouseButton
+{
 
-#else
-#define DALI_LOG_STREAM( filter, level, stream )
-#endif
+/**
+ * @brief Enumeration for mouse button type.
+ * @SINCE_1_3_31
+ */
+enum Type
+{
+  INVALID = -1, /**< No mouse button event or invalid data */
+  PRIMARY = 1, /**< Primary(Left) mouse button */
+  SECONDARY = 3, /**< Secondary(Right) mouse button */
+  TERTIARY = 2, /**< Center(Wheel) mouse button */
+};
+}
+
+/**
+ * @}
+ */
+} // namespace Dali
 
-#endif // DALI_GRAPHICS_VULKAN_DEBUG_H
+#endif // __DALI_MOUSE_BUTTON_H__
index 78ed53d..52c3799 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -68,22 +68,22 @@ PanGestureDetector& PanGestureDetector::operator=(const PanGestureDetector& rhs)
   return *this;
 }
 
-void PanGestureDetector::SetMinimumTouchesRequired(unsigned int minimum)
+void PanGestureDetector::SetMinimumTouchesRequired(uint32_t minimum)
 {
   GetImplementation(*this).SetMinimumTouchesRequired(minimum);
 }
 
-void PanGestureDetector::SetMaximumTouchesRequired(unsigned int maximum)
+void PanGestureDetector::SetMaximumTouchesRequired(uint32_t maximum)
 {
   GetImplementation(*this).SetMaximumTouchesRequired(maximum);
 }
 
-unsigned int PanGestureDetector::GetMinimumTouchesRequired() const
+uint32_t PanGestureDetector::GetMinimumTouchesRequired() const
 {
   return GetImplementation(*this).GetMinimumTouchesRequired();
 }
 
-unsigned int PanGestureDetector::GetMaximumTouchesRequired() const
+uint32_t PanGestureDetector::GetMaximumTouchesRequired() const
 {
   return GetImplementation(*this).GetMaximumTouchesRequired();
 }
@@ -105,7 +105,7 @@ size_t PanGestureDetector::GetAngleCount() const
 
 PanGestureDetector::AngleThresholdPair PanGestureDetector::GetAngle(size_t index) const
 {
-  return GetImplementation(*this).GetAngle(index);
+  return GetImplementation(*this).GetAngle( static_cast<uint32_t>( index ) );
 }
 
 void PanGestureDetector::ClearAngles()
index ec83a38..3f6449d 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/events/gesture-detector.h>
 #include <dali/public-api/object/property-index-ranges.h>
@@ -168,7 +171,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default minimum is '1'.
    */
-  void SetMinimumTouchesRequired(unsigned int minimum);
+  void SetMinimumTouchesRequired(uint32_t minimum);
 
   /**
    * @brief This is the maximum number of touches required for the pan gesture to be detected.
@@ -178,7 +181,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default maximum is '1'.
    */
-  void SetMaximumTouchesRequired(unsigned int maximum);
+  void SetMaximumTouchesRequired(uint32_t maximum);
 
 public: // Getters
 
@@ -189,7 +192,7 @@ public: // Getters
    * @return The minimum touches required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMinimumTouchesRequired() const;
+  uint32_t GetMinimumTouchesRequired() const;
 
   /**
    * @brief Retrieves the maximum number of touches required for the pan gesture to be detected.
@@ -198,7 +201,7 @@ public: // Getters
    * @return The maximum touches required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMaximumTouchesRequired() const;
+  uint32_t GetMaximumTouchesRequired() const;
 
 public: // Directional Panning
 
index d2fcb35..8c6dbfb 100644 (file)
@@ -140,7 +140,7 @@ struct DALI_CORE_API PanGesture: public Gesture
   /**
    * @brief The total number of fingers touching the screen in a pan gesture.
    */
-  unsigned int numberOfTouches;
+  uint32_t numberOfTouches;
 
   // Convenience Methods
 
index 9611496..e979fb7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ TapGestureDetector TapGestureDetector::New()
   return TapGestureDetector(internal.Get());
 }
 
-TapGestureDetector TapGestureDetector::New(unsigned int tapsRequired )
+TapGestureDetector TapGestureDetector::New(uint32_t tapsRequired )
 {
   Internal::TapGestureDetectorPtr internal = Internal::TapGestureDetector::New( tapsRequired );
 
@@ -66,22 +66,22 @@ TapGestureDetector& TapGestureDetector::operator=(const TapGestureDetector& rhs)
   return *this;
 }
 
-void TapGestureDetector::SetMinimumTapsRequired(unsigned int taps)
+void TapGestureDetector::SetMinimumTapsRequired(uint32_t taps)
 {
   GetImplementation(*this).SetMinimumTapsRequired(taps);
 }
 
-void TapGestureDetector::SetMaximumTapsRequired(unsigned int taps)
+void TapGestureDetector::SetMaximumTapsRequired(uint32_t taps)
 {
   GetImplementation(*this).SetMaximumTapsRequired(taps);
 }
 
-unsigned int TapGestureDetector::GetMinimumTapsRequired() const
+uint32_t TapGestureDetector::GetMinimumTapsRequired() const
 {
   return GetImplementation(*this).GetMinimumTapsRequired();
 }
 
-unsigned int TapGestureDetector::GetMaximumTapsRequired() const
+uint32_t TapGestureDetector::GetMaximumTapsRequired() const
 {
   return GetImplementation(*this).GetMaximumTapsRequired();
 }
index f51ebb4..0d2b829 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/events/gesture-detector.h>
 #include <dali/public-api/signals/dali-signal.h>
@@ -100,7 +103,7 @@ public: // Creation & Destruction
    * @param[in] tapsRequired The minimum & maximum number of taps required
    * @return A handle to a newly allocated Dali resource
    */
-  static TapGestureDetector New( unsigned int tapsRequired );
+  static TapGestureDetector New( uint32_t tapsRequired );
 
   /**
    * @brief Downcasts a handle to TapGestureDetector handle.
@@ -149,7 +152,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default is '1'.
    */
-  void SetMinimumTapsRequired( unsigned int minimumTaps );
+  void SetMinimumTapsRequired( uint32_t minimumTaps );
 
   /**
    * @brief Sets the maximum number of taps required.
@@ -160,7 +163,7 @@ public: // Setters
    * @pre The gesture detector has been initialized.
    * @note The default is '1'.
    */
-  void SetMaximumTapsRequired( unsigned int maximumTaps );
+  void SetMaximumTapsRequired( uint32_t maximumTaps );
 
 public: // Getters
 
@@ -171,7 +174,7 @@ public: // Getters
    * @return The minimum taps required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMinimumTapsRequired() const;
+  uint32_t GetMinimumTapsRequired() const;
 
   /**
    * @brief Retrieves the maximum number of taps required.
@@ -180,7 +183,7 @@ public: // Getters
    * @return The maximum taps required
    * @pre The gesture detector has been initialized.
    */
-  unsigned int GetMaximumTapsRequired() const;
+  uint32_t GetMaximumTapsRequired() const;
 
 public: // Signals
 
index e752400..6fc6852 100644 (file)
@@ -72,13 +72,13 @@ struct DALI_CORE_API TapGesture : public Gesture
   /**
    * @brief The number of taps in this tap gesture.
    */
-  unsigned int numberOfTaps;
+  uint32_t numberOfTaps;
 
   /**
    * @brief The number of touch points in this tap gesture, i.e. the number of fingers the user had on the
    * screen to generate the tap gesture.
    */
-  unsigned int numberOfTouches;
+  uint32_t numberOfTouches;
 
   /**
    * @brief This is the point, in screen coordinates, where the tap occurred.
old mode 100644 (file)
new mode 100755 (executable)
index a18a927..4461e96
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -112,6 +112,11 @@ Device::Subclass::Type TouchData::GetDeviceSubclass( std::size_t point ) const
   return GetImplementation( *this ).GetDeviceSubclass( point );
 }
 
+MouseButton::Type TouchData::GetMouseButton( std::size_t point ) const
+{
+  return GetImplementation( *this ).GetMouseButton( point );
+}
+
 TouchData::TouchData( Internal::TouchData* internal )
 : BaseHandle( internal )
 {
old mode 100644 (file)
new mode 100755 (executable)
index 9a3dec5..d395427
@@ -27,6 +27,7 @@
 #include <dali/public-api/events/point-state.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/math/degree.h>
+#include <dali/public-api/events/mouse-button.h>
 
 namespace Dali
 {
@@ -241,6 +242,17 @@ public:
    */
   Device::Subclass::Type GetDeviceSubclass( std::size_t point ) const;
 
+
+  /**
+   * @brief Get mouse device's button value (ex: right/left button)
+   *
+   * @SINCE_1_3_31
+   * @param[in] point The point required
+   * @return The mouse button value
+   */
+  MouseButton::Type GetMouseButton( std::size_t point ) const;
+
+
 public: // Not intended for application developers
 
   /// @cond internal
index 2ec7411..9a3a821 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -41,12 +41,12 @@ TouchEvent::~TouchEvent()
 {
 }
 
-unsigned int TouchEvent::GetPointCount() const
+uint32_t TouchEvent::GetPointCount() const
 {
-  return points.size();
+  return static_cast<uint32_t>( points.size() );
 }
 
-const TouchPoint& TouchEvent::GetPoint(unsigned int point) const
+const TouchPoint& TouchEvent::GetPoint( uint32_t point ) const
 {
   DALI_ASSERT_ALWAYS( point < points.size() && "No point at index" );
   return points[point];
index 9ce558e..f4adbf8 100644 (file)
@@ -90,7 +90,7 @@ struct DALI_CORE_API TouchEvent
    * @SINCE_1_0.0
    * @return Total number of Points
    */
-  unsigned int GetPointCount() const DALI_DEPRECATED_API;
+  uint32_t GetPointCount() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_1.37
@@ -104,7 +104,7 @@ struct DALI_CORE_API TouchEvent
    * @note "point" should be less than the value returned by GetPointCount().
    *       If out of range, then program asserts.
    */
-  const TouchPoint& GetPoint(unsigned int point) const DALI_DEPRECATED_API;
+  const TouchPoint& GetPoint( uint32_t point ) const DALI_DEPRECATED_API;
 };
 
 /**
index dbc588d..41a3785 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
 namespace Dali
 {
 
-TouchPoint::TouchPoint(int id, State state, float screenX, float screenY)
+TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY)
 : deviceId(id),
   state(state),
   local(screenX, screenY),
@@ -29,7 +29,7 @@ TouchPoint::TouchPoint(int id, State state, float screenX, float screenY)
 {
 }
 
-TouchPoint::TouchPoint(int id, State state, float screenX, float screenY, float localX, float localY)
+TouchPoint::TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY)
 : deviceId(id),
   state(state),
   local(localX, localY),
index 671ea4d..e6f099b 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/actors/actor.h>
@@ -69,7 +72,7 @@ struct DALI_CORE_API TouchPoint
    * @param[in] screenX The X co-ordinate relative to the screen's origin
    * @param[in] screenY The Y co-ordinate relative to the screen's origin
    */
-  TouchPoint(int id, State state, float screenX, float screenY);
+  TouchPoint(int32_t id, State state, float screenX, float screenY);
 
   /**
    * @brief Constructor.
@@ -82,7 +85,7 @@ struct DALI_CORE_API TouchPoint
    * @param[in] localX  The X co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
    * @param[in] localY  The Y co-ordinate relative to the top-left (0.0, 0.0, 0.5) of the actor
    */
-  TouchPoint(int id, State state, float screenX, float screenY, float localX, float localY);
+  TouchPoint(int32_t id, State state, float screenX, float screenY, float localX, float localY);
 
   /**
    * @brief Destructor.
@@ -95,7 +98,7 @@ struct DALI_CORE_API TouchPoint
   /**
    * @brief Each touch point has a unique device ID which specifies the touch device for that point.
    */
-  int deviceId;
+  int32_t deviceId;
 
   /**
    * @brief State of the point.
index 5bbb271..7494ef0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,9 +23,9 @@ namespace Dali
 
 namespace
 {
-const unsigned int MODIFIER_SHIFT = 0x1;
-const unsigned int MODIFIER_CTRL  = 0x2;
-const unsigned int MODIFIER_ALT   = 0x4;
+const uint32_t MODIFIER_SHIFT = 0x1;
+const uint32_t MODIFIER_CTRL  = 0x2;
+const uint32_t MODIFIER_ALT   = 0x4;
 
 }
 
@@ -39,7 +39,7 @@ WheelEvent::WheelEvent()
 {
 }
 
-WheelEvent::WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int z, unsigned int timeStamp )
+WheelEvent::WheelEvent( Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t z, uint32_t timeStamp )
 : type( type ),
   direction( direction ),
   modifiers( modifiers ),
index a0edc8f..541b33e 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/math/vector2.h>
@@ -72,7 +75,7 @@ struct DALI_CORE_API WheelEvent
    * @param[in] z         The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise)
    * @param[in] timeStamp The time the wheel is being rolled
    */
-  WheelEvent( Type type, int direction, unsigned int modifiers, Vector2 point, int z, unsigned int timeStamp );
+  WheelEvent( Type type, int32_t direction, uint32_t modifiers, Vector2 point, int32_t z, uint32_t timeStamp );
 
   /**
    * @brief Destructor.
@@ -118,12 +121,12 @@ struct DALI_CORE_API WheelEvent
    *
    * 0 means the default vertical wheel, and 1 means horizontal wheel.
    */
-  int direction;
+  int32_t direction;
 
   /**
    * @brief Modifier keys pressed during the event (such as shift, alt and control).
    */
-  unsigned int modifiers;
+  uint32_t modifiers;
 
   /**
    * @brief The co-ordinates of the cursor relative to the top-left of the screen
@@ -135,12 +138,12 @@ struct DALI_CORE_API WheelEvent
    * @brief The offset of the wheel rolling, where positive value means rolling down or clockwise
    * and negative value means rolling up or counter-clockwise.
    */
-  int z;
+  int32_t z;
 
   /**
    * @brief The time when the wheel is being rolled.
    */
-  unsigned int timeStamp;
+  uint32_t timeStamp;
 
 };
 
index ba9f26b..2c25261 100644 (file)
-#
-# Add public-api source files here
-#
-
-public_api_src_files = \
-  $(public_api_src_dir)/actors/actor.cpp \
-  $(public_api_src_dir)/actors/camera-actor.cpp \
-  $(public_api_src_dir)/actors/custom-actor.cpp \
-  $(public_api_src_dir)/actors/custom-actor-impl.cpp \
-  $(public_api_src_dir)/actors/layer.cpp \
-  $(public_api_src_dir)/animation/animation.cpp \
-  $(public_api_src_dir)/animation/alpha-function.cpp \
-  $(public_api_src_dir)/animation/constraint.cpp \
-  $(public_api_src_dir)/animation/constraint-source.cpp \
-  $(public_api_src_dir)/animation/key-frames.cpp \
-  $(public_api_src_dir)/animation/linear-constrainer.cpp \
-  $(public_api_src_dir)/animation/path.cpp \
-  $(public_api_src_dir)/animation/time-period.cpp \
-  $(public_api_src_dir)/common/constants.cpp \
-  $(public_api_src_dir)/common/dali-common.cpp \
-  $(public_api_src_dir)/common/dali-vector.cpp \
-  $(public_api_src_dir)/common/extents.cpp \
-  $(public_api_src_dir)/common/stage.cpp \
-  $(public_api_src_dir)/events/gesture.cpp \
-  $(public_api_src_dir)/events/gesture-detector.cpp \
-  $(public_api_src_dir)/events/hover-event.cpp \
-  $(public_api_src_dir)/events/key-event.cpp \
-  $(public_api_src_dir)/events/long-press-gesture.cpp \
-  $(public_api_src_dir)/events/long-press-gesture-detector.cpp \
-  $(public_api_src_dir)/events/wheel-event.cpp \
-  $(public_api_src_dir)/events/pan-gesture.cpp \
-  $(public_api_src_dir)/events/pan-gesture-detector.cpp \
-  $(public_api_src_dir)/events/pinch-gesture.cpp \
-  $(public_api_src_dir)/events/pinch-gesture-detector.cpp \
-  $(public_api_src_dir)/events/tap-gesture.cpp \
-  $(public_api_src_dir)/events/tap-gesture-detector.cpp \
-  $(public_api_src_dir)/events/touch-point.cpp \
-  $(public_api_src_dir)/events/touch-event.cpp \
-  $(public_api_src_dir)/events/touch-data.cpp \
-  $(public_api_src_dir)/images/image.cpp \
-  $(public_api_src_dir)/images/pixel.cpp \
-  $(public_api_src_dir)/images/pixel-data.cpp \
-  $(public_api_src_dir)/images/buffer-image.cpp \
-  $(public_api_src_dir)/images/frame-buffer-image.cpp \
-  $(public_api_src_dir)/images/encoded-buffer-image.cpp \
-  $(public_api_src_dir)/images/resource-image.cpp \
-  $(public_api_src_dir)/images/native-image.cpp \
-  $(public_api_src_dir)/math/compile-time-math.cpp \
-  $(public_api_src_dir)/math/degree.cpp \
-  $(public_api_src_dir)/math/matrix.cpp \
-  $(public_api_src_dir)/math/matrix3.cpp \
-  $(public_api_src_dir)/math/quaternion.cpp \
-  $(public_api_src_dir)/math/vector2.cpp \
-  $(public_api_src_dir)/math/vector3.cpp \
-  $(public_api_src_dir)/math/vector4.cpp \
-  $(public_api_src_dir)/object/any.cpp \
-  $(public_api_src_dir)/object/base-handle.cpp \
-  $(public_api_src_dir)/object/handle.cpp \
-  $(public_api_src_dir)/object/base-object.cpp \
-  $(public_api_src_dir)/object/object-registry.cpp \
-  $(public_api_src_dir)/object/property.cpp \
-  $(public_api_src_dir)/object/property-array.cpp \
-  $(public_api_src_dir)/object/property-conditions.cpp \
-  $(public_api_src_dir)/object/property-input.cpp \
-  $(public_api_src_dir)/object/property-key.cpp \
-  $(public_api_src_dir)/object/property-map.cpp \
-  $(public_api_src_dir)/object/property-notification.cpp \
-  $(public_api_src_dir)/object/property-types.cpp \
-  $(public_api_src_dir)/object/property-value.cpp \
-  $(public_api_src_dir)/object/ref-object.cpp \
-  $(public_api_src_dir)/render-tasks/render-task.cpp \
-  $(public_api_src_dir)/render-tasks/render-task-list.cpp \
-  $(public_api_src_dir)/rendering/frame-buffer.cpp \
-  $(public_api_src_dir)/rendering/geometry.cpp \
-  $(public_api_src_dir)/rendering/property-buffer.cpp \
-  $(public_api_src_dir)/rendering/texture.cpp \
-  $(public_api_src_dir)/rendering/texture-set.cpp \
-  $(public_api_src_dir)/rendering/renderer.cpp \
-  $(public_api_src_dir)/rendering/sampler.cpp \
-  $(public_api_src_dir)/rendering/shader.cpp \
-  $(public_api_src_dir)/signals/callback.cpp \
-  $(public_api_src_dir)/signals/connection-tracker.cpp \
-  $(public_api_src_dir)/signals/connection-tracker-interface.cpp \
-  $(public_api_src_dir)/signals/signal-slot-connections.cpp \
-  $(public_api_src_dir)/signals/signal-slot-observers.cpp \
-  $(public_api_src_dir)/signals/base-signal.cpp \
-  $(public_api_src_dir)/signals/functor-delegate.cpp \
-  $(public_api_src_dir)/object/type-info.cpp \
-  $(public_api_src_dir)/object/type-registry.cpp \
-  $(public_api_src_dir)/object/weak-handle.cpp \
-  $(public_api_src_dir)/dali-core-version.cpp
+# Set the source directory
+SET( public_api_src_dir ${ROOT_SRC_DIR}/dali/public-api )
 
+#
+SET( public_api_src_files
+  ${public_api_src_dir}/actors/actor.cpp
+  ${public_api_src_dir}/actors/camera-actor.cpp
+  ${public_api_src_dir}/actors/custom-actor.cpp
+  ${public_api_src_dir}/actors/custom-actor-impl.cpp
+  ${public_api_src_dir}/actors/layer.cpp
+  ${public_api_src_dir}/animation/animation.cpp
+  ${public_api_src_dir}/animation/alpha-function.cpp
+  ${public_api_src_dir}/animation/constraint.cpp
+  ${public_api_src_dir}/animation/constraint-source.cpp
+  ${public_api_src_dir}/animation/key-frames.cpp
+  ${public_api_src_dir}/animation/linear-constrainer.cpp
+  ${public_api_src_dir}/animation/path.cpp
+  ${public_api_src_dir}/animation/time-period.cpp
+  ${public_api_src_dir}/common/constants.cpp
+  ${public_api_src_dir}/common/dali-common.cpp
+  ${public_api_src_dir}/common/dali-vector.cpp
+  ${public_api_src_dir}/common/extents.cpp
+  ${public_api_src_dir}/common/stage.cpp
+  ${public_api_src_dir}/events/gesture.cpp
+  ${public_api_src_dir}/events/gesture-detector.cpp
+  ${public_api_src_dir}/events/hover-event.cpp
+  ${public_api_src_dir}/events/key-event.cpp
+  ${public_api_src_dir}/events/long-press-gesture.cpp
+  ${public_api_src_dir}/events/long-press-gesture-detector.cpp
+  ${public_api_src_dir}/events/wheel-event.cpp
+  ${public_api_src_dir}/events/pan-gesture.cpp
+  ${public_api_src_dir}/events/pan-gesture-detector.cpp
+  ${public_api_src_dir}/events/pinch-gesture.cpp
+  ${public_api_src_dir}/events/pinch-gesture-detector.cpp
+  ${public_api_src_dir}/events/tap-gesture.cpp
+  ${public_api_src_dir}/events/tap-gesture-detector.cpp
+  ${public_api_src_dir}/events/touch-point.cpp
+  ${public_api_src_dir}/events/touch-event.cpp
+  ${public_api_src_dir}/events/touch-data.cpp
+  ${public_api_src_dir}/images/image.cpp
+  ${public_api_src_dir}/images/pixel.cpp
+  ${public_api_src_dir}/images/pixel-data.cpp
+  ${public_api_src_dir}/images/buffer-image.cpp
+  ${public_api_src_dir}/images/frame-buffer-image.cpp
+  ${public_api_src_dir}/images/encoded-buffer-image.cpp
+  ${public_api_src_dir}/images/resource-image.cpp
+  ${public_api_src_dir}/images/native-image.cpp
+  ${public_api_src_dir}/math/compile-time-math.cpp
+  ${public_api_src_dir}/math/degree.cpp
+  ${public_api_src_dir}/math/matrix.cpp
+  ${public_api_src_dir}/math/matrix3.cpp
+  ${public_api_src_dir}/math/quaternion.cpp
+  ${public_api_src_dir}/math/vector2.cpp
+  ${public_api_src_dir}/math/vector3.cpp
+  ${public_api_src_dir}/math/vector4.cpp
+  ${public_api_src_dir}/object/any.cpp
+  ${public_api_src_dir}/object/base-handle.cpp
+  ${public_api_src_dir}/object/handle.cpp
+  ${public_api_src_dir}/object/base-object.cpp
+  ${public_api_src_dir}/object/object-registry.cpp
+  ${public_api_src_dir}/object/property.cpp
+  ${public_api_src_dir}/object/property-array.cpp
+  ${public_api_src_dir}/object/property-conditions.cpp
+  ${public_api_src_dir}/object/property-input.cpp
+  ${public_api_src_dir}/object/property-key.cpp
+  ${public_api_src_dir}/object/property-map.cpp
+  ${public_api_src_dir}/object/property-notification.cpp
+  ${public_api_src_dir}/object/property-types.cpp
+  ${public_api_src_dir}/object/property-value.cpp
+  ${public_api_src_dir}/object/ref-object.cpp
+  ${public_api_src_dir}/render-tasks/render-task.cpp
+  ${public_api_src_dir}/render-tasks/render-task-list.cpp
+  ${public_api_src_dir}/rendering/frame-buffer.cpp
+  ${public_api_src_dir}/rendering/geometry.cpp
+  ${public_api_src_dir}/rendering/property-buffer.cpp
+  ${public_api_src_dir}/rendering/texture.cpp
+  ${public_api_src_dir}/rendering/texture-set.cpp
+  ${public_api_src_dir}/rendering/renderer.cpp
+  ${public_api_src_dir}/rendering/sampler.cpp
+  ${public_api_src_dir}/rendering/shader.cpp
+  ${public_api_src_dir}/signals/callback.cpp
+  ${public_api_src_dir}/signals/connection-tracker.cpp
+  ${public_api_src_dir}/signals/connection-tracker-interface.cpp
+  ${public_api_src_dir}/signals/signal-slot-connections.cpp
+  ${public_api_src_dir}/signals/signal-slot-observers.cpp
+  ${public_api_src_dir}/signals/base-signal.cpp
+  ${public_api_src_dir}/signals/functor-delegate.cpp
+  ${public_api_src_dir}/object/type-info.cpp
+  ${public_api_src_dir}/object/type-registry.cpp
+  ${public_api_src_dir}/object/weak-handle.cpp
+  ${public_api_src_dir}/dali-core-version.cpp
+)
 
 #
 # Add public header files here
 #
 
-public_api_header_files = \
-  $(public_api_src_dir)/dali-core.h \
-  $(public_api_src_dir)/dali-core-version.h
-
-public_api_core_actors_header_files =  \
-  $(public_api_src_dir)/actors/actor.h \
-  $(public_api_src_dir)/actors/actor-enumerations.h \
-  $(public_api_src_dir)/actors/camera-actor.h \
-  $(public_api_src_dir)/actors/custom-actor.h \
-  $(public_api_src_dir)/actors/custom-actor-impl.h \
-  $(public_api_src_dir)/actors/draw-mode.h \
-  $(public_api_src_dir)/actors/layer.h \
-  $(public_api_src_dir)/actors/sampling.h
-
-public_api_core_animation_header_files = \
-  $(public_api_src_dir)/animation/alpha-function.h \
-  $(public_api_src_dir)/animation/animation.h \
-  $(public_api_src_dir)/animation/constraint.h \
-  $(public_api_src_dir)/animation/constraints.h \
-  $(public_api_src_dir)/animation/constraint-source.h \
-  $(public_api_src_dir)/animation/key-frames.h \
-  $(public_api_src_dir)/animation/linear-constrainer.h \
-  $(public_api_src_dir)/animation/path.h \
-  $(public_api_src_dir)/animation/time-period.h
-
-public_api_core_common_header_files = \
-  $(public_api_src_dir)/common/compile-time-assert.h \
-  $(public_api_src_dir)/common/constants.h \
-  $(public_api_src_dir)/common/dali-common.h \
-  $(public_api_src_dir)/common/dali-vector.h \
-  $(public_api_src_dir)/common/extents.h \
-  $(public_api_src_dir)/common/intrusive-ptr.h \
-  $(public_api_src_dir)/common/loading-state.h \
-  $(public_api_src_dir)/common/stage.h \
-  $(public_api_src_dir)/common/type-traits.h \
-  $(public_api_src_dir)/common/vector-wrapper.h \
-  $(public_api_src_dir)/common/view-mode.h
-
-public_api_core_events_header_files = \
-  $(public_api_src_dir)/events/device.h \
-  $(public_api_src_dir)/events/gesture.h \
-  $(public_api_src_dir)/events/gesture-detector.h \
-  $(public_api_src_dir)/events/hover-event.h \
-  $(public_api_src_dir)/events/key-event.h \
-  $(public_api_src_dir)/events/long-press-gesture.h \
-  $(public_api_src_dir)/events/long-press-gesture-detector.h \
-  $(public_api_src_dir)/events/wheel-event.h \
-  $(public_api_src_dir)/events/pan-gesture.h \
-  $(public_api_src_dir)/events/pan-gesture-detector.h \
-  $(public_api_src_dir)/events/pinch-gesture.h \
-  $(public_api_src_dir)/events/pinch-gesture-detector.h \
-  $(public_api_src_dir)/events/point-state.h \
-  $(public_api_src_dir)/events/tap-gesture.h \
-  $(public_api_src_dir)/events/tap-gesture-detector.h \
-  $(public_api_src_dir)/events/touch-point.h \
-  $(public_api_src_dir)/events/touch-event.h \
-  $(public_api_src_dir)/events/touch-data.h
-
-public_api_core_images_header_files = \
-  $(public_api_src_dir)/images/buffer-image.h \
-  $(public_api_src_dir)/images/encoded-buffer-image.h \
-  $(public_api_src_dir)/images/frame-buffer-image.h \
-  $(public_api_src_dir)/images/image.h \
-  $(public_api_src_dir)/images/image-operations.h \
-  $(public_api_src_dir)/images/pixel.h \
-  $(public_api_src_dir)/images/pixel-data.h \
-  $(public_api_src_dir)/images/resource-image.h \
-  $(public_api_src_dir)/images/native-image.h \
-  $(public_api_src_dir)/images/native-image-interface.h
-
-public_api_core_math_header_files = \
-  $(public_api_src_dir)/math/angle-axis.h \
-  $(public_api_src_dir)/math/compile-time-math.h \
-  $(public_api_src_dir)/math/degree.h \
-  $(public_api_src_dir)/math/math-utils.h \
-  $(public_api_src_dir)/math/matrix.h \
-  $(public_api_src_dir)/math/matrix3.h \
-  $(public_api_src_dir)/math/quaternion.h \
-  $(public_api_src_dir)/math/radian.h \
-  $(public_api_src_dir)/math/random.h \
-  $(public_api_src_dir)/math/rect.h \
-  $(public_api_src_dir)/math/uint-16-pair.h \
-  $(public_api_src_dir)/math/vector2.h \
-  $(public_api_src_dir)/math/vector3.h \
-  $(public_api_src_dir)/math/vector4.h \
-  $(public_api_src_dir)/math/viewport.h
-
-public_api_core_object_header_files = \
-  $(public_api_src_dir)/object/any.h \
-  $(public_api_src_dir)/object/base-handle.h \
-  $(public_api_src_dir)/object/base-object.h \
-  $(public_api_src_dir)/object/handle.h \
-  $(public_api_src_dir)/object/object-registry.h \
-  $(public_api_src_dir)/object/property-array.h \
-  $(public_api_src_dir)/object/property-conditions.h \
-  $(public_api_src_dir)/object/property-index-ranges.h \
-  $(public_api_src_dir)/object/property-input.h \
-  $(public_api_src_dir)/object/property-key.h \
-  $(public_api_src_dir)/object/property-map.h \
-  $(public_api_src_dir)/object/property-notification-declarations.h \
-  $(public_api_src_dir)/object/property-notification.h \
-  $(public_api_src_dir)/object/property-types.h \
-  $(public_api_src_dir)/object/property-value.h \
-  $(public_api_src_dir)/object/property.h \
-  $(public_api_src_dir)/object/ref-object.h \
-  $(public_api_src_dir)/object/type-info.h \
-  $(public_api_src_dir)/object/type-registry.h \
-  $(public_api_src_dir)/object/type-registry-helper.h \
-  $(public_api_src_dir)/object/weak-handle.h
-
-public_api_core_render_tasks_header_files = \
-  $(public_api_src_dir)/render-tasks/render-task.h \
-  $(public_api_src_dir)/render-tasks/render-task-list.h
-
-public_api_core_rendering_header_files = \
-  $(public_api_src_dir)/rendering/frame-buffer.h \
-  $(public_api_src_dir)/rendering/geometry.h \
-  $(public_api_src_dir)/rendering/property-buffer.h \
-  $(public_api_src_dir)/rendering/texture.h \
-  $(public_api_src_dir)/rendering/texture-set.h \
-  $(public_api_src_dir)/rendering/renderer.h \
-  $(public_api_src_dir)/rendering/sampler.h \
-  $(public_api_src_dir)/rendering/shader.h
-
-public_api_core_size_negotiation_header_files = \
-  $(public_api_src_dir)/size-negotiation/relayout-container.h
-
-public_api_core_signals_header_files = \
-  $(public_api_src_dir)/signals/base-signal.h \
-  $(public_api_src_dir)/signals/callback.h \
-  $(public_api_src_dir)/signals/connection-tracker-interface.h \
-  $(public_api_src_dir)/signals/connection-tracker.h \
-  $(public_api_src_dir)/signals/dali-signal.h \
-  $(public_api_src_dir)/signals/functor-delegate.h \
-  $(public_api_src_dir)/signals/signal-slot-connections.h \
-  $(public_api_src_dir)/signals/signal-slot-observers.h \
-  $(public_api_src_dir)/signals/slot-delegate.h
+SET( public_api_header_files
+  ${public_api_src_dir}/dali-core.h
+  ${public_api_src_dir}/dali-core-version.h
+)
+
+SET( public_api_core_actors_header_files
+  ${public_api_src_dir}/actors/actor.h
+  ${public_api_src_dir}/actors/actor-enumerations.h
+  ${public_api_src_dir}/actors/camera-actor.h
+  ${public_api_src_dir}/actors/custom-actor.h
+  ${public_api_src_dir}/actors/custom-actor-impl.h
+  ${public_api_src_dir}/actors/draw-mode.h
+  ${public_api_src_dir}/actors/layer.h
+  ${public_api_src_dir}/actors/sampling.h
+)
+
+SET( public_api_core_animation_header_files
+  ${public_api_src_dir}/animation/alpha-function.h
+  ${public_api_src_dir}/animation/animation.h
+  ${public_api_src_dir}/animation/constraint.h
+  ${public_api_src_dir}/animation/constraints.h
+  ${public_api_src_dir}/animation/constraint-source.h
+  ${public_api_src_dir}/animation/key-frames.h
+  ${public_api_src_dir}/animation/linear-constrainer.h
+  ${public_api_src_dir}/animation/path.h
+  ${public_api_src_dir}/animation/time-period.h
+)
+
+SET( public_api_core_common_header_files
+  ${public_api_src_dir}/common/compile-time-assert.h
+  ${public_api_src_dir}/common/constants.h
+  ${public_api_src_dir}/common/dali-common.h
+  ${public_api_src_dir}/common/dali-vector.h
+  ${public_api_src_dir}/common/extents.h
+  ${public_api_src_dir}/common/intrusive-ptr.h
+  ${public_api_src_dir}/common/loading-state.h
+  ${public_api_src_dir}/common/stage.h
+  ${public_api_src_dir}/common/type-traits.h
+  ${public_api_src_dir}/common/vector-wrapper.h
+  ${public_api_src_dir}/common/view-mode.h
+)
+
+SET(public_api_core_events_header_files
+  ${public_api_src_dir}/events/device.h
+  ${public_api_src_dir}/events/gesture.h
+  ${public_api_src_dir}/events/gesture-detector.h
+  ${public_api_src_dir}/events/hover-event.h
+  ${public_api_src_dir}/events/key-event.h
+  ${public_api_src_dir}/events/long-press-gesture.h
+  ${public_api_src_dir}/events/long-press-gesture-detector.h
+  ${public_api_src_dir}/events/wheel-event.h
+  ${public_api_src_dir}/events/pan-gesture.h
+  ${public_api_src_dir}/events/pan-gesture-detector.h
+  ${public_api_src_dir}/events/pinch-gesture.h
+  ${public_api_src_dir}/events/pinch-gesture-detector.h
+  ${public_api_src_dir}/events/point-state.h
+  ${public_api_src_dir}/events/tap-gesture.h
+  ${public_api_src_dir}/events/tap-gesture-detector.h
+  ${public_api_src_dir}/events/touch-point.h
+  ${public_api_src_dir}/events/touch-event.h
+  ${public_api_src_dir}/events/touch-data.h
+  ${public_api_src_dir}/events/mouse-button.h
+)
+
+SET(public_api_core_images_header_files
+  ${public_api_src_dir}/images/buffer-image.h
+  ${public_api_src_dir}/images/encoded-buffer-image.h
+  ${public_api_src_dir}/images/frame-buffer-image.h
+  ${public_api_src_dir}/images/image.h
+  ${public_api_src_dir}/images/image-operations.h
+  ${public_api_src_dir}/images/pixel.h
+  ${public_api_src_dir}/images/pixel-data.h
+  ${public_api_src_dir}/images/resource-image.h
+  ${public_api_src_dir}/images/native-image.h
+  ${public_api_src_dir}/images/native-image-interface.h
+)
+
+SET(public_api_core_math_header_files
+  ${public_api_src_dir}/math/angle-axis.h
+  ${public_api_src_dir}/math/compile-time-math.h
+  ${public_api_src_dir}/math/degree.h
+  ${public_api_src_dir}/math/math-utils.h
+  ${public_api_src_dir}/math/matrix.h
+  ${public_api_src_dir}/math/matrix3.h
+  ${public_api_src_dir}/math/quaternion.h
+  ${public_api_src_dir}/math/radian.h
+  ${public_api_src_dir}/math/random.h
+  ${public_api_src_dir}/math/rect.h
+  ${public_api_src_dir}/math/uint-16-pair.h
+  ${public_api_src_dir}/math/vector2.h
+  ${public_api_src_dir}/math/vector3.h
+  ${public_api_src_dir}/math/vector4.h
+  ${public_api_src_dir}/math/viewport.h
+)
+
+SET(public_api_core_object_header_files
+  ${public_api_src_dir}/object/any.h
+  ${public_api_src_dir}/object/base-handle.h
+  ${public_api_src_dir}/object/base-object.h
+  ${public_api_src_dir}/object/handle.h
+  ${public_api_src_dir}/object/object-registry.h
+  ${public_api_src_dir}/object/property-array.h
+  ${public_api_src_dir}/object/property-conditions.h
+  ${public_api_src_dir}/object/property-index-ranges.h
+  ${public_api_src_dir}/object/property-input.h
+  ${public_api_src_dir}/object/property-key.h
+  ${public_api_src_dir}/object/property-map.h
+  ${public_api_src_dir}/object/property-notification-declarations.h
+  ${public_api_src_dir}/object/property-notification.h
+  ${public_api_src_dir}/object/property-types.h
+  ${public_api_src_dir}/object/property-value.h
+  ${public_api_src_dir}/object/property.h
+  ${public_api_src_dir}/object/ref-object.h
+  ${public_api_src_dir}/object/type-info.h
+  ${public_api_src_dir}/object/type-registry.h
+  ${public_api_src_dir}/object/type-registry-helper.h
+  ${public_api_src_dir}/object/weak-handle.h
+)
+
+SET(public_api_core_render_tasks_header_files
+  ${public_api_src_dir}/render-tasks/render-task.h
+  ${public_api_src_dir}/render-tasks/render-task-list.h
+)
+
+SET(public_api_core_rendering_header_files
+  ${public_api_src_dir}/rendering/frame-buffer.h
+  ${public_api_src_dir}/rendering/geometry.h
+  ${public_api_src_dir}/rendering/property-buffer.h
+  ${public_api_src_dir}/rendering/texture.h
+  ${public_api_src_dir}/rendering/texture-set.h
+  ${public_api_src_dir}/rendering/renderer.h
+  ${public_api_src_dir}/rendering/sampler.h
+  ${public_api_src_dir}/rendering/shader.h
+)
+
+SET(public_api_core_size_negotiation_header_files
+  ${public_api_src_dir}/size-negotiation/relayout-container.h
+)
+
+SET(public_api_core_signals_header_files
+  ${public_api_src_dir}/signals/base-signal.h
+  ${public_api_src_dir}/signals/callback.h
+  ${public_api_src_dir}/signals/connection-tracker-interface.h
+  ${public_api_src_dir}/signals/connection-tracker.h
+  ${public_api_src_dir}/signals/dali-signal.h
+  ${public_api_src_dir}/signals/functor-delegate.h
+  ${public_api_src_dir}/signals/signal-slot-connections.h
+  ${public_api_src_dir}/signals/signal-slot-observers.h
+  ${public_api_src_dir}/signals/slot-delegate.h
+)
+
+SET( SOURCES ${SOURCES}
+  ${public_api_src_files}
+)
+
+SET( PUBLIC_API_HEADERS ${PUBLIC_API_HEADERS}
+  ${public_api_header_files}
+  ${public_api_core_actors_header_files}
+  ${public_api_core_animation_header_files}
+  ${public_api_core_common_header_files}
+  ${public_api_core_events_header_files}
+  ${public_api_core_images_header_files}
+  ${public_api_core_math_header_files}
+  ${public_api_core_object_header_files}
+  ${public_api_core_render_tasks_header_files}
+  ${public_api_core_rendering_header_files}
+  ${public_api_core_size_negotiation_header_files}
+  ${public_api_core_signals_header_files}
+)
index 6be47d3..205f4cc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -66,7 +66,7 @@ const BufferImage BufferImage::WHITE()
   return BufferImage(internal);
 }
 
-BufferImage BufferImage::New(unsigned int width, unsigned int height, Pixel::Format pixelformat)
+BufferImage BufferImage::New(uint32_t width, uint32_t height, Pixel::Format pixelformat)
 {
   DALI_ASSERT_ALWAYS( 0u != width  && "Invalid BufferImage width requested" );
   DALI_ASSERT_ALWAYS( 0u != height && "Invalid BufferImage height requested" );
@@ -75,7 +75,7 @@ BufferImage BufferImage::New(unsigned int width, unsigned int height, Pixel::For
   return BufferImage(internal.Get());
 }
 
-BufferImage BufferImage::New(PixelBuffer* pixBuf, unsigned int width, unsigned int height, Pixel::Format pixelformat, unsigned int stride)
+BufferImage BufferImage::New(PixelBuffer* pixBuf, uint32_t width, uint32_t height, Pixel::Format pixelformat, uint32_t stride)
 {
   DALI_ASSERT_ALWAYS( 0u != width  && "Invalid BufferImage width requested" );
   DALI_ASSERT_ALWAYS( 0u != height && "Invalid BufferImage height requested" );
@@ -89,12 +89,12 @@ PixelBuffer* BufferImage::GetBuffer()
   return GetImplementation(*this).GetBuffer();
 }
 
-unsigned int BufferImage::GetBufferSize() const
+uint32_t BufferImage::GetBufferSize() const
 {
   return GetImplementation(*this).GetBufferSize();
 }
 
-unsigned int BufferImage::GetBufferStride() const
+uint32_t BufferImage::GetBufferStride() const
 {
   return GetImplementation(*this).GetBufferStride();
 }
index 1515f11..a6d72ad 100644 (file)
@@ -35,8 +35,8 @@ namespace Internal DALI_INTERNAL
 class BufferImage;
 }
 
-typedef unsigned char         PixelBuffer;  ///< pixel data buffer @SINCE_1_0.0
-typedef Rect<unsigned int>    RectArea;     ///< rectangular area (x,y,w,h) @SINCE_1_0.0
+typedef uint8_t        PixelBuffer;  ///< pixel data buffer @SINCE_1_0.0
+typedef Rect<uint32_t> RectArea;     ///< rectangular area (x,y,w,h) @SINCE_1_0.0
 
 
 /**
@@ -84,8 +84,8 @@ public:
    * @note default resource management policies are Immediate and Never
    *
    */
-  static BufferImage New(unsigned int width,
-                         unsigned int height,
+  static BufferImage New(uint32_t width,
+                         uint32_t height,
                          Pixel::Format pixelformat=Pixel::RGBA8888) DALI_DEPRECATED_API;
 
   /**
@@ -113,10 +113,10 @@ public:
    * @pre width & height are greater than zero
    */
   static BufferImage New(PixelBuffer*  pixelBuffer,
-                         unsigned int  width,
-                         unsigned int  height,
+                         uint32_t  width,
+                         uint32_t  height,
                          Pixel::Format pixelFormat=Pixel::RGBA8888,
-                         unsigned int  stride=0) DALI_DEPRECATED_API;
+                         uint32_t  stride=0) DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_2.41
@@ -200,7 +200,7 @@ public:
    * @SINCE_1_0.0
    * @return The buffer size in bytes
    */
-  unsigned int GetBufferSize() const DALI_DEPRECATED_API;
+  uint32_t GetBufferSize() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_2.41
@@ -210,7 +210,7 @@ public:
    * @SINCE_1_0.0
    * @return The buffer stride
    */
-  unsigned int GetBufferStride() const DALI_DEPRECATED_API;
+  uint32_t GetBufferStride() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_2.41
index d160582..49893c5 100644 (file)
@@ -18,9 +18,6 @@
  *
  */
 
-// EXTERNAL INCLUDES
-#include <stdint.h>
-
 // INTERNAL INCLUDES
 #include <dali/public-api/images/image.h>
 #include <dali/public-api/images/image-operations.h>
index 5a97369..572ce79 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -51,12 +51,12 @@ FrameBufferImage& FrameBufferImage::operator=( const FrameBufferImage& rhs )
   return *this;
 }
 
-FrameBufferImage FrameBufferImage::New( unsigned int width, unsigned int height, Pixel::Format pixelformat, RenderBuffer::Format bufferformat )
+FrameBufferImage FrameBufferImage::New( uint32_t width, uint32_t height, Pixel::Format pixelformat, RenderBuffer::Format bufferformat )
 {
   Dali::Vector2 stageSize = Stage::GetCurrent().GetSize();
   Internal::FrameBufferImagePtr internal = Internal::FrameBufferImage::New(
-    (0 == width) ? stageSize.width : width,
-    (0 == height) ? stageSize.height : height,
+    (0 == width) ? static_cast<uint32_t>( stageSize.width ) : width,
+    (0 == height) ? static_cast<uint32_t>( stageSize.height ) : height,
     pixelformat,
     bufferformat);
 
index d7f4051..6230932 100644 (file)
@@ -91,7 +91,7 @@ public:
    * @return A handle to a new instance of a FrameBufferImage
    * @post When the FrameBufferImage is first used as a render target, an exception may be thrown if pixelFormat is not supported on the hardware platform.
    */
-  static FrameBufferImage New(unsigned int width = 0, unsigned int height = 0, Pixel::Format pixelFormat = Pixel::RGBA8888,
+  static FrameBufferImage New(uint32_t width = 0, uint32_t height = 0, Pixel::Format pixelFormat = Pixel::RGBA8888,
                               RenderBuffer::Format bufferFormat = RenderBuffer::COLOR) DALI_DEPRECATED_API;
 
   /**
index a512971..e5888ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -53,12 +53,12 @@ Image Image::DownCast( BaseHandle handle )
   return Image( dynamic_cast<Dali::Internal::Image*>(handle.GetObjectPtr()) );
 }
 
-unsigned int Image::GetWidth() const
+uint32_t Image::GetWidth() const
 {
   return GetImplementation(*this).GetWidth();
 }
 
-unsigned int Image::GetHeight() const
+uint32_t Image::GetHeight() const
 {
   return GetImplementation(*this).GetHeight();
 }
index 66af4ff..7c649a2 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
@@ -138,7 +139,7 @@ public:
    * @SINCE_1_0.0
    * @return Width of the image in pixels
    */
-  unsigned int GetWidth() const DALI_DEPRECATED_API;
+  uint32_t GetWidth() const DALI_DEPRECATED_API;
 
   /**
    * @DEPRECATED_1_2.41
@@ -150,7 +151,7 @@ public:
    * @SINCE_1_0.0
    * @return Height of the image in pixels
    */
-  unsigned int GetHeight() const DALI_DEPRECATED_API;
+  uint32_t GetHeight() const DALI_DEPRECATED_API;
 
 public: // Signals
 
index ea18111..a3b4531 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTEGRATION_NATIVE_IMAGE_INTERFACE_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <cstddef>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/ref-object.h>
@@ -69,7 +70,7 @@ public:
    * @return A GL error code
    * @pre There is a GL context for the current thread.
    */
-  virtual unsigned int TargetTexture() = 0;
+  virtual uint32_t TargetTexture() = 0;
 
   /**
    * @brief Called internally for each Bind call for this texture to allow implementation specific operations.
@@ -86,7 +87,7 @@ public:
    * @SINCE_1_0.0
    * @return Width
    */
-  virtual unsigned int GetWidth() const = 0;
+  virtual uint32_t GetWidth() const = 0;
 
   /**
    * @brief Returns the height of the NativeImage.
@@ -94,7 +95,7 @@ public:
    * @SINCE_1_0.0
    * @return Height
    */
-  virtual unsigned int GetHeight() const = 0;
+  virtual uint32_t GetHeight() const = 0;
 
  /**
   * @brief Queries whether blending is required.
index 1432b5d..b4e7cb3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 // CLASS HEADER
-#include "pixel-data.h"
-
-// EXTERNAL INLCUDES
-#include <stdlib.h>
+#include <dali/public-api/images/pixel-data.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/event/images/pixel-data-impl.h>
 namespace Dali
 {
 
-PixelData PixelData::New(unsigned char* buffer,
-                         unsigned int bufferSize,
-                         unsigned int width,
-                         unsigned int height,
-                         Pixel::Format pixelFormat,
-                         ReleaseFunction releaseFunction)
+PixelData PixelData::New( uint8_t* buffer,
+                          uint32_t bufferSize,
+                          uint32_t width,
+                          uint32_t height,
+                          Pixel::Format pixelFormat,
+                          ReleaseFunction releaseFunction )
 {
   IntrusivePtr<Internal::PixelData> internal = Internal::PixelData::New( buffer, bufferSize, width, height, pixelFormat, releaseFunction );
   return PixelData( internal.Get() );
@@ -62,12 +59,12 @@ PixelData& PixelData::operator=(const PixelData& rhs)
   return *this;
 }
 
-unsigned int PixelData::GetWidth() const
+uint32_t PixelData::GetWidth() const
 {
   return GetImplementation(*this).GetWidth();
 }
 
-unsigned int PixelData::GetHeight() const
+uint32_t PixelData::GetHeight() const
 {
   return GetImplementation(*this).GetHeight();
 }
index 2347433..19ffe30 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint8_t, uint32_t
+
+// INTERNAL INCLUDES
 #include <dali/public-api/images/pixel.h>
 #include <dali/public-api/object/base-handle.h>
 
@@ -62,10 +66,10 @@ public:
    * @param[in] releaseFunction The function used to release the memory
    * @return A handle to the PixelData
    */
-  static PixelData New( unsigned char* buffer,
-                        unsigned int bufferSize,
-                        unsigned int width,
-                        unsigned int height,
+  static PixelData New( uint8_t* buffer,
+                        uint32_t bufferSize,
+                        uint32_t width,
+                        uint32_t height,
                         Pixel::Format pixelFormat,
                         ReleaseFunction releaseFunction);
 
@@ -107,7 +111,7 @@ public:
    * @SINCE_1_1.43
    * @return The width of the buffer in pixels
    */
-  unsigned int GetWidth() const;
+  uint32_t GetWidth() const;
 
   /**
    * @brief Gets the height of the buffer in pixels.
@@ -115,7 +119,7 @@ public:
    * @SINCE_1_1.43
    * @return The height of the buffer in pixels
    */
-  unsigned int GetHeight() const;
+  uint32_t GetHeight() const;
 
   /**
    * @brief Gets the pixel format.
index 725d9e0..b50816f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -99,7 +99,7 @@ bool Pixel::HasAlpha(Format pixelformat)
   return false;
 }
 
-unsigned int Pixel::GetBytesPerPixel(Format pixelFormat)
+uint32_t Pixel::GetBytesPerPixel(Format pixelFormat)
 {
   switch (pixelFormat)
   {
index bb80167..f699af4 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 
@@ -144,7 +147,7 @@ DALI_CORE_API bool HasAlpha(Format pixelformat);
  * @param[in] pixelFormat The pixel format
  * @return The number of bytes per pixel
  */
-DALI_CORE_API unsigned int GetBytesPerPixel(Format pixelFormat);
+DALI_CORE_API uint32_t GetBytesPerPixel(Format pixelFormat);
 
 /**
  * @brief Returns the offset of the byte containing the alpha value from the start of the pixel data
index d5d50f5..1042bd1 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_MATH_UTILS_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/common/constants.h>
@@ -38,9 +41,9 @@ namespace Dali
  * @param[in] i Input number
  * @return The next power of two or i itself in case it's a power of two
  */
-inline unsigned int NextPowerOfTwo( unsigned int i )
+inline uint32_t NextPowerOfTwo( uint32_t i )
 {
-  DALI_ASSERT_ALWAYS(i <= 1u << (sizeof(unsigned) * 8 - 1) && "Return type cannot represent the next power of two greater than the argument.");
+  DALI_ASSERT_ALWAYS(i <= 1u << (sizeof(uint32_t) * 8 - 1) && "Return type cannot represent the next power of two greater than the argument.");
   if(i==0u)
   {
     return 1u;
@@ -63,7 +66,7 @@ inline unsigned int NextPowerOfTwo( unsigned int i )
  * @param[in] i Input number
  * @return    True if i is power of two.
  */
-inline bool IsPowerOfTwo( unsigned int i )
+inline bool IsPowerOfTwo( uint32_t i )
 {
   return (i != 0u) && ((i & (i - 1u)) == 0u);
 }
@@ -131,7 +134,7 @@ inline float GetRangedEpsilon( float a, float b )
   const float absA = fabsf( a );
   const float absB = fabsf( b );
   const float absF = absA > absB ? absA : absB;
-  const int absI = absF;
+  const int32_t absI = static_cast<int32_t>( absF ); // truncated
 
   float epsilon = Math::MACHINE_EPSILON_10000;
   if (absF < 0.1f)
@@ -207,12 +210,12 @@ inline bool Equals( float a, float b, float epsilon )
  * @param[in] pos decimal place
  * @return a rounded float
  */
-inline float Round(float value, int pos)
+inline float Round( float value, int32_t pos )
 {
   float temp;
-  temp = value * powf( 10, pos );
-  temp = floorf( temp + 0.5 );
-  temp *= powf( 10, -pos );
+  temp = value * powf( 10.f, static_cast<float>( pos ) );
+  temp = floorf( temp + 0.5f );
+  temp *= powf( 10.f, static_cast<float>( -pos ) );
   return temp;
 }
 
@@ -275,8 +278,8 @@ inline float WrapInDomain(float x, float start, float end)
  * @endcode
  *
  * Knowing the shortest distance is useful with wrapped domains
- * to solve problems such as determing the closest object to
- * a given point, or determing whether turning left or turning
+ * to solve problems such as determining the closest object to
+ * a given point, or determining whether turning left or turning
  * right is the shortest route to get from angle 10 degrees
  * to angle 350 degrees (clearly in a 0-360 degree domain, turning
  * left 20 degrees is quicker than turning right 340 degrees).
@@ -334,7 +337,7 @@ inline float ShortestDistanceInDomain( float a, float b, float start, float end
  * @return -1 for negative values, +1 for positive values and 0 if value is 0
  */
 template <typename T>
-int Sign( T value )
+int32_t Sign( T value )
 {
   return ( T(0) < value ) - ( value < T(0) );
 }
index 7892f3a..8e2f23f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <cmath>
-#include <cstring> // for memcpy
+#include <cstdint> // uint32_t
+#include <cstring> // memcpy
 #include <ostream>
 
 // INTERNAL INCLUDES
@@ -35,12 +36,12 @@ namespace
 {
 const float ROTATION_EPSILON = 0.003f; // Deliberately large
 
-const size_t NUM_BYTES_IN_ROW_OF_3( 3 * sizeof( float ) );
-const size_t NUM_BYTES_IN_ROW( 4 * sizeof( float ) );
-const size_t NUM_BYTES_IN_MATRIX( 16 * sizeof( float ) );
-const size_t ROW1_OFFSET( 4 );
-const size_t ROW2_OFFSET( 8 );
-const size_t ROW3_OFFSET( 12 );
+const uint32_t NUM_BYTES_IN_ROW_OF_3( 3 * sizeof( float ) );
+const uint32_t NUM_BYTES_IN_ROW( 4 * sizeof( float ) );
+const uint32_t NUM_BYTES_IN_MATRIX( 16 * sizeof( float ) );
+const uint32_t ROW1_OFFSET( 4 );
+const uint32_t ROW2_OFFSET( 8 );
+const uint32_t ROW3_OFFSET( 12 );
 
 /**
  * Helper to convert to Quaternion to float16 array
@@ -192,9 +193,9 @@ static bool InvertMatrix(const float* m, float* out)
     return false;
   }
 
-  det = 1.0 / det;
+  det = 1.0f / det;
 
-  for (int i = 0; i < 16; i++)
+  for( int32_t i = 0; i < 16; i++)
   {
     out[i] = inv[i] * det;
   }
@@ -274,13 +275,13 @@ void Matrix::Multiply( Matrix& result, const Matrix& lhs, const Matrix& rhs )
 
 #ifndef  __ARM_NEON__
 
-  for( int i=0; i < 4; i++ )
+  for( int32_t i=0; i < 4; i++ )
   {
     // i<<2 gives the first vector / column
-    int loc = i<<2;
-    int loc1 = loc + 1;
-    int loc2 = loc + 2;
-    int loc3 = loc + 3;
+    int32_t loc = i<<2;
+    int32_t loc1 = loc + 1;
+    int32_t loc2 = loc + 2;
+    int32_t loc3 = loc + 3;
     float value0 = lhsPtr[loc];
     float value1 = lhsPtr[loc1];
     float value2 = lhsPtr[loc2];
@@ -360,13 +361,13 @@ void Matrix::Multiply( Matrix& result, const Matrix& lhs, const Quaternion& rhs
 
 #ifndef  __ARM_NEON__
 
-  for( int i=0; i < 4; i++ )
+  for( int32_t i=0; i < 4; i++ )
   {
     // i<<2 gives the first vector / column
-    int loc = i<<2;
-    int loc1 = loc + 1;
-    int loc2 = loc + 2;
-    int loc3 = loc + 3;
+    int32_t loc = i<<2;
+    int32_t loc1 = loc + 1;
+    int32_t loc2 = loc + 2;
+    int32_t loc3 = loc + 3;
     float value0 = lhsPtr[loc];
     float value1 = lhsPtr[loc1];
     float value2 = lhsPtr[loc2];
old mode 100644 (file)
new mode 100755 (executable)
index 91faed2..247acea
@@ -60,7 +60,7 @@ class DALI_CORE_API Matrix
 {
 public:
 
-  friend std::ostream& operator<< (std::ostream& o, const Matrix& matrix);
+  friend DALI_CORE_API std::ostream& operator<< (std::ostream& o, const Matrix& matrix);
 
   /**
    * @brief Constructor.
index 50f7903..5fe55c3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,8 @@
 #include <dali/public-api/math/matrix3.h>
 
 // EXTERNAL INCLUDES
-#include <cstring> // for memcpy
+#include <cstdint> // uint32_t
+#include <cstring> // memcpy
 #include <ostream>
 
 // INTERNAL INCLUDES
@@ -43,8 +44,8 @@
 
 namespace
 {
-const size_t NUM_BYTES_IN_ROW    = 3*sizeof(float);
-const size_t NUM_BYTES_IN_MATRIX = 9*sizeof(float);
+const uint32_t NUM_BYTES_IN_ROW    = 3*sizeof(float);
+const uint32_t NUM_BYTES_IN_MATRIX = 9*sizeof(float);
 }
 
 namespace Dali
@@ -136,8 +137,8 @@ bool Matrix3::Invert()
   // In the case where the determinant is exactly zero, the matrix is non-invertible
   if( ! EqualsZero( det ) )
   {
-    det = 1.0 / det;
-    for (int i = 0; i < 9; i++)
+    det = 1.0f / det;
+    for( int32_t i = 0; i < 9; i++ )
     {
       mElements[i] = cof[i] * det;
     }
@@ -179,7 +180,7 @@ bool Matrix3::ScaledInverseTranspose()
   {
     // Use average rather than determinant to remove rounding to zero errors in further multiplication
     float sum=0;
-    for(size_t i=0;i<9;i++)
+    for(uint32_t i=0;i<9;i++)
     {
       sum+=fabsf(cof[i]);
     }
@@ -223,7 +224,7 @@ void Matrix3::Scale(float scale)
 float Matrix3::Magnitude() const
 {
   float avg=0;
-  for(size_t i=0;i<9;i++)
+  for(uint32_t i=0;i<9;i++)
   {
     avg+=fabsf(mElements[i]);
   }
@@ -237,11 +238,11 @@ void Matrix3::Multiply( Matrix3& result, const Matrix3& lhs, const Matrix3& rhs
   const float* rhsPtr  = rhs.AsFloat();
   const float* lhsPtr = lhs.AsFloat();
 
-  for( int i=0; i < 3; i++ )
+  for( int32_t i=0; i < 3; i++ )
   {
-    int loc = i * 3;
-    int loc1 = loc + 1;
-    int loc2 = loc + 2;
+    int32_t loc = i * 3;
+    int32_t loc1 = loc + 1;
+    int32_t loc2 = loc + 2;
 
     float value0 = lhsPtr[loc];
     float value1 = lhsPtr[loc1];
old mode 100644 (file)
new mode 100755 (executable)
index 2c3ee6c..91cf7f4
@@ -56,7 +56,7 @@ class DALI_CORE_API Matrix3
 {
 public:
 
-  friend std::ostream& operator<< (std::ostream& o, const Matrix3& matrix);
+  friend DALI_CORE_API std::ostream& operator<< (std::ostream& o, const Matrix3& matrix);
 
   /**
    * @brief The identity matrix.
index 46cd4b2..4abdb44 100644 (file)
@@ -470,7 +470,7 @@ float Quaternion::AngleBetween( const Quaternion& q1, const Quaternion& q2 )
   //Formula for angle θ between two quaternion is:
   //θ = cos^−1 (2⟨q1,q2⟩^2 − 1), Where (q1,q2) is inner product of the quaternions.
   float X = from.mVector.Dot4(to.mVector);
-  float theta = acos( (2 * X * X) - 1);
+  float theta = acosf( (2 * X * X) - 1); // float arc cosine
 
   return theta;
 }
index 2d5d237..1b08956 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_RANDOM_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -54,13 +54,13 @@ inline float Range(float f0, float f1)
   static bool initialized( false );
   if( !initialized )
   {
-    auto seed = time( NULL );
+    uint32_t seed = static_cast<uint32_t>( time( NULL ) );
     srand( seed );
     initialized = true;
   }
 
-  auto randValue = rand();
-  return (randValue & 0xfff) * (1.0f/4095.0f) * (max-min) + min;
+  int32_t randValue = rand();
+  return static_cast<float>(randValue & 0xfff) * (1.0f/4095.0f) * (max-min) + min;
 }
 
 /**
index 1ecd8f3..2d7df33 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
 #include <iosfwd>
 
 // INTERNAL INCLUDES
@@ -354,7 +355,7 @@ public:
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  const float& operator[](const unsigned int index) const
+  const float& operator[](const uint32_t index) const
   {
     DALI_ASSERT_ALWAYS( index < 2 && "Vector element index out of bounds" );
 
@@ -369,7 +370,7 @@ public:
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  float& operator[](const unsigned int index)
+  float& operator[](const uint32_t index)
   {
     DALI_ASSERT_ALWAYS( index < 2 && "Vector element index out of bounds" );
 
index 213651c..1a98005 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
 #include <iosfwd>
 
 // INTERNAL INCLUDES
@@ -340,7 +341,7 @@ struct DALI_CORE_API Vector3
    * @brief Unary negation operator.
    *
    * @SINCE_1_0.0
-   * @return A vector containg the negation
+   * @return A vector containing the negation
    */
   Vector3 operator-() const
   {
@@ -382,7 +383,7 @@ struct DALI_CORE_API Vector3
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  const float& operator[](const unsigned int index) const
+  const float& operator[](const uint32_t index) const
   {
     DALI_ASSERT_ALWAYS( index < 3 && "Vector element index out of bounds" );
 
@@ -397,7 +398,7 @@ struct DALI_CORE_API Vector3
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  float& operator[](const unsigned int index)
+  float& operator[](const uint32_t index)
   {
     DALI_ASSERT_ALWAYS( index < 3 && "Vector element index out of bounds" );
 
index 7516001..a42c55a 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
 #include <iosfwd>
 
 // INTERNAL INCLUDES
@@ -388,7 +389,7 @@ struct DALI_CORE_API Vector4
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  const float& operator[](const unsigned int index) const
+  const float& operator[](const uint32_t index) const
   {
     DALI_ASSERT_ALWAYS( index < 4 && "Vector element index out of bounds" );
 
@@ -403,7 +404,7 @@ struct DALI_CORE_API Vector4
    * @param[in] index Subscript index
    * @return The float at the given index
    */
-  float& operator[](const unsigned int index)
+  float& operator[](const uint32_t index)
   {
     DALI_ASSERT_ALWAYS( index < 4 && "Vector element index out of bounds" );
 
index cec1c15..b137a64 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_VIEWPORT_H__
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // int32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/math/rect.h>
 
@@ -32,7 +35,7 @@ namespace Dali
  * @brief Typedef for a viewport ( a rectangle representing a screen area ).
  * @SINCE_1_0.0
  */
-typedef Rect<int> Viewport;
+typedef Rect<int32_t> Viewport;
 
 /**
  * @}
index 4752fc0..e3fac2a 100644 (file)
@@ -41,7 +41,7 @@ namespace Dali
  * Any floatVariable( 4.5f );
  * Any strVariable( std::string( "Hello world" ) );
  * uintVariable = 1u;
- * unsigned int variable = AnyCast< unsigned int >( uintVariable );
+ * uint32_t variable = AnyCast< uint32_t >( uintVariable );
  * if ( typeid( int ) == uintVariable.GetType() )
  * \endcode
  * @SINCE_1_0.0
index 861e1e7..36b1887 100644 (file)
@@ -158,8 +158,8 @@ public:
    * @brief Returns the type info for the Handle.
    *
    * @SINCE_1_0.0
-   * @param[in] info The type information
-   * @return The type info
+   * @param[out] info The type information
+   * @return true if the type info exists
    */
   bool GetTypeInfo(Dali::TypeInfo& info) const;
 
index a464952..bb618ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
 #include <dali/internal/event/common/object-registry-impl.h>
 #include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/common/type-registry-impl.h>
+#include <dali/internal/event/common/thread-local-storage.h>
 
 namespace Dali
 {
@@ -38,20 +39,21 @@ BaseObject::~BaseObject()
 
 void BaseObject::RegisterObject()
 {
-  Internal::Stage* stage = Internal::Stage::GetCurrent();
-  if( stage )
+  Internal::ThreadLocalStorage* tls = Internal::ThreadLocalStorage::GetInternal();
+  if ( tls )
   {
-    stage->RegisterObject( this );
+    tls->GetEventThreadServices().RegisterObject( this );
   }
 }
 
 void BaseObject::UnregisterObject()
 {
+  Internal::ThreadLocalStorage* tls = Internal::ThreadLocalStorage::GetInternal();
+
   // Guard to allow handle destruction after Core has been destroyed
-  Internal::Stage* stage = Internal::Stage::GetCurrent();
-  if( stage )
+  if( tls )
   {
-    stage->UnregisterObject( this );
+    tls->GetEventThreadServices().UnregisterObject( this );
   }
 }
 
@@ -73,10 +75,10 @@ const std::string& BaseObject::GetTypeName() const
 
   if( registry )
   {
-    Dali::TypeInfo typeInfo = registry->GetTypeInfo(this);
+    Internal::TypeRegistry::TypeInfoPointer typeInfo = registry->GetTypeInfo(this);
     if( typeInfo )
     {
-      return typeInfo.GetName();
+      return typeInfo->GetName();
     }
   }
 
@@ -90,10 +92,10 @@ bool BaseObject::GetTypeInfo(Dali::TypeInfo& typeInfo) const
 {
   Dali::Internal::TypeRegistry* registry = Dali::Internal::TypeRegistry::Get();
 
-  Dali::TypeInfo info = registry->GetTypeInfo(this);
+  Internal::TypeRegistry::TypeInfoPointer info = registry->GetTypeInfo(this);
   if(info)
   {
-    typeInfo = info;
+    typeInfo = Dali::TypeInfo( info.Get() );
     return true;
   }
   else
index 9628240..6a72755 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@
 #include <dali/public-api/object/property-notification.h>
 #include <dali/internal/event/animation/constraint-impl.h>
 #include <dali/internal/event/common/object-impl.h>
-#include <dali/internal/event/object/custom-object-internal.h>
 #include <dali/integration-api/debug.h>
 
 namespace Dali
@@ -42,7 +41,7 @@ Handle::Handle()
 
 Handle Handle::New()
 {
-  return Handle( Internal::CustomObject::New() );
+  return Handle( Internal::Object::New().Get() );
 }
 
 Handle::~Handle()
@@ -75,7 +74,7 @@ bool Handle::Supports( Capability capability ) const
   return GetImplementation(*this).Supports( capability );
 }
 
-unsigned int Handle::GetPropertyCount() const
+uint32_t Handle::GetPropertyCount() const
 {
   return GetImplementation(*this).GetPropertyCount();
 }
@@ -132,7 +131,7 @@ Property::Value Handle::GetProperty( Property::Index index ) const
 
 Property::Value Handle::GetCurrentProperty( Property::Index index ) const
 {
-  return GetImplementation( *this ).GetCurrentProperty( index );
+  return GetImplementation(*this).GetCurrentProperty( index );
 }
 
 void Handle::GetPropertyIndices( Property::IndexContainer& indices ) const
@@ -168,7 +167,7 @@ void Handle::RemoveConstraints()
   GetImplementation(*this).RemoveConstraints();
 }
 
-void Handle::RemoveConstraints( unsigned int tag )
+void Handle::RemoveConstraints( uint32_t tag )
 {
   GetImplementation(*this).RemoveConstraints( tag );
 }
index a7fcb36..1894235 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -155,7 +156,7 @@ public:
    * @SINCE_1_0.0
    * @return The number of properties
    */
-  unsigned int GetPropertyCount() const;
+  uint32_t GetPropertyCount() const;
 
   /**
    * @brief Queries the name of a property.
@@ -390,7 +391,7 @@ public:
    * @param[in] tag The tag of the constraints which will be removed
    * @pre The Object has been initialized.
    */
-  void RemoveConstraints( unsigned int tag );
+  void RemoveConstraints( uint32_t tag );
 };
 
 /**
index eca8182..7fe8447 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -105,7 +105,7 @@ Property::Array& Property::Array::operator=( const Property::Array& other )
 std::ostream& operator<<( std::ostream& stream, const Property::Array& array )
 {
   stream << "Array(" << array.Count() << ") = [";
-  for( unsigned int i=0; i<array.Count(); ++i )
+  for( Property::Array::SizeType i=0; i<array.Count(); ++i )
   {
     if( i>0 )
     {
old mode 100644 (file)
new mode 100755 (executable)
index ef47612..331d1e9
@@ -200,7 +200,7 @@ public:
    * @brief Output to stream.
    * @SINCE_1_1.28
    */
-  friend std::ostream& operator<<( std::ostream& stream, const Property::Array& array );
+  friend DALI_CORE_API std::ostream& operator<<( std::ostream& stream, const Property::Array& array );
 
 private:
   struct DALI_INTERNAL Impl; ///< Private data
index ebd95a8..e3b5955 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -327,7 +327,7 @@ std::ostream& operator<<( std::ostream& stream, const Property::Map& map )
 {
   stream << "Map(" << map.Count() << ") = {";
 
-  int count = 0;
+  int32_t count = 0;
   // Output the String-Value pairs
   for ( StringValueContainer::iterator iter = map.mImpl->mStringValueContainer.begin(), endIter = map.mImpl->mStringValueContainer.end(); iter != endIter; ++iter )
   {
old mode 100644 (file)
new mode 100755 (executable)
index 8f77396..44a132f
@@ -363,7 +363,7 @@ public:
    * @brief Output to stream.
    * @SINCE_1_1.28
    */
-  friend std::ostream& operator<<( std::ostream& stream, const Property::Map& map );
+  friend DALI_CORE_API std::ostream& operator<<( std::ostream& stream, const Property::Map& map );
 
 private:
   struct DALI_INTERNAL Impl; ///< Private data
index 67264ae..f9ac88c 100644 (file)
@@ -41,7 +41,7 @@ const char* const PROPERTY_TYPE_NAMES[] =
   "MAP",
   "EXTENTS",
 };
-const unsigned int PROPERTY_TYPE_NAMES_COUNT = sizeof( PROPERTY_TYPE_NAMES ) / sizeof( const char* );
+const uint32_t PROPERTY_TYPE_NAMES_COUNT = static_cast<uint32_t>( sizeof( PROPERTY_TYPE_NAMES ) / sizeof( const char* ) );
 }
 
 namespace PropertyTypes
index a378caa..cd7ae5a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -68,7 +68,7 @@ struct Property::Value::Impl
     floatValue( floatValue )
   { }
 
-  Impl( int integerValue )
+  Impl( int32_t integerValue )
   : type( Property::INTEGER ),
     integerValue( integerValue )
   { }
@@ -119,7 +119,7 @@ struct Property::Value::Impl
   {
   }
 
-  Impl( const Rect<int>& rectValue )
+  Impl( const Rect<int32_t>& rectValue )
   : type( Property::RECTANGLE ),
     rectValue( new Rect<int>( rectValue ) )
   {
@@ -220,7 +220,7 @@ public: // Data
   Type type;
   union
   {
-    int integerValue;
+    int32_t integerValue;
     float floatValue;
     // must use pointers for any class value pre c++ 11
     Vector2* vector2Value;
@@ -230,7 +230,7 @@ public: // Data
     Matrix* matrixValue;
     AngleAxis* angleAxisValue;
     std::string* stringValue;
-    Rect<int>* rectValue;
+    Rect<int32_t>* rectValue;
     Property::Array* arrayValue;
     Property::Map* mapValue;
     Extents* extentsValue;
@@ -238,8 +238,10 @@ public: // Data
 
 private:
 
-  Impl( const Impl& ); ///< Undefined
-  Impl& operator=( const Impl& ); ///< Undefined
+  // non-copyable
+  Impl( const Impl& ) = delete;
+  Impl& operator=( const Impl& ) = delete;
+
 };
 
 Property::Value::Value()
@@ -257,7 +259,7 @@ Property::Value::Value( float floatValue )
 {
 }
 
-Property::Value::Value( int integerValue )
+Property::Value::Value( int32_t integerValue )
 : mImpl( new Impl( integerValue ) )
 {
 }
@@ -287,7 +289,7 @@ Property::Value::Value( const Matrix& matrixValue )
 {
 }
 
-Property::Value::Value( const Rect<int>& rectValue )
+Property::Value::Value( const Rect<int32_t>& rectValue )
 : mImpl( new Impl( rectValue ) )
 {
 }
@@ -372,7 +374,7 @@ Property::Value::Value( Type type )
     }
     case Property::RECTANGLE:
     {
-      mImpl = new Impl( Rect<int>(0,0,0,0) );
+      mImpl = new Impl( Rect<int32_t>(0,0,0,0) );
       break;
     }
     case Property::ROTATION:
@@ -651,7 +653,7 @@ bool Property::Value::Get( float& floatValue ) const
   return converted;
 }
 
-bool Property::Value::Get( int& integerValue ) const
+bool Property::Value::Get( int32_t& integerValue ) const
 {
   bool converted = false;
   if( mImpl )
@@ -663,7 +665,7 @@ bool Property::Value::Get( int& integerValue ) const
     }
     else if( mImpl->type == FLOAT )
     {
-      integerValue = static_cast< int >( mImpl->floatValue );
+      integerValue = static_cast< int32_t >( mImpl->floatValue );
       converted = true;
     }
   }
@@ -751,7 +753,7 @@ bool Property::Value::Get( Matrix& matrixValue ) const
   return converted;
 }
 
-bool Property::Value::Get( Rect<int>& rectValue ) const
+bool Property::Value::Get( Rect<int32_t>& rectValue ) const
 {
   bool converted = false;
   if( mImpl && (mImpl->type == RECTANGLE) ) // type cannot change in mImpl so rect is allocated
old mode 100644 (file)
new mode 100755 (executable)
index fa66e05..b054810
@@ -71,7 +71,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] integerValue An integer value
    */
-  Value( int integerValue );
+  Value( int32_t integerValue );
 
   /**
    * @brief Creates a float property value.
@@ -127,7 +127,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] vectorValue A vector of 4 integer values
    */
-  Value( const Rect<int>& vectorValue );
+  Value( const Rect<int32_t>& vectorValue );
 
   /**
    * @brief Creates an orientation property value.
@@ -270,7 +270,7 @@ public:
    * @return @c true if the value is successfully retrieved, @c false if the type is not convertible
    * @pre GetType() is a type convertible to int.
    */
-  bool Get( int& integerValue ) const;
+  bool Get( int32_t& integerValue ) const;
 
   /**
    * @brief Retrieves an integer rectangle.
@@ -280,7 +280,7 @@ public:
    * @return @c true if the value is successfully retrieved, @c false if the type is not convertible
    * @pre GetType() is a type convertible to Rect<int>.
    */
-  bool Get( Rect<int>& rect ) const;
+  bool Get( Rect<int32_t>& rect ) const;
 
   /**
    * @brief Retrieves a vector value.
@@ -412,7 +412,7 @@ public:
    * @brief Output to stream.
    * @SINCE_1_0.0
    */
-  friend std::ostream& operator<<( std::ostream& ouputStream, const Property::Value& value );
+  friend DALI_CORE_API std::ostream& operator<<( std::ostream& ouputStream, const Property::Value& value );
 
 private:
 
index ba6cf7d..1ac8453 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,9 +24,9 @@
 namespace Dali
 {
 
-const int Property::INVALID_INDEX           = -1;
-const int Property::INVALID_KEY             = -1;
-const int Property::INVALID_COMPONENT_INDEX = -1;
+const int32_t Property::INVALID_INDEX           = -1;
+const int32_t Property::INVALID_KEY             = -1;
+const int32_t Property::INVALID_COMPONENT_INDEX = -1;
 
 Property::Property(Handle& obj, Property::Index propIndex)
 : object(obj),
@@ -35,7 +35,7 @@ Property::Property(Handle& obj, Property::Index propIndex)
 {
 }
 
-Property::Property(Handle& obj, Property::Index propIndex, int compIndex)
+Property::Property(Handle& obj, Property::Index propIndex, int32_t compIndex)
 : object(obj),
   propertyIndex(propIndex),
   componentIndex(compIndex)
@@ -50,7 +50,7 @@ Property::Property(Handle& obj, const std::string& propertyName)
   propertyIndex = object.GetPropertyIndex( propertyName );
 }
 
-Property::Property(Handle& obj, const std::string& propertyName, int compIndex)
+Property::Property(Handle& obj, const std::string& propertyName, int32_t compIndex)
 : object(obj),
   propertyIndex(Property::INVALID_INDEX),
   componentIndex(compIndex)
index 54bf2ec..60236e9 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <string>
 #include <utility>
+#include <cstdint> // int32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -45,11 +46,11 @@ struct DALI_CORE_API Property
    * @brief A valid property index is zero or greater.
    * @SINCE_1_0.0
    */
-  typedef int Index;
+  typedef int32_t Index;
 
-  static const int INVALID_INDEX; ///< -1 is not a valid property index
-  static const int INVALID_KEY;   ///< -1 is not a valid property key
-  static const int INVALID_COMPONENT_INDEX; ///< -1 is not a valid property index
+  static const int32_t INVALID_INDEX; ///< -1 is not a valid property index
+  static const int32_t INVALID_KEY;   ///< -1 is not a valid property key
+  static const int32_t INVALID_COMPONENT_INDEX; ///< -1 is not a valid property index
 
   typedef Dali::Vector< Index > IndexContainer; ///< A vector of property indices @SINCE_1_0.0
 
@@ -128,7 +129,7 @@ struct DALI_CORE_API Property
    * @param[in] propertyIndex The index of a property.
    * @param[in] componentIndex Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1)
    */
-  Property( Handle& object, Property::Index propertyIndex, int componentIndex );
+  Property( Handle& object, Property::Index propertyIndex, int32_t componentIndex );
 
   /**
    * @brief Creates a Property instance.
@@ -151,7 +152,7 @@ struct DALI_CORE_API Property
    * @note This performs a property index query and is therefore slower than
    * constructing a Property directly with the index.
    */
-  Property( Handle& object, const std::string& propertyName, int componentIndex );
+  Property( Handle& object, const std::string& propertyName, int32_t componentIndex );
 
   /**
    * @brief Non-virtual destructor; Property is not intended as a base class.
@@ -163,7 +164,7 @@ struct DALI_CORE_API Property
 
   Index propertyIndex; ///< The index of a property provided by object.
 
-  int componentIndex; ///< Index of a property sub component, for use with Vector2, Vector3 and Vector4, -1 if using main property
+  int32_t componentIndex; ///< Index of a property sub component, for use with Vector2, Vector3 and Vector4, -1 if using main property
 };
 
 /**
index 3060f4b..cdd3546 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -161,7 +161,7 @@ void RefObject::Unreference()
   }
 }
 
-int RefObject::ReferenceCount()
+uint32_t RefObject::ReferenceCount()
 {
   return mCount;
 }
index 3ead400..553a1fe 100644 (file)
@@ -19,6 +19,9 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
+// INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/common/intrusive-ptr.h>
 
@@ -62,7 +65,7 @@ public:
    * @SINCE_1_0.0
    * @return The reference count
    */
-  int ReferenceCount();
+  uint32_t ReferenceCount();
 
 protected:
 
@@ -101,7 +104,7 @@ protected:
 
 private:
 
-  volatile int mCount; ///< Reference count
+  volatile uint32_t mCount; ///< Reference count
 };
 
 /**
index 92f1b67..c0e47d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -72,7 +72,7 @@ size_t TypeInfo::GetActionCount() const
 
 std::string TypeInfo::GetActionName(size_t index)
 {
-  return GetImplementation(*this).GetActionName(index);
+  return GetImplementation(*this).GetActionName( static_cast<uint32_t>( index ) );
 }
 
 size_t TypeInfo::GetSignalCount() const
@@ -82,7 +82,7 @@ size_t TypeInfo::GetSignalCount() const
 
 std::string TypeInfo::GetSignalName(size_t index)
 {
-  return GetImplementation(*this).GetSignalName(index);
+  return GetImplementation(*this).GetSignalName( static_cast<uint32_t>( index ) );
 }
 
 size_t TypeInfo::GetPropertyCount() const
@@ -98,7 +98,7 @@ void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
 
 const std::string& TypeInfo::GetPropertyName( Property::Index index ) const
 {
-  return GetImplementation(*this).GetPropertyName( index );
+  return GetImplementation(*this).GetRegisteredPropertyName( index );
 }
 
 Property::Index TypeInfo::GetChildPropertyIndex( const std::string& name ) const
index 1a8d702..386dda2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TYPE_INFO_H__
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,8 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
@@ -48,9 +50,10 @@ namespace Internal DALI_INTERNAL
 class DALI_CORE_API TypeInfo : public BaseHandle
 {
 public:
-  typedef BaseHandle (*CreateFunction)(); ///< Function signature for creating an instance of the associated object type. @SINCE_1_0.0
 
-  typedef bool (*ActionFunction)(BaseObject*, const std::string&, const Property::Map&); ///< Function signature for creating scriptable actions @SINCE_1_0.0
+  using CreateFunction = BaseHandle (*)(); ///< Function signature for creating an instance of the associated object type. @SINCE_1_0.0
+
+  using ActionFunction = bool (*)(BaseObject*, const std::string&, const Property::Map&); ///< Function signature for creating scriptable actions @SINCE_1_0.0
 
   /**
    * @brief Connects a callback function with the object's signals.
@@ -63,7 +66,7 @@ public:
    * @return True if the signal was connected
    * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
    */
-  typedef bool (*SignalConnectorFunction)(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor);
+  using SignalConnectorFunction = bool (*)(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor);
 
   /**
    * @brief Callback to set an event-thread only property.
@@ -74,7 +77,7 @@ public:
    * @param[in] value The new value of the property for the object specified
    * @see PropertyRegistration.
    */
-  typedef void (*SetPropertyFunction)( BaseObject* object, Property::Index index, const Property::Value& value );
+  using SetPropertyFunction = void (*)( BaseObject* object, Property::Index index, const Property::Value& value );
 
   /**
    * @brief Callback to get the value of an event-thread only property.
@@ -85,7 +88,7 @@ public:
    * @return The current value of the property for the object specified
    * @see PropertyRegistration.
    */
-  typedef Property::Value (*GetPropertyFunction)( BaseObject* object, Property::Index index );
+  using GetPropertyFunction = Property::Value (*)( BaseObject* object, Property::Index index );
 
   /**
    * @brief Allows the creation of an empty TypeInfo handle.
@@ -187,7 +190,6 @@ public:
   /**
    * @brief Retrieves the number of event side type registered properties for this type.
    *
-   * This count does not include all properties.
    * @SINCE_1_0.0
    * @return The count
    */
@@ -220,7 +222,7 @@ public:
    * @param[in] index The property index
    * @return The name of the property at the given index
    * @exception DaliException If index is not valid.
-   *
+   * @note this method only works for custom registered properties
    */
   const std::string& GetPropertyName( Property::Index index ) const;
 
index ed1bb70..b85c6af 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/object/property-index-ranges.h>
 #include <dali/internal/event/common/type-registry-impl.h>
+#include <dali/internal/event/object/default-property-metadata.h>
 
 namespace Dali
 {
@@ -53,12 +54,12 @@ TypeRegistry TypeRegistry::Get()
 
 Dali::TypeInfo TypeRegistry::GetTypeInfo( const std::string &uniqueTypeName )
 {
-  return GetImplementation(*this).GetTypeInfo( uniqueTypeName );
+  return Dali::TypeInfo( GetImplementation(*this).GetTypeInfo( uniqueTypeName ).Get() );
 }
 
 Dali::TypeInfo TypeRegistry::GetTypeInfo( const std::type_info& registerType )
 {
-  return GetImplementation(*this).GetTypeInfo( registerType );
+  return Dali::TypeInfo( GetImplementation(*this).GetTypeInfo( registerType ).Get() );
 }
 
 size_t TypeRegistry::GetTypeNameCount() const
@@ -68,7 +69,7 @@ size_t TypeRegistry::GetTypeNameCount() const
 
 std::string TypeRegistry::GetTypeName(size_t index) const
 {
-  return GetImplementation(*this).GetTypeName(index);
+  return GetImplementation(*this).GetTypeName( static_cast<uint32_t>( index ) );
 }
 
 TypeRegistry::TypeRegistry(Internal::TypeRegistry* internal)
@@ -82,10 +83,7 @@ TypeRegistration::TypeRegistration( const std::type_info& registerType, const st
 {
   Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
 
-  if( impl->Register( registerType, baseType, f, false ) )
-  {
-    mName = impl->RegistrationName( registerType );
-  }
+  mName = impl->Register( registerType, baseType, f, false );
 }
 
 TypeRegistration::TypeRegistration( const std::type_info& registerType, const std::type_info& baseType,
@@ -94,10 +92,15 @@ TypeRegistration::TypeRegistration( const std::type_info& registerType, const st
 {
   Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
 
-  if( impl->Register( registerType, baseType, f, callCreateOnInit ) )
-  {
-    mName = impl->RegistrationName( registerType );
-  }
+  mName = impl->Register( registerType, baseType, f, callCreateOnInit );
+}
+
+TypeRegistration::TypeRegistration( const std::type_info& registerType, const std::type_info& baseType,
+                                    TypeInfo::CreateFunction f, const DefaultPropertyMetadata& defaultProperties )
+{
+  Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
+
+  mName = impl->Register( registerType, baseType, f, false, defaultProperties.propertyTable, defaultProperties.propertyCount );
 }
 
 TypeRegistration::TypeRegistration( const std::string& name, const std::type_info& baseType,
@@ -106,10 +109,7 @@ TypeRegistration::TypeRegistration( const std::string& name, const std::type_inf
 {
   Internal::TypeRegistry *impl = Internal::TypeRegistry::Get();
 
-  if( impl->Register( name, baseType, f, false ) )
-  {
-    mName = name;
-  }
+  mName = impl->Register( name, baseType, f, false );
 }
 
 
@@ -149,7 +149,7 @@ AnimatablePropertyRegistration::AnimatablePropertyRegistration( TypeRegistration
   Internal::TypeRegistry::Get()->RegisterAnimatableProperty( registered, name, index, value );
 }
 
-AnimatablePropertyComponentRegistration::AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex)
+AnimatablePropertyComponentRegistration::AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex)
 {
   DALI_ASSERT_ALWAYS( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) );
 
index 89d28bd..21a9a30 100644 (file)
@@ -18,9 +18,9 @@
  *
  */
 
-
 // EXTERNAL INCLUDES
 #include <typeinfo>
+#include <cstdint> // uint32_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
@@ -37,6 +37,7 @@ namespace Internal DALI_INTERNAL
 {
 class TypeRegistry;
 }
+class DefaultPropertyMetadata;
 
 /**
  * @brief The TypeRegistry allows registration of type instance creation functions.
@@ -212,6 +213,18 @@ public:
                     TypeInfo::CreateFunction f, bool callCreateOnInit );
 
   /**
+   * @brief Constructor registers the type creation function.
+   *
+   * @SINCE_1_4.0
+   * @param[in] registerType the type info for the type to be registered
+   * @param[in] baseType the base type info of registerType
+   * @param[in] f registerType instance creation function
+   * @param[in] defaultProperties the default property meta-data
+   */
+  TypeRegistration( const std::type_info& registerType, const std::type_info& baseType,
+                    TypeInfo::CreateFunction f, const DefaultPropertyMetadata& defaultProperties );
+
+  /**
    * @brief Constructor registers the type creation function for a named class or type.
    *
    * This allows types to be created dynamically from script. The name must be
@@ -378,7 +391,7 @@ public:
    * @param[in] componentIndex The index of the component (e.g. 0 for the x component of a Vector2 property and 1 for the y component of a Vector2 property)
    * @pre "registered" must be registered with the TypeRegistry.
    */
-  AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, unsigned int componentIndex );
+  AnimatablePropertyComponentRegistration( TypeRegistration& registered, const std::string& name, Property::Index index, Property::Index baseIndex, uint32_t componentIndex );
 };
 
 /**
index 7bd754b..c604bd9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -50,22 +50,25 @@ RenderTaskList& RenderTaskList::operator=(const RenderTaskList& rhs)
 
 RenderTask RenderTaskList::CreateTask()
 {
-  return GetImplementation(*this).CreateTask();
+  return RenderTask( GetImplementation(*this).CreateTask().Get() );
 }
 
 void RenderTaskList::RemoveTask( RenderTask task )
 {
-  GetImplementation(*this).RemoveTask( task );
+  if( task ) // don't crash if called with empty task handle
+  {
+    GetImplementation(*this).RemoveTask( GetImplementation( task ) );
+  }
 }
 
-unsigned int RenderTaskList::GetTaskCount() const
+uint32_t RenderTaskList::GetTaskCount() const
 {
   return GetImplementation(*this).GetTaskCount();
 }
 
-RenderTask RenderTaskList::GetTask( unsigned int index ) const
+RenderTask RenderTaskList::GetTask( uint32_t index ) const
 {
-  return GetImplementation(*this).GetTask( index );
+  return RenderTask( GetImplementation(*this).GetTask( index ).Get() );
 }
 
 RenderTaskList::RenderTaskList( Internal::RenderTaskList* internal )
index 7f4b557..47bcb7a 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
 
@@ -113,7 +116,7 @@ public:
    * @SINCE_1_0.0
    * @return The number of render-tasks
    */
-  unsigned int GetTaskCount() const;
+  uint32_t GetTaskCount() const;
 
   /**
    * @brief Retrieves a render-task.
@@ -123,7 +126,7 @@ public:
    * @return A handle to the render-task
    * @pre index should be in range i.e. less than GetTaskCount().
    */
-  RenderTask GetTask( unsigned int index ) const;
+  RenderTask GetTask( uint32_t index ) const;
 
 public: // Not intended for application developers
 
index b9545ab..6daeb65 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,12 +43,12 @@ static bool FullScreenFrameBufferFunction( Vector2& coordinates )
 RenderTask::ConstScreenToFrameBufferFunction RenderTask::DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION = DefaultScreenToFrameBufferFunction;
 RenderTask::ConstScreenToFrameBufferFunction RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION        = FullScreenFrameBufferFunction;
 
-const bool         RenderTask::DEFAULT_EXCLUSIVE     = false;
-const bool         RenderTask::DEFAULT_INPUT_ENABLED = true;
-const Vector4      RenderTask::DEFAULT_CLEAR_COLOR   = Vector4( 0.0f, 0.0f, 0.0f, 1.0f ); // cannot use Color::Black because it may or may not be initialized yet
-const bool         RenderTask::DEFAULT_CLEAR_ENABLED = false;
-const bool         RenderTask::DEFAULT_CULL_MODE     = true;
-const unsigned int RenderTask::DEFAULT_REFRESH_RATE  = REFRESH_ALWAYS;
+const bool     RenderTask::DEFAULT_EXCLUSIVE     = false;
+const bool     RenderTask::DEFAULT_INPUT_ENABLED = true;
+const Vector4  RenderTask::DEFAULT_CLEAR_COLOR   = Vector4( 0.0f, 0.0f, 0.0f, 1.0f ); // cannot use Color::Black because it may or may not be initialized yet
+const bool     RenderTask::DEFAULT_CLEAR_ENABLED = false;
+const bool     RenderTask::DEFAULT_CULL_MODE     = true;
+const uint32_t RenderTask::DEFAULT_REFRESH_RATE  = REFRESH_ALWAYS;
 
 RenderTask::RenderTask()
 {
@@ -164,19 +164,12 @@ RenderTask::ScreenToFrameBufferFunction RenderTask::GetScreenToFrameBufferFuncti
 
 void RenderTask::SetScreenToFrameBufferMappingActor( Dali::Actor mappingActor )
 {
-  // NULL handle is allowed
-  Internal::Actor* actorImpl( NULL );
-  if ( mappingActor )
-  {
-    actorImpl = &GetImplementation( mappingActor );
-  }
-
-  GetImplementation(*this).SetScreenToFrameBufferMappingActor( actorImpl );
+  GetImplementation(*this).SetScreenToFrameBufferMappingActor( mappingActor );
 }
 
 Dali::Actor RenderTask::GetScreenToFrameBufferMappingActor() const
 {
-  return Dali::Actor(GetImplementation(*this).GetScreenToFrameBufferMappingActor());
+  return GetImplementation(*this).GetScreenToFrameBufferMappingActor();
 }
 
 void RenderTask::SetViewportPosition( Vector2 position )
@@ -241,12 +234,12 @@ bool RenderTask::GetCullMode() const
   return GetImplementation(*this).GetCullMode();
 }
 
-void RenderTask::SetRefreshRate( unsigned int refreshRate )
+void RenderTask::SetRefreshRate( uint32_t refreshRate )
 {
   GetImplementation(*this).SetRefreshRate( refreshRate );
 }
 
-unsigned int RenderTask::GetRefreshRate() const
+uint32_t RenderTask::GetRefreshRate() const
 {
   return GetImplementation(*this).GetRefreshRate();
 }
index 6ca2b06..064f535 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/math/viewport.h>
 #include <dali/public-api/object/handle.h>
@@ -171,12 +174,12 @@ public:
     REFRESH_ALWAYS = 1  ///< Process every frame. @SINCE_1_0.0
   };
 
-  static const bool         DEFAULT_EXCLUSIVE;     ///< false
-  static const bool         DEFAULT_INPUT_ENABLED; ///< true
-  static const Vector4      DEFAULT_CLEAR_COLOR;   ///< Color::BLACK
-  static const bool         DEFAULT_CLEAR_ENABLED; ///< false
-  static const bool         DEFAULT_CULL_MODE;     ///< true
-  static const unsigned int DEFAULT_REFRESH_RATE;  ///< REFRESH_ALWAYS
+  static const bool     DEFAULT_EXCLUSIVE;     ///< false
+  static const bool     DEFAULT_INPUT_ENABLED; ///< true
+  static const Vector4  DEFAULT_CLEAR_COLOR;   ///< Color::BLACK
+  static const bool     DEFAULT_CLEAR_ENABLED; ///< false
+  static const bool     DEFAULT_CULL_MODE;     ///< true
+  static const uint32_t DEFAULT_REFRESH_RATE;  ///< REFRESH_ALWAYS
 
   /**
    * @brief Creates an empty RenderTask handle.
@@ -473,14 +476,14 @@ public:
    * @SINCE_1_0.0
    * @param[in] refreshRate The new refresh rate
    */
-  void SetRefreshRate( unsigned int refreshRate );
+  void SetRefreshRate( uint32_t refreshRate );
 
   /**
    * @brief Queries the refresh-rate of the RenderTask.
    * @SINCE_1_0.0
    * @return The refresh-rate
    */
-  unsigned int GetRefreshRate() const;
+  uint32_t GetRefreshRate() const;
 
   /**
    * @brief Gets viewport coordinates for given world position.
index af6b8e1..89b0a53 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use *this file except in compliance with the License.
 // CLASS HEADER
 #include <dali/public-api/rendering/frame-buffer.h>
 
+// EXTERNAL INCLUDES
+#include <type_traits>
+
 // INTERNAL INCLUDES
+#include <dali/integration-api/debug.h> // DALI_LOG_WARNING_NOFN
 #include <dali/internal/event/rendering/frame-buffer-impl.h> // Dali::Internal::FrameBuffer
-
+#include <dali/internal/event/rendering/texture-impl.h> // Dali::Internal::Texture
 
 namespace Dali
 {
 
-FrameBuffer FrameBuffer::New( unsigned int width, unsigned int height, unsigned int attachments )
+namespace
+{
+/// Bool operator for FrameBuffer::Attachment::Mask.
+/// in cpp as only used in this file
+bool operator&( FrameBuffer::Attachment::Mask lhs, FrameBuffer::Attachment::Mask rhs )
+{
+  using UnderlyingType = typename std::underlying_type< FrameBuffer::Attachment::Mask >::type;
+  return static_cast<bool>( static_cast<UnderlyingType>( lhs ) & static_cast<UnderlyingType>( rhs ) );
+}
+
+} // unnamed namespace
+
+FrameBuffer FrameBuffer::New( uint32_t width, uint32_t height )
+{
+  return New( width, height, FrameBuffer::Attachment::COLOR );
+}
+
+FrameBuffer FrameBuffer::New( uint32_t width, uint32_t height, Attachment::Mask attachments )
 {
   Internal::FrameBufferPtr frameBuffer = Internal::FrameBuffer::New( width, height, attachments );
+  if( attachments & FrameBuffer::Attachment::COLOR )
+  {
+    Internal::TexturePtr texture = Internal::Texture::New( Dali::TextureType::TEXTURE_2D, Pixel::RGB888, width, height );
+    frameBuffer->AttachColorTexture( texture, 0u, 0u );
+  }
+  return FrameBuffer( frameBuffer.Get() );
+}
+
+FrameBuffer FrameBuffer::New( uint32_t width, uint32_t height, uint32_t attachments )
+{
+  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: FrameBuffer::New(uint32_t,uint32_t,uint32_t) is deprecated and will be removed from next release. use New(uint32_t, uint32_t,Attachment::Mask) instead.\n" );
+  // have to static cast, which according to standard since C++11 is undefined behaviour, hence this variant is deprecated
+  Internal::FrameBufferPtr frameBuffer = Internal::FrameBuffer::New( width, height, static_cast<Attachment::Mask>( attachments ) );
   return FrameBuffer( frameBuffer.Get() );
 }
 
@@ -65,7 +99,7 @@ void FrameBuffer::AttachColorTexture( Texture& texture )
   AttachColorTexture( texture, 0u, 0u );
 }
 
-void FrameBuffer::AttachColorTexture( Texture& texture, unsigned int mipmapLevel, unsigned int layer )
+void FrameBuffer::AttachColorTexture( Texture& texture, uint32_t mipmapLevel, uint32_t layer )
 {
   if( texture )
   {
index 9663d55..4443040 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_FRAMEBUFFER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdint> // uint32_t
+
 // INTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/rendering/texture.h>
@@ -40,7 +43,7 @@ public:
 
   /**
    * @brief The initial attachments to create the FrameBuffer with.
-   * @note The color attachment is created on calling AttachColorTexture(). If a color attachment is not required, omit this call.
+   * @note The color attachment can also be created on calling AttachColorTexture().
    * @note With "NONE", no attachments are created initially. However color attachments can still be added as described above.
    *
    * @SINCE_1_1.45
@@ -48,31 +51,59 @@ public:
   struct Attachment
   {
     /**
-     * @brief Enumeration for the bit-mask value.
+     * @brief Enumeration for the attachments and/or textures to be created by default
      * @SINCE_1_1.45
      */
     enum Mask
     {
-      NONE          = 0,               ///< No attachments are created initially                            @SINCE_1_1.45
-
-      DEPTH         = 1 << 0,          ///< Depth buffer bit-mask value                                     @SINCE_1_1.45
-      STENCIL       = 1 << 1,          ///< Stencil buffer bit-mask value                                   @SINCE_1_1.45
-
-      // Preset bit-mask combinations:
-      DEPTH_STENCIL = DEPTH | STENCIL  ///< The Framebuffer will be created with depth and stencil buffer   @SINCE_1_1.45
+      NONE          = 0,                          ///< No attachments are created initially             @SINCE_1_1.45
+      DEPTH         = 1 << 0,                     ///< Depth buffer is created                          @SINCE_1_1.45
+      STENCIL       = 1 << 1,                     ///< Stencil buffer is created                        @SINCE_1_1.45
+      DEPTH_STENCIL = DEPTH | STENCIL,            ///< Depth and stencil buffer will be created         @SINCE_1_1.45
+      COLOR         = 1 << 2,                     ///< Color texture will be created                    @SINCE_1_4.0
+      COLOR_DEPTH   = COLOR | DEPTH,              ///< Color texture and depth buffer will be created   @SINCE_1_4.0
+      COLOR_STENCIL = COLOR | STENCIL,            ///< Color texture and stencil buffer will be created @SINCE_1_4.0
+      COLOR_DEPTH_STENCIL = COLOR_DEPTH | STENCIL ///< Color, depth and stencil buffer will be created  @SINCE_1_4.0
     };
   };
 
   /**
+   * @brief Creates a new FrameBuffer with only COLOR texture attached on it
+   *
+   * @SINCE_1_4.0
+   *
+   * @note Call GetColorTexture() to get the COLOR texture
+   *
+   * @param[in] width The width of the FrameBuffer and the color texture
+   * @param[in] height The height of the FrameBuffer and the color texture
+   * @return A handle to a newly allocated FrameBuffer
+   */
+  static FrameBuffer New( uint32_t width, uint32_t height );
+
+  /**
+   * @brief Creates a new FrameBuffer with the specified attachments
+   *
+   * @SINCE_1_4.0
+   *
+   * @param[in] width The width of the FrameBuffer and the attachments
+   * @param[in] height The height of the FrameBuffer and the attachments
+   * @param[in] attachments Enumeration of the attachments to create
+   * @return A handle to a newly allocated FrameBuffer
+   */
+  static FrameBuffer New( uint32_t width, uint32_t height, Attachment::Mask attachments );
+
+  /**
+   * @DEPRECATED_1_4.0 use New( uint32_t width, uint32_t height ) or New( uint32_t width, uint32_t height, Attachment::Mask attachments ) instead
    * @brief Creates a new FrameBuffer object.
    *
    * @SINCE_1_1.43
+   *
    * @param[in] width The width of the FrameBuffer
    * @param[in] height The height of the FrameBuffer
    * @param[in] attachments The attachments comprising the format of the FrameBuffer (the type is int to allow multiple bitmasks to be ORd)
    * @return A handle to a newly allocated FrameBuffer
    */
-  static FrameBuffer New( unsigned int width, unsigned int height, unsigned int attachments );
+  static FrameBuffer New( uint32_t width, uint32_t height, uint32_t attachments );
 
   /**
    * @brief Default constructor, creates an empty handle.
@@ -133,7 +164,7 @@ public:
    * @note The specified texture mipmap has to have the same size than the FrameBuffer
    * otherwise it won't be attached.
    */
-  void AttachColorTexture( Texture& texture, unsigned int mipmapLevel, unsigned int layer );
+  void AttachColorTexture( Texture& texture, uint32_t mipmapLevel, uint32_t layer );
 
   /**
    * @brief Gets the color texture used as output in the FrameBuffer.
index 43dfb0d..48f6aab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use *this file except in compliance with the License.
@@ -67,12 +67,12 @@ std::size_t Geometry::GetNumberOfVertexBuffers() const
 
 void Geometry::RemoveVertexBuffer( std::size_t index )
 {
-  GetImplementation(*this).RemoveVertexBuffer( index );
+  GetImplementation(*this).RemoveVertexBuffer( static_cast<uint32_t>( index ) );
 }
 
-void Geometry::SetIndexBuffer( const unsigned short* indices, size_t count )
+void Geometry::SetIndexBuffer( const uint16_t* indices, size_t count )
 {
-  GetImplementation(*this).SetIndexBuffer( indices, count );
+  GetImplementation(*this).SetIndexBuffer( indices, static_cast<uint32_t>( count ) );
 }
 
 void Geometry::SetType( Type geometryType )
index 1c1732e..70c94c9 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <cstddef> // std::size_t
+#include <cstdint> // uint16_t
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/handle.h> // Dali::Handle
@@ -144,7 +145,7 @@ public:
    * @param[in] indices Array of indices
    * @param[in] count Number of indices in the array
    */
-  void SetIndexBuffer( const unsigned short* indices, size_t count );
+  void SetIndexBuffer( const uint16_t* indices, size_t count );
 
   /**
    * @brief Sets the type of primitives this geometry contains.
index b62e5e6..f2a942b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -58,7 +58,7 @@ PropertyBuffer& PropertyBuffer::operator=( const PropertyBuffer& handle )
 
 void PropertyBuffer::SetData( const void* data, std::size_t size )
 {
-  GetImplementation(*this).SetData( data, size );
+  GetImplementation(*this).SetData( data, static_cast<uint32_t>( size ) ); // only support 4,294,967,295 bytes
 }
 
 std::size_t PropertyBuffer::GetSize() const
index ca8b913..fb51a13 100644 (file)
@@ -56,7 +56,7 @@ class PropertyBuffer;
  *  texturedQuadVertices.SetData( texturedQuadVertexData, 4 );
  *
  *  // Create indices
- *  unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
+ *  uint32_t indexData[6] = { 0, 3, 1, 0, 2, 3 };
  *
  *  // Create the geometry object
  *  Geometry texturedQuadGeometry = Geometry::New();
index e894e30..07f14b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -64,8 +64,7 @@ void Renderer::SetGeometry( Geometry& geometry )
 
 Geometry Renderer::GetGeometry() const
 {
-  Internal::Geometry* geometryPtr( GetImplementation(*this).GetGeometry() );
-  return Dali::Geometry( geometryPtr );
+  return Dali::Geometry( GetImplementation(*this).GetGeometry().Get() );
 }
 
 void Renderer::SetTextures( TextureSet& textureSet )
@@ -76,8 +75,7 @@ void Renderer::SetTextures( TextureSet& textureSet )
 
 TextureSet Renderer::GetTextures() const
 {
-  Internal::TextureSet* textureSet( GetImplementation(*this).GetTextures() );
-  return Dali::TextureSet( textureSet );
+  return Dali::TextureSet( GetImplementation(*this).GetTextures().Get() );
 }
 
 void Renderer::SetShader( Shader& shader )
@@ -88,8 +86,7 @@ void Renderer::SetShader( Shader& shader )
 
 Shader Renderer::GetShader() const
 {
-  Internal::Shader* shaderPtr( GetImplementation(*this).GetShader() );
-  return Dali::Shader( shaderPtr );
+  return Dali::Shader( GetImplementation(*this).GetShader().Get() );
 }
 
 Renderer::Renderer( Internal::Renderer* pointer )
index 6c57ab9..aa1ab6c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SHADER_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -105,7 +105,7 @@ public:
       /**
        * @brief Name: "program", Type: MAP.
        * @note The default value is empty.
-       * @note Format: {"vertex":"","fragment":"",hints:"","vertexPrefix":"","fragmentPrefix":""}
+       * @note Format: {"vertex":"","fragment":"",hints:""}
        * @SINCE_1_1.43
        */
       PROGRAM = DEFAULT_OBJECT_PROPERTY_START_INDEX
index 261e597..e4da733 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -61,17 +61,17 @@ void TextureSet::SetTexture( size_t index, Texture texture )
   if( texture )
   {
     Internal::TexturePtr texturePtr( &GetImplementation( texture ) );
-    GetImplementation(*this).SetTexture( index, texturePtr );
+    GetImplementation(*this).SetTexture( static_cast<uint32_t>( index ), texturePtr ); // only support 4,294,967,295 textures
   }
   else
   {
-    GetImplementation(*this).SetTexture( index, NULL );
+    GetImplementation(*this).SetTexture( static_cast<uint32_t>( index ), NULL ); // only support 4,294,967,295 textures
   }
 }
 
 Texture TextureSet::GetTexture( size_t index ) const
 {
-  Internal::Texture* texturePtr = GetImplementation(*this).GetTexture( index );
+  Internal::Texture* texturePtr = GetImplementation(*this).GetTexture( static_cast<uint32_t>( index ) ); // only support 4,294,967,295 textures
   return Dali::Texture( texturePtr );
 }
 
@@ -80,17 +80,17 @@ void TextureSet::SetSampler( size_t index, Sampler sampler )
   if( sampler )
   {
     Internal::SamplerPtr samplerPtr( &GetImplementation( sampler ) );
-    GetImplementation(*this).SetSampler( index, samplerPtr );
+    GetImplementation(*this).SetSampler( static_cast<uint32_t>( index ), samplerPtr ); // only support 4,294,967,295 samplers
   }
   else
   {
-    GetImplementation(*this).SetSampler( index, NULL );
+    GetImplementation(*this).SetSampler( static_cast<uint32_t>( index ), NULL ); // only support 4,294,967,295 samplers
   }
 }
 
 Sampler TextureSet::GetSampler( size_t index ) const
 {
-  Internal::Sampler* samplerPtr = GetImplementation(*this).GetSampler( index );
+  Internal::Sampler* samplerPtr = GetImplementation(*this).GetSampler( static_cast<uint32_t>( index ) ); // only support 4,294,967,295 samplers
   return Dali::Sampler( samplerPtr );
 }
 
index 79720cf..f23a3f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use *this file except in compliance with the License.
@@ -26,7 +26,7 @@
 namespace Dali
 {
 
-Texture Texture::New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height )
+Texture Texture::New( TextureType::Type type, Pixel::Format format, uint32_t width, uint32_t height )
 {
   Internal::TexturePtr texture = Internal::Texture::New(type, format, width, height );
   return Texture( texture.Get() );
@@ -69,9 +69,9 @@ bool Texture::Upload( PixelData pixelData )
 }
 
 bool Texture::Upload( PixelData pixelData,
-               unsigned int layer, unsigned int mipmap,
-               unsigned int xOffset, unsigned int yOffset,
-               unsigned int width, unsigned int height )
+               uint32_t layer, uint32_t mipmap,
+               uint32_t xOffset, uint32_t yOffset,
+               uint32_t width, uint32_t height )
 {
   Internal::PixelData& internalPixelData = GetImplementation( pixelData );
   return GetImplementation(*this).Upload( &internalPixelData, layer, mipmap, xOffset, yOffset, width, height );
@@ -82,12 +82,12 @@ void Texture::GenerateMipmaps()
   return GetImplementation(*this).GenerateMipmaps();
 }
 
-unsigned int Texture::GetWidth() const
+uint32_t Texture::GetWidth() const
 {
   return GetImplementation(*this).GetWidth();
 }
 
-unsigned int Texture::GetHeight() const
+uint32_t Texture::GetHeight() const
 {
   return GetImplementation(*this).GetHeight();
 }
index bbf2e67..3569904 100644 (file)
@@ -55,12 +55,12 @@ namespace CubeMapLayer
    * These constants should be used as the "layer" parameter when uploading a cube-map with Texture::Upload.
    * @SINCE_1_1.43
    */
-  const unsigned int POSITIVE_X = 0u; ///< CubeMap image for +x @SINCE_1_1.43
-  const unsigned int NEGATIVE_X = 1u; ///< CubeMap image for -x @SINCE_1_1.43
-  const unsigned int POSITIVE_Y = 2u; ///< CubeMap image for +y @SINCE_1_1.43
-  const unsigned int NEGATIVE_Y = 3u; ///< CubeMap image for -y @SINCE_1_1.43
-  const unsigned int POSITIVE_Z = 4u; ///< CubeMap image for +z @SINCE_1_1.43
-  const unsigned int NEGATIVE_Z = 5u; ///< CubeMap image for -z @SINCE_1_1.43
+  const uint32_t POSITIVE_X = 0u; ///< CubeMap image for +x @SINCE_1_1.43
+  const uint32_t NEGATIVE_X = 1u; ///< CubeMap image for -x @SINCE_1_1.43
+  const uint32_t POSITIVE_Y = 2u; ///< CubeMap image for +y @SINCE_1_1.43
+  const uint32_t NEGATIVE_Y = 3u; ///< CubeMap image for -y @SINCE_1_1.43
+  const uint32_t POSITIVE_Z = 4u; ///< CubeMap image for +z @SINCE_1_1.43
+  const uint32_t NEGATIVE_Z = 5u; ///< CubeMap image for -z @SINCE_1_1.43
 
 } // namespace CubeMapLayer
 
@@ -83,7 +83,7 @@ public:
    * @param[in] height The height of the texture
    * @return A handle to a newly allocated Texture
    */
-  static Texture New( TextureType::Type type, Pixel::Format format, unsigned int width, unsigned int height );
+  static Texture New( TextureType::Type type, Pixel::Format format, uint32_t width, uint32_t height );
 
   /**
    * @brief Creates a new Texture object from a native image.
@@ -161,9 +161,9 @@ public:
    * @return True if the PixelData object has compatible pixel format and fits in the rectangle specified, false otherwise
    */
   bool Upload( PixelData pixelData,
-               unsigned int layer, unsigned int mipmap,
-               unsigned int xOffset, unsigned int yOffset,
-               unsigned int width, unsigned int height );
+               uint32_t layer, uint32_t mipmap,
+               uint32_t xOffset, uint32_t yOffset,
+               uint32_t width, uint32_t height );
 
   /**
    * @brief Generates mipmaps for the texture.
@@ -179,7 +179,7 @@ public:
    * @SINCE_1_1.43
    * @return The width, in pixels, of the texture
    */
-  unsigned int GetWidth() const;
+  uint32_t GetWidth() const;
 
   /**
    * @brief Returns the height of the texture.
@@ -187,7 +187,7 @@ public:
    * @SINCE_1_1.43
    * @return The height, in pixels, of the texture
    */
-  unsigned int GetHeight() const;
+  uint32_t GetHeight() const;
 
 public:
 
index c84393a..b03f9d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
 namespace
 {
 
-const int INVALID_CALLBACK_INDEX = -1;
+const int32_t INVALID_CALLBACK_INDEX = -1;
 
 } // unnamed namespace
 
@@ -120,7 +120,7 @@ void BaseSignal::OnConnect( CallbackBase* callback )
 {
   DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Connect()" );
 
-  int index = FindCallback( callback );
+  int32_t index = FindCallback( callback );
 
   // Don't double-connect the same callback
   if( INVALID_CALLBACK_INDEX == index )
@@ -141,7 +141,7 @@ void BaseSignal::OnDisconnect( CallbackBase* callback )
 {
   DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Disconnect()" );
 
-  int index = FindCallback( callback );
+  int32_t index = FindCallback( callback );
 
   if( index > INVALID_CALLBACK_INDEX )
   {
@@ -157,7 +157,7 @@ void BaseSignal::OnConnect( ConnectionTrackerInterface* tracker, CallbackBase* c
   DALI_ASSERT_ALWAYS( NULL != tracker  && "Invalid ConnectionTrackerInterface pointer passed to Connect()" );
   DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Connect()" );
 
-  int index = FindCallback( callback );
+  int32_t index = FindCallback( callback );
 
   // Don't double-connect the same callback
   if( INVALID_CALLBACK_INDEX == index )
@@ -182,7 +182,7 @@ void BaseSignal::OnDisconnect( ConnectionTrackerInterface* tracker, CallbackBase
   DALI_ASSERT_ALWAYS( NULL != tracker  && "Invalid ConnectionTrackerInterface pointer passed to Disconnect()" );
   DALI_ASSERT_ALWAYS( NULL != callback && "Invalid member function pointer passed to Disconnect()" );
 
-  int index = FindCallback( callback );
+  int32_t index = FindCallback( callback );
 
   if( index > INVALID_CALLBACK_INDEX )
   {
@@ -239,23 +239,22 @@ CallbackBase* BaseSignal::GetCallback( std::size_t connectionIndex ) const
   return callback;
 }
 
-int BaseSignal::FindCallback( CallbackBase* callback )
+int32_t BaseSignal::FindCallback( CallbackBase* callback )
 {
-  int index( INVALID_CALLBACK_INDEX );
+  int32_t index( INVALID_CALLBACK_INDEX );
 
   // A signal can have multiple slots connected to it.
   // We need to search for the slot which has the same call back function (if it's static)
   // Or the same object / member function (for non-static)
-  const std::size_t count( mSignalConnections.Count() );
-  for( std::size_t i=0; i < count; ++i )
+  const std::size_t count = mSignalConnections.Count();
+  for( std::size_t i = 0; i < count; ++i )
   {
     const CallbackBase* connectionCallback = GetCallback( i );
 
     // Note that values are set to NULL in DeleteConnection
-    if( connectionCallback &&
-        ( *connectionCallback == *callback ) )
+    if( connectionCallback && ( *connectionCallback == *callback ) )
     {
-      index = i;
+      index = static_cast<int>( i ); // only 2,147,483,647 connections supported, no error check
       break;
     }
   }
old mode 100644 (file)
new mode 100755 (executable)
index 2ea9770..5de0137
@@ -113,7 +113,7 @@ public:
    * @brief Used to guard against nested Emit() calls.
    * @SINCE_1_0.0
    */
-  struct EmitGuard
+  struct DALI_CORE_API EmitGuard
   {
     /**
      * @brief Creates the guard.
@@ -494,7 +494,7 @@ private:
    * @param[in] callback The call back object
    * @return A valid index if the callback is connected
    */
-  int FindCallback( CallbackBase* callback );
+  int32_t FindCallback( CallbackBase* callback );
 
   /**
    * @brief Deletes a connection object from the list of connections.
index 0bb1e9d..bca0626 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_CONNECTION_TRACKER_H__
-#define __DALI_CONNECTION_TRACKER_H__
+#ifndef DALI_CONNECTION_TRACKER_H
+#define DALI_CONNECTION_TRACKER_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
@@ -72,6 +72,7 @@ public:
 
   /**
    * @brief Returns the connection count.
+   *
    * @SINCE_1_0.0
    * @return The connection count
    */
@@ -92,4 +93,4 @@ private:
  */
 } // namespace Dali
 
-#endif // __DALI_CONNECTION_TRACKER_H__
+#endif // DALI_CONNECTION_TRACKER_H
index 8b5f260..5577e40 100644 (file)
@@ -108,7 +108,7 @@ public:
   }
 
   /**
-   * @copydoc ConnectionTracker::GetConnectionCount
+   * @copydoc Dali::ConnectionTracker::GetConnectionCount
    */
   std::size_t GetConnectionCount() const
   {
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a3c79d5
--- /dev/null
@@ -0,0 +1,6 @@
+#
+# Add package doxy headers here
+#
+SET(PACKAGE_DOXY_HEADERS
+  ${CMAKE_CURRENT_SOURCE_DIR}/dali-core-doc.h
+  PARENT_SCOPE )
index b0fc9e5..742add8 100644 (file)
@@ -1,2 +1,8 @@
-package_doxy_files = \
-  $(package_doxy_dir)/dali-core-doc.h
+#
+# Add package doxy headers here
+
+SET(package_doxy_dir ${ROOT_SRC_DIR}/doc)
+#
+SET(PACKAGE_DOXY_HEADERS
+  ${package_doxy_dir}/dali-core-doc.h
+)
index 79bbf03..b6d48d8 100644 (file)
@@ -41,97 +41,7 @@ function toggleVisibility( button, obj )
 </HEAD>
 <BODY>
 
-<H1>General</H1>
-  <P>
-    Here's a few pragmatic programmer guidelines to follow (<A HREF="http://www.codinghorror.com/blog/files/Pragmatic%20Quick%20Reference.htm">Web version</A>)
-    <H3>Details <input type="button" value="Hide" onclick="toggleVisibility( this, 'general_details' );"/></H3>
-    <ARTICLE class="detail" id="general_details">
-      <UL>
-      <LI><B>Care About the Software, Care about your API users and end users</B><BR>
-            Why spend your life developing software unless you care about doing it well?
-            Turn off the autopilot and take control. Constantly critique and appraise your work.
-      <LI><B>Don't Live with Broken Windows</B><BR>
-            Fix bad designs, wrong decisions, and poor code when you see them.
-            You can't force change on people. Instead, show them how the future might be and help them participate in creating it.
-      <LI><B>Remember the Big Picture</B><BR>
-            Don't get so engrossed in the details that you forget to check what's happening around you.
-      <LI><B>DRY - Don't Repeat Yourself</B><BR>
-            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
-      <LI><B>Eliminate Effects Between Unrelated Things</B><BR>
-            Design components that are self-contained. independent, and have a single, well-defined purpose.
-      <LI><B>There Are No Final Decisions</B><BR>
-            No decision is cast in stone. Instead, consider each as being written in the sand at the beach, and plan for change.
-      <LI><B>Fix the Problem, Not the Blame</B><BR>
-            It doesn't really matter whether the bug is your fault or someone else's—it is still your problem, and it still needs to be fixed.
-      <LI><B>You Can't Write Perfect Software</B><BR>
-            Software can't be perfect. Protect your code and users from the inevitable errors.
-      <LI><B>Design with Contracts</B><BR>
-            Use contracts to document and verify that code does no more and no less than it claims to do.
-      <LI><B>Crash Early</B><BR>
-            A dead program normally does a lot less damage than a crippled one.
-      <LI><B>Use Assertions to Prevent the Impossible</B><BR>
-            Assertions validate your assumptions. Use them to protect your code from an uncertain world.
-      <LI><B>Use Exceptions for Exceptional Problems</B><BR>
-            Exceptions can suffer from all the readability and maintainability problems of classic spaghetti code. Reserve exceptions for exceptional things.
-      <LI><B>Minimize Coupling Between Modules</B><BR>
-            Avoid coupling by writing "shy" code and applying the Law of Demeter.
-      <LI><B>Put Abstractions in Code, Details in Metadata</B><BR>
-            Program for the general case, and put the specifics outside the compiled code base.
-      <LI><B>Always Design for Concurrency</B><BR>
-            Allow for concurrency, and you'll design cleaner interfaces with fewer assumptions.
-      <LI><B>Don't Program by Coincidence</B><BR>
-            Rely only on reliable things. Beware of accidental complexity, and don't confuse a happy coincidence with a purposeful plan.
-      <LI><B>Test Your Estimates</B><BR>
-            Mathematical analysis of algorithms doesn't tell you everything. Try timing your code in its target environment.
-      <LI><B>Refactor Early, Refactor Often</B><BR>
-            Just as you might weed and rearrange a garden, rewrite, rework, and re-architect code when it needs it. Fix the root of the problem.
-      <LI><B>Design to Test</B><BR>
-            Start thinking about testing before you write a line of code.
-      <LI><B>Abstractions Live Longer than Details</B><BR>
-            Invest in the abstraction, not the implementation. Abstractions can survive the barrage of changes from different implementations and new technologies.
-      <LI><B>Coding Ain't Done 'Til All the Tests Run</B><BR>
-            'Nuff said.
-      <LI><B>Use Saboteurs to Test Your Testing</B><BR>
-            Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.
-      <LI><B>Find Bugs Once</B><BR>
-            Once a human tester finds a bug, it should be the last time a human tester finds that bug. Automatic tests should check for it from then on.
-      <LI><B>Sign Your Work</B><BR>
-            Craftsmen of an earlier age were proud to sign their work. You should be, too.
-      </UL>
-    </ARTICLE>
-  </P>
-
-  <H2>Avoid Tight Coupling</H2>
-    <P>
-      Always choose the loosest possible coupling between entities. In C++ the tightest coupling is Friend, second is Inheritance,
-      then Containment and last is Usage through reference, pointer or handle.
-    <H3>Details <input type="button" value="Hide" onclick="toggleVisibility( this, 'coupling_details' );"/></H3>
-    <ARTICLE class="detail" id="coupling_details">
-      <UL>
-        <LI>Friend defines a "must-know" about details of implementation, don't use it unless your happy stating that Xxx really <B>must</B> know about Yyy implementation. and Yyy can never change without informing Xxx.
-        <LI>Inheritance defines a "is-a" relationship, don't use it unless you really can naturally say Xxx is-a Yyy. Most of the cases containment through interface is what you
-        <LI>Containment defines a "owns-a" relationship, use it when you have a natural Xxx owns-a Yyy relationship.
-      </UL>
-      Most of the time containment through interface and normal usage is what you should go for.
-      Strong ownership always beats sharing through reference counting. Reference counting means "part owns".
-      You would not want to part own anything in real life, so why do that in software? sooner or later it will leak,
-    </ARTICLE>
-    </P>
-
-  Two key principles to follow:
-  <H2>Open Closed Principle</H2>
-    <P>
-      Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
-      That is, such an entity can allow its behaviour to be modified without altering its source code. Techniqu
-    </P>
-
-  <H2>Dependency Inversion Principle</H2>
-    <P>
-      High-level modules should not depend on low-level modules. Both should depend on abstractions.
-      Abstractions should not depend upon details. Details should depend upon abstractions.
-    </P>
-
-<H1>General conventions</H1>
+<H1>General coding conventions</H1>
   <H2>Type casting <input type="button" value="Hide" onclick="toggleVisibility( this, 'ccasts_details' );"/></H2>
     <ARTICLE class="detail" id="ccasts_details">
       <SUMMARY>
@@ -145,10 +55,10 @@ function toggleVisibility( button, obj )
         <B>Avoid using pointer or reference casts. They have been referred to as the goto of OO programming, fix the design instead</B><BR>
       </SUMMARY>
       <CODE class="good">
-        X* ptr = static_cast<X*>( y_ptr ); // ok, compiler checks whether types are compatible
+  X* ptr = static_cast&#x3C;X*&#x3E;( y_ptr ); // ok, compiler checks whether types are compatible
       </CODE>
       <CODE class="bad">
-        (Foo*) ptr; // bad! C-cast is not guaranteed to check and never complains
+  (Foo*) ptr; // bad! C-cast is not guaranteed to check and never complains
       </CODE>
     </ARTICLE>
 
@@ -174,13 +84,21 @@ function toggleVisibility( button, obj )
         This could lead to unexpected results. The same goes with default constructor and copy constructor.
       </P>
       <CODE class="good">
-        class X
-        {
-          X();                      // default constructor
-          X( const X& );            // copy constructor
-          X& operator=( const X& ); // copy assignment operator
-          ~X();                     // destructor
-        };
+  class X
+  {
+    X();                      // default constructor
+    X( const X& );            // copy constructor
+    X& operator=( const X& ); // copy assignment operator
+    ~X();                     // destructor
+  };
+
+  class X
+  {
+    X();                                // default constructor
+    ~X();                               // destructor
+    X( const X& ) = delete;             // copy constructor not allowed
+    X& operator=( const X& ); = delete; // copy assignment operator not allowed
+  };
       </CODE>
     </ARTICLE>
   <H2>Class types <input type="button" value="Hide" onclick="toggleVisibility( this, 'class_types_details' );"/></H2>
@@ -197,7 +115,7 @@ function toggleVisibility( button, obj )
       <P>
         Classes with <B>Pointer</B> semantics are always passed through pointers, references or smart pointers.
         These classes are ususally compound types that cannot be easily copied and thus prevent copy constructor,
-        and assignment operator. That can be only stored on STL containers through smart pointers.
+        and assignment operator. They can be only stored on STL containers through smart pointers.
       </P>
     </ARTICLE>
   <H2>Access Rights <input type="button" value="Hide" onclick="toggleVisibility( this, 'access_details' );"/></H2>
@@ -235,21 +153,21 @@ function toggleVisibility( button, obj )
       <P>
         Declare all single argument constructors as explicit thus preventing their use as implicit type convertors.
         <CODE class="good">
-          class C
-          {
-          public:
-            explicit C( int );         // good, explicit
-            C( int, int );             // ok more than one non-default argument
-          };
+  class C
+  {
+  public:
+    explicit C( int );         // good, explicit
+    C( int, int );             // ok more than one non-default argument
+  };
         </CODE>
         <CODE class="bad">
-          class C
-          {
-          public:
-            C( double );               // bad, can be used in implicit conversion
-            C( float f, int i=0 );     // bad, implicit conversion constructor
-            C( int i=0, float f=0.0 ); // bad, default constructor, but also a conversion constructor
-          };
+  class C
+  {
+  public:
+    C( double );               // bad, can be used in implicit conversion
+    C( float f, int i=0 );     // bad, implicit conversion constructor
+    C( int i=0, float f=0.0 ); // bad, default constructor, but also a conversion constructor
+  };
         </CODE>
       </P>
     </ARTICLE>
@@ -281,11 +199,11 @@ function toggleVisibility( button, obj )
       <P>
         Don't shortcut, like use the returned reference of getter to assign a new value. If a Setter is missing, add it!
         <CODE class="bad">
-            initial.GetPosition() = Position(10, 10); // bad!, If GetPosition is one day changed to return copy
-                                                      // of Position this code silently changes to a no-op.
+  initial.GetPosition() = Position(10, 10); // bad!, If GetPosition is one day changed to return copy
+                                            // of Position this code silently changes to a no-op.
         </CODE>
         <CODE class="good">
-            initial.SetPosition( Position( 10, 10 ) );
+  initial.SetPosition( Position( 10, 10 ) );
         </CODE>
       </P>
       <P>
@@ -303,29 +221,307 @@ function toggleVisibility( button, obj )
 
         GCC automatically inlines member functions defined within the class body of C++ programs even if they are not explicitly declared inline.
         <CODE class="bad">
-               class Color
-               {
-                       inline float& GetRed()  { return mRed;   }              // inline keyword not needed
-                       inline float& GetGreen(){ return mGreen; }
-               };
+  class Color
+  {
+    inline float& GetRed()  { return mRed;   } // inline keyword not needed
+    inline float& GetGreen(){ return mGreen; }
+  };
+        </CODE>
+        <CODE class="good">
+  class Color
+  {
+    float& GetRed()   { return mRed;   }
+    float& GetGreen(){ return mGreen; }
+  };
+        </CODE>
+      </P>
+      <P>
+        If there are a lot of inlines, they should be in a .inl file.
+        Remember the inline keyword is just a hint to the compiler. Whether
+        a function will be inlined or not is down to the compiler and its flags.
+      </P>
+      <P>
+      </P>
+    </ARTICLE>
+
+  <H2>Conversion operators <input type="button" value="Hide" onclick="toggleVisibility( this, 'conversion_details' );"/></H2>
+    <ARTICLE class="detail" id="conversion_details">
+      <P>
+
+        Don't declare implicit conversion operators in classes. They allow the compiler to trip you up and go from one type to another via the conversion operator unintentionally.
+        Conversion operators are particularly dangerous in conjunction with auto keyword. If conversion is required, make it explicit or better yet, add a getter with a more meaningfull name.
+        <CODE class="bad">
+
+  // Bad:
+  class SmallInt
+  {
+  public:
+    // implicit conversion to float
+    operator float() const { return float( val ); }
+  private:
+    int val;
+  };
+  //... and in the program:
+
+  int main( void )
+  {
+    int value;
+    SmallValue foo;
+    value = foo; // oops, didn't really want to allow conversion to int but the compiler can do that as float can be assigned to int.
+
+    return 0;
+  }
+        </CODE>
+        <CODE class="good">
+
+  // Good:
+  class SmallInt
+  {
+  public:
+    // explicit getter for float
+    float AsFloat const { return static_cast&#x3C;float&#x3E;( val ); }
+  private:
+    int val;
+  };
+  //... and in the program:
+
+  int main( void )
+  {
+    int value;
+    SmallValue foo;
+    si.AsFloat() + 3; // ok: explicitly request the conversion
+
+    return 0;
+  }
+
+  // Good:
+  class SmallInt
+  {
+  public:
+    // explicit conversion to int
+    explicit operator int() const { return val; }
+  private:
+    int val;
+  };
+  //... and in the program:
+
+  int main()
+  {
+    SmallInt si = 3; // ok: the SmallInt constructor is not explicit
+    si + 3; // error: implicit is conversion required, but operator int is explicit
+    static_cast&#x3C;int&#x3E;(si) + 3; // ok: explicitly request the conversion
+
+    return 0;
+  }
+
+        </CODE>
+      </P>
+      <P>
+      </P>
+    </ARTICLE>
+
+  <H2>Auto keyword <input type="button" value="Hide" onclick="toggleVisibility( this, 'auto_details' );"/></H2>
+    <ARTICLE class="detail" id="auto_details">
+      <P>
+
+        auto keyword should only be used where it improves the readability of the code and does not lead to ambiguities.
+        never use auto in a line where multiple different types occur as part of expressions like additions, subtracts, multiplies as the conversion ordering rules are not always obvious.
+
+        <CODE class="good">
+
+  // Good:
+  auto actor = Actor::DownCast(GetOwner()); // it is obvious that actor is of type Actor so no need to retype the type
+  auto widthMode = widthMeasureSpec.GetMode(); // it is relatively obvious that Mode is an enumeration with potentially long name so no need to repeat the type, no ambiguity
+  auto childLayout = GetChildAt( i ); // name of the variable is clear enough indication of the type, no ambiguity
+  auto childPosition = childOwner.GetProperty&#x3C; Dali::Vector3 &#x3E;( Actor::Property::POSITION ); // getter already contains the type, no need to repeat it
+
+  for ( auto&& renderTask : mImpl->taskList.GetTasks() ) // iterator type not relevant for the algorithm, code much cleaner with auto
+  {
+    renderTask->UpdateState();
+  }
+
+        </CODE>
+        <CODE class="bad">
+
+  // Bad:
+  auto width = layout->GetWidth() - padding.end - padding.start; // not obvious what the final type ends up as multiple type conversions may occur
+
+  auto size = std::max( LayoutLength(0), specSize - padding ); // not obvious which of the types is preferred by compiler; or what the type of specSize - padding actually is
+
+  auto minPosition = Vector3( Vector3::ZERO ); // auto does not add any value here
+        </CODE>
+        <CODE class="good">
+  // Good:
+  Vector3 minPosition; // vector initializes to 0,0,0
+        </CODE>
+        <CODE class="bad">
+  // Bad:
+  auto specification = MeasureSpec( GetMeasuredHeight(), MeasureSpec::Mode::EXACTLY ); // no value in typing auto in assignment, much cleaner and less ambiguous to write:
+        </CODE>
+        <CODE class="good">
+  // Good:
+  MeasureSpec specification( GetMeasuredHeight(), MeasureSpec::Mode::EXACTLY ); // obvious construction of a type with parameters
+        </CODE>
+
+      </P>
+      <P>
+      </P>
+    </ARTICLE>
+
+  <H2>Class Inheritance <input type="button" value="Hide" onclick="toggleVisibility( this, 'class_inheritance' );"/></H2>
+    <H3>Overriding</H3>
+    <ARTICLE class="detail" id="class_inheritance">
+      <P>
+
+        When using inheritance, any methods in the base class that can be overridden MUST be marked as <b>virtual</b>.
+        In deriving classes, when a virtual method is overridden, then only use the <b>override</b> keyword.
+        If a method should not be overridden further, then use the <b>final</b> keyword alone.
+
+        <CODE class="good">
+
+  // Good:
+  class Base
+  {
+  public:
+    virtual void Print() const;
+    virtual void SetPrintSpeed( float speed );
+  };
+
+  class Derived : public Base
+  {
+  public:
+    void Print() const override;
+    void SetPrintSpeed( float speed ) final;
+  };
         </CODE>
+      </P>
+      <P>
+        If a class should not be overridden then use the <b>final</b> keyword on the class itself.
+        This should also be done for a derived class that should not to be overridden further as well.
+        Overridden methods within that class can be marked as <b>final</b> or <b>override</b>.
+
         <CODE class="good">
-               class Color
-               {
-                       float& GetRed()   { return mRed;   }
-                       float& GetGreen(){ return mGreen; }
-               };
+
+  class Derived final : public Base
+  {
+  public:
+    void Print() const override;
+    void SetPrintSpeed( float speed ) final;
+  };
         </CODE>
       </P>
+    <H3>Overloading</H3>
       <P>
-       If there are a lot of inlines, they should be in a .inl file.
-       Remember the inline keyword is just a hint to the compiler. Whether
-       a function will be inlined or not is down to the compiler and its flags.
+        Overloading of Base class methods SHOULD be avoided but if it's required, then use the <b>using</b> keyword.
+
+        <CODE class="good">
+
+  class Derived : public Base
+  {
+  public:
+    void Print( float number ) const; // overloaded member
+    using Base::Print; // Make the Base class' Print method visible here as well.
+  };
+        </CODE>
+      </P>
+      <P>
+        If we do not add the using line, then we can only use the overloaded Print method for a Derived object (unless we cast to the Base class).
+        Attempting to use the base class' Print() method on a Derived object would result in a compilation error.
       </P>
       <P>
       </P>
     </ARTICLE>
 
+<H1>General design priciples</H1>
+  <P>
+    Here's a few pragmatic programmer guidelines to follow (<A HREF="http://www.codinghorror.com/blog/files/Pragmatic%20Quick%20Reference.htm">Web version</A>)
+    <H3>Details <input type="button" value="Hide" onclick="toggleVisibility( this, 'general_details' );"/></H3>
+    <ARTICLE class="detail" id="general_details">
+      <UL>
+      <LI><B>Care About the Software, Care about your API users and end users</B><BR>
+            Why spend your life developing software unless you care about doing it well?
+            Turn off the autopilot and take control. Constantly critique and appraise your work.
+      <LI><B>Don't Live with Broken Windows</B><BR>
+            Fix bad designs, wrong decisions, and poor code when you see them.
+            You can't force change on people. Instead, show them how the future might be and help them participate in creating it.
+      <LI><B>Remember the Big Picture</B><BR>
+            Don't get so engrossed in the details that you forget to check what's happening around you.
+      <LI><B>DRY - Don't Repeat Yourself</B><BR>
+            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
+      <LI><B>Eliminate Effects Between Unrelated Things</B><BR>
+            Design components that are self-contained. independent, and have a single, well-defined purpose.
+      <LI><B>There Are No Final Decisions</B><BR>
+            No decision is cast in stone. Instead, consider each as being written in the sand at the beach, and plan for change.
+      <LI><B>Fix the Problem, Not the Blame</B><BR>
+            It doesn't really matter whether the bug is your fault or someone else's—it is still your problem, and it still needs to be fixed.
+      <LI><B>You Can't Write Perfect Software</B><BR>
+            Software can't be perfect. Protect your code and users from the inevitable errors.
+      <LI><B>Design with Contracts</B><BR>
+            Use contracts to document and verify that code does no more and no less than it claims to do.
+      <LI><B>Crash Early</B><BR>
+            A dead program normally does a lot less damage than a crippled one.
+      <LI><B>Use Assertions to Prevent the Impossible</B><BR>
+            Assertions validate your assumptions. Use them to protect your code from an uncertain world.
+      <LI><B>Use Exceptions for Exceptional Problems</B><BR>
+            Exceptions can suffer from all the readability and maintainability problems of classic spaghetti code. Reserve exceptions for exceptional things.
+      <LI><B>Minimize Coupling Between Modules</B><BR>
+            Avoid coupling by writing "shy" code and applying the Law of Demeter.
+      <LI><B>Put Abstractions in Code, Details in Metadata</B><BR>
+            Program for the general case, and put the specifics outside the compiled code base.
+      <LI><B>Always Design for Concurrency</B><BR>
+            Allow for concurrency, and you'll design cleaner interfaces with fewer assumptions.
+      <LI><B>Don't Program by Coincidence</B><BR>
+            Rely only on reliable things. Beware of accidental complexity, and don't confuse a happy coincidence with a purposeful plan.
+      <LI><B>Test Your Estimates</B><BR>
+            Mathematical analysis of algorithms doesn't tell you everything. Try timing your code in its target environment.
+      <LI><B>Refactor Early, Refactor Often</B><BR>
+            Just as you might weed and rearrange a garden, rewrite, rework, and re-architect code when it needs it. Fix the root of the problem.
+      <LI><B>Design to Test</B><BR>
+            Start thinking about testing before you write a line of code.
+      <LI><B>Abstractions Live Longer than Details</B><BR>
+            Invest in the abstraction, not the implementation. Abstractions can survive the barrage of changes from different implementations and new technologies.
+      <LI><B>Coding Ain't Done 'Til All the Tests Run</B><BR>
+            'Nuff said.
+      <LI><B>Use Saboteurs to Test Your Testing</B><BR>
+            Introduce bugs on purpose in a separate copy of the source to verify that testing will catch them.
+      <LI><B>Find Bugs Once</B><BR>
+            Once a human tester finds a bug, it should be the last time a human tester finds that bug. Automatic tests should check for it from then on.
+      <LI><B>Sign Your Work</B><BR>
+            Craftsmen of an earlier age were proud to sign their work. You should be, too.
+      </UL>
+    </ARTICLE>
+  </P>
+
+  <H2>Avoid Tight Coupling</H2>
+    <P>
+      Always choose the loosest possible coupling between entities. In C++ the tightest coupling is Friend, second is Inheritance,
+      then Containment and last is Usage through reference, pointer or handle.
+    <H3>Details <input type="button" value="Hide" onclick="toggleVisibility( this, 'coupling_details' );"/></H3>
+    <ARTICLE class="detail" id="coupling_details">
+      <UL>
+        <LI>Friend defines a "must-know" about details of implementation, don't use it unless your happy stating that Xxx really <B>must</B> know about Yyy implementation. and Yyy can never change without informing Xxx.
+        <LI>Inheritance defines a "is-a" relationship, don't use it unless you really can naturally say Xxx is-a Yyy. Most of the cases containment through interface is what you
+        <LI>Containment defines a "owns-a" relationship, use it when you have a natural Xxx owns-a Yyy relationship.
+      </UL>
+      Most of the time containment through interface and normal usage is what you should go for.
+      Strong ownership always beats sharing through reference counting. Reference counting means "part owns".
+      You would not want to part own anything in real life, so why do that in software? sooner or later it will leak,
+    </ARTICLE>
+    </P>
+
+  Two key principles to follow:
+  <H2>Open Closed Principle</H2>
+    <P>
+      Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
+      That is, such an entity can allow its behaviour to be modified without altering its source code. Techniqu
+    </P>
+
+  <H2>Dependency Inversion Principle</H2>
+    <P>
+      High-level modules should not depend on low-level modules. Both should depend on abstractions.
+      Abstractions should not depend upon details. Details should depend upon abstractions.
+    </P>
+
   <P>Thats all folks, if you read this far you are now all equipped to write good code :) !! </P>
 
 </BODY>
diff --git a/docs/uml/allocate-descriptor-sets-action-diagram.puml b/docs/uml/allocate-descriptor-sets-action-diagram.puml
new file mode 100644 (file)
index 0000000..62610f4
--- /dev/null
@@ -0,0 +1,35 @@
+@startuml
+
+start
+
+if (Do descriptor pool data\n exist for the calling thread?) then (Yes)
+else (No)
+  : Create and store\n( DescriptorSetLayoutSignature,\n vector of DescriptorPools)\n pairs for each provided signature\n and map it with the current thread id.;
+endif
+
+  while (For each provided signature...)
+    if (Signature match found?) then (Yes)
+    else (No)
+        : Create a new ( Signature, vector of DescriptorPools ) entry.;
+    endif
+
+    while( While there are still allocation left... )
+                while (For each descriptor pool of this signature...)
+                        if ( Does the pool have the capacity to allocate?) then (Yes)
+                            : Allocate descriptor sets.;
+                        else (No)
+                        endif
+                endwhile
+
+                if ( Are all allocations completed? ) then ( Yes )
+                else (No)
+                    : Determine the number of additional descriptor pools\n needed to complete the remaining allocations;
+                    : Create additional descriptor pools;
+                endif
+     endwhile
+  endwhile
+
+: Return allocated descriptor sets.;
+stop
+
+@enduml
index 40dd993..8d10f38 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali
 Summary:    DALi 3D Engine
-Version:    1.3.26
+Version:    1.4.16
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
@@ -9,55 +9,16 @@ Source0:    %{name}-%{version}.tar.gz
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
+BuildRequires:  cmake
 BuildRequires:  pkgconfig
 BuildRequires:  gawk
-
-%if 0%{?tizen_version_major} >= 3
+#BuildRequires:  Vulkan-LoaderAndValidationLayers
+#BuildRequires:  Vulkan-LoaderAndValidationLayers-devel
 BuildRequires:  pkgconfig(libtzplatform-config)
-%endif
-
-%if 0%{?tizen_version_major} < 4
-%define disable_cxx03_build 1
-%endif
 
 %description
 DALi 3D Engine
 
-%if !0%{?disable_cxx03_build}
-##############################
-# cxx03
-##############################
-%package cxx03
-Summary:       DALi 3D Engine with cxx03 abi
-Provides:      %{name}-cxx03 = %{version}-%{release}
-
-%description cxx03
-DALi 3D Engine with cxx03 abi with cxx03 abi
-
-##############################
-# devel-cxx03
-##############################
-%package devel-cxx03
-Summary:    Development components for DALi 3D Engine with cxx03 abi
-Group:      Development/Building
-Requires:   %{name}-cxx03 = %{version}-%{release}
-Requires:   %{name}-integration-devel-cxx03 = %{version}-%{release}
-
-%description devel-cxx03
-Development components for DALi 3D Engine - public headers and package config
-
-##############################
-# integration-devel-cxx03
-##############################
-%package integration-devel-cxx03
-Summary:    Integration development package for DALi 3D Engine witch cxx03 abi
-Group:      Development/Building
-Requires:   %{name}-cxx03 = %{version}-%{release}
-
-%description integration-devel-cxx03
-Integration development package for DALi 3D Engine - headers for integrating with an adaptor/platform abstraction library.
-%endif
-
 ##############################
 # devel
 ##############################
@@ -87,16 +48,6 @@ Integration development package for DALi 3D Engine - headers for integrating wit
 %prep
 %setup -q
 
-#Use TZ_PATH when tizen version is 3.x
-
-%if "%{tizen_version_major}" == "2"
-%define dali_data_rw_dir /opt/usr/share/dali/
-%define dali_data_ro_dir /usr/share/dali/
-%else
-%define dali_data_rw_dir %TZ_SYS_SHARE/dali/
-%define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/
-%endif
-
 %define dev_include_path %{_includedir}
 
 ##############################
@@ -104,8 +55,8 @@ Integration development package for DALi 3D Engine - headers for integrating wit
 ##############################
 %build
 PREFIX="/usr"
-CXXFLAGS+=" -Wall -g -Os -DNDEBUG -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections "
-LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -lgcc_s -lgcc -Wl,-Bsymbolic-functions "
+CXXFLAGS+=" -Wall -g -Os -DNDEBUG -fPIC -fvisibility-inlines-hidden -fdata-sections -ffunction-sections -std=gnu++14 "
+LDFLAGS+=" -Wl,--rpath=$PREFIX/lib -Wl,--as-needed -Wl,--gc-sections -lgcc_s -lgcc -lpthread -Wl,-Bsymbolic-functions "
 
 %ifarch %{arm}
 CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon"
@@ -118,84 +69,22 @@ LDFLAGS+=" --coverage "
 
 libtoolize --force
 cd %{_builddir}/%{name}-%{version}/build/tizen
-autoreconf --install
-DALI_DATA_RW_DIR="%{dali_data_rw_dir}"
-DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
-export DALI_DATA_RW_DIR
-export DALI_DATA_RO_DIR
-
-# Default to GLES 2.0 if not specified.
-%{!?target_gles_version: %define target_gles_version 20}
 
 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS;
 CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS;
 LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
 
-./configure \
-      --program-prefix=%{?_program_prefix} \
-      --prefix=%{_prefix} \
-      --exec-prefix=%{_exec_prefix} \
-      --bindir=%{_bindir} \
-      --sbindir=%{_sbindir} \
-      --sysconfdir=%{_sysconfdir} \
-      --datadir=%{_datadir} \
-      --includedir=%{_includedir} \
-      --libdir=%{_libdir} \
-      --libexecdir=%{_libexecdir} \
-      --localstatedir=%{_localstatedir} \
-      --sharedstatedir=%{_sharedstatedir} \
-      --mandir=%{_mandir} \
-      --enable-gles=%{target_gles_version} \
-%if 0%{?enable_debug}
-      --enable-debug \
-%endif
-%if 0%{?enable_trace}
-      --enable-trace \
-%endif
-      --infodir=%{_infodir} \
-      --enable-rename-so=no
-
-make %{?jobs:-j%jobs}
-
-pushd %{_builddir}/%{name}-%{version}/build/tizen
-%make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
-popd
-
-pushd %{buildroot}%{_libdir}
-for FILE in libdali-core-cxx11.so*; do mv "$FILE" "%{_builddir}/%{name}-%{version}/build/tizen/$FILE"; done
-mv pkgconfig/dali-core.pc %{_builddir}/%{name}-%{version}/build/tizen/dali-core.pc
-popd
-
-%if !0%{?disable_cxx03_build}
-make clean
-
-./configure \
-      --program-prefix=%{?_program_prefix} \
-      --prefix=%{_prefix} \
-      --exec-prefix=%{_exec_prefix} \
-      --bindir=%{_bindir} \
-      --sbindir=%{_sbindir} \
-      --sysconfdir=%{_sysconfdir} \
-      --datadir=%{_datadir} \
-      --includedir=%{_includedir} \
-      --libdir=%{_libdir} \
-      --libexecdir=%{_libexecdir} \
-      --localstatedir=%{_localstatedir} \
-      --sharedstatedir=%{_sharedstatedir} \
-      --mandir=%{_mandir} \
-      --enable-cxx03-abi=yes  \
-      --enable-gles=%{target_gles_version} \
+cmake \
 %if 0%{?enable_debug}
-      --enable-debug \
+      -DCMAKE_BUILD_TYPE=Debug \
 %endif
-%if 0%{?enable_trace}
-      --enable-trace \
-%endif
-      --infodir=%{_infodir} \
-      --enable-rename-so=no
+      -DENABLE_TRACE=ON \
+      -DENABLE_BACKTRACE=ON \
+      -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+      -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
+      -DCMAKE_INSTALL_INCLUDEDIR=%{_includedir}
 
 make %{?jobs:-j%jobs}
-%endif
 
 ##############################
 # Installation
@@ -205,24 +94,7 @@ rm -rf %{buildroot}
 cd build/tizen
 
 pushd %{_builddir}/%{name}-%{version}/build/tizen
-%make_install DALI_DATA_RW_DIR="%{dali_data_rw_dir}" DALI_DATA_RO_DIR="%{dali_data_ro_dir}"
-
-for FILE in libdali-*.so*; do mv "$FILE" "%{buildroot}%{_libdir}/$FILE"; done
-mv dali-core.pc %{buildroot}%{_libdir}/pkgconfig/dali-core.pc
-popd
-
-#############################
-#rename
-#############################
-pushd  %{buildroot}%{_libdir}
-rm -rf libdali-core.so
-rm -rf libdali-core-cxx11.so
-%if !0%{?disable_cxx03_build}
-ln -s libdali-core.so.0.0.* libdali-core-cxx03.so
-%endif
-ln -s libdali-core-cxx11.so.0.0.* libdali-core.so
-popd
-
+%make_install
 
 ##############################
 # Post Install
@@ -242,20 +114,6 @@ exit 0
 # Files in Binary Packages
 ##############################
 
-%if !0%{?disable_cxx03_build}
-%files cxx03
-%if 0%{?enable_dali_smack_rules}
-%manifest dali.manifest-smack
-%else
-%manifest dali.manifest
-%endif
-%defattr(-,root,root,-)
-%{_libdir}/libdali-core.so.*
-%{_libdir}/libdali-core-cxx03.so
-%defattr(-,app,app,-)
-%license LICENSE
-%endif
-
 %files
 %if 0%{?enable_dali_smack_rules}
 %manifest dali.manifest-smack
@@ -263,24 +121,9 @@ exit 0
 %manifest dali.manifest
 %endif
 %defattr(-,root,root,-)
-%{_libdir}/libdali-core-cxx11.so.*
-%{_libdir}/libdali-core.so
-%defattr(-,app,app,-)
+%{_libdir}/libdali-core.so*
 %license LICENSE
 
-%if !0%{?disable_cxx03_build}
-%files devel-cxx03
-%defattr(-,root,root,-)
-%{_libdir}/pkgconfig/dali-core-cxx03.pc
-%{dev_include_path}/dali/public-api/*
-%{dev_include_path}/dali/devel-api/*
-%{dev_include_path}/dali/doc/*
-
-%files integration-devel-cxx03
-%defattr(-,root,root,-)
-%{_includedir}/dali/integration-api/*
-%endif
-
 %files devel
 %defattr(-,root,root,-)
 %{_libdir}/pkgconfig/dali-core.pc
@@ -291,3 +134,4 @@ exit 0
 %files integration-devel
 %defattr(-,root,root,-)
 %{_includedir}/dali/integration-api/*
+%{_includedir}/dali/graphics-api/*