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_CPP_
18 #define _TVG_CANVAS_CPP_
20 #include "tvgCommon.h"
21 #include "tvgCanvasImpl.h"
23 /************************************************************************/
24 /* External Class Implementation */
25 /************************************************************************/
27 Canvas::Canvas(RenderMethod *pRenderer):pImpl(make_unique<Impl>(pRenderer))
37 Result Canvas::reserve(uint32_t n) noexcept
39 IMPL->paints.reserve(n);
40 return Result::Success;
44 Result Canvas::push(unique_ptr<Paint> paint) noexcept
46 return IMPL->push(move(paint));
50 Result Canvas::clear() noexcept
56 Result Canvas::draw(bool async) noexcept
62 Result Canvas::update() noexcept
64 return IMPL->update();
68 Result Canvas::update(Paint* paint) noexcept
70 return IMPL->update(paint);
74 Result Canvas::sync() noexcept
76 if (IMPL->renderer->flush()) return Result::Success;
78 return Result::InsufficientCondition;
81 #endif /* _TVG_CANVAS_CPP_ */