2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 #include "resource-loader-debug.h"
19 #if defined(DEBUG_ENABLED)
24 #include <dali/integration-api/glyph-set.h>
30 using namespace Dali::Integration;
33 * Filter for resource loader debug. Change levels here to turn on debugging
35 Debug::Filter* gLoaderFilter = Debug::Filter::New(Debug::Concise, false, "LOG_RESOURCE_LOADER");
38 std::string DebugRequestList(TextResourceType::CharacterList& chars)
40 std::string textString;
42 for(std::size_t i=0, length=chars.size(); i<length; i++)
44 std::ostringstream oss;
45 const TextResourceType::GlyphPosition& glyph = chars[i];
46 oss << static_cast<char>(glyph.character) << "(" << glyph.xPosition << "," << glyph.yPosition
47 << " " << (glyph.quality?"Hg":"Lw") << " " << (glyph.loaded?"LD":"UN") << ") ";
48 textString.append(oss.str());
53 std::string DebugResourceList(LoadedResource& partialResource)
55 GlyphSetPointer glyphSet = static_cast<GlyphSet*>(partialResource.resource.Get());
56 const GlyphSet::CharacterList& characterList = glyphSet->GetCharacterList();
57 std::string textString;
59 for(std::size_t i=0, length=characterList.size(); i<length; i++)
61 std::ostringstream oss;
62 const GlyphMetrics& gm = characterList[i].second;
63 oss << static_cast<char>(gm.code) << "(" << gm.xPosition << "," << gm.yPosition
64 << " " << (gm.quality?"H":"L") << ") ";
65 textString.append(oss.str());