2 * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _TVG_CANVAS_BASE_CPP_
18 #define _TVG_CANVAS_BASE_CPP_
20 #include "tvgCommon.h"
25 vector<PaintNode*> nodes;
26 RenderMethod* renderer;
28 CanvasBase(RenderMethod *pRenderer):renderer(pRenderer)
52 for (auto node : nodes) {
53 if (SceneNode *scene = dynamic_cast<SceneNode *>(node)) {
54 cout << "TODO: " << scene << endl;
55 } else if (ShapeNode *shape = dynamic_cast<ShapeNode *>(node)) {
56 ret |= renderer->dispose(*shape, shape->engine());
71 for(auto node: nodes) {
72 ret |= node->update(renderer);
78 int push(unique_ptr<PaintNode> paint)
80 PaintNode *node = paint.release();
82 nodes.push_back(node);
83 return node->update(renderer);
92 for(auto node: nodes) {
93 if (SceneNode *scene = dynamic_cast<SceneNode *>(node)) {
94 cout << "TODO: " << scene << endl;
95 } else if (ShapeNode *shape = dynamic_cast<ShapeNode *>(node)) {
96 ret |= renderer->render(*shape, shape->engine());
104 #endif /* _TVG_CANVAS_BASE_CPP_ */