2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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.
18 #include "resource-loader-debug.h"
20 #if defined(DEBUG_ENABLED)
25 #include <dali/integration-api/glyph-set.h>
31 using namespace Dali::Integration;
34 * Filter for resource loader debug. Change levels here to turn on debugging
36 Debug::Filter* gLoaderFilter = Debug::Filter::New(Debug::Concise, false, "LOG_RESOURCE_LOADER");
39 std::string DebugRequestList(TextResourceType::CharacterList& chars)
41 std::string textString;
43 for(std::size_t i=0, length=chars.size(); i<length; i++)
45 std::ostringstream oss;
46 const TextResourceType::GlyphPosition& glyph = chars[i];
47 oss << static_cast<char>(glyph.character) << "(" << glyph.xPosition << "," << glyph.yPosition
48 << " " << (glyph.quality?"Hg":"Lw") << " " << (glyph.loaded?"LD":"UN") << ") ";
49 textString.append(oss.str());
54 std::string DebugResourceList(LoadedResource& partialResource)
56 GlyphSetPointer glyphSet = static_cast<GlyphSet*>(partialResource.resource.Get());
57 const GlyphSet::CharacterList& characterList = glyphSet->GetCharacterList();
58 std::string textString;
60 for(std::size_t i=0, length=characterList.size(); i<length; i++)
62 std::ostringstream oss;
63 const GlyphMetrics& gm = characterList[i].second;
64 oss << static_cast<char>(gm.code) << "(" << gm.xPosition << "," << gm.yPosition
65 << " " << (gm.quality?"H":"L") << ") ";
66 textString.append(oss.str());