1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef TEXT_BLOB_BUILDER_IMPL_H 17 #define TEXT_BLOB_BUILDER_IMPL_H 18 19 #include "impl_interface/base_impl.h" 20 #include "text/font.h" 21 #include "text/text_blob.h" 22 #include "text/text_blob_builder.h" 23 #include "utils/rect.h" 24 #include "utils/scalar.h" 25 26 namespace OHOS { 27 namespace Rosen { 28 namespace Drawing { 29 class TextBlobBuilderImpl : public BaseImpl { 30 public: 31 TextBlobBuilderImpl(const TextBlobBuilderImpl& other) = delete; 32 TextBlobBuilderImpl& operator=(const TextBlobBuilderImpl& other) = delete; 33 ~TextBlobBuilderImpl() override = default; 34 35 virtual std::shared_ptr<TextBlob> Make() = 0; 36 37 virtual const TextBlobBuilder::RunBuffer& AllocRunPos(const Font& font, int count, 38 const Rect* bounds) = 0; 39 40 virtual const TextBlobBuilder::RunBuffer& AllocRunRSXform(const Font& font, int count) = 0; 41 42 protected: 43 TextBlobBuilderImpl() noexcept = default; 44 }; 45 } // namespace Drawing 46 } // namespace Rosen 47 } // namespace OHOS 48 #endif