1 #ifndef DALI_GRAPHICS_API_RENDER_COMMAND_H
2 #define DALI_GRAPHICS_API_RENDER_COMMAND_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
27 #include <dali/graphics-api/graphics-api-generic-buffer.h>
28 #include <dali/graphics-api/utility/utility-builder.h>
29 #include <dali/graphics-api/utility/utility-strong-type.h>
37 using PrimitiveCount = Utility::StrongType<size_t, struct PrimitiveCountTag>;
38 using BufferInfo = std::unique_ptr<GenericBufferBase>;
39 using BufferList = Utility::StrongType<std::vector<BufferInfo>, struct BufferListTag>;
42 * @brief Interface class for RenderCommand types in the graphics API.
44 class RenderCommand final
47 RenderCommand( PrimitiveCount primitiveCount, BufferList&& bufferList )
48 : mPrimitiveCount{primitiveCount}, mBufferList{std::move( bufferList )}
52 // derived types should not be moved direcly to prevent slicing
53 RenderCommand( RenderCommand&& ) = default;
54 RenderCommand& operator=( RenderCommand&& ) = default;
57 RenderCommand( const RenderCommand& ) = delete;
58 RenderCommand& operator=( const RenderCommand& ) = delete;
60 ~RenderCommand() = default;
63 PrimitiveCount mPrimitiveCount;
64 BufferList mBufferList;
67 using RenderCommandBuilder = Utility::Builder<RenderCommand, PrimitiveCount, BufferList>;
70 } // namespace Graphics
73 #endif // DALI_GRAPHICS_API_RENDER_COMMAND_H